~gala-dev/gala/windowswitcher-fade-opacity

« back to all changes in this revision

Viewing changes to src/DBus.vala

  • Committer: RabbitBot
  • Author(s): Tom Beckmann, Rico Tzschichholz, Cody Garver
  • Date: 2014-04-06 18:30:23 UTC
  • mfrom: (368.1.21 plugins)
  • Revision ID: rabbitbot-20140406183023-0v1juolllz5u2fht
Add plugin support, move zoom functionality into a plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
        public class DBus
22
22
        {
23
23
                static DBus? instance;
24
 
                static Plugin plugin;
 
24
                static WindowManager wm;
25
25
                
26
26
                [DBus (visibile = false)]
27
 
                public static void init (Plugin _plugin)
 
27
                public static void init (WindowManager _wm)
28
28
                {
29
 
                        plugin = _plugin;
 
29
                        wm = _wm;
30
30
                        
31
31
                        Bus.own_name (BusType.SESSION, "org.pantheon.gala", BusNameOwnerFlags.NONE,
32
32
                                (connection) => {
43
43
                
44
44
                private DBus ()
45
45
                {
46
 
#if HAS_MUTTER38
47
 
                        if (plugin.background_group != null)
48
 
                                (plugin.background_group as BackgroundManager).changed.connect (() => background_changed ());
 
46
                        if (wm.background_group != null)
 
47
                                (wm.background_group as BackgroundManager).changed.connect (() => background_changed ());
49
48
                        else
50
49
                                assert_not_reached ();
51
 
#endif
52
50
                }
53
51
                
54
52
                public void perform_action (ActionType type)
55
53
                {
56
 
                        plugin.perform_action (type);
 
54
                        wm.perform_action (type);
57
55
                }
58
56
 
59
 
#if HAS_MUTTER38
60
57
                const double SATURATION_WEIGHT = 1.5;
61
58
                const double WEIGHT_THRESHOLD = 1.0;
62
59
 
104
101
                        int reference_x, int reference_y, int reference_width, int reference_height)
105
102
                        throws DBusError
106
103
                {
107
 
                        var background = plugin.background_group.get_child_at_index (monitor);
 
104
                        var background = wm.background_group.get_child_at_index (monitor);
108
105
                        if (background == null)
109
106
                                throw new DBusError.INVALID_ARGS ("Invalid monitor requested");
110
107
 
224
221
 
225
222
                        return { rTotal, gTotal, bTotal, mean, variance };
226
223
                }
227
 
#endif
228
224
        }
229
225
}