├── .gitignore
├── data
├── pixmaps
│ └── mate-window-applets
│ │ ├── Black
│ │ ├── close.png
│ │ ├── maximize.png
│ │ ├── minimize.png
│ │ ├── unmaximize.png
│ │ ├── close_prelight.png
│ │ ├── maximize_prelight.png
│ │ ├── minimize_prelight.png
│ │ └── unmaximize_prelight.png
│ │ └── White
│ │ ├── close.png
│ │ ├── maximize.png
│ │ ├── minimize.png
│ │ ├── unmaximize.png
│ │ ├── close_prelight.png
│ │ ├── maximize_prelight.png
│ │ ├── minimize_prelight.png
│ │ └── unmaximize_prelight.png
├── meson.build
└── org.mate.window-applets.gschema.xml
├── window-menu-applet
├── org.mate.panel.applet.WindowMenuAppletFactory.service.in
├── org.mate.panel.WindowMenuApplet.mate-panel-applet.in
├── meson.build
├── window-menu-button.vala
├── dialog.ui
└── window-menu-applet.vala
├── window-title-applet
├── org.mate.panel.applet.WindowTitleAppletFactory.service.in
├── org.mate.panel.WindowTitleApplet.mate-panel-applet.in
├── meson.build
├── dialog.ui
└── window-title-applet.vala
├── window-buttons-applet
├── org.mate.panel.applet.WindowButtonsAppletFactory.service.in
├── org.mate.panel.WindowButtonsApplet.mate-panel-applet.in
├── meson.build
├── window-button.vala
├── window-buttons-theme.vala
├── window-buttons-applet.vala
└── dialog.ui
├── substitute.sh
├── meson_options.txt
├── .github
└── FUNDING.yml
├── install-icons.sh
├── meson.build
├── README.md
├── vapi
└── libmatepanelapplet-4.0.vapi
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/data/pixmaps/mate-window-applets/Black/close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ubuntu-mate/mate-window-applets/HEAD/data/pixmaps/mate-window-applets/Black/close.png
--------------------------------------------------------------------------------
/data/pixmaps/mate-window-applets/White/close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ubuntu-mate/mate-window-applets/HEAD/data/pixmaps/mate-window-applets/White/close.png
--------------------------------------------------------------------------------
/data/pixmaps/mate-window-applets/Black/maximize.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ubuntu-mate/mate-window-applets/HEAD/data/pixmaps/mate-window-applets/Black/maximize.png
--------------------------------------------------------------------------------
/data/pixmaps/mate-window-applets/Black/minimize.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ubuntu-mate/mate-window-applets/HEAD/data/pixmaps/mate-window-applets/Black/minimize.png
--------------------------------------------------------------------------------
/data/pixmaps/mate-window-applets/Black/unmaximize.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ubuntu-mate/mate-window-applets/HEAD/data/pixmaps/mate-window-applets/Black/unmaximize.png
--------------------------------------------------------------------------------
/data/pixmaps/mate-window-applets/White/maximize.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ubuntu-mate/mate-window-applets/HEAD/data/pixmaps/mate-window-applets/White/maximize.png
--------------------------------------------------------------------------------
/data/pixmaps/mate-window-applets/White/minimize.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ubuntu-mate/mate-window-applets/HEAD/data/pixmaps/mate-window-applets/White/minimize.png
--------------------------------------------------------------------------------
/data/pixmaps/mate-window-applets/White/unmaximize.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ubuntu-mate/mate-window-applets/HEAD/data/pixmaps/mate-window-applets/White/unmaximize.png
--------------------------------------------------------------------------------
/window-menu-applet/org.mate.panel.applet.WindowMenuAppletFactory.service.in:
--------------------------------------------------------------------------------
1 | [D-BUS Service]
2 | Name=org.mate.panel.applet.WindowMenuAppletFactory
3 | Exec=@LOCATION@
4 |
--------------------------------------------------------------------------------
/window-title-applet/org.mate.panel.applet.WindowTitleAppletFactory.service.in:
--------------------------------------------------------------------------------
1 | [D-BUS Service]
2 | Name=org.mate.panel.applet.WindowTitleAppletFactory
3 | Exec=@LOCATION@
4 |
--------------------------------------------------------------------------------
/data/pixmaps/mate-window-applets/Black/close_prelight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ubuntu-mate/mate-window-applets/HEAD/data/pixmaps/mate-window-applets/Black/close_prelight.png
--------------------------------------------------------------------------------
/data/pixmaps/mate-window-applets/White/close_prelight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ubuntu-mate/mate-window-applets/HEAD/data/pixmaps/mate-window-applets/White/close_prelight.png
--------------------------------------------------------------------------------
/window-buttons-applet/org.mate.panel.applet.WindowButtonsAppletFactory.service.in:
--------------------------------------------------------------------------------
1 | [D-BUS Service]
2 | Name=org.mate.panel.applet.WindowButtonsAppletFactory
3 | Exec=@LOCATION@
4 |
--------------------------------------------------------------------------------
/data/pixmaps/mate-window-applets/Black/maximize_prelight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ubuntu-mate/mate-window-applets/HEAD/data/pixmaps/mate-window-applets/Black/maximize_prelight.png
--------------------------------------------------------------------------------
/data/pixmaps/mate-window-applets/Black/minimize_prelight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ubuntu-mate/mate-window-applets/HEAD/data/pixmaps/mate-window-applets/Black/minimize_prelight.png
--------------------------------------------------------------------------------
/data/pixmaps/mate-window-applets/White/maximize_prelight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ubuntu-mate/mate-window-applets/HEAD/data/pixmaps/mate-window-applets/White/maximize_prelight.png
--------------------------------------------------------------------------------
/data/pixmaps/mate-window-applets/White/minimize_prelight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ubuntu-mate/mate-window-applets/HEAD/data/pixmaps/mate-window-applets/White/minimize_prelight.png
--------------------------------------------------------------------------------
/data/pixmaps/mate-window-applets/Black/unmaximize_prelight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ubuntu-mate/mate-window-applets/HEAD/data/pixmaps/mate-window-applets/Black/unmaximize_prelight.png
--------------------------------------------------------------------------------
/data/pixmaps/mate-window-applets/White/unmaximize_prelight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ubuntu-mate/mate-window-applets/HEAD/data/pixmaps/mate-window-applets/White/unmaximize_prelight.png
--------------------------------------------------------------------------------
/substitute.sh:
--------------------------------------------------------------------------------
1 | #! /bin/bash
2 |
3 | cp $1 $2
4 |
5 | sed -i -e 's,@VERSION@,1.5.1,g' $2;
6 |
7 | if [[ ! -z $3 ]]; then
8 |
9 | sed -i -e 's,@LOCATION@,'${3}',g' $2;
10 |
11 | fi
12 |
--------------------------------------------------------------------------------
/meson_options.txt:
--------------------------------------------------------------------------------
1 | option('build-window-buttons', type: 'boolean',value:true)
2 | option('build-window-menu', type: 'boolean',value:true)
3 | option('build-window-title', type: 'boolean',value:true)
4 |
--------------------------------------------------------------------------------
/data/meson.build:
--------------------------------------------------------------------------------
1 | schema_dir = get_option('prefix') + '/' + get_option('datadir') + '/' + 'glib-2.0/schemas'
2 |
3 | gschema = custom_target('gscema',
4 | output: 'org.mate.window-applets.gschema.xml',
5 | input: 'org.mate.window-applets.gschema.xml',
6 | command: [sub,'@INPUT@', '@OUTPUT@'],
7 | install: true,
8 | install_dir: schema_dir,
9 | )
10 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 | patreon: ubuntu_mate
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: ubuntumate
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | custom: https://ubuntu-mate.org/donate/
10 |
--------------------------------------------------------------------------------
/window-menu-applet/org.mate.panel.WindowMenuApplet.mate-panel-applet.in:
--------------------------------------------------------------------------------
1 | [Applet Factory]
2 | Id=WindowMenuAppletFactory
3 | InProcess=false
4 | Location=@LOCATION@
5 | Name=Widow Menu Applet Factory
6 | Description=A Window Menu Applet Factory
7 |
8 | [WindowMenuApplet]
9 | Name=Window Menu Applet
10 | Name[bg]=Аплет меню на прозореца
11 | Name[de]=Fenstermenü
12 | Description=A applet that shows window menu on panel
13 | Description[bg]=Аплет който показва менюто на прозореца върху панела
14 | Description[de]=Zeigt das Fenstermenü in der Leiste
15 | Icon=menu-editor
16 | MateComponentId=OAFIID:MATE_WindowMenuApplet;
17 |
--------------------------------------------------------------------------------
/window-title-applet/org.mate.panel.WindowTitleApplet.mate-panel-applet.in:
--------------------------------------------------------------------------------
1 | [Applet Factory]
2 | Id=WindowTitleAppletFactory
3 | InProcess=false
4 | Location=@LOCATION@
5 | Name=Widow Title Applet Factory
6 | Description=A Window Title Applet Factory
7 |
8 | [WindowTitleApplet]
9 | Name=Window Title Applet
10 | Name[bg]=Аплет заглавие на прозореца
11 | Name[de]=Fenstertitel
12 | Description=A applet that shows window title on panel
13 | Description[bg]=Аплет който показва заглавието на прозореца върху панела
14 | Description[de]=Zeigt den Fenstertitel in der Leiste
15 | Icon=user-desktop
16 | MateComponentId=OAFIID:MATE_WindowTitleApplet;
17 |
--------------------------------------------------------------------------------
/window-buttons-applet/org.mate.panel.WindowButtonsApplet.mate-panel-applet.in:
--------------------------------------------------------------------------------
1 |
2 | [Applet Factory]
3 | Id=WindowButtonsAppletFactory
4 | InProcess=false
5 | Location=@LOCATION@
6 | Name=Widow Buttons Applet Factory
7 | Description=A Window Buttons Applet Factory
8 |
9 | [WindowButtonsApplet]
10 | Name=Window Buttons Applet
11 | Name[bg]=Аплет бутони на прозореца
12 | Name[de]=Fensterknöpfe
13 | Description=A applet that shows window buttons on panel
14 | Description[bg]=Аплет който показва бутоните на прозореца върху панела
15 | Description[de]=Zeigt die Fensterknöpfe in der Leiste
16 | Icon=window-close
17 | MateComponentId=OAFIID:MATE_WindowButtonsApplet;
18 |
--------------------------------------------------------------------------------
/install-icons.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | usage=$()
4 |
5 | if [[ -z "$1" ]]; then
6 | echo "Usage: $0 {path}(optional) install/uninstall"
7 | exit 1
8 | else
9 |
10 | if [[ "$1" == "install" || "$1" == "uninstall" ]]; then
11 | DIR="/usr/share/"
12 | echo "Installing icons in $DIR"
13 |
14 | if [[ $1 == "install" ]]; then
15 | cp -v -r data/pixmaps $DIR
16 | elif [[ $1 == "uninstall" ]]; then
17 | rm -v -r $DIR"pixmaps/mate-window-applets"
18 | fi
19 |
20 | else
21 |
22 | DIR=$1
23 | echo "Installing icons in $DIR"
24 |
25 | if [[ -z "$2" ]]; then
26 | echo "Usage: $0 {path}(optional) install/uninstall"
27 | exit 1
28 | else
29 |
30 | if [[ "$2" == "install" || "$2" == uninstall ]]; then
31 | if [[ $2 == "install" ]]; then
32 | cp -v -r data/pixmaps $DIR
33 | elif [[ $2 == "uninstall" ]]; then
34 | rm -v -r $DIR"pixmaps/mate-window-applets"
35 | else
36 | echo "Usage: $0 {path}(optional) install/uninstall"
37 | fi
38 |
39 | else
40 | echo "Usage: $0 {path}(optional) install/uninstall"
41 | exit 1
42 | fi
43 | fi
44 | fi
45 |
46 |
47 |
48 |
49 | fi
50 |
--------------------------------------------------------------------------------
/window-title-applet/meson.build:
--------------------------------------------------------------------------------
1 | if get_option('build-window-title') == true
2 |
3 | message('Building with Window Menu')
4 |
5 | target_name = 'window-title-applet'
6 | target_files = ['window-title-applet.vala']
7 | window_title_dir = applets_dir + 'window-title/'
8 |
9 | executable(target_name,target_files,dependencies: deps,install: true,install_dir: window_title_dir)
10 |
11 | title_factory = custom_target('title_factory',
12 | output: 'org.mate.panel.WindowTitleApplet.mate-panel-applet',
13 | input: 'org.mate.panel.WindowTitleApplet.mate-panel-applet.in',
14 | command: [sub,'@INPUT@', '@OUTPUT@',window_title_dir + target_name],
15 | install: true,
16 | install_dir: factories_dir)
17 |
18 | title_service = custom_target('title_service',
19 | output: 'org.mate.panel.applet.WindowTitleAppletFactory.service',
20 | input: 'org.mate.panel.applet.WindowTitleAppletFactory.service.in',
21 | command: [sub,'@INPUT@', '@OUTPUT@',window_title_dir + target_name],
22 | install: true,
23 | install_dir: service_dir)
24 |
25 | title_ui = custom_target('title_ui',
26 | output: 'dialog.ui',
27 | input: 'dialog.ui',
28 | command: [sub,'@INPUT@', '@OUTPUT@'],
29 | install: true,
30 | install_dir: window_title_dir)
31 |
32 | endif
33 |
--------------------------------------------------------------------------------
/window-menu-applet/meson.build:
--------------------------------------------------------------------------------
1 | if get_option('build-window-menu') == true
2 |
3 | message('Building with Window Menu')
4 |
5 | target_name = 'window-menu-applet'
6 | target_files = ['window-menu-applet.vala','window-menu-button.vala']
7 | window_menu_dir = applets_dir + 'window-menu/'
8 |
9 | executable(target_name,target_files,dependencies: deps,install: true,install_dir: window_menu_dir)
10 |
11 | menu_factory = custom_target('menu_factory',
12 | output: 'org.mate.panel.WindowMenuApplet.mate-panel-applet',
13 | input: 'org.mate.panel.WindowMenuApplet.mate-panel-applet.in',
14 | command: [sub,'@INPUT@', '@OUTPUT@',window_menu_dir + target_name],
15 | install: true,
16 | install_dir: factories_dir)
17 |
18 | menu_service = custom_target('menu_service',
19 | output: 'org.mate.panel.applet.WindowMenuAppletFactory.service',
20 | input: 'org.mate.panel.applet.WindowMenuAppletFactory.service.in',
21 | command: [sub,'@INPUT@', '@OUTPUT@',window_menu_dir + target_name],
22 | install: true,
23 | install_dir: service_dir)
24 |
25 | menu_ui = custom_target('menu_ui',
26 | output: 'dialog.ui',
27 | input: 'dialog.ui',
28 | command: [sub,'@INPUT@', '@OUTPUT@'],
29 | install: true,
30 | install_dir: window_menu_dir)
31 |
32 | endif
33 |
--------------------------------------------------------------------------------
/window-buttons-applet/meson.build:
--------------------------------------------------------------------------------
1 | if get_option('build-window-buttons') == true
2 |
3 | message('Building with Window Buttons')
4 |
5 | target_name = 'window-buttons-applet'
6 | target_files = ['window-buttons-applet.vala','window-button.vala','window-buttons-theme.vala']
7 | window_buttons_dir = applets_dir + 'window-buttons/'
8 |
9 | executable(target_name,target_files,dependencies: deps,install: true,install_dir: window_buttons_dir)
10 |
11 | factory = custom_target('factory',
12 | output: 'org.mate.panel.WindowButtonsApplet.mate-panel-applet',
13 | input: 'org.mate.panel.WindowButtonsApplet.mate-panel-applet.in',
14 | command: [sub,'@INPUT@', '@OUTPUT@',window_buttons_dir + target_name],
15 | install: true,
16 | install_dir: factories_dir)
17 |
18 | service = custom_target('service',
19 | output: 'org.mate.panel.applet.WindowButtonsAppletFactory.service',
20 | input: 'org.mate.panel.applet.WindowButtonsAppletFactory.service.in',
21 | command: [sub,'@INPUT@', '@OUTPUT@',window_buttons_dir + target_name],
22 | install: true,
23 | install_dir: service_dir)
24 |
25 | ui = custom_target('ui',
26 | output: 'dialog.ui',
27 | input: 'dialog.ui',
28 | command: [sub,'@INPUT@', '@OUTPUT@'],
29 | install: true,
30 | install_dir: window_buttons_dir)
31 |
32 | endif
33 |
--------------------------------------------------------------------------------
/meson.build:
--------------------------------------------------------------------------------
1 | project('mate-window-applets','vala','c',version: '20.04.0',meson_version: '>=0.36.0')
2 |
3 |
4 | add_global_arguments(['--vapidir', join_paths(meson.current_source_dir(), 'vapi')],
5 | language: 'vala')
6 |
7 | add_global_arguments(['-DWNCK_I_KNOW_THIS_IS_UNSTABLE'],language:'c')
8 |
9 | if get_option('prefix') == '/usr/local'
10 |
11 | add_global_arguments(['-D', 'LOCAL_PATH'],language:'vala')
12 |
13 | elif get_option('prefix') == '/usr/local/'
14 |
15 | add_global_arguments(['-D', 'LOCAL_PATH'],language:'vala')
16 |
17 | endif
18 |
19 | sub = find_program('substitute.sh')
20 |
21 | applets_dir = get_option('prefix') + '/lib/mate-applets/mate-window-applets/'
22 | factories_dir = get_option('prefix') + '/' + get_option('datadir') + '/mate-panel/applets/'
23 | service_dir = get_option('prefix') + '/' + get_option('datadir') + '/dbus-1/services/'
24 |
25 | glib_dep = dependency('glib-2.0')
26 | gobject_dep = dependency('gobject-2.0')
27 | gtk_dep = dependency('gtk+-3.0')
28 | gdk_dep = dependency('gdk-pixbuf-2.0')
29 | wnck_dep = dependency('libwnck-3.0')
30 |
31 | mate_dep = dependency('libmatepanelapplet-4.0')
32 |
33 | deps = [glib_dep,gobject_dep,gtk_dep,gdk_dep,wnck_dep,mate_dep]
34 |
35 | subdir('window-buttons-applet')
36 | subdir('window-menu-applet')
37 | subdir('window-title-applet')
38 | subdir('data')
39 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # mate-window-applets
2 |
3 | Applets for `mate-panel` to show various window controls. The original author delete their GitHub repository, so this in an import from the source uploaded to Debian.
4 |
5 | * WindowButtons applet shows the close,minimize,actions in a panel.
6 | * WindowTitle applet shows the title of the active window.
7 | * WindowMenu applet shows you the window menu of the active window.
8 |
9 | ## Install
10 |
11 | On [Ubuntu MATE](https://ubuntu-mate.org) 18.04 or newer:
12 |
13 | ```
14 | sudo apt install mate-window-buttons-applet mate-window-menu-applet mate-window-title-applet
15 | ```
16 |
17 | ## Compile
18 |
19 | ### Requirements
20 |
21 | * meson
22 | * ninja
23 | * vala
24 | * Gtk3
25 | * Gdk3
26 | * libwnck3
27 | * libmatepanelapplet
28 |
29 | To install them in Ubuntu MATE 20.04 or newer, run:
30 | ```
31 | sudo apt install meson ninja-build valac libwnck-3-dev libgtk-3-dev libgdk-pixbuf2.0-dev libmate-panel-applet-dev
32 | ```
33 |
34 | ### Build
35 |
36 | ```
37 | meson --prefix=/usr build
38 | cd build
39 | ninja
40 | sudo ninja install
41 | cd ..
42 | sudo ./install-icons.sh install
43 | sudo glib-compile-schemas /usr/share/glib-2.0/schemas
44 | ```
45 |
46 | #### Remove
47 |
48 | ```
49 | cd build
50 | sudo ninja uninstall
51 | cd ..
52 | sudo ./install-icons.sh uninstall
53 | ```
54 |
55 | ### License
56 |
57 | * GPLv3
58 |
59 | See the [LICENSE](LICENSE) file.
60 |
--------------------------------------------------------------------------------
/window-menu-applet/window-menu-button.vala:
--------------------------------------------------------------------------------
1 | namespace WindowWidgets{
2 | public class WindowMenuButton : Gtk.MenuButton{
3 | //Properties
4 |
5 | private Gtk.Image button_image = new Gtk.Image();
6 |
7 | private Wnck.Window _window;
8 | private Gdk.Pixbuf _icon;
9 | private int _icon_size = 18;
10 |
11 | public Wnck.Window window {
12 | get{ return _window; }
13 | set{ _window = value; }
14 | }
15 |
16 | public Gdk.Pixbuf icon{
17 | get{ return _icon; }
18 | set{ _icon = value; }
19 | }
20 |
21 | public int icon_size{
22 | get{ return _icon_size; }
23 | set{ _icon_size = value; }
24 | }
25 |
26 | public WindowMenuButton(){
27 | Object();
28 |
29 | this.set_relief(Gtk.ReliefStyle.NONE);
30 |
31 | this.set_image(button_image);
32 |
33 | this.set_always_show_image(true);
34 |
35 | this.icon_set();
36 | this.menu_set();
37 | }
38 |
39 | public void icon_set(){
40 | if(_window != null){
41 | _icon = _window.get_icon();
42 | _icon = _icon.scale_simple(_icon_size * this.get_scale_factor(),_icon_size * this.get_scale_factor(), Gdk.InterpType.HYPER);
43 |
44 | if(!_window.is_active()){
45 | _icon.saturate_and_pixelate(_icon, 0, false);
46 | }
47 |
48 | Cairo.Surface surface = Gdk.cairo_surface_create_from_pixbuf(_icon, this.get_scale_factor(), null);
49 | button_image.set_from_surface(surface);
50 | }
51 | else {
52 | button_image.clear();
53 | }
54 | }
55 |
56 | public void menu_set(){
57 |
58 | if(_window != null){
59 | this.set_popup(new Wnck.ActionMenu(_window));
60 | this.set_sensitive(true);
61 | }
62 | else{
63 | this.get_popup().detach();
64 | this.set_sensitive(false);
65 | }
66 |
67 | }
68 |
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/data/org.mate.window-applets.gschema.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | true
17 | Determines if buttons will use marco order
18 |
19 |
20 |
21 | 'close,maximize,minimize'
22 | Choose the order of the buttons
23 |
24 | Values should be a string separated by ','.
25 | The string may include "close","maximize","minimize".
26 | Does not work when use-marco-order is set to true.
27 |
28 |
29 |
30 |
31 | 8
32 | Spacing betwene buttons
33 |
34 |
35 |
36 | 4
37 | Padding betwene panel and buttons
38 |
39 |
40 |
41 | false
42 | Whether the applet should control maximized windows only
43 |
44 |
45 |
46 | 'active-always'
47 | Which window is controlled by the applet
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | 'active-always'
56 | Which window is controlled by the applet
57 |
58 |
59 |
60 |
61 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/vapi/libmatepanelapplet-4.0.vapi:
--------------------------------------------------------------------------------
1 | /* MatePanelApplet-4.0.vapi generated by vapigen, do not modify. */
2 |
3 | [CCode (cprefix = "MatePanel", gir_namespace = "MatePanelApplet", gir_version = "4.0", lower_case_cprefix = "mate_panel_")]
4 | namespace MatePanel {
5 | [CCode (cheader_filename = "mate-panel-applet.h", type_id = "mate_panel_applet_get_type ()")]
6 | public class Applet : Gtk.EventBox, Atk.Implementor, Gtk.Buildable {
7 | [CCode (has_construct_function = false, type = "GtkWidget*")]
8 | public Applet ();
9 | public static int factory_main (string factory_id, bool out_process, GLib.Type applet_type, MatePanel.AppletFactoryCallback callback);
10 | public MatePanel.AppletBackgroundType get_background (out Gdk.RGBA color,out Cairo.Pattern pixmap);
11 | public MatePanel.AppletFlags get_flags ();
12 | public bool get_locked_down ();
13 | public MatePanel.AppletOrient get_orient ();
14 | public string get_preferences_path ();
15 | public int get_size ();
16 | public void request_focus (int32 timestamp);
17 | [Version (deprecated = true, deprecated_since = "3.20")]
18 | public void set_background_widget (Gtk.Widget widget);
19 | public void set_flags (MatePanel.AppletFlags flags);
20 | public void set_size_hints (int size_hints, int n_elements, int base_size);
21 | public void setup_menu (string xml, Gtk.ActionGroup action_group);
22 | public void setup_menu_from_file (string filename, Gtk.ActionGroup action_group);
23 | [NoAccessorMethod]
24 | public string background { owned get; set; }
25 | [NoAccessorMethod]
26 | public void* closure { get; construct; }
27 | [NoAccessorMethod]
28 | public GLib.DBusConnection connection { owned get; construct; }
29 | public int flags { get; set; }
30 | [NoAccessorMethod]
31 | public string id { owned get; construct; }
32 | [NoAccessorMethod]
33 | public bool locked { get; set; }
34 | [NoAccessorMethod]
35 | public bool locked_down { get; set; }
36 | [NoAccessorMethod]
37 | public int orient { get; set; }
38 | [NoAccessorMethod]
39 | public string prefs_path { owned get; set; }
40 | [NoAccessorMethod]
41 | public int size { get; set; }
42 | [NoAccessorMethod]
43 | public void* size_hints { get; set; }
44 | public virtual signal void change_background (MatePanel.AppletBackgroundType type, Gdk.RGBA color, Cairo.Pattern pixmap);
45 | public virtual signal void change_orient (int orient);
46 | public virtual signal void change_size (int size);
47 | public virtual signal void move_focus_out_of_applet (Gtk.DirectionType direction);
48 | }
49 | [CCode (cheader_filename = "mate-panel-applet-enums.h", cprefix = "PANEL_", type_id = "mate_panel_applet_background_type_get_type ()")]
50 | public enum AppletBackgroundType {
51 | NO_BACKGROUND,
52 | COLOR_BACKGROUND,
53 | PIXMAP_BACKGROUND
54 | }
55 | [CCode (cheader_filename = "mate-panel-applet-enums.h", cprefix = "MATE_PANEL_APPLET_", type_id = "mate_panel_applet_flags_get_type ()")]
56 | [Flags]
57 | public enum AppletFlags {
58 | FLAGS_NONE,
59 | EXPAND_MAJOR,
60 | EXPAND_MINOR,
61 | HAS_HANDLE
62 | }
63 | [CCode (cheader_filename = "mate-panel-applet-enums.h", cprefix = "MATE_PANEL_APPLET_ORIENT_", type_id = "mate_panel_applet_orient_get_type ()")]
64 | public enum AppletOrient {
65 | UP,
66 | DOWN,
67 | LEFT,
68 | RIGHT
69 | }
70 | [CCode (cheader_filename = "mate-panel-applet.h", instance_pos = 2.9)]
71 | public delegate bool AppletFactoryCallback (MatePanel.Applet applet, string iid);
72 | [CCode (cheader_filename = "mate-panel-applet.h", cname = "MATE_PANEL_APPLET_FLAGS_ALL")]
73 | public const int APPLET_FLAGS_ALL;
74 | namespace AppletSettings
75 | {
76 | public GLib.Settings @new(Applet applet, string schema);
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/window-buttons-applet/window-button.vala:
--------------------------------------------------------------------------------
1 | namespace WindowWidgets{
2 | public class WindowButton : Gtk.EventBox {
3 | //Properties
4 |
5 | private Gtk.Image button_image = new Gtk.Image();
6 |
7 | private WindowButtonType _button_type;
8 | private int _icon_size = 18;
9 | private Wnck.Window _window;
10 | private IconAction _current_action;
11 |
12 | public WindowButtonsTheme theme;
13 |
14 | public WindowButtonType button_type{
15 | get{return _button_type;}
16 | set{_button_type = value;}
17 | }
18 |
19 | public int icon_size{
20 | get{return icon_size;}
21 | set{_icon_size = value;}
22 | }
23 |
24 | public Wnck.Window window{
25 | get{return _window;}
26 | set{_window = value;}
27 | }
28 |
29 | //Constructor
30 |
31 | public WindowButton(WindowButtonType btype){
32 | Object();
33 |
34 | this._button_type = btype;
35 |
36 | this.add(button_image);
37 | this.button_image.show();
38 |
39 |
40 | // Time for connecting
41 |
42 | this.button_release_event.connect( (ev_button) => {
43 | if(ev_button.button == 1){
44 | if(_button_type == WindowButtonType.CLOSE){
45 | close_window(0);
46 | }
47 | else if(_button_type == WindowButtonType.MINIMIZE){
48 | minimize_window();
49 | }
50 | else if(_button_type == WindowButtonType.MAXIMIZE){
51 | maximize_window();
52 | }
53 | }
54 |
55 | return false;
56 |
57 | });
58 |
59 | this.enter_notify_event.connect( (object,event) => { this.event_set(event); return false; } );
60 | this.leave_notify_event.connect( (object,event) => { this.event_set(event); return false; } );
61 | this.button_press_event.connect( (object,event) => { this.event_set(event); return false; } );
62 | this.button_release_event.connect( (object,event) => { this.event_set(event); return false; } );
63 | }
64 |
65 | //Helpers
66 |
67 | public void close_window(uint32 timestamp){
68 | _window.close(timestamp);
69 | }
70 |
71 | public void minimize_window(){
72 | _window.minimize();
73 | }
74 |
75 | public void maximize_window(){
76 | if(_window.is_maximized()){
77 | _window.unmaximize();
78 | }
79 | else{
80 | _window.maximize();
81 | }
82 | }
83 |
84 | public void update(bool theme_change = false){
85 |
86 | IconType type;
87 | if(_button_type == WindowButtonType.MINIMIZE)
88 | type = IconType.MINIMIZE;
89 | else if(_button_type == WindowButtonType.MAXIMIZE){
90 | if(_window != null && _window.is_maximized())
91 | type = IconType.UNMAXIMIZE;
92 | else
93 | type = IconType.MAXIMIZE;
94 | } else
95 | type = IconType.CLOSE;
96 |
97 |
98 | IconState state;
99 | if(_window != null && !_window.is_active())
100 | state = IconState.UNFOCUSED;
101 | else
102 | state = IconState.FOCUSED;
103 |
104 |
105 | Gdk.Pixbuf? icon = theme.get_icon(type, state, _current_action);
106 |
107 | // If this is a new theme, and it doesn't have an icon for the current state and action, then reset
108 | // everything, otherwise we would be showing the icons of the old theme
109 | if(theme_change && icon == null){
110 | state = IconState.FOCUSED;
111 | _current_action = IconAction.NORMAL;
112 |
113 | icon = theme.get_icon(type, state, _current_action);
114 | }
115 |
116 | if(icon != null){
117 | Cairo.Surface surface = Gdk.cairo_surface_create_from_pixbuf(icon, this.get_scale_factor(), null);
118 | button_image.set_from_surface(surface);
119 | }
120 |
121 | }
122 |
123 | private void event_set(Gdk.Event *event){
124 | if(event->get_event_type() == Gdk.EventType.ENTER_NOTIFY || event->get_event_type() == Gdk.EventType.BUTTON_RELEASE)
125 | _current_action = IconAction.HOVERED;
126 | else if(event->get_event_type() == Gdk.EventType.BUTTON_PRESS)
127 | _current_action = IconAction.PRESSED;
128 | else
129 | _current_action = IconAction.NORMAL;
130 |
131 | this.update();
132 | }
133 |
134 | }
135 |
136 | public enum WindowButtonType{
137 | CLOSE = 0,
138 | MINIMIZE = 1,
139 | MAXIMIZE = 2
140 | }
141 |
142 | }
143 |
--------------------------------------------------------------------------------
/window-menu-applet/dialog.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
41 |
42 | False
43 | GDK_STRUCTURE_MASK | GDK_SCROLL_MASK
44 | center
45 | static
46 |
47 |
54 |
55 |
56 |
57 | True
58 | False
59 | vertical
60 | 4
61 | True
62 |
63 |
64 | True
65 | False
66 |
67 |
68 | True
69 | False
70 | start
71 | Behaviour:
72 |
73 |
74 | True
75 | True
76 | 2
77 | 0
78 |
79 |
80 |
81 |
82 | True
83 | True
84 | center
85 |
86 | - Always control active window
87 | - Only control active window when maximized
88 | - Control top-most maximized window
89 |
90 |
91 |
92 | False
93 | True
94 | 1
95 |
96 |
97 |
98 |
99 | False
100 | True
101 | 5
102 |
103 |
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/window-title-applet/dialog.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | False
7 | GDK_STRUCTURE_MASK | GDK_SCROLL_MASK
8 | center
9 | dialog
10 | Mate Window Applets - Window Title
11 | @VERSION@
12 | Copyright © 2017 Ivalin Radulov
13 | https://github.com/ubuntu-mate/mate-window-applets
14 |
15 | gpl-3-0
16 |
17 |
24 |
25 |
26 |
27 | False
28 |
29 |
30 | False
31 |
32 |
33 | False
34 | False
35 | 0
36 |
37 |
38 |
39 |
40 |
41 |
42 | False
43 | GDK_STRUCTURE_MASK | GDK_SCROLL_MASK
44 | center
45 | static
46 |
47 |
54 |
55 |
56 |
57 | True
58 | False
59 | vertical
60 | 4
61 | True
62 |
63 |
64 | True
65 | False
66 |
67 |
68 | True
69 | False
70 | start
71 | Behaviour:
72 |
73 |
74 | True
75 | True
76 | 2
77 | 0
78 |
79 |
80 |
81 |
82 | True
83 | True
84 | center
85 |
86 | - Always control active window
87 | - Only control active window when maximized
88 | - Control top-most maximized window
89 |
90 |
91 |
92 | False
93 | True
94 | 1
95 |
96 |
97 |
98 |
99 | False
100 | True
101 | 5
102 |
103 |
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/window-buttons-applet/window-buttons-theme.vala:
--------------------------------------------------------------------------------
1 | namespace WindowWidgets {
2 | public class WindowButtonsTheme {
3 |
4 | private string _theme_name;
5 | private int _icon_size;
6 | private int _scale_factor;
7 | private Gdk.Pixbuf[,,] _pixbufs;
8 | private string[] _extensions;
9 | private string[] _prefixes;
10 | private string[,] _type_names;
11 | private string[,] _state_names;
12 | private string[,] _action_names;
13 |
14 | public WindowButtonsTheme(string name, Gdk.RGBA fg_color, int icon_size, int scale_factor){
15 | _pixbufs = new Gdk.Pixbuf[
16 | IconType.TYPES,
17 | IconState.STATES,
18 | IconAction.ACTIONS
19 | ];
20 |
21 | _theme_name = name;
22 |
23 | _icon_size = icon_size;
24 | _scale_factor = scale_factor;
25 |
26 | _extensions = {"svg", "png"};
27 |
28 | _prefixes = {null, "button", "icon"};
29 |
30 | _type_names = {
31 | {"close", null},
32 | {"minimize", null},
33 | {"maximize", null},
34 | {"unmaximize", "restore"}
35 | };
36 |
37 | _state_names = {
38 | {"focused", ""},
39 | {"unfocused", null}
40 | };
41 |
42 | _action_names = {
43 | {"normal", ""},
44 | {"prelight", null},
45 | {"pressed", null}
46 | };
47 |
48 | string[] paths = get_search_paths();
49 |
50 | load_icons(paths);
51 |
52 | if( _pixbufs[IconType.CLOSE, IconState.FOCUSED, IconAction.NORMAL] == null
53 | || _pixbufs[IconType.MINIMIZE, IconState.FOCUSED, IconAction.NORMAL] == null
54 | || _pixbufs[IconType.MAXIMIZE, IconState.FOCUSED, IconAction.NORMAL] == null ) {
55 | load_fallback_icons(fg_color);
56 | }
57 | }
58 |
59 | private string[] get_search_paths(){
60 | string[] paths = {
61 | Environment.get_home_dir() + "/.icons/mate-window-applets/" + _theme_name,
62 | Environment.get_home_dir() + "/.themes/" + _theme_name + "/metacity-1",
63 | Environment.get_home_dir() + "/.themes/" + _theme_name + "/unity",
64 | "/usr/local/share/themes/" + _theme_name + "/metacity-1",
65 | "/usr/local/share/themes/" + _theme_name + "/unity",
66 | "/usr/share/themes/" + _theme_name + "/metacity-1",
67 | "/usr/share/themes/" + _theme_name + "/unity"
68 | };
69 | string[] result = {};
70 | foreach(string path in paths){
71 | if( FileUtils.test(path, FileTest.IS_DIR) )
72 | result += path;
73 | }
74 | return result;
75 | }
76 |
77 | private void load_icons(string[] paths){
78 |
79 | for(int type = 0; type < IconType.TYPES; type++){
80 | for(int state = 0; state < IconState.STATES; state++){
81 | for(int action = 0; action < IconAction.ACTIONS; action++){
82 |
83 | var icon_names = get_icon_aliases(type, state, action);
84 | Gdk.Pixbuf icon = find_icon(paths, icon_names);
85 |
86 | if( icon != null ){
87 | _pixbufs[type, state, action] = icon;
88 | }
89 |
90 | }
91 | }
92 | }
93 | }
94 |
95 | private List get_icon_aliases(int type, int state, int action){
96 | var aliases = new List ();
97 | for(int i = 0; i < _type_names.length[1]; i++){
98 | if(_type_names[type,i] == null)
99 | break;
100 |
101 | for(int j = 0; j < _state_names.length[1]; j++){
102 | if(_state_names[state,j] == null)
103 | break;
104 |
105 | for(int k = 0; k < _action_names.length[1]; k++){
106 | if(_action_names[action,k] == null)
107 | break;
108 |
109 | string[] parts = {_type_names[type,i]};
110 |
111 | if(_state_names[state,j] != "")
112 | parts += _state_names[state,j];
113 |
114 | if(_action_names[action,k] != "")
115 | parts += _action_names[action,k];
116 |
117 | aliases.append( string.joinv("_", parts) );
118 |
119 | }
120 | }
121 | }
122 | return aliases;
123 | }
124 |
125 | private Gdk.Pixbuf? find_icon(string[] paths, List icon_names){
126 | string file_path = find_icon_filepath(paths, icon_names);
127 | if( file_path != null ){
128 | try {
129 | return new Gdk.Pixbuf.from_file_at_size(file_path, this._icon_size * this._scale_factor, this._icon_size * this._scale_factor);
130 | } catch (GLib.Error e){
131 | stdout.printf("Error: %s\n", e.message);
132 | }
133 | }
134 | return null;
135 | }
136 |
137 | private string? find_icon_filepath(string[] paths, List icon_names){
138 | foreach(string prefix in _prefixes){
139 | foreach(string ext in _extensions){
140 | foreach(string path in paths){
141 | string result = find_icon_filepath_with(path, ext, prefix, icon_names);
142 | if(result != null)
143 | return result;
144 | }
145 | }
146 | }
147 | return null;
148 | }
149 |
150 | private string? find_icon_filepath_with(string path, string extension, string? prefix, List icon_names){
151 | foreach(string icon_name in icon_names){
152 | if(prefix != null)
153 | icon_name = prefix + "_" + icon_name;
154 |
155 | string file_path = path + "/" + icon_name + "." + extension;
156 | if( FileUtils.test(file_path, FileTest.EXISTS) )
157 | return file_path;
158 | }
159 | return null;
160 | }
161 |
162 | public Gdk.Pixbuf? get_icon(IconType type, IconState state, IconAction action){
163 | return _pixbufs[type, state, action];
164 | }
165 |
166 | private void load_fallback_icons(Gdk.RGBA fg_color){
167 | double lum = 0.299*fg_color.red + 0.587*fg_color.green + 0.114*fg_color.blue;
168 | string theme;
169 | if(lum > 0.5)
170 | theme = "White";
171 | else
172 | theme = "Black";
173 |
174 | #if LOCAL_PATH
175 | string[] paths = {"/usr/local/share/pixmaps/mate-window-applets/" + theme};
176 | #else
177 | string[] paths = {"/usr/share/pixmaps/mate-window-applets/" + theme};
178 | #endif
179 |
180 | load_icons(paths);
181 | }
182 |
183 | }
184 |
185 | public enum IconType {
186 | CLOSE = 0,
187 | MINIMIZE,
188 | MAXIMIZE,
189 | UNMAXIMIZE,
190 |
191 | TYPES
192 | }
193 |
194 | public enum IconState {
195 | FOCUSED = 0,
196 | UNFOCUSED,
197 |
198 | STATES
199 | }
200 |
201 | public enum IconAction {
202 | NORMAL = 0,
203 | HOVERED,
204 | PRESSED,
205 |
206 | ACTIONS
207 | }
208 | }
--------------------------------------------------------------------------------
/window-menu-applet/window-menu-applet.vala:
--------------------------------------------------------------------------------
1 | using WindowWidgets;
2 |
3 | namespace WindowMenuApplet{
4 |
5 | class WindowMenu {
6 | public WindowWidgets.WindowMenuButton button;
7 | public Gdk.Monitor monitor;
8 | private Wnck.Window *window;
9 | private Wnck.Window *active_window;
10 | private Gdk.Monitor active_window_monitor;
11 |
12 | public GLib.Settings gsettings = new GLib.Settings("org.mate.window-applets.window-menu");
13 |
14 | public WindowMenu(){
15 | button = new WindowMenuButton();
16 | }
17 |
18 | public void reload(){
19 |
20 | // Disconnect signals from old window
21 | if(window != null){
22 | window->icon_changed.disconnect(button.icon_set);
23 | window->actions_changed.disconnect(button.menu_set);
24 | window->state_changed.disconnect(reload);
25 | }
26 |
27 | if(active_window != null){
28 | active_window->state_changed.disconnect(reload);
29 | active_window->geometry_changed.disconnect(detect_monitor_change);
30 | }
31 |
32 |
33 | window = get_current_window();
34 |
35 | button.window = window;
36 |
37 | button.icon_set();
38 | button.menu_set();
39 |
40 | // Watch for changes to new controlled window
41 | if(window != null){
42 | window->icon_changed.connect(button.icon_set);
43 | window->actions_changed.connect(button.menu_set);
44 | window->state_changed.connect(reload);
45 | }
46 |
47 | active_window = Wnck.Screen.get_default().get_active_window();
48 | if(active_window != null){
49 | // When active window is not the controlled window (because it is unmaximized),
50 | // we need to watch its state as well
51 | if(active_window != window)
52 | active_window->state_changed.connect(reload);
53 |
54 | active_window->geometry_changed.connect(detect_monitor_change);
55 | }
56 | }
57 |
58 | public void change_orient(MatePanel.Applet applet){
59 | MatePanel.AppletOrient orient = applet.get_orient();
60 | switch(orient){
61 | case MatePanel.AppletOrient.UP:
62 | button.set_direction(Gtk.ArrowType.DOWN);
63 | break;
64 | case MatePanel.AppletOrient.DOWN:
65 | button.set_direction(Gtk.ArrowType.UP);
66 | break;
67 | case MatePanel.AppletOrient.LEFT:
68 | button.set_direction(Gtk.ArrowType.RIGHT);
69 | break;
70 | case MatePanel.AppletOrient.RIGHT:
71 | button.set_direction(Gtk.ArrowType.LEFT);
72 | break;
73 | default:
74 | break;
75 | }
76 |
77 | }
78 |
79 | public void change_behaviour(){
80 | string behaviour = gsettings.get_string("behaviour");
81 |
82 | Wnck.Screen.get_default().window_closed.disconnect( reload );
83 |
84 | if(behaviour == "topmost-maximized")
85 | Wnck.Screen.get_default().window_closed.connect( reload );
86 | }
87 |
88 | private Wnck.Window? get_current_window(){
89 | Wnck.WindowType window_type;
90 | string behaviour = gsettings.get_string("behaviour");
91 | Wnck.Workspace active_workspace = Wnck.Screen.get_default().get_active_workspace();
92 |
93 | List windows = Wnck.Screen.get_default().get_windows_stacked().copy();
94 | windows.reverse();
95 |
96 | foreach(Wnck.Window* win in windows) {
97 | window_type = win->get_window_type();
98 | if(window_type == Wnck.WindowType.DESKTOP || window_type == Wnck.WindowType.DOCK)
99 | continue;
100 |
101 | if(win->is_minimized())
102 | continue;
103 |
104 | if(!win->is_in_viewport(active_workspace))
105 | continue;
106 |
107 | if(monitor != get_monitor_at_window(win))
108 | continue;
109 |
110 | switch(behaviour){
111 | case "active-always":
112 | return win;
113 |
114 | case "active-maximized":
115 | if(win->is_maximized())
116 | return win;
117 | else
118 | return null;
119 |
120 | case "topmost-maximized":
121 | if(win->is_maximized())
122 | return win;
123 | break;
124 | }
125 | }
126 |
127 | return null;
128 | }
129 |
130 | private Gdk.Monitor? get_monitor_at_window(Wnck.Window *win){
131 | int x, y, w, h;
132 |
133 | win->get_client_window_geometry(out x, out y, out w, out h);
134 |
135 | return Gdk.Display.get_default().get_monitor_at_point(x + w/2, y + h/2);
136 | }
137 |
138 | private void detect_monitor_change(){
139 | Gdk.Monitor mon = get_monitor_at_window(active_window);
140 | if(mon != active_window_monitor){
141 | active_window_monitor = mon;
142 | reload();
143 | }
144 | }
145 | }
146 |
147 | private bool factory(MatePanel.Applet applet,string iid){
148 | if(iid != "WindowMenuApplet")return false;
149 |
150 | var windowMenu = new WindowMenu();
151 |
152 | Gtk.Builder builder = new Gtk.Builder();
153 |
154 | #if LOCAL_PATH
155 | var dialog_path = "/usr/local/lib/mate-applets/mate-window-applets/window-menu/dialog.ui";
156 | #else
157 | var dialog_path = "/usr/lib/mate-applets/mate-window-applets/window-menu/dialog.ui";
158 | #endif
159 |
160 | try{
161 | builder.add_from_file(dialog_path);
162 | } catch (GLib.Error e){
163 | stdout.printf("Error: %s\n", e.message);
164 | }
165 |
166 | Gtk.Window settings = builder.get_object("Settings") as Gtk.Window;
167 | Gtk.Window about = builder.get_object("About") as Gtk.Window;
168 |
169 | Gtk.ActionGroup action_group = new Gtk.ActionGroup("action_group");
170 |
171 | Gtk.Action settings_action = new Gtk.Action("settings","Settings",null,Gtk.Stock.PREFERENCES);
172 | Gtk.Action about_action = new Gtk.Action("about","About",null,Gtk.Stock.ABOUT);
173 |
174 | action_group.add_action(settings_action);
175 | action_group.add_action(about_action);
176 |
177 | string menu = """""";
178 | menu += """""";
179 |
180 | windowMenu.gsettings.bind("behaviour",builder.get_object("behaviour"),"active_id",SettingsBindFlags.DEFAULT);
181 | windowMenu.gsettings.changed["behaviour"].connect( () => { windowMenu.change_behaviour(); windowMenu.reload(); } );
182 |
183 | applet.add(windowMenu.button);
184 | applet.setup_menu(menu,action_group);
185 |
186 | settings.delete_event.connect( (event) => { settings.hide() ; return true ; } );
187 | about.delete_event.connect( (event) => { about.hide() ; return true ; } );
188 |
189 | settings_action.activate.connect( () => { settings.present() ; } );
190 | about_action.activate.connect( () => { about.present() ; } );
191 |
192 | applet.change_orient.connect( () => { windowMenu.change_orient(applet); windowMenu.reload(); } );
193 |
194 | applet.show_all();
195 |
196 | Wnck.Screen.get_default().active_window_changed.connect( windowMenu.reload );
197 |
198 | windowMenu.monitor = applet.get_parent_window().get_screen().get_display().get_monitor_at_window(applet.get_parent_window());
199 |
200 | windowMenu.change_orient(applet);
201 | windowMenu.change_behaviour();
202 | windowMenu.reload();
203 |
204 | return true;
205 | }
206 |
207 | }
208 |
209 |
210 | static int main(string[] args){
211 | Gtk.init(ref args);
212 |
213 | MatePanel.Applet.factory_main("WindowMenuAppletFactory", true, typeof (MatePanel.Applet), WindowMenuApplet.factory);
214 |
215 | return 0;
216 | }
217 |
--------------------------------------------------------------------------------
/window-title-applet/window-title-applet.vala:
--------------------------------------------------------------------------------
1 | namespace WindowTitleApplet{
2 |
3 | class WindowTitle {
4 | public Gtk.Label title;
5 | public Gdk.Monitor monitor;
6 | private Wnck.Window *window;
7 | private Wnck.Window *active_window;
8 | private Gdk.Monitor active_window_monitor;
9 |
10 | public GLib.Settings gsettings = new GLib.Settings("org.mate.window-applets.window-title");
11 |
12 | public WindowTitle(){
13 | title = new Gtk.Label("");
14 | title.ellipsize = Pango.EllipsizeMode.END;
15 |
16 | change_behaviour();
17 | }
18 |
19 | public void reload(){
20 |
21 | // Disconnect signals from old window
22 | if(window != null){
23 | window->name_changed.disconnect(update);
24 | window->state_changed.disconnect(reload);
25 | }
26 |
27 | if(active_window != null){
28 | active_window->state_changed.disconnect(reload);
29 | active_window->geometry_changed.disconnect(detect_monitor_change);
30 | }
31 |
32 |
33 | window = get_current_window();
34 |
35 | update();
36 |
37 |
38 | // Watch for changes to new controlled window
39 | if(window != null){
40 | window->name_changed.connect(update);
41 | window->state_changed.connect(reload);
42 | }
43 |
44 | active_window = Wnck.Screen.get_default().get_active_window();
45 | if(active_window != null){
46 | // When active window is not the controlled window (because it is unmaximized),
47 | // we need to watch its state as well
48 | if(active_window != window)
49 | active_window->state_changed.connect(reload);
50 |
51 | active_window->geometry_changed.connect(detect_monitor_change);
52 | }
53 | }
54 |
55 | public void update(){
56 | if(window != null){
57 | string title_text = GLib.Markup.escape_text(window->get_name());
58 | if(window->is_active())
59 | title.set_markup(title_text);
60 | else
61 | title.set_markup(""+title_text+"");
62 | } else {
63 | title.set_label("");
64 | }
65 | }
66 |
67 | public void change_behaviour(){
68 | string behaviour = gsettings.get_string("behaviour");
69 |
70 | Wnck.Screen.get_default().window_closed.disconnect( reload );
71 |
72 | if(behaviour == "topmost-maximized")
73 | Wnck.Screen.get_default().window_closed.connect( reload );
74 | }
75 |
76 | private Wnck.Window? get_current_window(){
77 | Wnck.WindowType window_type;
78 | string behaviour = gsettings.get_string("behaviour");
79 | Wnck.Workspace active_workspace = Wnck.Screen.get_default().get_active_workspace();
80 |
81 | List windows = Wnck.Screen.get_default().get_windows_stacked().copy();
82 | windows.reverse();
83 |
84 | foreach(Wnck.Window* win in windows) {
85 | window_type = win->get_window_type();
86 | if(window_type == Wnck.WindowType.DESKTOP || window_type == Wnck.WindowType.DOCK)
87 | continue;
88 |
89 | if(win->is_minimized())
90 | continue;
91 |
92 | if(!win->is_in_viewport(active_workspace))
93 | continue;
94 |
95 | if(monitor != get_monitor_at_window(win))
96 | continue;
97 |
98 | switch(behaviour){
99 | case "active-always":
100 | return win;
101 |
102 | case "active-maximized":
103 | if(win->is_maximized())
104 | return win;
105 | else
106 | return null;
107 |
108 | case "topmost-maximized":
109 | if(win->is_maximized())
110 | return win;
111 | break;
112 | }
113 | }
114 |
115 | return null;
116 | }
117 |
118 | public void clicked(Gdk.EventButton *event){
119 | if(window != null){
120 | Wnck.Screen.get_default().force_update();
121 | window->activate(Gtk.get_current_event_time());
122 | if(event->type == Gdk.EventType.2BUTTON_PRESS) {
123 | if(window->is_maximized())
124 | window->unmaximize();
125 | else
126 | window->maximize();
127 | }
128 | }
129 | }
130 |
131 | private Gdk.Monitor? get_monitor_at_window(Wnck.Window *win){
132 | int x, y, w, h;
133 |
134 | win->get_client_window_geometry(out x, out y, out w, out h);
135 |
136 | return Gdk.Display.get_default().get_monitor_at_point(x + w/2, y + h/2);
137 | }
138 |
139 | private void detect_monitor_change(){
140 | Gdk.Monitor mon = get_monitor_at_window(active_window);
141 | if(mon != active_window_monitor){
142 | active_window_monitor = mon;
143 | reload();
144 | }
145 | }
146 |
147 | }
148 |
149 | private bool factory(MatePanel.Applet applet,string iid){
150 | if(iid != "WindowTitleApplet")return false;
151 |
152 | var windowTitle = new WindowTitle();
153 |
154 | Gtk.Builder builder = new Gtk.Builder();
155 |
156 | #if LOCAL_PATH
157 | var dialog_path = "/usr/local/lib/mate-applets/mate-window-applets/window-title/dialog.ui";
158 | #else
159 | var dialog_path = "/usr/lib/mate-applets/mate-window-applets/window-title/dialog.ui";
160 | #endif
161 |
162 | try{
163 | builder.add_from_file(dialog_path);
164 | } catch (GLib.Error e){
165 | stdout.printf("Error: %s\n", e.message);
166 | }
167 |
168 | Gtk.Window settings = builder.get_object("Settings") as Gtk.Window;
169 | Gtk.Window about = builder.get_object("About") as Gtk.Window;
170 |
171 | Gtk.ActionGroup action_group = new Gtk.ActionGroup("action_group");
172 |
173 | Gtk.Action settings_action = new Gtk.Action("settings","Settings",null,Gtk.Stock.PREFERENCES);
174 | Gtk.Action about_action = new Gtk.Action("about","About",null,Gtk.Stock.ABOUT);
175 |
176 | action_group.add_action(settings_action);
177 | action_group.add_action(about_action);
178 |
179 | string menu = """""";
180 | menu += """""";
181 |
182 | windowTitle.gsettings.bind("behaviour",builder.get_object("behaviour"),"active_id",SettingsBindFlags.DEFAULT);
183 | windowTitle.gsettings.changed["behaviour"].connect( () => { windowTitle.change_behaviour(); windowTitle.reload(); } );
184 |
185 | applet.set_flags(MatePanel.AppletFlags.EXPAND_MINOR | MatePanel.AppletFlags.EXPAND_MAJOR);
186 |
187 | applet.add(windowTitle.title);
188 | applet.setup_menu(menu,action_group);
189 |
190 | settings.delete_event.connect( (event) => { settings.hide() ; return true ; } );
191 | about.delete_event.connect( (event) => { about.hide() ; return true ; } );
192 |
193 | settings_action.activate.connect( () => { settings.present() ; } );
194 | about_action.activate.connect( () => { about.present() ; } );
195 |
196 | applet.button_press_event.connect( (widget,event) => { windowTitle.clicked(event); return false; } );
197 |
198 | //applet.change_size.connect();
199 |
200 | //--//applet.add(widget_container);
201 | applet.show_all();
202 |
203 | Wnck.Screen.get_default().active_window_changed.connect( windowTitle.reload );
204 |
205 | windowTitle.monitor = applet.get_parent_window().get_screen().get_display().get_monitor_at_window(applet.get_parent_window());
206 |
207 | windowTitle.reload();
208 |
209 | return true;
210 | }
211 |
212 | }
213 |
214 |
215 | static int main(string[] args){
216 | Gtk.init(ref args);
217 |
218 | MatePanel.Applet.factory_main("WindowTitleAppletFactory", true, typeof (MatePanel.Applet), WindowTitleApplet.factory);
219 |
220 | return 0;
221 | }
222 |
--------------------------------------------------------------------------------
/window-buttons-applet/window-buttons-applet.vala:
--------------------------------------------------------------------------------
1 | using WindowWidgets;
2 |
3 | namespace WindowButtonsApplet{
4 |
5 | public class ButtonsApplet : Gtk.Box{
6 |
7 | // Struct to contain witch buttons are enabled.
8 |
9 | public struct EnabledButtons {
10 | bool close ;
11 | bool minimize ;
12 | bool maximize ;
13 | }
14 |
15 | public Gdk.Monitor monitor;
16 | private Wnck.Window* window = null;
17 | private Wnck.Window *active_window = null;
18 | private Gdk.Monitor active_window_monitor;
19 |
20 | public GLib.Settings gsettings = new GLib.Settings("org.mate.window-applets.window-buttons");
21 | public GLib.Settings marco_gsettings = new GLib.Settings("org.mate.Marco.general");
22 |
23 | protected WindowButton CLOSE = new WindowButton(WindowButtonType.CLOSE);
24 | protected WindowButton MINIMIZE = new WindowButton(WindowButtonType.MINIMIZE);
25 | protected WindowButton MAXIMIZE = new WindowButton(WindowButtonType.MAXIMIZE);
26 |
27 | protected EnabledButtons enabled_buttons = EnabledButtons();
28 | protected int icon_size;
29 |
30 | private Gtk.StyleContext* applet_style_context;
31 |
32 | // Constructor
33 |
34 | public ButtonsApplet(Gtk.Orientation orient, MatePanel.Applet applet){
35 | Object(orientation: orient);
36 |
37 | this.set_homogeneous(true);
38 |
39 | this.applet_style_context = applet.get_style_context();
40 | this.set_size(applet.get_size());
41 |
42 | this.change_layout();
43 | this.change_theme();
44 | this.change_spacing();
45 | this.change_behaviour();
46 |
47 | this.marco_gsettings.changed["theme"].connect(this.change_theme);
48 | this.marco_gsettings.changed["button_layout"].connect(this.change_layout);
49 | this.gsettings.changed["spacing"].connect(this.change_spacing);
50 | this.gsettings.changed["padding"].connect( (key) => { this.change_size(applet.get_size()); } );
51 |
52 | Wnck.Screen.get_default().active_window_changed.connect(this.reload);
53 |
54 | }
55 |
56 | // Helpers
57 |
58 | private void reload_actions(){
59 | if( window == null ){
60 | CLOSE.set_visible(false);
61 | MINIMIZE.set_visible(false);
62 | MAXIMIZE.set_visible(false);
63 | } else {
64 | Wnck.WindowActions actions = window->get_actions();
65 | if(enabled_buttons.close == true){
66 | if((Wnck.WindowActions.CLOSE & actions)>0){
67 | CLOSE.set_visible(true);
68 | CLOSE.window = window;
69 | CLOSE.update();
70 | } else CLOSE.set_visible(false);
71 | }
72 |
73 | if(enabled_buttons.minimize == true){
74 | if((Wnck.WindowActions.MINIMIZE & actions)>0){
75 | MINIMIZE.set_visible(true);
76 | MINIMIZE.window = window;
77 | MINIMIZE.update();
78 | } else MINIMIZE.set_visible(false);
79 | }
80 |
81 | if(enabled_buttons.maximize == true){
82 | if((Wnck.WindowActions.MAXIMIZE & actions)>0){
83 | MAXIMIZE.set_visible(true);
84 | MAXIMIZE.window = window;
85 | MAXIMIZE.update();
86 | } else MAXIMIZE.set_visible(false);
87 | }
88 | }
89 | }
90 |
91 | public void reload(){
92 |
93 | // Disconnect signals from old window
94 | if(window != null){
95 | window->actions_changed.disconnect(reload);
96 | window->state_changed.disconnect(reload);
97 | }
98 |
99 | if(active_window != null){
100 | active_window->state_changed.disconnect(reload);
101 | active_window->geometry_changed.disconnect(detect_monitor_change);
102 | }
103 |
104 | window = get_current_window();
105 |
106 | reload_actions();
107 |
108 | // Watch for changes to new controlled window
109 | if(window != null){
110 | window->actions_changed.connect(reload);
111 | window->state_changed.connect(reload);
112 | }
113 |
114 | active_window = Wnck.Screen.get_default().get_active_window();
115 | if(active_window != null){
116 | // When active window is not the controlled window (because it is unmaximized),
117 | // we need to watch its state as well
118 | if(active_window != window)
119 | active_window->state_changed.connect(reload);
120 |
121 | active_window->geometry_changed.connect(detect_monitor_change);
122 | }
123 | }
124 |
125 | public void change_layout(){
126 | bool use_marco_layout = gsettings.get_boolean("use-marco-layout");
127 |
128 | string[] button_layout = new string[10];
129 | if(use_marco_layout){
130 | string marco_layout = marco_gsettings.get_string("button-layout");
131 | marco_layout = marco_layout.replace(":","");
132 | marco_layout = marco_layout.replace("menu","");
133 | button_layout = marco_layout.split(",");
134 | }
135 | else{
136 | button_layout = gsettings.get_string("buttons-layout").split(",");
137 | }
138 |
139 | enabled_buttons.close = false;
140 | enabled_buttons.minimize = false;
141 | enabled_buttons.maximize = false;
142 |
143 | this.remove(CLOSE);
144 | this.remove(MINIMIZE);
145 | this.remove(MAXIMIZE);
146 |
147 | foreach(string button in button_layout){
148 | if(button == "close"){
149 | this.add(CLOSE);
150 | enabled_buttons.close = true;
151 | }
152 | else if(button == "minimize"){
153 | this.add(MINIMIZE);
154 | enabled_buttons.minimize = true;
155 | }
156 | else if(button == "maximize"){
157 | this.add(MAXIMIZE);
158 | enabled_buttons.maximize = true;
159 | }
160 | }
161 |
162 | reload_actions();
163 | }
164 |
165 | public void change_theme(){
166 | string theme_name = marco_gsettings.get_string("theme");
167 |
168 | Gdk.RGBA fg_color = applet_style_context->get_color(Gtk.StateFlags.ACTIVE);
169 |
170 | WindowButtonsTheme theme = new WindowButtonsTheme(theme_name, fg_color, this.icon_size, this.get_scale_factor());
171 |
172 | CLOSE.theme = theme;
173 | CLOSE.icon_size = this.icon_size;
174 | if(enabled_buttons.close)
175 | CLOSE.update(true);
176 |
177 | MINIMIZE.theme = theme;
178 | MINIMIZE.icon_size = this.icon_size;
179 | if(enabled_buttons.minimize)
180 | MINIMIZE.update(true);
181 |
182 | MAXIMIZE.theme = theme;
183 | MAXIMIZE.icon_size = this.icon_size;
184 | if(enabled_buttons.maximize)
185 | MAXIMIZE.update(true);
186 |
187 | }
188 |
189 | public void set_size(int size){
190 | int padding = gsettings.get_int("padding");
191 | this.icon_size = size - padding;
192 | }
193 |
194 | public void change_size(int size){
195 | this.set_size(size);
196 | this.change_theme();
197 | }
198 |
199 | public void change_orient(int orient){
200 | if(orient == MatePanel.AppletOrient.UP || orient == MatePanel.AppletOrient.DOWN){
201 | this.orientation = Gtk.Orientation.HORIZONTAL;
202 | }
203 | else{
204 | this.orientation = Gtk.Orientation.VERTICAL;
205 | }
206 | }
207 |
208 |
209 | public void change_spacing(){
210 | int spacing = gsettings.get_int("spacing");
211 |
212 | this.set_spacing(spacing);
213 | }
214 |
215 | public void change_behaviour(){
216 | string behaviour = gsettings.get_string("behaviour");
217 |
218 | Wnck.Screen.get_default().window_closed.disconnect( reload );
219 |
220 | if(behaviour == "topmost-maximized")
221 | Wnck.Screen.get_default().window_closed.connect( reload );
222 | }
223 |
224 | private Wnck.Window? get_current_window(){
225 | Wnck.WindowType window_type;
226 | string behaviour = gsettings.get_string("behaviour");
227 | Wnck.Workspace active_workspace = Wnck.Screen.get_default().get_active_workspace();
228 |
229 | List windows = Wnck.Screen.get_default().get_windows_stacked().copy();
230 | windows.reverse();
231 |
232 | foreach(Wnck.Window* win in windows) {
233 | window_type = win->get_window_type();
234 | if(window_type == Wnck.WindowType.DESKTOP || window_type == Wnck.WindowType.DOCK)
235 | continue;
236 |
237 | if(win->is_minimized())
238 | continue;
239 |
240 | if(!win->is_in_viewport(active_workspace))
241 | continue;
242 |
243 | if(monitor != get_monitor_at_window(win))
244 | continue;
245 |
246 | switch(behaviour){
247 | case "active-always":
248 | return win;
249 |
250 | case "active-maximized":
251 | if(win->is_maximized())
252 | return win;
253 | else
254 | return null;
255 |
256 | case "topmost-maximized":
257 | if(win->is_maximized())
258 | return win;
259 | break;
260 | }
261 | }
262 |
263 | return null;
264 | }
265 |
266 | private Gdk.Monitor? get_monitor_at_window(Wnck.Window *win){
267 | int x, y, w, h;
268 |
269 | win->get_client_window_geometry(out x, out y, out w, out h);
270 |
271 | return Gdk.Display.get_default().get_monitor_at_point(x + w/2, y + h/2);
272 | }
273 |
274 | private void detect_monitor_change(){
275 | Gdk.Monitor mon = get_monitor_at_window(active_window);
276 | if(mon != active_window_monitor){
277 | active_window_monitor = mon;
278 | reload();
279 | }
280 | }
281 | }
282 |
283 | private bool factory(MatePanel.Applet applet,string iid){
284 | if(iid != "WindowButtonsApplet")return false;
285 |
286 | Gtk.Builder builder = new Gtk.Builder();
287 |
288 | #if LOCAL_PATH
289 | var dialog_path = "/usr/local/lib/mate-applets/mate-window-applets/window-buttons/dialog.ui";
290 | #else
291 | var dialog_path = "/usr/lib/mate-applets/mate-window-applets/window-buttons/dialog.ui";
292 | #endif
293 |
294 | try{
295 | builder.add_from_file(dialog_path);
296 | } catch (GLib.Error e){
297 | stdout.printf("Error: %s\n", e.message);
298 | }
299 |
300 | Gtk.Window settings = builder.get_object("Settings") as Gtk.Window;
301 | Gtk.Window about = builder.get_object("About") as Gtk.Window;
302 |
303 | var widget_container = new ButtonsApplet(Gtk.Orientation.HORIZONTAL, applet);
304 |
305 | widget_container.monitor = applet.get_parent_window().get_screen().get_display().get_monitor_at_window(applet.get_parent_window());
306 |
307 | widget_container.show();
308 | widget_container.change_orient(applet.get_orient());
309 |
310 | Gtk.ActionGroup action_group = new Gtk.ActionGroup("action_group");
311 |
312 | Gtk.Action settings_action = new Gtk.Action("settings","Settings",null,Gtk.Stock.PREFERENCES);
313 | Gtk.Action about_action = new Gtk.Action("about","About",null,Gtk.Stock.ABOUT);
314 |
315 | action_group.add_action(settings_action);
316 | action_group.add_action(about_action);
317 |
318 | string menu = """""";
319 | menu += """""";
320 |
321 | widget_container.gsettings.bind("use-marco-layout",builder.get_object("use-marco-layout"),"state",SettingsBindFlags.DEFAULT);
322 | widget_container.gsettings.bind("buttons-layout",builder.get_object("layout"),"text",SettingsBindFlags.DEFAULT);
323 | widget_container.gsettings.bind("spacing",builder.get_object("spacing"),"value",SettingsBindFlags.DEFAULT);
324 | widget_container.gsettings.bind("padding",builder.get_object("padding"),"value",SettingsBindFlags.DEFAULT);
325 | widget_container.gsettings.bind("behaviour",builder.get_object("behaviour"),"active_id",SettingsBindFlags.DEFAULT);
326 |
327 | widget_container.gsettings.changed["use-marco-layout"].connect(widget_container.change_layout);
328 | widget_container.gsettings.changed["buttons-layout"].connect(widget_container.change_layout);
329 | widget_container.gsettings.changed["behaviour"].connect( () => { widget_container.change_behaviour(); widget_container.reload(); } );
330 | applet.setup_menu(menu,action_group);
331 |
332 | settings.delete_event.connect( (event) => { settings.hide() ; return true ; } );
333 | about.delete_event.connect( (event) => { about.hide() ; return true ; } );
334 |
335 | settings_action.activate.connect( () => { settings.present() ; } );
336 | about_action.activate.connect( () => { about.present() ; } );
337 |
338 | applet.change_size.connect(widget_container.change_size);
339 | applet.change_orient.connect(widget_container.change_orient);
340 |
341 | applet.set_flags(MatePanel.AppletFlags.EXPAND_MINOR);
342 | applet.add(widget_container);
343 | applet.show();
344 |
345 | return true;
346 | }
347 |
348 | }
349 |
350 |
351 | static int main(string[] args){
352 | Gtk.init(ref args);
353 |
354 | MatePanel.Applet.factory_main("WindowButtonsAppletFactory", true, typeof (MatePanel.Applet), WindowButtonsApplet.factory);
355 |
356 | return 0;
357 | }
358 |
--------------------------------------------------------------------------------
/window-buttons-applet/dialog.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | False
7 | GDK_STRUCTURE_MASK | GDK_SCROLL_MASK
8 | center
9 | dialog
10 | Mate Window Applets - Window Buttons
11 | @VERSION@
12 | Copyright © 2017 Ivalin Radulov
13 | https://github.com/ubuntu-mate/mate-window-applets
14 |
15 | gpl-3-0
16 |
17 |
24 |
25 |
26 |
27 | False
28 |
29 |
30 | False
31 |
32 |
33 | False
34 | False
35 | 0
36 |
37 |
38 |
39 |
40 |
41 |
42 | 100
43 | 1
44 | 10
45 |
46 |
47 | 100
48 | 1
49 | 10
50 |
51 |
52 | False
53 | GDK_STRUCTURE_MASK | GDK_SCROLL_MASK
54 | center
55 | static
56 |
57 |
64 |
65 |
66 |
67 | True
68 | False
69 | vertical
70 | 4
71 | True
72 |
73 |
74 | True
75 | False
76 |
77 |
78 | True
79 | False
80 | start
81 | Use marco layout :
82 |
83 |
84 | True
85 | True
86 | 2
87 | 0
88 |
89 |
90 |
91 |
92 | True
93 | True
94 | center
95 |
96 |
97 | False
98 | True
99 | 2
100 | 1
101 |
102 |
103 |
104 |
105 | False
106 | True
107 | 0
108 |
109 |
110 |
111 |
112 | True
113 | False
114 |
115 |
116 | True
117 | False
118 | start
119 | Layout :
120 |
121 |
122 | True
123 | True
124 | 2
125 | 0
126 |
127 |
128 |
129 |
130 | True
131 | True
132 | end
133 | center
134 | 40
135 | none
136 | GTK_INPUT_HINT_NO_SPELLCHECK | GTK_INPUT_HINT_LOWERCASE | GTK_INPUT_HINT_NONE
137 |
138 |
139 | True
140 | True
141 | 2
142 | 1
143 |
144 |
145 |
146 |
147 | False
148 | True
149 | 1
150 |
151 |
152 |
153 |
154 | True
155 | False
156 |
157 |
158 | True
159 | False
160 | start
161 | Spacing :
162 |
163 |
164 | True
165 | True
166 | 2
167 | 0
168 |
169 |
170 |
171 |
172 | True
173 | True
174 | end
175 | center
176 | False
177 | 8
178 | False
179 | adjustment1
180 | True
181 | True
182 |
183 |
184 | False
185 | True
186 | 2
187 | 1
188 |
189 |
190 |
191 |
192 | False
193 | True
194 | 2
195 | 3
196 |
197 |
198 |
199 |
200 | True
201 | False
202 |
203 |
204 | True
205 | False
206 | start
207 | Padding :
208 |
209 |
210 | True
211 | True
212 | 2
213 | 0
214 |
215 |
216 |
217 |
218 | True
219 | True
220 | end
221 | center
222 | False
223 | 0
224 | False
225 | adjustment2
226 | True
227 | True
228 |
229 |
230 | False
231 | True
232 | 2
233 | 1
234 |
235 |
236 |
237 |
238 | False
239 | True
240 | 2
241 | 4
242 |
243 |
244 |
245 |
246 | True
247 | False
248 |
249 |
250 | True
251 | False
252 | start
253 | Behaviour:
254 |
255 |
256 | True
257 | True
258 | 2
259 | 0
260 |
261 |
262 |
263 |
264 | True
265 | True
266 | center
267 |
268 | - Always control active window
269 | - Only control active window when maximized
270 | - Control top-most maximized window
271 |
272 |
273 |
274 | False
275 | True
276 | 1
277 |
278 |
279 |
280 |
281 | False
282 | True
283 | 5
284 |
285 |
286 |
287 |
288 |
289 |
290 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 | {one line to give the program's name and a brief idea of what it does.}
635 | Copyright (C) {year} {name of author}
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | {project} Copyright (C) {year} {fullname}
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------