updated on Thu Jan 12 04:00:44 UTC 2012
[aur-mirror.git] / gnome-shell-extension-coverflow-alt-tab / extension.js
blob06369028446a17149d2abc1702be4686554d1443
1 /* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
3 /* 
4  * Gnome-shell extension specific routines.
5  *
6  * register/unregister keybinding handlers, etc.
7  */
9 const Lang = imports.lang;
10 const Main = imports.ui.main;
12 const CoverflowAltTab = imports.ui.extensionSystem.extensions["CoverflowAltTab@palatis.blogspot.com"];
13 const Manager = CoverflowAltTab.manager;
15 let manager = null;
17 function init() {
20 function enable() {
21         if (!manager) {
22                 manager = new Manager.Manager();
23         }
25         Main.wm.setKeybindingHandler('switch_windows', Lang.bind(manager, manager._startWindowSwitcher));
26         Main.wm.setKeybindingHandler('switch_group', Lang.bind(manager, manager._startWindowSwitcher));
27         Main.wm.setKeybindingHandler('switch_panels', Lang.bind(manager, manager._startWindowSwitcher));
28         Main.wm.setKeybindingHandler('switch_windows_backward', Lang.bind(manager, manager._startWindowSwitcher));
29         Main.wm.setKeybindingHandler('switch_group_backward', Lang.bind(manager, manager._startWindowSwitcher));
32 function disable() {
33         if (manager) {
34                 manager = null;
35         }
37         Main.wm.setKeybindingHandler('switch_windows', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
38         Main.wm.setKeybindingHandler('switch_group', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
39         Main.wm.setKeybindingHandler('switch_panels', Lang.bind(Main.wm, Main.wm._startA11ySwitcher));
40         Main.wm.setKeybindingHandler('switch_windows_backward', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
41         Main.wm.setKeybindingHandler('switch_group_backward', Lang.bind(Main.wm, Main.wm._startAppSwitcher));