Merge lp:~victored/wingpanel/lp-1295634 into lp:~elementary-pantheon/wingpanel/old-trunk

Proposed by Victor Martinez
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
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

To post a comment you must log in.
lp:~victored/wingpanel/lp-1295634 updated
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 IndicatorFileModel.vala and move it to IndicatorFactory.vala to avoid copying data structures
- Update WingpanelApp.vala to make proper use of GLib.Application.startup and GLib.Application.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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-01-24 17:27:31 +0000
+++ CMakeLists.txt 2014-03-25 04:00:57 +0000
@@ -1,6 +1,6 @@
1# Check http://webdev.elementaryos.org/docs/developer-guide/cmake for documentation1# Check http://webdev.elementaryos.org/docs/developer-guide/cmake for documentation
22
3project (wingpanel)3project (wingpanel C)
4cmake_minimum_required (VERSION 2.8)4cmake_minimum_required (VERSION 2.8)
5cmake_policy (VERSION 2.8)5cmake_policy (VERSION 2.8)
66
@@ -33,8 +33,29 @@
33add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)33add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
3434
35# Set dependencies35# Set dependencies
36<<<<<<< TREE
36set (WINGPANEL_DEPS "gobject-2.0;glib-2.0;gio-2.0;gee-0.8;gdk-x11-3.0;x11;gtk+-3.0;granite")37set (WINGPANEL_DEPS "gobject-2.0;glib-2.0;gio-2.0;gee-0.8;gdk-x11-3.0;x11;gtk+-3.0;granite")
37set (WINGPANEL_DEPS_NOVALA "gthread-2.0;indicator3-0.4")38set (WINGPANEL_DEPS_NOVALA "gthread-2.0;indicator3-0.4")
39=======
40set (WINGPANEL_DEPS
41 gobject-2.0
42 glib-2.0
43 gio-2.0
44 gee-0.8
45 gdk-x11-3.0
46 x11
47 gtk+-3.0
48 granite
49 indicator3-0.4
50 libido3-0.1
51 libwnck-3.0
52)
53
54set (WINGPANEL_DEPS_NOVALA
55 gthread-2.0
56)
57
58>>>>>>> MERGE-SOURCE
38find_package (PkgConfig)59find_package (PkgConfig)
39pkg_check_modules (DEPS REQUIRED ${WINGPANEL_DEPS})60pkg_check_modules (DEPS REQUIRED ${WINGPANEL_DEPS})
40pkg_check_modules (DEPS_NOVALA REQUIRED ${WINGPANEL_DEPS_NOVALA})61pkg_check_modules (DEPS_NOVALA REQUIRED ${WINGPANEL_DEPS_NOVALA})
@@ -57,6 +78,8 @@
57link_libraries(${DEPS_LIBRARIES} ${DEPS_NOVALA_LIBRARIES})78link_libraries(${DEPS_LIBRARIES} ${DEPS_NOVALA_LIBRARIES})
58link_directories(${DEPS_LIBRARY_DIRS} ${DEPS_NOVALA_DIRS})79link_directories(${DEPS_LIBRARY_DIRS} ${DEPS_NOVALA_DIRS})
5980
81add_definitions (-DWNCK_I_KNOW_THIS_IS_UNSTABLE)
82
60# Handle Vala Compilation83# Handle Vala Compilation
61find_package(Vala REQUIRED)84find_package(Vala REQUIRED)
62include(ValaVersion)85include(ValaVersion)
@@ -69,7 +92,6 @@
69 src/IndicatorIface.vala92 src/IndicatorIface.vala
70 src/IndicatorLoader.vala93 src/IndicatorLoader.vala
7194
72 src/Indicator/IndicatorFileModel.vala
73 src/Indicator/IndicatorObjectEntry.vala95 src/Indicator/IndicatorObjectEntry.vala
74 src/Indicator/IndicatorObject.vala96 src/Indicator/IndicatorObject.vala
75 src/Indicator/IndicatorFactory.vala97 src/Indicator/IndicatorFactory.vala
@@ -87,14 +109,19 @@
87 src/Services/AppLauncherService.vala109 src/Services/AppLauncherService.vala
88 src/Services/LauncherRunner.vala110 src/Services/LauncherRunner.vala
89 src/Services/IndicatorSorter.vala111 src/Services/IndicatorSorter.vala
112 src/Services/BackgroundManager.vala
90PACKAGES113PACKAGES
91 ${WINGPANEL_DEPS}114 ${WINGPANEL_DEPS}
92CUSTOM_VAPIS115CUSTOM_VAPIS
93 vapi/config.vapi116 vapi/config.vapi
94 vapi/indicator-0.4.vapi
95OPTIONS117OPTIONS
118 -g
96 --thread119 --thread
120<<<<<<< TREE
97 -g121 -g
122=======
123 --vapidir=${CMAKE_CURRENT_SOURCE_DIR}/vapi/
124>>>>>>> MERGE-SOURCE
98)125)
99126
100# Settings Schema127# Settings Schema
@@ -106,6 +133,7 @@
106133
107# Create the Executable134# Create the Executable
108add_executable(${EXEC_NAME} ${VALA_C})135add_executable(${EXEC_NAME} ${VALA_C})
136target_link_libraries(${EXEC_NAME} m)
109137
110# Installation138# Installation
111install (TARGETS ${EXEC_NAME} RUNTIME DESTINATION bin)139install (TARGETS ${EXEC_NAME} RUNTIME DESTINATION bin)
112140
=== modified file 'org.pantheon.desktop.wingpanel.gschema.xml'
--- org.pantheon.desktop.wingpanel.gschema.xml 2012-07-08 03:02:36 +0000
+++ org.pantheon.desktop.wingpanel.gschema.xml 2014-03-25 04:00:57 +0000
@@ -13,7 +13,17 @@
13 <key type="s" name="default-launcher">13 <key type="s" name="default-launcher">
14 <default>"slingshot-launcher"</default>14 <default>"slingshot-launcher"</default>
15 <summary>The default program to use as App launcher.</summary>15 <summary>The default program to use as App launcher.</summary>
16 <description>Description</description>16 <description>The default program to use as App launcher.</description>
17 </key>
18 <key type="d" name="background-alpha">
19 <default>0.8</default>
20 <summary>Background opacity variable.</summary>
21 <description>Background opacity variable (must be between zero and one).</description>
22 </key>
23 <key type="b" name="auto-adjust-alpha">
24 <default>true</default>
25 <summary>Automatically update background alpha.</summary>
26 <description>Automatically update the background alpha to zero if it will be readable, else 0.8.</description>
17 </key>27 </key>
18 </schema>28 </schema>
19</schemalist>29</schemalist>
2030
=== modified file 'src/Indicator/IndicatorFactory.vala'
--- src/Indicator/IndicatorFactory.vala 2013-04-14 17:37:10 +0000
+++ src/Indicator/IndicatorFactory.vala 2014-03-25 04:00:57 +0000
@@ -1,45 +1,101 @@
1// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-1// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
2// 2//
3// Copyright (C) 2013 Wingpanel Developers3// Copyright (C) 2013 Wingpanel Developers
4// 4//
5// This program is free software: you can redistribute it and/or modify5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.8// (at your option) any later version.
9// 9//
10// This program is distributed in the hope that it will be useful,10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.13// GNU General Public License for more details.
14// 14//
15// You should have received a copy of the GNU General Public License15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <http://www.gnu.org/licenses/>.16// along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
18public class Wingpanel.Backend.IndicatorFactory : Object, IndicatorLoader {18public class Wingpanel.Backend.IndicatorFactory : Object, IndicatorLoader {
19 private IndicatorFileModel model;
20 private Gee.Collection<IndicatorIface> indicators;19 private Gee.Collection<IndicatorIface> indicators;
21 private bool initted = false;20 private string[] settings_blacklist;
2221
23 public IndicatorFactory (Services.Settings settings) {22 public IndicatorFactory (string[] settings_blacklist) {
24 model = new IndicatorFileModel (settings);23 this.settings_blacklist = settings_blacklist;
25 }24 }
2625
27 public Gee.Collection<IndicatorIface> get_indicators () {26 public Gee.Collection<IndicatorIface> get_indicators () {
28 if (!initted) {27 if (indicators == null) {
28 indicators = new Gee.LinkedList<IndicatorIface> ();
29 load_indicators ();29 load_indicators ();
30 initted = true;
31 }30 }
3231
33 return indicators.read_only_view;32 return indicators.read_only_view;
34 }33 }
3534
36 private void load_indicators () {35 private void load_indicators () {
37 indicators = new Gee.LinkedList<IndicatorIface> ();36 // Fetch list of indicators that should not be loaded
38 var indicators_list = model.get_indicators ();37 string skip_list = Environment.get_variable ("UNITY_PANEL_INDICATORS_SKIP") ?? "";
3938
40 foreach (var indicator in indicators_list) {39 if (skip_list == "all") {
41 string name = model.get_indicator_name (indicator);40 warning ("Skipping all indicator loading");
42 indicators.add (new IndicatorObject (indicator, name));41 return;
42 }
43
44 foreach (string blocked_indicator in settings_blacklist)
45 skip_list += "," + blocked_indicator;
46
47 debug ("Blacklisted Indicators: %s", skip_list);
48
49 // Legacy indicator libraries
50 load_indicators_from_dir (Build.INDICATORDIR, true, skip_list);
51
52 // Ng indicators
53 load_indicators_from_dir ("/usr/share/unity/indicators", false, skip_list);
54 }
55
56 private void load_indicators_from_dir (string dir_path, bool legacy_libs_only, string skip_list) {
57 try {
58 var dir = File.new_for_path (dir_path);
59 var enumerator = dir.enumerate_children (FileAttribute.STANDARD_NAME,
60 FileQueryInfoFlags.NONE, null);
61 FileInfo file_info;
62
63 while ((file_info = enumerator.next_file (null)) != null) {
64 string name = file_info.get_name ();
65
66 if (name in skip_list)
67 continue;
68
69 load_indicator (dir, legacy_libs_only, name);
70 }
71 } catch (Error err) {
72 warning ("Unable to read indicators: %s", err.message);
73 }
74 }
75
76 private void load_indicator (File parent_dir, bool legacy_lib, string name) {
77 string indicator_path = parent_dir.get_child (name).get_path ();
78
79 try {
80 Indicator.Object indicator = null;
81
82 if (legacy_lib) {
83 if (!name.has_suffix (".so"))
84 return;
85
86 debug ("Loading Indicator Library: %s", name);
87 indicator = new Indicator.Object.from_file (indicator_path);
88 } else {
89 debug ("Loading Indicator File: %s", name);
90 indicator = new Indicator.Ng.for_profile (indicator_path, "desktop");
91 }
92
93 if (indicator != null)
94 indicators.add (new IndicatorObject (indicator, name));
95 else
96 critical ("Unable to load %s: invalid object.", name);
97 } catch (Error err) {
98 warning ("Could not load indicator at %s: %s", indicator_path, err.message);
43 }99 }
44 }100 }
45}101}
46102
=== removed file 'src/Indicator/IndicatorFileModel.vala'
--- src/Indicator/IndicatorFileModel.vala 2013-04-14 17:31:20 +0000
+++ src/Indicator/IndicatorFileModel.vala 1970-01-01 00:00:00 +0000
@@ -1,94 +0,0 @@
1// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
2/***
3 BEGIN LICENSE
4
5 Copyright (C) 2010-2012 Canonical Ltd
6 This program is free software: you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License version 3, as published
8 by the Free Software Foundation.
9
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranties of
12 MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
13 PURPOSE. See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with this program. If not, see <http://www.gnu.org/licenses/>
17
18 END LICENSE
19
20 Authored by canonical.com
21***/
22
23namespace Wingpanel.Backend {
24
25 public class IndicatorFileModel {
26 private Gee.HashMap<Indicator.Object, string> indicator_map;
27
28 public IndicatorFileModel (Services.Settings settings) {
29 indicator_map = new Gee.HashMap<Indicator.Object, string> ();
30
31 // Indicators we don't want to load
32 string skip_list = Environment.get_variable ("UNITY_PANEL_INDICATORS_SKIP") ?? "";
33
34 if (skip_list == "all") {
35 warning ("Skipping all indicator loading");
36 return;
37 }
38
39 foreach (string blocked_indicator in settings.blacklist) {
40 skip_list += "," + blocked_indicator;
41 debug ("Blacklisting %s", blocked_indicator);
42 }
43
44 debug ("Blacklisted Indicators: %s", skip_list);
45
46 var indicators_to_load = new Gee.ArrayList<string> ();
47 var dir = File.new_for_path (Build.INDICATORDIR);
48 debug ("Indicator Directory: %s", dir.get_path ());
49
50 try {
51 var enumerator = dir.enumerate_children (FileAttribute.STANDARD_NAME,
52 FileQueryInfoFlags.NONE, null);
53
54 FileInfo file_info;
55
56 while ((file_info = enumerator.next_file (null)) != null) {
57 string leaf = file_info.get_name ();
58
59 if (leaf in skip_list) {
60 warning ("SKIP LOADING: %s", leaf);
61 continue;
62 }
63
64 if (leaf.has_suffix (".so"))
65 indicators_to_load.add (leaf);
66 }
67 } catch (Error err) {
68 error ("Unable to read indicators: %s", err.message);
69 }
70
71 foreach (string leaf in indicators_to_load)
72 load_indicator (dir.get_child (leaf).get_path (), leaf);
73 }
74
75 public Gee.Collection<Indicator.Object> get_indicators () {
76 return indicator_map.keys;
77 }
78
79 public string get_indicator_name (Indicator.Object indicator) {
80 return indicator_map.get (indicator);
81 }
82
83 private void load_indicator (string filename, string leaf) {
84 debug ("LOADING: %s", leaf);
85
86 var indicator = new Indicator.Object.from_file (filename);
87
88 if (indicator is Indicator.Object)
89 indicator_map.set (indicator, leaf);
90 else
91 critical ("Unable to load %s", filename);
92 }
93 }
94}
950
=== modified file 'src/Indicator/IndicatorObject.vala'
--- src/Indicator/IndicatorObject.vala 2013-04-14 17:39:47 +0000
+++ src/Indicator/IndicatorObject.vala 2014-03-25 04:00:57 +0000
@@ -1,17 +1,17 @@
1// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-1// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
2// 2//
3// Copyright (C) 2013 Wingpanel Developers3// Copyright (C) 2013 Wingpanel Developers
4// 4//
5// This program is free software: you can redistribute it and/or modify5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.8// (at your option) any later version.
9// 9//
10// This program is distributed in the hope that it will be useful,10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.13// GNU General Public License for more details.
14// 14//
15// You should have received a copy of the GNU General Public License15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <http://www.gnu.org/licenses/>.16// along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
@@ -63,14 +63,14 @@
6363
64 private void on_entry_removed (Indicator.Object object, Indicator.ObjectEntry entry) {64 private void on_entry_removed (Indicator.Object object, Indicator.ObjectEntry entry) {
65 assert (this.object == object);65 assert (this.object == object);
66 66
67 var entry_widget = entries.get (entry);67 var entry_widget = entries.get (entry);
68 entries.unset (entry);68 entries.unset (entry);
69 69
70 entry_removed (entry_widget);70 entry_removed (entry_widget);
71 }71 }
7272
73 private IndicatorWidget create_entry (Indicator.ObjectEntry entry) {73 private IndicatorWidget create_entry (Indicator.ObjectEntry entry) {
74 return new IndicatorObjectEntry (entry, this);74 return new IndicatorObjectEntry (entry, object, this);
75 }75 }
76}76}
7777
=== modified file 'src/Indicator/IndicatorObjectEntry.vala'
--- src/Indicator/IndicatorObjectEntry.vala 2013-08-25 14:47:58 +0000
+++ src/Indicator/IndicatorObjectEntry.vala 2014-03-25 04:00:57 +0000
@@ -18,10 +18,11 @@
18 END LICENSE18 END LICENSE
19***/19***/
2020
21namespace Wingpanel.Backend21namespace Wingpanel.Backend {
22{22
23 public class IndicatorObjectEntry: Widgets.IndicatorButton, IndicatorWidget {23 public class IndicatorObjectEntry: Widgets.IndicatorButton, IndicatorWidget {
24 private unowned Indicator.ObjectEntry entry;24 private unowned Indicator.ObjectEntry entry;
25 private unowned Indicator.Object parent_object;
25 private IndicatorIface indicator;26 private IndicatorIface indicator;
2627
27 // used for drawing28 // used for drawing
@@ -37,17 +38,18 @@
37 .menu {38 .menu {
38 background-color:@transparent;39 background-color:@transparent;
39 border-color:@transparent;40 border-color:@transparent;
40 -unico-inner-stroke-width: 0;
41 background-image:none;41 background-image:none;
42 border-width:0;
42 }43 }
43 .popover_bg {44 .popover_bg {
44 background-color:#fff;45 background-color:#fff;
45 }46 }
46 """;47 """;
4748
48 public IndicatorObjectEntry (Indicator.ObjectEntry entry, IndicatorIface indicator) {49 public IndicatorObjectEntry (Indicator.ObjectEntry entry, Indicator.Object obj, IndicatorIface indicator) {
49 this.entry = entry;50 this.entry = entry;
50 this.indicator = indicator;51 this.indicator = indicator;
52 parent_object = obj;
5153
52 var image = entry.image;54 var image = entry.image;
53 if (image != null && image is Gtk.Image)55 if (image != null && image is Gtk.Image)
@@ -218,32 +220,7 @@
218 }220 }
219221
220 public override bool scroll_event (Gdk.EventScroll event) {222 public override bool scroll_event (Gdk.EventScroll event) {
221 var direction = Indicator.ScrollDirection.UP;223 parent_object.entry_scrolled (entry, 1, (Indicator.ScrollDirection) event.direction);
222 double delta = 0;
223
224 switch (event.direction) {
225 case Gdk.ScrollDirection.UP:
226 delta = event.delta_y;
227 direction = Indicator.ScrollDirection.UP;
228 break;
229 case Gdk.ScrollDirection.DOWN:
230 delta = event.delta_y;
231 direction = Indicator.ScrollDirection.DOWN;
232 break;
233 case Gdk.ScrollDirection.LEFT:
234 delta = event.delta_x;
235 direction = Indicator.ScrollDirection.LEFT;
236 break;
237 case Gdk.ScrollDirection.RIGHT:
238 delta = event.delta_x;
239 direction = Indicator.ScrollDirection.RIGHT;
240 break;
241 default:
242 break;
243 }
244
245 entry.parent_object.entry_scrolled (entry, (uint) delta, direction);
246
247 return false;224 return false;
248 }225 }
249 }226 }
250227
=== added file 'src/Services/BackgroundManager.vala'
--- src/Services/BackgroundManager.vala 1970-01-01 00:00:00 +0000
+++ src/Services/BackgroundManager.vala 2014-03-25 04:00:57 +0000
@@ -0,0 +1,110 @@
1// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
2//
3// Copyright (C) 2014 Wingpanel Developers
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18namespace Wingpanel.Services {
19 struct ColorInformation {
20 double average_red;
21 double average_green;
22 double average_blue;
23 double mean;
24 double variance;
25 }
26
27 [DBus (name = "org.pantheon.gala")]
28 interface GalaDBus : Object {
29 public signal void background_changed ();
30 public async abstract ColorInformation get_background_color_information (int monitor,
31 int x, int y, int width, int height) throws IOError;
32 }
33
34 public class BackgroundManager : Object {
35 public static const double MIN_ALPHA = 0.3;
36
37 private const int HEIGHT = 50;
38 private const double MIN_VARIANCE = 50;
39 private const double MIN_LUM = 25;
40
41 /**
42 * Emitted when the background changed. It supplies the alpha value that
43 * can be used with this wallpaper while maintining legibility
44 */
45 public signal void update_background_alpha (double legible_alpha_value);
46
47 private Services.Settings settings;
48 private Gdk.Screen screen;
49 private GalaDBus gala_dbus;
50
51 public BackgroundManager (Services.Settings settings, Gdk.Screen screen) {
52 this.settings = settings;
53 this.screen = screen;
54 establish_connection ();
55 }
56
57 private void establish_connection () {
58 try {
59 gala_dbus = Bus.get_proxy_sync (BusType.SESSION,
60 "org.pantheon.gala",
61 "/org/pantheon/gala");
62 gala_dbus.background_changed.connect (on_background_change);
63 on_background_change ();
64 } catch (Error e) {
65 gala_dbus = null;
66 warning ("Auto-adjustment of background opacity not available, " +
67 "connecting to gala dbus failed: %s", e.message);
68 return;
69 }
70 }
71
72 private void on_background_change () {
73 if (!settings.auto_adjust_alpha)
74 return;
75
76 calculate_alpha.begin ((obj, res) => {
77 var alpha = calculate_alpha.end (res);
78 update_background_alpha (alpha);
79 });
80 }
81
82 private async double calculate_alpha () {
83 double alpha = 0;
84 Gdk.Rectangle monitor_geometry;
85 ColorInformation? color_info = null;
86
87 var primary = screen.get_primary_monitor ();
88 screen.get_monitor_geometry (primary, out monitor_geometry);
89
90 try {
91 color_info = yield gala_dbus.get_background_color_information (
92 primary, // monitor index
93 0, // x of reference rect
94 0, // y of rect
95 monitor_geometry.width, // width of rect
96 HEIGHT); // height of rect
97 } catch (Error e) {
98 warning (e.message);
99 alpha = MIN_ALPHA;
100 }
101
102 if (color_info != null
103 && (color_info.mean > MIN_LUM
104 || color_info.variance > MIN_VARIANCE))
105 alpha = MIN_ALPHA;
106
107 return alpha;
108 }
109 }
110}
0111
=== modified file 'src/Services/IndicatorSorter.vala'
--- src/Services/IndicatorSorter.vala 2013-04-14 10:19:10 +0000
+++ src/Services/IndicatorSorter.vala 2014-03-25 04:00:57 +0000
@@ -23,6 +23,7 @@
23 * be passed as CompareFuncs.23 * be passed as CompareFuncs.
24 */24 */
25public class Wingpanel.Services.IndicatorSorter {25public class Wingpanel.Services.IndicatorSorter {
26
26 private struct IndicatorOrderNode {27 private struct IndicatorOrderNode {
27 public string name; // name of indicator (library)28 public string name; // name of indicator (library)
28 public string? entry_name; // name of entry (menu item)29 public string? entry_name; // name of entry (menu item)
@@ -32,19 +33,25 @@
32 { "libapplication.so", null }, // indicator-application (App indicators)33 { "libapplication.so", null }, // indicator-application (App indicators)
33 { "libapplication.so", "keyboard" }, // Keyboard layout selector (old)34 { "libapplication.so", "keyboard" }, // Keyboard layout selector (old)
34 { "libapplication.so", "gsd-keyboard-xkb" }, // keyboard layout selector35 { "libapplication.so", "gsd-keyboard-xkb" }, // keyboard layout selector
36 { "com.canonical.indicator.keyboard", null },
35 { "libsoundmenu.so", null }, // indicator-sound37 { "libsoundmenu.so", null }, // indicator-sound
38 { "com.canonical.indicator.sound", null },
36 { "libnetwork.so", null }, // indicator-network39 { "libnetwork.so", null }, // indicator-network
37 { "libnetworkmenu.so", null }, // indicator-network40 { "libnetworkmenu.so", null }, // indicator-network
38 { "libapplication.so", "nm-applet" }, // network manager41 { "libapplication.so", "nm-applet" }, // network manager
39 { "libbluetooth.so", null }, // indicator-bluetooth42 { "libbluetooth.so", null }, // indicator-bluetooth
40 { "libapplication.so", "bluetooth-manager" }, // indicator-gnome-bluetooth (old)43 { "libapplication.so", "bluetooth-manager" }, // indicator-gnome-bluetooth (old)
44 { "com.canonical.indicator.bluetooth", null },
41 { "libprintersmenu.so", null }, // indicator-printers45 { "libprintersmenu.so", null }, // indicator-printers
42 { "libsyncindicator.so", null }, // indicator-sync46 { "libsyncindicator.so", null }, // indicator-sync
43 { "libpower.so", null }, // indicator-power47 { "libpower.so", null }, // indicator-power
48 { "com.canonical.indicator.power", null },
44 { "libmessaging.so", null }, // indicator-messages49 { "libmessaging.so", null }, // indicator-messages
50 { "com.canonical.indicator.messages", null },
45 { "libsession.so", null }, // indicator-session51 { "libsession.so", null }, // indicator-session
46 { "libsession.so", "indicator-session-users" }, // indicator-session52 { "libsession.so", "indicator-session-users" }, // indicator-session
47 { "libsession.so", "indicator-session-devices" } // indicator-session53 { "libsession.so", "indicator-session-devices" },// indicator-session
54 { "com.canonical.indicator.session", null }
48 };55 };
4956
50 public static int compare_func (IndicatorWidget? a, IndicatorWidget? b) {57 public static int compare_func (IndicatorWidget? a, IndicatorWidget? b) {
5158
=== modified file 'src/Services/Settings.vala'
--- src/Services/Settings.vala 2013-04-14 07:54:25 +0000
+++ src/Services/Settings.vala 2014-03-25 04:00:57 +0000
@@ -23,6 +23,8 @@
23 public string[] blacklist { get; set; }23 public string[] blacklist { get; set; }
24 public bool show_launcher { get; set; }24 public bool show_launcher { get; set; }
25 public string default_launcher { get; set; }25 public string default_launcher { get; set; }
26 public double background_alpha { get; set; }
27 public bool auto_adjust_alpha { get; set; }
2628
27 public Settings () {29 public Settings () {
28 base ("org.pantheon.desktop.wingpanel");30 base ("org.pantheon.desktop.wingpanel");
2931
=== modified file 'src/Widgets/BasePanel.vala'
--- src/Widgets/BasePanel.vala 2013-08-07 10:18:24 +0000
+++ src/Widgets/BasePanel.vala 2014-03-25 04:00:57 +0000
@@ -1,17 +1,17 @@
1// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-1// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
2// 2//
3// Copyright (C) 2011-2013 Wingpanel Developers3// Copyright (C) 2011-2014 Wingpanel Developers
4// 4//
5// This program is free software: you can redistribute it and/or modify5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.8// (at your option) any later version.
9// 9//
10// This program is distributed in the hope that it will be useful,10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.13// GNU General Public License for more details.
14// 14//
15// You should have received a copy of the GNU General Public License15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <http://www.gnu.org/licenses/>.16// along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
@@ -32,6 +32,8 @@
32 N_VALUES32 N_VALUES
33 }33 }
3434
35 protected Services.Settings settings { get; private set; }
36
35 private const int SHADOW_SIZE = 4;37 private const int SHADOW_SIZE = 4;
3638
37 private int panel_height = 0;39 private int panel_height = 0;
@@ -41,9 +43,19 @@
41 private int panel_displacement = -40;43 private int panel_displacement = -40;
42 private uint animation_timer = 0;44 private uint animation_timer = 0;
4345
46 private double legible_alpha_value = -1.0;
47 private double panel_alpha = 0.0;
48 private double panel_current_alpha = 0.0;
49 private uint panel_alpha_timer = 0;
50 const int FPS = 60;
51 const double ALPHA_ANIMATION_STEP = 0.05;
52
44 private PanelShadow shadow = new PanelShadow ();53 private PanelShadow shadow = new PanelShadow ();
4554 private Wnck.Screen wnck_screen;
46 public BasePanel () {55
56 public BasePanel (Services.Settings settings) {
57 this.settings = settings;
58
47 decorated = false;59 decorated = false;
48 resizable = false;60 resizable = false;
49 skip_taskbar_hint = true;61 skip_taskbar_hint = true;
@@ -58,6 +70,29 @@
58 screen.monitors_changed.connect (on_monitors_changed);70 screen.monitors_changed.connect (on_monitors_changed);
5971
60 destroy.connect (Gtk.main_quit);72 destroy.connect (Gtk.main_quit);
73
74 wnck_screen = Wnck.Screen.get_default ();
75 wnck_screen.active_workspace_changed.connect (update_panel_alpha);
76 wnck_screen.window_opened.connect ((window) => {
77 if (window.get_window_type () == Wnck.WindowType.NORMAL)
78 window.state_changed.connect (window_state_changed);
79 });
80 wnck_screen.window_closed.connect ((window) => {
81 if (window.get_window_type () == Wnck.WindowType.NORMAL)
82 window.state_changed.disconnect (window_state_changed);
83 });
84
85 update_panel_alpha ();
86 }
87
88 private void window_state_changed (Wnck.Window window,
89 Wnck.WindowState changed_mask, Wnck.WindowState new_state) {
90 if (((changed_mask & Wnck.WindowState.MAXIMIZED_HORIZONTALLY) != 0
91 || (changed_mask & Wnck.WindowState.MAXIMIZED_VERTICALLY) != 0
92 || (changed_mask & Wnck.WindowState.MINIMIZED) != 0)
93 && (window.get_workspace () == wnck_screen.get_active_workspace ()
94 || window.is_sticky ()))
95 update_panel_alpha ();
61 }96 }
6297
63 protected abstract Gtk.StyleContext get_draw_style_context ();98 protected abstract Gtk.StyleContext get_draw_style_context ();
@@ -79,7 +114,11 @@
79 }114 }
80115
81 var ctx = get_draw_style_context ();116 var ctx = get_draw_style_context ();
82 ctx.render_background (cr, size.x, size.y, size.width, size.height);117 var background_color = ctx.get_background_color (Gtk.StateFlags.NORMAL);
118 background_color.alpha = panel_current_alpha;
119 Gdk.cairo_set_source_rgba (cr, background_color);
120 cr.rectangle (size.x, size.y, size.width, size.height);
121 cr.fill ();
83122
84 // Slide in123 // Slide in
85 if (animation_timer == 0) {124 if (animation_timer == 0) {
@@ -92,21 +131,75 @@
92 if (child != null)131 if (child != null)
93 propagate_draw (child, cr);132 propagate_draw (child, cr);
94133
95 if (!shadow.visible)134 if (panel_alpha > 1E-3) {
135 shadow.show ();
96 shadow.show_all ();136 shadow.show_all ();
137 } else
138 shadow.hide ();
97139
98 return true;140 return true;
99 }141 }
100142
143 public void update_opacity (double alpha) {
144 legible_alpha_value = alpha;
145 update_panel_alpha ();
146 }
147
148 private void update_panel_alpha () {
149 panel_alpha = settings.background_alpha;
150 if (settings.auto_adjust_alpha) {
151 if (active_workspace_has_maximized_window ())
152 panel_alpha = 1.0;
153 else if (legible_alpha_value >= 0)
154 panel_alpha = legible_alpha_value;
155 }
156
157 if (panel_current_alpha != panel_alpha)
158 panel_alpha_timer = Gdk.threads_add_timeout (1000 / FPS, draw_timeout);
159 }
160
161 private bool draw_timeout () {
162 queue_draw ();
163
164 if (panel_current_alpha > panel_alpha) {
165 panel_current_alpha -= ALPHA_ANIMATION_STEP;
166 panel_current_alpha = double.max (panel_current_alpha, panel_alpha);
167 } else if (panel_current_alpha < panel_alpha) {
168 panel_current_alpha += ALPHA_ANIMATION_STEP;
169 panel_current_alpha = double.min (panel_current_alpha, panel_alpha);
170 }
171
172 if (panel_current_alpha != panel_alpha)
173 return true;
174
175 if (panel_alpha_timer > 0) {
176 Source.remove (panel_alpha_timer);
177 panel_alpha_timer = 0;
178 }
179
180 return false;
181 }
182
101 private bool animation_callback () {183 private bool animation_callback () {
102 if (panel_displacement >= 0 ) {184 if (panel_displacement >= 0 )
103 return false;185 return false;
104 } else {186
105 panel_displacement += 1;187 panel_displacement += 1;
106 move (panel_x, panel_y + panel_displacement);188 move (panel_x, panel_y + panel_displacement);
107 shadow.move (panel_x, panel_y + panel_height + panel_displacement);189 shadow.move (panel_x, panel_y + panel_height + panel_displacement);
108 return true;190 return true;
191 }
192
193 private bool active_workspace_has_maximized_window () {
194 var workspace = wnck_screen.get_active_workspace ();
195
196 foreach (var window in wnck_screen.get_windows ()) {
197 if ((window.is_pinned () || window.get_workspace () == workspace)
198 && window.is_maximized () && !window.is_minimized ())
199 return true;
109 }200 }
201
202 return false;
110 }203 }
111204
112 private void on_monitors_changed () {205 private void on_monitors_changed () {
@@ -144,9 +237,9 @@
144 screen.get_monitor_geometry (screen.get_primary_monitor (), out monitor_dimensions);237 screen.get_monitor_geometry (screen.get_primary_monitor (), out monitor_dimensions);
145238
146 // if we have multiple monitors, we must check if the panel would be placed inbetween239 // if we have multiple monitors, we must check if the panel would be placed inbetween
147 // monitors. If that's the case we have to move it to the topmost, or we'll make the 240 // monitors. If that's the case we have to move it to the topmost, or we'll make the
148 // upper monitor unusable because of the struts.241 // upper monitor unusable because of the struts.
149 // First check if there are monitors overlapping horizontally and if they are higher 242 // First check if there are monitors overlapping horizontally and if they are higher
150 // our current highest, make this one the new highest and test all again243 // our current highest, make this one the new highest and test all again
151 if (screen.get_n_monitors () > 1) {244 if (screen.get_n_monitors () > 1) {
152 Gdk.Rectangle dimensions;245 Gdk.Rectangle dimensions;
@@ -156,8 +249,8 @@
156 && dimensions.x < monitor_dimensions.x + monitor_dimensions.width)249 && dimensions.x < monitor_dimensions.x + monitor_dimensions.width)
157 || (dimensions.x + dimensions.width > monitor_dimensions.x250 || (dimensions.x + dimensions.width > monitor_dimensions.x
158 && dimensions.x + dimensions.width <= monitor_dimensions.x + monitor_dimensions.width)251 && dimensions.x + dimensions.width <= monitor_dimensions.x + monitor_dimensions.width)
159 || (dimensions.x < monitor_dimensions.x252 || (dimensions.x < monitor_dimensions.x
160 && dimensions.x + dimensions.width > monitor_dimensions.x + monitor_dimensions.width))253 && dimensions.x + dimensions.width > monitor_dimensions.x + monitor_dimensions.width))
161 && dimensions.y < monitor_dimensions.y) {254 && dimensions.y < monitor_dimensions.y) {
162 warning ("Not placing wingpanel on the primary monitor because of problems" +255 warning ("Not placing wingpanel on the primary monitor because of problems" +
163 " with multimonitor setups");256 " with multimonitor setups");
164257
=== modified file 'src/Widgets/Panel.vala'
--- src/Widgets/Panel.vala 2013-04-14 07:54:25 +0000
+++ src/Widgets/Panel.vala 2014-03-25 04:00:57 +0000
@@ -2,7 +2,7 @@
2/***2/***
3 BEGIN LICENSE3 BEGIN LICENSE
44
5 Copyright (C) 2011-2012 Wingpanel Developers5 Copyright (C) 2011-2014 Wingpanel Developers
6 This program is free software: you can redistribute it and/or modify it6 This program is free software: you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License version 3, as published7 under the terms of the GNU Lesser General Public License version 3, as published
8 by the Free Software Foundation.8 by the Free Software Foundation.
@@ -31,10 +31,11 @@
3131
32 private IndicatorLoader indicator_loader;32 private IndicatorLoader indicator_loader;
3333
34 public Panel (WingpanelApp app, Services.Settings settings, IndicatorLoader indicator_loader) {34 public Panel (Gtk.Application app, Services.Settings settings, IndicatorLoader indicator_loader) {
35 set_application (app as Gtk.Application);35 base (settings);
3636
37 this.indicator_loader = indicator_loader;37 this.indicator_loader = indicator_loader;
38 set_application (app);
3839
39 container = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);40 container = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
40 left_wrapper = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);41 left_wrapper = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
@@ -77,7 +78,9 @@
77 }78 }
7879
79 private void create_entry (IndicatorWidget entry) {80 private void create_entry (IndicatorWidget entry) {
80 if (entry.get_indicator ().get_name () == "libdatetime.so")81 string entry_name = entry.get_indicator ().get_name ();
82
83 if (entry_name == "libdatetime.so" || entry_name == "com.canonical.indicator.datetime")
81 clock.prepend (entry);84 clock.prepend (entry);
82 else85 else
83 menubar.insert_sorted (entry);86 menubar.insert_sorted (entry);
@@ -110,6 +113,18 @@
110 var gpr = new Gtk.SizeGroup (Gtk.SizeGroupMode.HORIZONTAL);113 var gpr = new Gtk.SizeGroup (Gtk.SizeGroupMode.HORIZONTAL);
111 gpr.add_widget (left_wrapper);114 gpr.add_widget (left_wrapper);
112 gpr.add_widget (right_wrapper);115 gpr.add_widget (right_wrapper);
116
117 // make sure those are all transparent when we later adjust the transparency
118 // in the panel's draw callback
119 clock.override_background_color (Gtk.StateFlags.NORMAL, Gdk.RGBA () {
120 red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0
121 });
122 menubar.override_background_color (Gtk.StateFlags.NORMAL, Gdk.RGBA () {
123 red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0
124 });
125 apps_menubar.override_background_color (Gtk.StateFlags.NORMAL, Gdk.RGBA () {
126 red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0
127 });
113 }128 }
114 }129 }
115}130}
116131
=== modified file 'src/WingpanelApp.vala'
--- src/WingpanelApp.vala 2013-04-14 07:54:25 +0000
+++ src/WingpanelApp.vala 2014-03-25 04:00:57 +0000
@@ -1,59 +1,57 @@
1// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-1// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
2/***2//
3 BEGIN LICENSE3// Copyright (C) 2013 Wingpanel Developers
44//
5 Copyright (C) 2011-2012 Wingpanel Developers5// This program is free software: you can redistribute it and/or modify
6 This program is free software: you can redistribute it and/or modify it6// it under the terms of the GNU General Public License as published by
7 under the terms of the GNU Lesser General Public License version 3, as published7// the Free Software Foundation, either version 3 of the License, or
8 by the Free Software Foundation.8// (at your option) any later version.
99//
10 This program is distributed in the hope that it will be useful, but10// This program is distributed in the hope that it will be useful,
11 WITHOUT ANY WARRANTY; without even the implied warranties of11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 PURPOSE. See the GNU General Public License for more details.13// GNU General Public License for more details.
1414//
15 You should have received a copy of the GNU General Public License along15// You should have received a copy of the GNU General Public License
16 with this program. If not, see <http://www.gnu.org/licenses/>16// along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
18 END LICENSE18public class Wingpanel.App : Granite.Application {
19***/19 private IndicatorLoader indicator_loader;
2020 private Widgets.BasePanel panel;
21namespace Wingpanel {21 private Services.BackgroundManager background_manager;
2222
23 public class WingpanelApp : Granite.Application {23 construct {
24 private IndicatorLoader indicator_loader;24 build_data_dir = Build.DATADIR;
25 private Services.Settings settings;25 build_pkg_data_dir = Build.PKGDATADIR;
26 private Widgets.BasePanel panel;26 build_release_name = Build.RELEASE_NAME;
2727 build_version = Build.VERSION;
28 construct {28 build_version_info = Build.VERSION_INFO;
29 build_data_dir = Build.DATADIR;29
30 build_pkg_data_dir = Build.PKGDATADIR;30 program_name = "Wingpanel";
31 build_release_name = Build.RELEASE_NAME;31 exec_name = "wingpanel";
32 build_version = Build.VERSION;32 application_id = "net.launchpad.wingpanel";
33 build_version_info = Build.VERSION_INFO;33 }
3434
35 program_name = "Wingpanel";35 protected override void startup () {
36 exec_name = "wingpanel";36 base.startup ();
37 application_id = "net.launchpad.wingpanel";37
38 }38 Ido.init ();
3939
40 protected override void activate () {40 var settings = new Services.Settings ();
41 debug ("Activating");41 indicator_loader = new Backend.IndicatorFactory (settings.blacklist);
4242 panel = new Widgets.Panel (this, settings, indicator_loader);
43 if (get_windows () == null)43
44 init ();44 panel.show_all ();
45 }45
4646 background_manager = new Services.BackgroundManager (settings, panel.get_screen ());
47 private void init () {47 background_manager.update_background_alpha.connect (panel.update_opacity);
48 settings = new Services.Settings ();48 }
49 indicator_loader = new Backend.IndicatorFactory (settings);49
50 panel = new Widgets.Panel (this, settings, indicator_loader);50 protected override void activate () {
5151 panel.present ();
52 panel.show_all ();52 }
53 }53
5454 public static int main (string[] args) {
55 public static int main (string[] args) {55 return new Wingpanel.App ().run (args);
56 return new WingpanelApp ().run (args);
57 }
58 }56 }
59}57}
6058
=== renamed file 'vapi/indicator-0.4.vapi' => 'vapi/indicator3-0.4.vapi'
--- vapi/indicator-0.4.vapi 2013-10-15 20:44:53 +0000
+++ vapi/indicator3-0.4.vapi 2014-03-25 04:00:57 +0000
@@ -1,4 +1,4 @@
1/* indicator-0.4.vapi generated by vapigen, do not modify. */1/* indicator3-0.4.vapi generated by vapigen, do not modify. */
22
3namespace Indicator {3namespace Indicator {
4 [CCode (cheader_filename = "libindicator/indicator-desktop-shortcuts.h", type_check_function = "INDICATOR_IS_DESKTOP_SHORTCUTS", type_id = "indicator_desktop_shortcuts_get_type ()")]4 [CCode (cheader_filename = "libindicator/indicator-desktop-shortcuts.h", type_check_function = "INDICATOR_IS_DESKTOP_SHORTCUTS", type_id = "indicator_desktop_shortcuts_get_type ()")]
@@ -7,12 +7,28 @@
7 public DesktopShortcuts (string file, string identity);7 public DesktopShortcuts (string file, string identity);
8 public unowned string get_nicks ();8 public unowned string get_nicks ();
9 public bool nick_exec (string nick);9 public bool nick_exec (string nick);
10 public bool nick_exec_with_context (string nick, GLib.AppLaunchContext launch_context);
10 public unowned string nick_get_name (string nick);11 public unowned string nick_get_name (string nick);
11 public string desktop_file { construct; }12 public string desktop_file { construct; }
12 [NoAccessorMethod]13 [NoAccessorMethod]
13 public string identity { owned get; construct; }14 public string identity { owned get; construct; }
14 }15 }
15 [CCode (cheader_filename = "libindicator/indicator-object.h", type_check_function = "INDICATOR_IS_OBJECT", type_id = "indicator_object_get_type ()")]16<<<<<<< TREE
17 [CCode (cheader_filename = "libindicator/indicator-object.h", type_check_function = "INDICATOR_IS_OBJECT", type_id = "indicator_object_get_type ()")]
18=======
19 [CCode (cheader_filename = "libindicator/indicator-ng.h", type_check_function = "INDICATOR_IS_NG", type_id = "indicator_ng_get_type ()")]
20 public class Ng : Indicator.Object, GLib.Initable {
21 [CCode (has_construct_function = false)]
22 public Ng (string service_file) throws GLib.Error;
23 [CCode (has_construct_function = false)]
24 public Ng.for_profile (string service_file, string profile) throws GLib.Error;
25 public unowned string get_profile ();
26 public unowned string get_service_file ();
27 public string profile { get; construct; }
28 public string service_file { get; construct; }
29 }
30 [CCode (cheader_filename = "libindicator/indicator-object.h", type_check_function = "INDICATOR_IS_OBJECT", type_id = "indicator_object_get_type ()")]
31>>>>>>> MERGE-SOURCE
16 public class Object : GLib.Object {32 public class Object : GLib.Object {
17 [CCode (has_construct_function = false)]33 [CCode (has_construct_function = false)]
18 protected Object ();34 protected Object ();
@@ -42,17 +58,8 @@
42 public virtual unowned Gtk.Menu get_menu ();58 public virtual unowned Gtk.Menu get_menu ();
43 [NoWrapper]59 [NoWrapper]
44 public virtual unowned string get_name_hint ();60 public virtual unowned string get_name_hint ();
61 public virtual int get_position ();
45 public virtual bool get_show_now (Indicator.ObjectEntry entry);62 public virtual bool get_show_now (Indicator.ObjectEntry entry);
46 [NoWrapper]
47 public virtual void reserved1 ();
48 [NoWrapper]
49 public virtual void reserved2 ();
50 [NoWrapper]
51 public virtual void reserved3 ();
52 [NoWrapper]
53 public virtual void reserved4 ();
54 [NoWrapper]
55 public virtual void reserved5 ();
56 public void set_environment (string[] env);63 public void set_environment (string[] env);
57 public void set_visible (bool visible);64 public void set_visible (bool visible);
58 [NoAccessorMethod]65 [NoAccessorMethod]
@@ -75,26 +82,15 @@
75 public weak Gtk.Menu menu;82 public weak Gtk.Menu menu;
76 public weak string name_hint;83 public weak string name_hint;
77 public weak Indicator.Object parent_object;84 public weak Indicator.Object parent_object;
78 public weak GLib.Callback reserved1;
79 public weak GLib.Callback reserved2;
80 public weak GLib.Callback reserved3;
81 public weak GLib.Callback reserved4;
82 public static void activate (Indicator.Object io, Indicator.ObjectEntry entry, uint timestamp);85 public static void activate (Indicator.Object io, Indicator.ObjectEntry entry, uint timestamp);
83 public static void activate_window (Indicator.Object io, Indicator.ObjectEntry entry, uint windowid, uint timestamp);86 public static void activate_window (Indicator.Object io, Indicator.ObjectEntry entry, uint windowid, uint timestamp);
84 public static void close (Indicator.Object io, Indicator.ObjectEntry entry, uint timestamp);87 public static void close (Indicator.Object io, Indicator.ObjectEntry entry, uint timestamp);
88 public static bool is_visible (Indicator.Object io, Indicator.ObjectEntry entry);
85 }89 }
86 [CCode (cheader_filename = "libindicator/indicator-service.h", type_check_function = "INDICATOR_IS_SERVICE", type_id = "indicator_service_get_type ()")]90 [CCode (cheader_filename = "libindicator/indicator-service.h", type_check_function = "INDICATOR_IS_SERVICE", type_id = "indicator_service_get_type ()")]
87 public class Service : GLib.Object {91 public class Service : GLib.Object {
88 [CCode (has_construct_function = false)]92 [CCode (has_construct_function = false)]
89 public Service (string name);93 public Service (string name);
90 [NoWrapper]
91 public virtual void indicator_service_reserved1 ();
92 [NoWrapper]
93 public virtual void indicator_service_reserved2 ();
94 [NoWrapper]
95 public virtual void indicator_service_reserved3 ();
96 [NoWrapper]
97 public virtual void indicator_service_reserved4 ();
98 [CCode (cname = "indicator_service_new_version", has_construct_function = false)]94 [CCode (cname = "indicator_service_new_version", has_construct_function = false)]
99 public Service.with_version (string name, uint version);95 public Service.with_version (string name, uint version);
100 [NoAccessorMethod]96 [NoAccessorMethod]
@@ -108,14 +104,6 @@
108 [CCode (has_construct_function = false)]104 [CCode (has_construct_function = false)]
109 public ServiceManager (string dbus_name);105 public ServiceManager (string dbus_name);
110 public bool connected ();106 public bool connected ();
111 [NoWrapper]
112 public virtual void indicator_service_manager_reserved1 ();
113 [NoWrapper]
114 public virtual void indicator_service_manager_reserved2 ();
115 [NoWrapper]
116 public virtual void indicator_service_manager_reserved3 ();
117 [NoWrapper]
118 public virtual void indicator_service_manager_reserved4 ();
119 public void set_refresh (uint time_in_ms);107 public void set_refresh (uint time_in_ms);
120 [CCode (cname = "indicator_service_manager_new_version", has_construct_function = false)]108 [CCode (cname = "indicator_service_manager_new_version", has_construct_function = false)]
121 public ServiceManager.with_version (string dbus_name, uint version);109 public ServiceManager.with_version (string dbus_name, uint version);
@@ -140,28 +128,6 @@
140 public const string GET_TYPE_S;128 public const string GET_TYPE_S;
141 [CCode (cheader_filename = "libindicator/indicator.h")]129 [CCode (cheader_filename = "libindicator/indicator.h")]
142 public const string GET_VERSION_S;130 public const string GET_VERSION_S;
143 [CCode (cheader_filename = "libindicator/indicator-gobject.h")]
144 public const string OBJECT_DEFAULT_VISIBILITY;
145 [CCode (cheader_filename = "libindicator/indicator-gobject.h")]
146 public const string OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE;
147 [CCode (cheader_filename = "libindicator/indicator-gobject.h")]
148 public const string OBJECT_SIGNAL_ENTRY_ADDED;
149 [CCode (cheader_filename = "libindicator/indicator-gobject.h")]
150 public const string OBJECT_SIGNAL_ENTRY_MOVED;
151 [CCode (cheader_filename = "libindicator/indicator-gobject.h")]
152 public const string OBJECT_SIGNAL_ENTRY_REMOVED;
153 [CCode (cheader_filename = "libindicator/indicator-gobject.h")]
154 public const string OBJECT_SIGNAL_ENTRY_SCROLLED;
155 [CCode (cheader_filename = "libindicator/indicator-gobject.h")]
156 public const string OBJECT_SIGNAL_MENU_SHOW;
157 [CCode (cheader_filename = "libindicator/indicator-gobject.h")]
158 public const string OBJECT_SIGNAL_SECONDARY_ACTIVATE;
159 [CCode (cheader_filename = "libindicator/indicator-gobject.h")]
160 public const string OBJECT_SIGNAL_SHOW_NOW_CHANGED;
161 [CCode (cheader_filename = "libindicator/indicator-service-manager.h")]
162 public const string SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE;
163 [CCode (cheader_filename = "libindicator/indicator-service.h")]
164 public const string SERVICE_SIGNAL_SHUTDOWN;
165 [CCode (cheader_filename = "libindicator/indicator.h")]131 [CCode (cheader_filename = "libindicator/indicator.h")]
166 public const int SET_VERSION;132 public const int SET_VERSION;
167 [CCode (cheader_filename = "libindicator/indicator.h")]133 [CCode (cheader_filename = "libindicator/indicator.h")]
@@ -172,4 +138,6 @@
172 public static unowned Gtk.Image image_helper (string name);138 public static unowned Gtk.Image image_helper (string name);
173 [CCode (cheader_filename = "libindicator/indicator-image-helper.h")]139 [CCode (cheader_filename = "libindicator/indicator-image-helper.h")]
174 public static void image_helper_update (Gtk.Image image, string name);140 public static void image_helper_update (Gtk.Image image, string name);
141 [CCode (cheader_filename = "libindicator/indicator-image-helper.h")]
142 public static void image_helper_update_from_gicon (Gtk.Image image, GLib.Icon icon);
175}143}
176144
=== added file 'vapi/libido3-0.1.vapi'
--- vapi/libido3-0.1.vapi 1970-01-01 00:00:00 +0000
+++ vapi/libido3-0.1.vapi 2014-03-25 04:00:57 +0000
@@ -0,0 +1,4 @@
1[CCode (cheader_filename="libido/libido.h", lower_case_cprefix = "ido_")]
2namespace Ido {
3 public void init ();
4}

Subscribers

People subscribed via source and target branches

to all changes: