Always use private keyword (#1543)

Co-authored-by: Danielle Foré <danielle@elementary.io>
This commit is contained in:
Leo 2023-02-19 02:32:32 +09:00 committed by GitHub
parent 23a60c1c36
commit e212898742
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
42 changed files with 367 additions and 367 deletions

View File

@ -35,7 +35,7 @@ namespace Gala {
}
public class Daemon {
SessionClient? sclient = null;
private SessionClient? sclient = null;
public Daemon () {
register.begin ((o, res)=> {
@ -109,7 +109,7 @@ namespace Gala {
return session_client;
}
async bool register () {
private async bool register () {
sclient = yield register_with_session ("org.pantheon.gala.daemon");
sclient.query_end_session.connect (() => end_session (false));
@ -119,7 +119,7 @@ namespace Gala {
return true;
}
void end_session (bool quit) {
private void end_session (bool quit) {
if (quit) {
Gtk.main_quit ();
return;

View File

@ -16,11 +16,11 @@
//
namespace Gala {
const string DBUS_NAME = "org.pantheon.gala";
const string DBUS_OBJECT_PATH = "/org/pantheon/gala";
private const string DBUS_NAME = "org.pantheon.gala";
private const string DBUS_OBJECT_PATH = "/org/pantheon/gala";
const string DAEMON_DBUS_NAME = "org.pantheon.gala.daemon";
const string DAEMON_DBUS_OBJECT_PATH = "/org/pantheon/gala/daemon";
private const string DAEMON_DBUS_NAME = "org.pantheon.gala.daemon";
private const string DAEMON_DBUS_OBJECT_PATH = "/org/pantheon/gala/daemon";
[DBus (name = "org.pantheon.gala")]
public interface WMDBus : GLib.Object {
@ -39,25 +39,25 @@ namespace Gala {
private Granite.AccelLabel on_visible_workspace_accellabel;
private Granite.AccelLabel resize_accellabel;
private Granite.AccelLabel screenshot_accellabel;
Gtk.Menu? window_menu = null;
Gtk.MenuItem hide;
Gtk.MenuItem maximize;
Gtk.MenuItem move;
Gtk.MenuItem resize;
Gtk.CheckMenuItem always_on_top;
Gtk.CheckMenuItem on_visible_workspace;
Gtk.MenuItem move_left;
Gtk.MenuItem move_right;
Gtk.MenuItem close;
Gtk.MenuItem screenshot;
private Gtk.Menu? window_menu = null;
private Gtk.MenuItem hide;
private Gtk.MenuItem maximize;
private Gtk.MenuItem move;
private Gtk.MenuItem resize;
private Gtk.CheckMenuItem always_on_top;
private Gtk.CheckMenuItem on_visible_workspace;
private Gtk.MenuItem move_left;
private Gtk.MenuItem move_right;
private Gtk.MenuItem close;
private Gtk.MenuItem screenshot;
// Desktop Menu
Gtk.Menu? desktop_menu = null;
private Gtk.Menu? desktop_menu = null;
WMDBus? wm_proxy = null;
private WMDBus? wm_proxy = null;
ulong always_on_top_sid = 0U;
ulong on_visible_workspace_sid = 0U;
private ulong always_on_top_sid = 0U;
private ulong on_visible_workspace_sid = 0U;
private static GLib.Settings keybind_settings;
private static GLib.Settings gala_keybind_settings;
@ -75,7 +75,7 @@ namespace Gala {
Bus.watch_name (BusType.SESSION, DBUS_NAME, BusNameWatcherFlags.NONE, gala_appeared, lost_gala);
}
void on_gala_get (GLib.Object? o, GLib.AsyncResult? res) {
private void on_gala_get (GLib.Object? o, GLib.AsyncResult? res) {
try {
wm_proxy = Bus.get_proxy.end (res);
} catch (Error e) {
@ -83,17 +83,17 @@ namespace Gala {
}
}
void lost_gala () {
private void lost_gala () {
wm_proxy = null;
}
void gala_appeared () {
private void gala_appeared () {
if (wm_proxy == null) {
Bus.get_proxy.begin<WMDBus> (BusType.SESSION, DBUS_NAME, DBUS_OBJECT_PATH, 0, null, on_gala_get);
}
}
void on_bus_acquired (DBusConnection conn) {
private void on_bus_acquired (DBusConnection conn) {
try {
conn.register_object (DAEMON_DBUS_OBJECT_PATH, this);
} catch (Error e) {
@ -101,7 +101,7 @@ namespace Gala {
}
}
void perform_action (Gala.ActionType type) {
private void perform_action (Gala.ActionType type) {
if (wm_proxy != null) {
try {
wm_proxy.perform_action (type);

View File

@ -25,8 +25,8 @@ namespace Gala {
}
public class DragDropAction : Clutter.Action {
static Gee.HashMap<string,Gee.LinkedList<Actor>>? sources = null;
static Gee.HashMap<string,Gee.LinkedList<Actor>>? destinations = null;
private static Gee.HashMap<string,Gee.LinkedList<Actor>>? sources = null;
private static Gee.HashMap<string,Gee.LinkedList<Actor>>? destinations = null;
/**
* A drag has been started. You have to connect to this signal and
@ -99,15 +99,15 @@ namespace Gala {
public Actor? hovered { private get; set; default = null; }
bool clicked = false;
float last_x;
float last_y;
private bool clicked = false;
private float last_x;
private float last_y;
#if HAS_MUTTER42
Grab? grab = null;
static unowned Actor? grabbed_actor = null;
InputDevice? grabbed_device = null;
ulong on_event_id = 0;
private Grab? grab = null;
private static unowned Actor? grabbed_actor = null;
private InputDevice? grabbed_device = null;
private ulong on_event_id = 0;
#endif
/**
@ -146,7 +146,7 @@ namespace Gala {
base.set_actor (new_actor);
}
void release_actor (Actor actor) {
private void release_actor (Actor actor) {
if (DragDropActionType.SOURCE in drag_type) {
#if !HAS_MUTTER42
actor.button_press_event.disconnect (source_clicked);
@ -162,7 +162,7 @@ namespace Gala {
}
}
void connect_actor (Actor actor) {
private void connect_actor (Actor actor) {
if (DragDropActionType.SOURCE in drag_type) {
#if !HAS_MUTTER42
actor.button_press_event.connect (source_clicked);
@ -188,7 +188,7 @@ namespace Gala {
}
}
void emit_crossed (Actor destination, bool is_hovered) {
private void emit_crossed (Actor destination, bool is_hovered) {
get_drag_drop_action (destination).crossed (actor, is_hovered);
destination_crossed (destination, is_hovered);
}
@ -254,7 +254,7 @@ namespace Gala {
return base.handle_event (event);
}
void grab_actor (Actor actor, InputDevice device) {
private void grab_actor (Actor actor, InputDevice device) {
if (grabbed_actor != null) {
critical ("Tried to grab an actor with a grab already in progress");
}
@ -265,7 +265,7 @@ namespace Gala {
on_event_id = actor.event.connect (on_event);
}
void ungrab_actor () {
private void ungrab_actor () {
if (on_event_id == 0 || grabbed_actor == null) {
return;
}
@ -281,7 +281,7 @@ namespace Gala {
grabbed_actor = null;
}
bool on_event (Clutter.Event event) {
private bool on_event (Clutter.Event event) {
var device = event.get_device ();
if (grabbed_device != null &&
@ -381,7 +381,7 @@ namespace Gala {
return false;
}
#else
bool source_clicked (ButtonEvent event) {
private bool source_clicked (ButtonEvent event) {
if (event.button != 1) {
actor_clicked (event.button);
return false;
@ -395,7 +395,7 @@ namespace Gala {
return true;
}
bool follow_move (Event event) {
private bool follow_move (Event event) {
// still determining if we actually want to start a drag action
if (!dragging) {
switch (event.get_type ()) {
@ -521,7 +521,7 @@ namespace Gala {
*
* @return the DragDropAction instance on this actor or NULL
*/
DragDropAction? get_drag_drop_action (Actor actor) {
private DragDropAction? get_drag_drop_action (Actor actor) {
DragDropAction? drop_action = null;
foreach (var action in actor.get_actions ()) {
@ -565,7 +565,7 @@ namespace Gala {
}
}
void finish () {
private void finish () {
// make sure they reset the style or whatever they changed when hovered
emit_crossed (hovered, false);
@ -574,7 +574,7 @@ namespace Gala {
drag_end (hovered);
}
void cleanup () {
private void cleanup () {
var source_list = sources.@get (drag_id);
if (source_list != null) {
foreach (var actor in source_list) {

View File

@ -343,8 +343,8 @@ namespace Gala.Drawing {
context.set_operator (Operator.OVER);
}
const int ALPHA_PRECISION = 16;
const int PARAM_PRECISION = 7;
private const int ALPHA_PRECISION = 16;
private const int PARAM_PRECISION = 7;
/**
* Performs a blur operation on the internal {@link Cairo.Surface}, using an
@ -401,7 +401,7 @@ namespace Gala.Drawing {
context.set_operator (Operator.OVER);
}
void exponential_blur_columns (
private void exponential_blur_columns (
uint8* pixels,
int width,
int height,
@ -432,7 +432,7 @@ namespace Gala.Drawing {
}
}
void exponential_blur_rows (
private void exponential_blur_rows (
uint8* pixels,
int width,
int height,
@ -614,7 +614,7 @@ namespace Gala.Drawing {
context.set_operator (Operator.OVER);
}
void gaussian_blur_horizontal (
private void gaussian_blur_horizontal (
double* src,
double* dest,
double* kernel,
@ -643,7 +643,7 @@ namespace Gala.Drawing {
}
}
void gaussian_blur_vertical (
private void gaussian_blur_vertical (
double* src,
double* dest,
double* kernel,
@ -673,7 +673,7 @@ namespace Gala.Drawing {
}
}
static double[] build_gaussian_kernel (int gauss_width) requires (gauss_width % 2 == 1) {
private static double[] build_gaussian_kernel (int gauss_width) requires (gauss_width % 2 == 1) {
var kernel = new double[gauss_width];
// Maximum value of curve

View File

@ -373,7 +373,7 @@ namespace Gala.Drawing {
return this;
}
void rgb_to_hsv (
private void rgb_to_hsv (
double r, double g, double b, out double h, out double s, out double v
) requires (r >= 0 && r <= 1) requires (g >= 0 && g <= 1) requires (b >= 0 && b <= 1) {
var min = double.min (r, double.min (g, b));
@ -417,7 +417,7 @@ namespace Gala.Drawing {
}
}
void hsv_to_rgb (
private void hsv_to_rgb (
double h, double s, double v, out double r, out double g, out double b
) requires (h >= 0 && h <= 360) requires (s >= 0 && s <= 1) requires (v >= 0 && v <= 1) {
r = 0;

View File

@ -23,14 +23,14 @@ namespace Gala {
public int scale;
}
static Gdk.Pixbuf? resize_pixbuf = null;
static Gdk.Pixbuf? close_pixbuf = null;
private static Gdk.Pixbuf? resize_pixbuf = null;
private static Gdk.Pixbuf? close_pixbuf = null;
static Gee.HashMultiMap<DesktopAppInfo, CachedIcon?> icon_cache;
static Gee.HashMap<Meta.Window, DesktopAppInfo> window_to_desktop_cache;
static Gee.ArrayList<CachedIcon?> unknown_icon_cache;
private static Gee.HashMultiMap<DesktopAppInfo, CachedIcon?> icon_cache;
private static Gee.HashMap<Meta.Window, DesktopAppInfo> window_to_desktop_cache;
private static Gee.ArrayList<CachedIcon?> unknown_icon_cache;
static AppCache app_cache;
private static AppCache app_cache;
static construct {
icon_cache = new Gee.HashMultiMap<DesktopAppInfo, CachedIcon?> ();
@ -441,7 +441,7 @@ namespace Gala {
return texture;
}
static Gtk.CssProvider gala_css = null;
private static Gtk.CssProvider gala_css = null;
public static unowned Gtk.CssProvider? get_gala_css () {
if (gala_css == null) {
gala_css = new Gtk.CssProvider ();

View File

@ -46,7 +46,7 @@ namespace Gala {
}
}
bool _destroy_on_unmanaged = false;
private bool _destroy_on_unmanaged = false;
/**
* Creates a new WindowIcon
@ -70,7 +70,7 @@ namespace Gala {
update_texture (true);
}
void update_texture (bool initial) {
private void update_texture (bool initial) {
var pixbuf = Gala.Utils.get_icon_for_window (window, icon_size, scale);
try {
var image = new Clutter.Image ();

View File

@ -22,7 +22,7 @@ public class Gala.Plugins.PIP.Plugin : Gala.Plugin {
private Gala.WindowManager? wm = null;
private SelectionArea? selection_area;
static inline bool meta_rectangle_contains (Meta.Rectangle rect, int x, int y) {
private static inline bool meta_rectangle_contains (Meta.Rectangle rect, int x, int y) {
return x >= rect.x && x < rect.x + rect.width
&& y >= rect.y && y < rect.y + rect.height;
}
@ -50,7 +50,7 @@ public class Gala.Plugins.PIP.Plugin : Gala.Plugin {
}
[CCode (instance_pos = -1)]
void on_initiate (Meta.Display display, Meta.Window? window, Clutter.KeyEvent event,
private void on_initiate (Meta.Display display, Meta.Window? window, Clutter.KeyEvent event,
Meta.KeyBinding binding) {
selection_area = new SelectionArea (wm);
selection_area.selected.connect (on_selection_actor_selected);

View File

@ -40,24 +40,24 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
private Clutter.Grab? grab = null;
#endif
static unowned Meta.Window? previous_focus = null;
private static unowned Meta.Window? previous_focus = null;
// From https://opensourcehacker.com/2011/12/01/calculate-aspect-ratio-conserving-resize-for-images-in-javascript/
static void calculate_aspect_ratio_size_fit (float src_width, float src_height, float max_width, float max_height,
private static void calculate_aspect_ratio_size_fit (float src_width, float src_height, float max_width, float max_height,
out float width, out float height) {
float ratio = float.min (max_width / src_width, max_height / src_height);
width = src_width * ratio;
height = src_height * ratio;
}
static bool get_window_is_normal (Meta.Window window) {
private static bool get_window_is_normal (Meta.Window window) {
var window_type = window.get_window_type ();
return window_type == Meta.WindowType.NORMAL
|| window_type == Meta.WindowType.DIALOG
|| window_type == Meta.WindowType.MODAL_DIALOG;
}
static void get_current_cursor_position (out int x, out int y) {
private static void get_current_cursor_position (out int x, out int y) {
Gdk.Display.get_default ().get_default_seat ().get_pointer ().get_position (null, out x, out y);
}

View File

@ -22,10 +22,10 @@
namespace Gala.Plugins.Template {
public class Main : Gala.Plugin {
const int PADDING = 50;
private const int PADDING = 50;
Gala.WindowManager? wm = null;
Clutter.Actor red_box;
private Gala.WindowManager? wm = null;
private Clutter.Actor red_box;
// This function is called as soon as Gala has started and gives you
// an instance of the GalaWindowManager class.
@ -69,7 +69,7 @@ namespace Gala.Plugins.Template {
wm.ui_group.add_child (red_box);
}
bool turn_green (Clutter.ButtonEvent event) {
private bool turn_green (Clutter.ButtonEvent event) {
red_box.background_color = { 0, 255, 0, 255 };
return true;
}

View File

@ -23,7 +23,7 @@ namespace Gala {
public double transition_duration { get; private set; default = 0.0; }
public bool loaded { get; private set; default = false; }
Gnome.BGSlideShow? show = null;
private Gnome.BGSlideShow? show = null;
public Animation (string filename) {
Object (filename: filename);

View File

@ -17,8 +17,8 @@
namespace Gala {
public class Background : Object {
const double ANIMATION_OPACITY_STEP_INCREMENT = 4.0;
const double ANIMATION_MIN_WAKEUP_INTERVAL = 1.0;
private const double ANIMATION_OPACITY_STEP_INCREMENT = 4.0;
private const double ANIMATION_MIN_WAKEUP_INTERVAL = 1.0;
public signal void changed ();
public signal void loaded ();
@ -31,10 +31,10 @@ namespace Gala {
public string? filename { get; construct; }
public Meta.Background background { get; private set; }
Animation? animation = null;
Gee.HashMap<string,ulong> file_watches;
Cancellable cancellable;
uint update_animation_timeout_id = 0;
private Animation? animation = null;
private Gee.HashMap<string,ulong> file_watches;
private Cancellable cancellable;
private uint update_animation_timeout_id = 0;
private Gnome.WallClock clock;
private ulong clock_timezone_handler = 0;
@ -91,7 +91,7 @@ namespace Gala {
}
}
void set_loaded () {
private void set_loaded () {
if (is_loaded)
return;
@ -103,7 +103,7 @@ namespace Gala {
});
}
void load_pattern () {
private void load_pattern () {
string color_string;
var settings = background_source.settings;
@ -121,7 +121,7 @@ namespace Gala {
}
}
void watch_file (string filename) {
private void watch_file (string filename) {
if (file_watches.has_key (filename))
return;
@ -138,14 +138,14 @@ namespace Gala {
});
}
void remove_animation_timeout () {
private void remove_animation_timeout () {
if (update_animation_timeout_id != 0) {
Source.remove (update_animation_timeout_id);
update_animation_timeout_id = 0;
}
}
void finish_animation (string[] files) {
private void finish_animation (string[] files) {
set_loaded ();
if (files.length > 1)
@ -158,7 +158,7 @@ namespace Gala {
queue_update_animation ();
}
void update_animation () {
private void update_animation () {
update_animation_timeout_id = 0;
animation.update (display.get_monitor_geometry (monitor_index));
@ -188,7 +188,7 @@ namespace Gala {
}
}
void queue_update_animation () {
private void queue_update_animation () {
if (update_animation_timeout_id != 0)
return;
@ -213,7 +213,7 @@ namespace Gala {
});
}
async void load_animation (string filename) {
private async void load_animation (string filename) {
animation = yield BackgroundCache.get_default ().get_animation (filename);
if (animation == null || cancellable.is_cancelled ()) {
@ -225,7 +225,7 @@ namespace Gala {
watch_file (filename);
}
void load_image (string filename) {
private void load_image (string filename) {
background.set_file (File.new_for_path (filename), style);
watch_file (filename);
@ -242,14 +242,14 @@ namespace Gala {
}
}
void load_file (string filename) {
private void load_file (string filename) {
if (filename.has_suffix (".xml"))
load_animation.begin (filename);
else
load_image (filename);
}
void load () {
private void load () {
load_pattern ();
if (filename == null)
@ -258,7 +258,7 @@ namespace Gala {
load_file (filename);
}
void settings_changed () {
private void settings_changed () {
changed ();
}
}

View File

@ -17,7 +17,7 @@
namespace Gala {
public class BackgroundCache : Object {
static BackgroundCache? instance = null;
private static BackgroundCache? instance = null;
public static unowned BackgroundCache get_default () {
if (instance == null)
@ -28,10 +28,10 @@ namespace Gala {
public signal void file_changed (string filename);
Gee.HashMap<string,FileMonitor> file_monitors;
Gee.HashMap<string,BackgroundSource> background_sources;
private Gee.HashMap<string,FileMonitor> file_monitors;
private Gee.HashMap<string,BackgroundSource> background_sources;
Animation animation;
private Animation animation;
public BackgroundCache () {
Object ();

View File

@ -43,7 +43,7 @@ namespace Gala {
Meta.MonitorManager.@get ().monitors_changed.disconnect (update);
}
void update () {
private void update () {
var reference_child = (get_child_at_index (0) as BackgroundManager);
if (reference_child != null)
reference_child.changed.disconnect (background_changed);
@ -60,7 +60,7 @@ namespace Gala {
}
}
void background_changed () {
private void background_changed () {
changed ();
}
}

View File

@ -17,11 +17,11 @@
namespace Gala {
public class BackgroundManager : Meta.BackgroundGroup {
const string GNOME_BACKGROUND_SCHEMA = "org.gnome.desktop.background";
const string GALA_BACKGROUND_SCHEMA = "io.elementary.desktop.background";
const string DIM_WALLPAPER_KEY = "dim-wallpaper-in-dark-style";
const double DIM_OPACITY = 0.85;
const int FADE_ANIMATION_TIME = 1000;
private const string GNOME_BACKGROUND_SCHEMA = "org.gnome.desktop.background";
private const string GALA_BACKGROUND_SCHEMA = "io.elementary.desktop.background";
private const string DIM_WALLPAPER_KEY = "dim-wallpaper-in-dark-style";
private const double DIM_OPACITY = 0.85;
private const int FADE_ANIMATION_TIME = 1000;
public signal void changed ();
@ -29,9 +29,9 @@ namespace Gala {
public int monitor_index { get; construct; }
public bool control_position { get; construct; }
BackgroundSource background_source;
Meta.BackgroundActor background_actor;
Meta.BackgroundActor? new_background_actor = null;
private BackgroundSource background_source;
private Meta.BackgroundActor background_actor;
private Meta.BackgroundActor? new_background_actor = null;
private Clutter.PropertyTransition? last_dim_transition = null;
@ -52,7 +52,7 @@ namespace Gala {
destroy.connect (on_destroy);
}
void on_destroy () {
private void on_destroy () {
BackgroundCache.get_default ().release_background_source (GNOME_BACKGROUND_SCHEMA);
background_source = null;
@ -67,7 +67,7 @@ namespace Gala {
}
}
void swap_background_actor (bool animate) {
private void swap_background_actor (bool animate) {
return_if_fail (new_background_actor != null);
var old_background_actor = background_actor;
@ -97,7 +97,7 @@ namespace Gala {
}
}
void update_background_actor (bool animate = true) {
private void update_background_actor (bool animate = true) {
if (new_background_actor != null) {
// Skip displaying existing background queued for load
new_background_actor.destroy ();
@ -144,7 +144,7 @@ namespace Gala {
}
}
Meta.BackgroundActor create_background_actor () {
private Meta.BackgroundActor create_background_actor () {
var background = background_source.get_background (monitor_index);
var background_actor = new Meta.BackgroundActor (display, monitor_index);

View File

@ -18,7 +18,7 @@
namespace Gala {
public class BackgroundSource : Object {
// list of keys that are actually relevant for us
const string[] OPTIONS = {
private const string[] OPTIONS = {
"color-shading-type",
"picture-opacity",
"picture-options",
@ -34,8 +34,8 @@ namespace Gala {
internal int use_count { get; set; default = 0; }
Gee.HashMap<int,Background> backgrounds;
uint[] hash_cache;
private Gee.HashMap<int,Background> backgrounds;
private uint[] hash_cache;
public BackgroundSource (Meta.Display display, string settings_schema) {
Object (display: display, settings: new Settings (settings_schema));
@ -68,7 +68,7 @@ namespace Gala {
});
}
void monitors_changed () {
private void monitors_changed () {
var n = display.get_n_monitors ();
var i = 0;
@ -113,7 +113,7 @@ namespace Gala {
return backgrounds[monitor_index];
}
void background_changed (Background background) {
private void background_changed (Background background) {
background.changed.disconnect (background_changed);
background.destroy ();
backgrounds.unset (background.monitor_index);

View File

@ -17,7 +17,7 @@
namespace Gala {
public class SystemBackground : GLib.Object {
const Clutter.Color DEFAULT_BACKGROUND_COLOR = { 0x2e, 0x34, 0x36, 0xff };
private const Clutter.Color DEFAULT_BACKGROUND_COLOR = { 0x2e, 0x34, 0x36, 0xff };
static Meta.Background? system_background = null;
public Meta.BackgroundActor background_actor { get; construct; }

View File

@ -18,8 +18,8 @@
namespace Gala {
[DBus (name="org.pantheon.gala")]
public class DBus {
static DBus? instance;
static WindowManager wm;
private static DBus? instance;
private static WindowManager wm;
[DBus (visible = false)]
public static void init (WindowManager _wm) {
@ -91,10 +91,10 @@ namespace Gala {
wm.perform_action (type);
}
const double SATURATION_WEIGHT = 1.5;
const double WEIGHT_THRESHOLD = 1.0;
private const double SATURATION_WEIGHT = 1.5;
private const double WEIGHT_THRESHOLD = 1.0;
class DummyOffscreenEffect : Clutter.OffscreenEffect {
private class DummyOffscreenEffect : Clutter.OffscreenEffect {
public signal void done_painting ();
#if HAS_MUTTER40

View File

@ -57,7 +57,7 @@ namespace Gala {
[DBus (name="org.gnome.Shell")]
public class DBusAccelerator {
static DBusAccelerator? instance;
private static DBusAccelerator? instance;
[DBus (visible = false)]
public static unowned DBusAccelerator init (WindowManager wm) {
@ -69,10 +69,10 @@ namespace Gala {
public signal void accelerator_activated (uint action, GLib.HashTable<string, Variant> parameters);
WindowManager wm;
GLib.HashTable<unowned string, GrabbedAccelerator> grabbed_accelerators;
private WindowManager wm;
private GLib.HashTable<unowned string, GrabbedAccelerator> grabbed_accelerators;
DBusAccelerator (WindowManager _wm) {
private DBusAccelerator (WindowManager _wm) {
wm = _wm;
grabbed_accelerators = new HashTable<unowned string, GrabbedAccelerator> (str_hash, str_equal);
wm.get_display ().accelerator_activated.connect (on_accelerator_activated);

View File

@ -35,9 +35,9 @@ namespace Gala {
public string accept_label { get; set; }
public string deny_label { get; set; }
const string PANTHEON_PORTAL_NAME = "org.freedesktop.impl.portal.desktop.pantheon";
const string FDO_PORTAL_PATH = "/org/freedesktop/portal/desktop";
const string GALA_DIALOG_PATH = "/io/elementary/gala/dialog";
private const string PANTHEON_PORTAL_NAME = "org.freedesktop.impl.portal.desktop.pantheon";
private const string FDO_PORTAL_PATH = "/org/freedesktop/portal/desktop";
private const string GALA_DIALOG_PATH = "/io/elementary/gala/dialog";
protected static AccessPortal? portal = null;
protected ObjectPath? path = null;

View File

@ -375,7 +375,7 @@ namespace Gala {
/**
* Returns the workspaces geometry following the only_on_primary settings.
*/
public static Meta.Rectangle get_workspaces_geometry (Meta.Display display) {
public static Meta.Rectangle get_workspaces_geometry (Meta.Display display) {
if (InternalUtils.workspaces_only_on_primary ()) {
var primary = display.get_primary_monitor ();
return display.get_monitor_geometry (primary);

View File

@ -17,8 +17,8 @@
namespace Gala {
public class KeyboardManager : Object {
static KeyboardManager? instance;
static VariantType sources_variant_type;
private static KeyboardManager? instance;
private static VariantType sources_variant_type;
public static void init (Meta.Display display) {
if (instance != null)
@ -33,9 +33,9 @@ namespace Gala {
sources_variant_type = new VariantType ("a(ss)");
}
GLib.Settings settings;
private GLib.Settings settings;
KeyboardManager () {
private KeyboardManager () {
Object ();
}
@ -51,7 +51,7 @@ namespace Gala {
}
[CCode (instance_pos = -1)]
bool handle_modifiers_accelerator_activated (Meta.Display display) {
private bool handle_modifiers_accelerator_activated (Meta.Display display) {
display.ungrab_keyboard (display.get_current_time ());
var sources = settings.get_value ("sources");
@ -69,7 +69,7 @@ namespace Gala {
}
[CCode (instance_pos = -1)]
void set_keyboard_layout (GLib.Settings settings, string key) {
private void set_keyboard_layout (GLib.Settings settings, string key) {
if (!(key == "current" || key == "sources" || key == "xkb-options"))
return;

View File

@ -16,12 +16,12 @@
//
namespace Gala {
const OptionEntry[] OPTIONS = {
private const OptionEntry[] OPTIONS = {
{ "version", 0, OptionFlags.NO_ARG, OptionArg.CALLBACK, (void*) print_version, "Print version", null },
{ null }
};
void print_version () {
private void print_version () {
stdout.printf ("Gala %s\n", Config.VERSION);
Meta.exit (Meta.ExitCode.SUCCESS);
}

View File

@ -34,8 +34,8 @@ namespace Gala {
}
}
static MediaFeedback? instance = null;
static ThreadPool<Feedback>? pool = null;
private static MediaFeedback? instance = null;
private static ThreadPool<Feedback>? pool = null;
public static void init () {
if (instance == null)
@ -50,10 +50,10 @@ namespace Gala {
}
}
DBusNotifications? notifications = null;
uint32 notification_id = 0;
private DBusNotifications? notifications = null;
private uint32 notification_id = 0;
MediaFeedback () {
private MediaFeedback () {
Object ();
}
@ -88,7 +88,7 @@ namespace Gala {
notifications = null;
}
void send_feedback (owned Feedback feedback) {
private void send_feedback (owned Feedback feedback) {
if (notifications == null) {
return;
}

View File

@ -16,10 +16,10 @@
//
namespace Gala {
delegate PluginInfo RegisterPluginFunction ();
public delegate PluginInfo RegisterPluginFunction ();
public class PluginManager : Object {
static PluginManager? instance = null;
private static PluginManager? instance = null;
public static unowned PluginManager get_default () {
if (instance == null)
instance = new PluginManager ();
@ -41,14 +41,14 @@ namespace Gala {
public string? window_overview_provider { get; private set; default = null; }
public string? workspace_view_provider { get; private set; default = null; }
HashTable<string,Plugin> plugins;
File plugin_dir;
private HashTable<string,Plugin> plugins;
private File plugin_dir;
WindowManager? wm = null;
private WindowManager? wm = null;
Gee.LinkedList<PluginInfo?> load_later_plugins;
private Gee.LinkedList<PluginInfo?> load_later_plugins;
PluginManager () {
private PluginManager () {
plugins = new HashTable<string,Plugin> (str_hash, str_equal);
load_later_plugins = new Gee.LinkedList<PluginInfo?> ();
@ -84,7 +84,7 @@ namespace Gala {
}
}
bool load_module (string plugin_name) {
private bool load_module (string plugin_name) {
var path = Module.build_path (plugin_dir.get_path (), plugin_name);
var module = Module.open (path, ModuleFlags.BIND_LOCAL);
if (module == null) {
@ -122,7 +122,7 @@ namespace Gala {
return true;
}
void load_plugin_class (PluginInfo info) {
private void load_plugin_class (PluginInfo info) {
var plugin = (Plugin)Object.@new (info.plugin_type);
plugins.set (info.module_name, plugin);
@ -134,12 +134,12 @@ namespace Gala {
}
}
void initialize_plugin (string plugin_name, Plugin plugin) {
private void initialize_plugin (string plugin_name, Plugin plugin) {
plugin.initialize (wm);
plugin.region_changed.connect (recalculate_regions);
}
bool check_provides (string name, PluginFunction provides) {
private bool check_provides (string name, PluginFunction provides) {
var message = "Plugins %s and %s both provide %s functionality, using first one only";
switch (provides) {
case PluginFunction.WORKSPACE_VIEW:
@ -200,7 +200,7 @@ namespace Gala {
* Iterate over all plugins and grab their regions, update the regions
* array accordingly and emit the regions_changed signal.
*/
void recalculate_regions () {
private void recalculate_regions () {
X.Xrectangle[] regions = {};
plugins.@foreach ((name, plugin) => {

View File

@ -16,12 +16,12 @@
//
namespace Gala {
const string EXTENSION = ".png";
const int UNCONCEAL_TEXT_TIMEOUT = 2000;
private const string EXTENSION = ".png";
private const int UNCONCEAL_TEXT_TIMEOUT = 2000;
[DBus (name="org.gnome.Shell.Screenshot")]
public class ScreenshotManager : Object {
static ScreenshotManager? instance;
private static ScreenshotManager? instance;
[DBus (visible = false)]
public static unowned ScreenshotManager init (WindowManager wm) {
@ -31,19 +31,19 @@ namespace Gala {
return instance;
}
WindowManager wm;
Settings desktop_settings;
private WindowManager wm;
private Settings desktop_settings;
string prev_font_regular;
string prev_font_document;
string prev_font_mono;
uint conceal_timeout;
private string prev_font_regular;
private string prev_font_document;
private string prev_font_mono;
private uint conceal_timeout;
construct {
desktop_settings = new Settings ("org.gnome.desktop.interface");
}
ScreenshotManager (WindowManager _wm) {
private ScreenshotManager (WindowManager _wm) {
wm = _wm;
}
@ -249,7 +249,7 @@ namespace Gala {
return result;
}
static string find_target_path () {
private static string find_target_path () {
// Try to create dedicated "Screenshots" subfolder in PICTURES xdg-dir
unowned string? base_path = Environment.get_user_special_dir (UserDirectory.PICTURES);
if (base_path != null && FileUtils.test (base_path, FileTest.EXISTS)) {
@ -266,13 +266,13 @@ namespace Gala {
return Environment.get_home_dir ();
}
static async bool save_image (Cairo.ImageSurface image, string filename, out string used_filename) {
private static async bool save_image (Cairo.ImageSurface image, string filename, out string used_filename) {
return (filename != "")
? yield save_image_to_file (image, filename, out used_filename)
: save_image_to_clipboard (image, filename, out used_filename);
}
static async bool save_image_to_file (Cairo.ImageSurface image, string filename, out string used_filename) {
private static async bool save_image_to_file (Cairo.ImageSurface image, string filename, out string used_filename) {
used_filename = filename;
// We only alter non absolute filename because absolute
@ -309,7 +309,7 @@ namespace Gala {
}
}
static bool save_image_to_clipboard (Cairo.ImageSurface image, string filename, out string used_filename) {
private static bool save_image_to_clipboard (Cairo.ImageSurface image, string filename, out string used_filename) {
used_filename = filename;
unowned Gdk.Display display = Gdk.Display.get_default ();
@ -339,7 +339,7 @@ namespace Gala {
context.play_full (0, props, null);
}
Cairo.ImageSurface take_screenshot (int x, int y, int width, int height, bool include_cursor) {
private Cairo.ImageSurface take_screenshot (int x, int y, int width, int height, bool include_cursor) {
Cairo.ImageSurface image;
#if HAS_MUTTER338
int image_width, image_height;
@ -393,7 +393,7 @@ namespace Gala {
return image;
}
Cairo.ImageSurface composite_capture_images (Clutter.Capture[] captures, int x, int y, int width, int height) {
private Cairo.ImageSurface composite_capture_images (Clutter.Capture[] captures, int x, int y, int width, int height) {
var image = new Cairo.ImageSurface (captures[0].image.get_format (), width, height);
var cr = new Cairo.Context (image);
@ -414,7 +414,7 @@ namespace Gala {
return image;
}
Cairo.ImageSurface composite_stage_cursor (Cairo.ImageSurface image, Cairo.RectangleInt image_rect) {
private Cairo.ImageSurface composite_stage_cursor (Cairo.ImageSurface image, Cairo.RectangleInt image_rect) {
unowned Meta.CursorTracker cursor_tracker = wm.get_display ().get_cursor_tracker ();
Graphene.Point coords = {};
#if HAS_MUTTER40
@ -454,7 +454,7 @@ namespace Gala {
return (Cairo.ImageSurface)cr.get_target ();
}
async void wait_stage_repaint () {
private async void wait_stage_repaint () {
ulong signal_id = 0UL;
signal_id = wm.stage.after_paint.connect (() => {
wm.stage.disconnect (signal_id);

View File

@ -32,7 +32,7 @@ namespace Gala {
[DBus (name = "org.gnome.SessionManager.EndSessionDialog")]
public class SessionManager : Object {
static SessionManager? instance;
private static SessionManager? instance;
[DBus (visible = false)]
public static unowned SessionManager init () {
@ -49,14 +49,14 @@ namespace Gala {
public signal void canceled ();
public signal void closed ();
WingpanelEndSessionDialog? proxy = null;
private WingpanelEndSessionDialog? proxy = null;
SessionManager () {
private SessionManager () {
Bus.watch_name (BusType.SESSION, "io.elementary.wingpanel.session.EndSessionDialog",
BusNameWatcherFlags.NONE, proxy_appeared, proxy_vanished);
}
void get_proxy_cb (Object? o, AsyncResult? res) {
private void get_proxy_cb (Object? o, AsyncResult? res) {
try {
proxy = Bus.get_proxy.end (res);
} catch (Error e) {
@ -71,13 +71,13 @@ namespace Gala {
proxy.closed.connect (() => closed ());
}
void proxy_appeared () {
private void proxy_appeared () {
Bus.get_proxy.begin<WingpanelEndSessionDialog> (BusType.SESSION,
"io.elementary.wingpanel.session.EndSessionDialog", "/io/elementary/wingpanel/session/EndSessionDialog",
0, null, get_proxy_cb);
}
void proxy_vanished () {
private void proxy_vanished () {
proxy = null;
}

View File

@ -13,11 +13,11 @@ namespace Gala {
public class IconGroup : Clutter.Actor {
public const int SIZE = 64;
const int PLUS_SIZE = 8;
const int PLUS_WIDTH = 24;
private const int PLUS_SIZE = 8;
private const int PLUS_WIDTH = 24;
const int CLOSE_BUTTON_SIZE = 36;
const int SHOW_CLOSE_BUTTON_DELAY = 200;
private const int CLOSE_BUTTON_SIZE = 36;
private const int SHOW_CLOSE_BUTTON_DELAY = 200;
/**
* The group has been clicked. The MultitaskingView should consider activating
@ -25,7 +25,7 @@ namespace Gala {
*/
public signal void selected ();
uint8 _backdrop_opacity = 0;
private uint8 _backdrop_opacity = 0;
/**
* The opacity of the backdrop/highlight. Set by the active property setter.
*/
@ -39,7 +39,7 @@ namespace Gala {
}
}
bool _active = false;
private bool _active = false;
/**
* Fades in/out the backdrop/highlight
*/
@ -67,13 +67,13 @@ namespace Gala {
}
}
DragDropAction drag_action;
private DragDropAction drag_action;
public Meta.Workspace workspace { get; construct; }
Clutter.Actor? prev_parent = null;
Clutter.Actor close_button;
Clutter.Actor icon_container;
private Clutter.Actor? prev_parent = null;
private Clutter.Actor close_button;
private Clutter.Actor icon_container;
public IconGroup (Meta.Workspace workspace) {
Object (workspace: workspace);
@ -179,7 +179,7 @@ namespace Gala {
close_button.add_transition ("opacity", new_transition);
}
bool resize_canvas () {
private bool resize_canvas () {
var scale = InternalUtils.get_ui_scaling_factor ();
var size = SIZE * scale;
@ -189,7 +189,7 @@ namespace Gala {
return ((Clutter.Canvas) content).set_size (size, size);
}
void place_close_button () {
private void place_close_button () {
var size = CLOSE_BUTTON_SIZE * InternalUtils.get_ui_scaling_factor ();
close_button.set_size (size, size);
@ -308,7 +308,7 @@ namespace Gala {
* That way the workspace won't be deleted if windows decide to ignore the
* delete signal
*/
void close () {
private void close () {
var time = workspace.get_display ().get_current_time ();
foreach (var window in workspace.list_windows ()) {
var type = window.window_type;
@ -322,7 +322,7 @@ namespace Gala {
* Draw the background or plus sign and do layouting. We won't lose performance here
* by relayouting in the same function, as it's only ever called when we invalidate it.
*/
bool draw (Cairo.Context cr) {
private bool draw (Cairo.Context cr) {
var scale = InternalUtils.get_ui_scaling_factor ();
cr.set_operator (Cairo.Operator.CLEAR);
@ -486,7 +486,7 @@ namespace Gala {
return false;
}
Clutter.Actor? drag_begin (float click_x, float click_y) {
private Clutter.Actor? drag_begin (float click_x, float click_y) {
toggle_close_button (false);
unowned Meta.WorkspaceManager manager = workspace.get_display ().get_workspace_manager ();
@ -521,7 +521,7 @@ namespace Gala {
return this;
}
void drag_end (Clutter.Actor destination) {
private void drag_end (Clutter.Actor destination) {
if (destination is WorkspaceInsertThumb) {
get_parent ().remove_child (this);
@ -535,12 +535,12 @@ namespace Gala {
}
}
void drag_canceled () {
private void drag_canceled () {
get_parent ().remove_child (this);
restore_group ();
}
void restore_group () {
private void restore_group () {
var container = prev_parent as IconGroupContainer;
if (container != null) {
container.add_group (this);

View File

@ -98,7 +98,7 @@ namespace Gala {
}
}
void expanded_changed (ParamSpec param) {
private void expanded_changed (ParamSpec param) {
request_reposition (true);
}
@ -143,7 +143,7 @@ namespace Gala {
}
}
void update_inserter_indices () {
private void update_inserter_indices () {
var current_index = 0;
foreach (var child in get_children ()) {

View File

@ -30,8 +30,8 @@ namespace Gala {
public int monitor { get; construct; }
public GestureTracker gesture_tracker { get; construct; }
WindowCloneContainer window_container;
BackgroundManager background;
private WindowCloneContainer window_container;
private BackgroundManager background;
public MonitorClone (Meta.Display display, int monitor, GestureTracker gesture_tracker) {
Object (display: display, monitor: monitor, gesture_tracker: gesture_tracker);
@ -103,14 +103,14 @@ namespace Gala {
background.opacity = 255;
}
void window_left (int window_monitor, Meta.Window window) {
private void window_left (int window_monitor, Meta.Window window) {
if (window_monitor != monitor)
return;
window_container.remove_window (window);
}
void window_entered (int window_monitor, Meta.Window window) {
private void window_entered (int window_monitor, Meta.Window window) {
if (window_monitor != monitor || window.window_type != Meta.WindowType.NORMAL)
return;

View File

@ -28,20 +28,20 @@ namespace Gala {
private GestureTracker multitasking_gesture_tracker;
private GestureTracker workspace_gesture_tracker;
const int SMOOTH_SCROLL_DELAY = 500;
private const int SMOOTH_SCROLL_DELAY = 500;
public WindowManager wm { get; construct; }
Meta.Display display;
ModalProxy modal_proxy;
bool opened = false;
bool animating = false;
private Meta.Display display;
private ModalProxy modal_proxy;
private bool opened = false;
private bool animating = false;
List<MonitorClone> window_containers_monitors;
private List<MonitorClone> window_containers_monitors;
IconGroupContainer icon_groups;
Clutter.Actor workspaces;
Clutter.Actor dock_clones;
private IconGroupContainer icon_groups;
private Clutter.Actor workspaces;
private Clutter.Actor dock_clones;
private GLib.Settings gala_behavior_settings;
@ -135,7 +135,7 @@ namespace Gala {
* Places the primary container for the WorkspaceClones and the
* MonitorClones at the right positions
*/
void update_monitors () {
private void update_monitors () {
foreach (var monitor_clone in window_containers_monitors)
monitor_clone.destroy ();
@ -347,7 +347,7 @@ namespace Gala {
* @param animate Whether to animate the movement or have all elements take their
* positions immediately.
*/
void update_positions (bool animate) {
private void update_positions (bool animate) {
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
var active_index = manager.get_active_workspace ().index ();
var active_x = 0.0f;
@ -378,7 +378,7 @@ namespace Gala {
reposition_icon_groups (animate);
}
void reposition_icon_groups (bool animate) {
private void reposition_icon_groups (bool animate) {
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
var active_index = manager.get_active_workspace ().index ();
@ -401,7 +401,7 @@ namespace Gala {
icon_groups.restore_easing_state ();
}
void add_workspace (int num) {
private void add_workspace (int num) {
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
var workspace = new WorkspaceClone (manager.get_workspace_by_index (num), multitasking_gesture_tracker);
workspace.window_selected.connect (window_selected);
@ -416,7 +416,7 @@ namespace Gala {
workspace.open ();
}
void remove_workspace (int num) {
private void remove_workspace (int num) {
WorkspaceClone? workspace = null;
// FIXME is there a better way to get the removed workspace?
@ -457,7 +457,7 @@ namespace Gala {
* Otherwise it will only be made active, but the view won't be
* closed.
*/
void activate_workspace (WorkspaceClone clone, bool close_view) {
private void activate_workspace (WorkspaceClone clone, bool close_view) {
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
close_view = close_view && manager.get_active_workspace () == clone.workspace;
@ -509,7 +509,7 @@ namespace Gala {
*
* @param direction The direction in which to move the focus to
*/
void select_window (Meta.MotionDirection direction) {
private void select_window (Meta.MotionDirection direction) {
get_active_workspace_clone ().window_container.select_next_window (direction);
}
@ -518,7 +518,7 @@ namespace Gala {
*
* @return The active WorkspaceClone
*/
WorkspaceClone get_active_workspace_clone () {
private WorkspaceClone get_active_workspace_clone () {
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
foreach (var child in workspaces.get_children ()) {
unowned WorkspaceClone workspace_clone = (WorkspaceClone) child;
@ -530,7 +530,7 @@ namespace Gala {
assert_not_reached ();
}
void window_selected (Meta.Window window) {
private void window_selected (Meta.Window window) {
var time = display.get_current_time ();
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
var workspace = window.get_workspace ();
@ -573,7 +573,7 @@ namespace Gala {
* starting the modal mode and hiding the WindowGroup. Finally tells all components
* to animate to their positions.
*/
void toggle (bool with_gesture = false, bool is_cancel_animation = false) {
private void toggle (bool with_gesture = false, bool is_cancel_animation = false) {
if (animating) {
return;
}
@ -683,7 +683,7 @@ namespace Gala {
}
}
void show_docks (bool with_gesture, bool is_cancel_animation) {
private void show_docks (bool with_gesture, bool is_cancel_animation) {
unowned GLib.List<Meta.WindowActor> window_actors = display.get_window_actors ();
foreach (unowned Meta.WindowActor actor in window_actors) {
const int MAX_OFFSET = 85;
@ -748,7 +748,7 @@ namespace Gala {
}
}
void hide_docks (bool with_gesture, bool is_cancel_animation) {
private void hide_docks (bool with_gesture, bool is_cancel_animation) {
foreach (var child in dock_clones.get_children ()) {
var dock = (Clutter.Clone) child;
var initial_y = dock.y;

View File

@ -53,7 +53,7 @@ namespace Gala {
window.unmanaged.disconnect (reset_source);
}
void reset_source () {
private void reset_source () {
// actually destroying the clone will be handled somewhere else (unless we were
// requested to destroy it), we just need to make sure the clone doesn't attempt
// to draw a clone of a window that has been destroyed

View File

@ -30,13 +30,13 @@ namespace Gala {
public GestureTracker? gesture_tracker { get; construct; }
public bool overview_mode { get; construct; }
bool opened;
private bool opened;
/**
* The window that is currently selected via keyboard shortcuts. It is not
* necessarily the same as the active window.
*/
WindowClone? current_window;
private WindowClone? current_window;
public WindowCloneContainer (GestureTracker? gesture_tracker, bool overview_mode = false) {
Object (gesture_tracker: gesture_tracker, overview_mode: overview_mode);
@ -111,11 +111,11 @@ namespace Gala {
}
}
void window_selected_cb (WindowClone tiled) {
private void window_selected_cb (WindowClone tiled) {
window_selected (tiled.window);
}
void window_destroyed (Clutter.Actor actor) {
private void window_destroyed (Clutter.Actor actor) {
var window = actor as WindowClone;
if (window == null)
return;

View File

@ -24,9 +24,9 @@ namespace Gala {
public class WindowIconActor : Clutter.Actor {
public Meta.Window window { get; construct; }
int icon_scale;
private int icon_scale;
int _icon_size;
private int _icon_size;
/**
* The icon size of the WindowIcon. Once set the new icon will be
* faded over the old one and the actor animates to the new size.
@ -51,7 +51,7 @@ namespace Gala {
}
}
bool _temporary;
private bool _temporary;
/**
* Mark the WindowIcon as temporary. Only effect of this is that a pulse
* animation will be played on the actor. Used while DnDing window thumbs
@ -98,10 +98,10 @@ namespace Gala {
}
}
bool initial = true;
private bool initial = true;
WindowIcon? icon = null;
WindowIcon? old_icon = null;
private WindowIcon? icon = null;
private WindowIcon? old_icon = null;
public WindowIconActor (Meta.Window window) {
Object (window: window);
@ -120,7 +120,7 @@ namespace Gala {
window.notify["on-all-workspaces"].disconnect (on_all_workspaces_changed);
}
void on_all_workspaces_changed () {
private void on_all_workspaces_changed () {
// we don't display windows that are on all workspaces
if (window.on_all_workspaces)
destroy ();
@ -151,7 +151,7 @@ namespace Gala {
/**
* Fades out the old icon and fades in the new icon
*/
void fade_new_icon () {
private void fade_new_icon () {
var scale = InternalUtils.get_ui_scaling_factor ();
var new_icon = new WindowIcon (window, icon_size, scale);
new_icon.add_constraint (new Clutter.BindConstraint (this, Clutter.BindCoordinate.SIZE, 0));

View File

@ -25,18 +25,18 @@ namespace Gala {
public delegate void WindowPlacer (Clutter.Actor window, Meta.Rectangle rect);
public class WindowOverview : Clutter.Actor, ActivatableComponent {
const int BORDER = 10;
const int TOP_GAP = 30;
const int BOTTOM_GAP = 100;
private const int BORDER = 10;
private const int TOP_GAP = 30;
private const int BOTTOM_GAP = 100;
public WindowManager wm { get; construct; }
Meta.Display display;
ModalProxy modal_proxy;
bool ready;
private Meta.Display display;
private ModalProxy modal_proxy;
private bool ready;
// the workspaces which we expose right now
List<Meta.Workspace> workspaces;
private List<Meta.Workspace> workspaces;
public WindowOverview (WindowManager wm) {
Object (wm : wm);
@ -193,17 +193,17 @@ namespace Gala {
ready = true;
}
bool keybinding_filter (Meta.KeyBinding binding) {
private bool keybinding_filter (Meta.KeyBinding binding) {
var name = binding.get_name ();
return (name != "expose-windows" && name != "expose-all-windows");
}
void restack_windows (Meta.Display display) {
private void restack_windows (Meta.Display display) {
foreach (var child in get_children ())
((WindowCloneContainer) child).restack_windows (display);
}
void window_left_monitor (int num, Meta.Window window) {
private void window_left_monitor (int num, Meta.Window window) {
unowned WindowCloneContainer container = get_child_at_index (num) as WindowCloneContainer;
if (container == null)
return;
@ -216,7 +216,7 @@ namespace Gala {
}
}
void add_window (Meta.Window window) {
private void add_window (Meta.Window window) {
if (!visible
|| (window.window_type != Meta.WindowType.NORMAL && window.window_type != Meta.WindowType.DIALOG))
return;
@ -233,7 +233,7 @@ namespace Gala {
}
}
void remove_window (Meta.Window window) {
private void remove_window (Meta.Window window) {
unowned WindowCloneContainer container = get_child_at_index (window.get_monitor ()) as WindowCloneContainer;
if (container == null)
return;
@ -241,7 +241,7 @@ namespace Gala {
container.remove_window (window);
}
void thumb_selected (Meta.Window window) {
private void thumb_selected (Meta.Window window) {
if (window.get_workspace () == display.get_workspace_manager ().get_active_workspace ()) {
window.activate (display.get_current_time ());
close ();
@ -283,7 +283,7 @@ namespace Gala {
});
}
void cleanup () {
private void cleanup () {
ready = true;
visible = false;

View File

@ -13,30 +13,30 @@ namespace Gala {
public const int WRAPPER_PADDING = 12;
public const string CAPTION_FONT_NAME = "Inter";
const int MIN_OFFSET = 64;
const int FIX_TIMEOUT_INTERVAL = 100;
private const int MIN_OFFSET = 64;
private const int FIX_TIMEOUT_INTERVAL = 100;
public bool opened { get; private set; default = false; }
public Gala.WindowManager? wm { get; construct; }
Gala.ModalProxy modal_proxy = null;
private Gala.ModalProxy modal_proxy = null;
private Granite.Settings granite_settings;
private Clutter.Canvas canvas;
Clutter.Actor container;
Clutter.Actor indicator;
Clutter.Text caption;
private Clutter.Actor container;
private Clutter.Actor indicator;
private Clutter.Text caption;
int modifier_mask;
private int modifier_mask;
WindowIcon? cur_icon = null;
private WindowIcon? cur_icon = null;
private int scaling_factor = 1;
// For some reason, on Odin, the height of the caption loses
// its padding after the first time the switcher displays. As a
// workaround, I store the initial value here once we have it.
float caption_height = -1.0f;
private float caption_height = -1.0f;
public WindowSwitcher (Gala.WindowManager wm) {
Object (wm: wm);
@ -212,7 +212,7 @@ namespace Gala {
next_window (display, workspace, backward);
}
bool collect_windows (Meta.Display display, Meta.Workspace? workspace) {
private bool collect_windows (Meta.Display display, Meta.Workspace? workspace) {
var windows = display.get_tab_list (Meta.TabList.NORMAL, workspace);
if (windows == null) {
@ -237,7 +237,7 @@ namespace Gala {
return true;
}
void open_switcher () {
private void open_switcher () {
var display = wm.get_display ();
if (container.get_n_children () == 0) {
@ -310,7 +310,7 @@ namespace Gala {
}
}
void toggle_display (bool show) {
private void toggle_display (bool show) {
if (opened == show) {
return;
}
@ -330,7 +330,7 @@ namespace Gala {
container.reactive = show;
}
void push_modal () {
private void push_modal () {
modal_proxy = wm.push_modal (this);
modal_proxy.set_keybinding_filter ((binding) => {
// if it's not built-in, we can block it right away
@ -349,7 +349,7 @@ namespace Gala {
#endif
}
void close_switcher (uint32 time, bool cancel = false) {
private void close_switcher (uint32 time, bool cancel = false) {
if (!opened) {
return;
}
@ -371,7 +371,7 @@ namespace Gala {
toggle_display (false);
}
void next_window (Meta.Display display, Meta.Workspace? workspace, bool backward) {
private void next_window (Meta.Display display, Meta.Workspace? workspace, bool backward) {
Clutter.Actor actor;
var current = cur_icon;
@ -396,7 +396,7 @@ namespace Gala {
update_indicator_position ();
}
void update_caption_text () {
private void update_caption_text () {
var current_window = cur_icon.window;
var current_caption = "n/a";
if (current_window != null) {
@ -413,7 +413,7 @@ namespace Gala {
);
}
void update_indicator_position (bool initial = false) {
private void update_indicator_position (bool initial = false) {
// FIXME there are some troubles with layouting, in some cases we
// are here too early, in which case all the children are at
// (0|0), so we can easily check for that and come back later
@ -444,7 +444,7 @@ namespace Gala {
close_switcher (wm.get_display ().get_current_time ());
}
bool container_motion_event (Clutter.MotionEvent event) {
private bool container_motion_event (Clutter.MotionEvent event) {
var actor = event.stage.get_actor_at_pos (Clutter.PickMode.ALL, (int)event.x, (int)event.y);
if (actor == null) {
return true;
@ -463,7 +463,7 @@ namespace Gala {
return true;
}
bool container_mouse_press (Clutter.ButtonEvent event) {
private bool container_mouse_press (Clutter.ButtonEvent event) {
if (opened && event.button == Gdk.BUTTON_PRIMARY) {
close_switcher (event.time);
}
@ -486,7 +486,7 @@ namespace Gala {
return false;
}
Gdk.ModifierType get_current_modifiers () {
private Gdk.ModifierType get_current_modifiers () {
Gdk.ModifierType modifiers;
double[] axes = {};
Gdk.Display.get_default ()

View File

@ -19,7 +19,7 @@ namespace Gala {
/**
* Utility class which adds a border and a shadow to a Background
*/
class FramedBackground : BackgroundManager {
private class FramedBackground : BackgroundManager {
private Cogl.Pipeline pipeline;
private Cairo.ImageSurface cached_surface;
private Cairo.Context cached_context;
@ -123,19 +123,19 @@ namespace Gala {
/**
* The offset of the scaled background to the top of the monitor bounds
*/
const int TOP_OFFSET = 20;
private const int TOP_OFFSET = 20;
/**
* The amount of time a window has to be over the WorkspaceClone while in drag
* before we activate the workspace.
*/
const int HOVER_ACTIVATE_DELAY = 400;
private const int HOVER_ACTIVATE_DELAY = 400;
/**
* The MultitaskingView shows the workspaces overlapping them WorkspaceClone.X_OFFSET pixels
* making it possible to move windows to the next/previous workspace.
*/
public const int X_OFFSET = 150;
public const int X_OFFSET = 150;
/**
* A window has been selected, the MultitaskingView should consider activating
@ -156,7 +156,7 @@ namespace Gala {
public IconGroup icon_group { get; private set; }
public WindowCloneContainer window_container { get; private set; }
bool _active = false;
private bool _active = false;
/**
* If this WorkspaceClone is currently the active one. Also sets the active
* state on its IconGroup.
@ -171,10 +171,10 @@ namespace Gala {
}
}
BackgroundManager background;
bool opened;
private BackgroundManager background;
private bool opened;
uint hover_activate_timeout = 0;
private uint hover_activate_timeout = 0;
public WorkspaceClone (Meta.Workspace workspace, GestureTracker gesture_tracker) {
Object (workspace: workspace, gesture_tracker: gesture_tracker);
@ -265,7 +265,7 @@ namespace Gala {
* Add a window to the WindowCloneContainer and the IconGroup if it really
* belongs to this workspace and this monitor.
*/
void add_window (Meta.Window window) {
private void add_window (Meta.Window window) {
if (window.window_type != Meta.WindowType.NORMAL
|| window.get_workspace () != workspace
|| window.on_all_workspaces
@ -283,16 +283,16 @@ namespace Gala {
/**
* Remove a window from the WindowCloneContainer and the IconGroup
*/
void remove_window (Meta.Window window) {
private void remove_window (Meta.Window window) {
window_container.remove_window (window);
icon_group.remove_window (window, opened);
}
void window_entered_monitor (Meta.Display display, int monitor, Meta.Window window) {
private void window_entered_monitor (Meta.Display display, int monitor, Meta.Window window) {
add_window (window);
}
void window_left_monitor (Meta.Display display, int monitor, Meta.Window window) {
private void window_left_monitor (Meta.Display display, int monitor, Meta.Window window) {
if (monitor == display.get_primary_monitor ())
remove_window (window);
}
@ -315,7 +315,7 @@ namespace Gala {
/**
* @return The amount of pixels the workspace is overlapped in the X axis.
*/
float current_x_overlap () {
private float current_x_overlap () {
var scale_factor = InternalUtils.get_ui_scaling_factor ();
var display = workspace.get_display ();
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
@ -334,7 +334,7 @@ namespace Gala {
*
* @param amount The amount in px to shrink.
*/
static inline void shrink_rectangle (ref Meta.Rectangle rect, int amount) {
private static inline void shrink_rectangle (ref Meta.Rectangle rect, int amount) {
rect.x += amount;
rect.y += amount;
rect.width -= amount * 2;

View File

@ -11,7 +11,7 @@ public class Gala.WorkspaceInsertThumb : Clutter.Actor {
public bool expanded { get; set; default = false; }
public int delay { get; set; default = EXPAND_DELAY; }
uint expand_timeout = 0;
private uint expand_timeout = 0;
public WorkspaceInsertThumb (int workspace_index) {
Object (workspace_index: workspace_index);

View File

@ -21,7 +21,7 @@ public class Gala.WindowListener : Object {
Meta.Rectangle outer;
}
static WindowListener? instance = null;
private static WindowListener? instance = null;
public static void init (Meta.Display display) {
if (instance != null)
@ -50,9 +50,9 @@ public class Gala.WindowListener : Object {
public signal void window_no_longer_on_all_workspaces (Meta.Window window);
Gee.HashMap<Meta.Window, WindowGeometry?> unmaximized_state_geometry;
private Gee.HashMap<Meta.Window, WindowGeometry?> unmaximized_state_geometry;
WindowListener () {
private WindowListener () {
unmaximized_state_geometry = new Gee.HashMap<Meta.Window, WindowGeometry?> ();
}
@ -63,7 +63,7 @@ public class Gala.WindowListener : Object {
window_maximized_changed (window);
}
void window_notify (Object object, ParamSpec pspec) {
private void window_notify (Object object, ParamSpec pspec) {
var window = (Meta.Window) object;
switch (pspec.name) {
@ -77,14 +77,14 @@ public class Gala.WindowListener : Object {
}
}
void window_on_all_workspaces_changed (Meta.Window window) {
private void window_on_all_workspaces_changed (Meta.Window window) {
if (window.on_all_workspaces)
return;
window_no_longer_on_all_workspaces (window);
}
void window_maximized_changed (Meta.Window window) {
private void window_maximized_changed (Meta.Window window) {
WindowGeometry window_geometry = {};
window_geometry.inner = window.get_frame_rect ();
window_geometry.outer = window.get_buffer_rect ();

View File

@ -16,8 +16,8 @@
//
namespace Gala {
const string DAEMON_DBUS_NAME = "org.pantheon.gala.daemon";
const string DAEMON_DBUS_OBJECT_PATH = "/org/pantheon/gala/daemon";
private const string DAEMON_DBUS_NAME = "org.pantheon.gala.daemon";
private const string DAEMON_DBUS_OBJECT_PATH = "/org/pantheon/gala/daemon";
[DBus (name = "org.pantheon.gala.daemon")]
public interface Daemon: GLib.Object {
@ -65,45 +65,45 @@ namespace Gala {
public PointerLocator pointer_locator { get; private set; }
SystemBackground system_background;
private SystemBackground system_background;
Meta.PluginInfo info;
private Meta.PluginInfo info;
WindowSwitcher? winswitcher = null;
ActivatableComponent? window_overview = null;
private WindowSwitcher? winswitcher = null;
private ActivatableComponent? window_overview = null;
public ScreenSaverManager? screensaver { get; private set; }
HotCornerManager? hot_corner_manager = null;
private HotCornerManager? hot_corner_manager = null;
public WindowTracker? window_tracker { get; private set; }
/**
* Allow to zoom in/out the entire desktop.
*/
Zoom? zoom = null;
private Zoom? zoom = null;
AccentColorManager accent_color_manager;
private AccentColorManager accent_color_manager;
Clutter.Actor? tile_preview;
private Clutter.Actor? tile_preview;
private Meta.Window? moving; //place for the window that is being moved over
Daemon? daemon_proxy = null;
private Daemon? daemon_proxy = null;
NotificationStack notification_stack;
private NotificationStack notification_stack;
Gee.LinkedList<ModalProxy> modal_stack = new Gee.LinkedList<ModalProxy> ();
private Gee.LinkedList<ModalProxy> modal_stack = new Gee.LinkedList<ModalProxy> ();
Gee.HashSet<Meta.WindowActor> minimizing = new Gee.HashSet<Meta.WindowActor> ();
Gee.HashSet<Meta.WindowActor> maximizing = new Gee.HashSet<Meta.WindowActor> ();
Gee.HashSet<Meta.WindowActor> unmaximizing = new Gee.HashSet<Meta.WindowActor> ();
Gee.HashSet<Meta.WindowActor> mapping = new Gee.HashSet<Meta.WindowActor> ();
Gee.HashSet<Meta.WindowActor> destroying = new Gee.HashSet<Meta.WindowActor> ();
Gee.HashSet<Meta.WindowActor> unminimizing = new Gee.HashSet<Meta.WindowActor> ();
GLib.HashTable<Meta.Window, int> ws_assoc = new GLib.HashTable<Meta.Window, int> (direct_hash, direct_equal);
Meta.SizeChange? which_change = null;
Meta.Rectangle old_rect_size_change;
private Gee.HashSet<Meta.WindowActor> minimizing = new Gee.HashSet<Meta.WindowActor> ();
private Gee.HashSet<Meta.WindowActor> maximizing = new Gee.HashSet<Meta.WindowActor> ();
private Gee.HashSet<Meta.WindowActor> unmaximizing = new Gee.HashSet<Meta.WindowActor> ();
private Gee.HashSet<Meta.WindowActor> mapping = new Gee.HashSet<Meta.WindowActor> ();
private Gee.HashSet<Meta.WindowActor> destroying = new Gee.HashSet<Meta.WindowActor> ();
private Gee.HashSet<Meta.WindowActor> unminimizing = new Gee.HashSet<Meta.WindowActor> ();
private GLib.HashTable<Meta.Window, int> ws_assoc = new GLib.HashTable<Meta.Window, int> (direct_hash, direct_equal);
private Meta.SizeChange? which_change = null;
private Meta.Rectangle old_rect_size_change;
private GLib.Settings animations_settings;
private GLib.Settings behavior_settings;
@ -149,11 +149,11 @@ namespace Gala {
});
}
void lost_daemon () {
private void lost_daemon () {
daemon_proxy = null;
}
void daemon_appeared () {
private void daemon_appeared () {
if (daemon_proxy == null) {
Bus.get_proxy.begin<Daemon> (BusType.SESSION, DAEMON_DBUS_NAME, DAEMON_DBUS_OBJECT_PATH, 0, null, (obj, res) => {
try {
@ -165,7 +165,7 @@ namespace Gala {
}
}
bool show_stage () {
private bool show_stage () {
unowned Meta.Display display = get_display ();
screen_shield = new ScreenShield (this);
@ -377,7 +377,7 @@ namespace Gala {
} catch (Error e) { warning (e.message); }
}
void on_show_background_menu (int x, int y) {
private void on_show_background_menu (int x, int y) {
if (daemon_proxy == null) {
return;
}
@ -391,12 +391,12 @@ namespace Gala {
});
}
void on_monitors_changed () {
private void on_monitors_changed () {
screen_shield.expand_to_screen_size ();
}
[CCode (instance_pos = -1)]
void handle_cycle_workspaces (Meta.Display display, Meta.Window? window, Clutter.KeyEvent event,
private void handle_cycle_workspaces (Meta.Display display, Meta.Window? window, Clutter.KeyEvent event,
Meta.KeyBinding binding) {
var direction = (binding.get_name () == "cycle-workspaces-next" ? 1 : -1);
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
@ -413,7 +413,7 @@ namespace Gala {
}
[CCode (instance_pos = -1)]
void handle_move_to_workspace (Meta.Display display, Meta.Window? window,
private void handle_move_to_workspace (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) {
if (window == null)
return;
@ -423,7 +423,7 @@ namespace Gala {
}
[CCode (instance_pos = -1)]
void handle_move_to_workspace_end (Meta.Display display, Meta.Window? window,
private void handle_move_to_workspace_end (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) {
if (window == null)
return;
@ -436,14 +436,14 @@ namespace Gala {
}
[CCode (instance_pos = -1)]
void handle_switch_to_workspace (Meta.Display display, Meta.Window? window,
private void handle_switch_to_workspace (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) {
var direction = (binding.get_name () == "switch-to-workspace-left" ? Meta.MotionDirection.LEFT : Meta.MotionDirection.RIGHT);
switch_to_next_workspace (direction);
}
[CCode (instance_pos = -1)]
void handle_switch_to_workspace_end (Meta.Display display, Meta.Window? window,
private void handle_switch_to_workspace_end (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) {
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
var index = (binding.get_name () == "switch-to-workspace-first" ? 0 : manager.n_workspaces - 1);
@ -451,13 +451,13 @@ namespace Gala {
}
[CCode (instance_pos = -1)]
void handle_applications_menu (Meta.Display display, Meta.Window? window,
private void handle_applications_menu (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) {
launch_action ("panel-main-menu-action");
}
[CCode (instance_pos = -1)]
void handle_screenshot (Meta.Display display, Meta.Window? window,
private void handle_screenshot (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) {
switch (binding.get_name ()) {
case "screenshot":
@ -586,7 +586,7 @@ namespace Gala {
}
}
void update_input_area () {
private void update_input_area () {
unowned Meta.Display display = get_display ();
if (screensaver != null) {
@ -609,7 +609,7 @@ namespace Gala {
InternalUtils.set_input_area (display, InputArea.DEFAULT);
}
void show_bottom_stack_window (Meta.Window bottom_window) {
private void show_bottom_stack_window (Meta.Window bottom_window) {
unowned Meta.Workspace workspace = bottom_window.get_workspace ();
if (Utils.get_n_windows (workspace) == 0) {
return;
@ -658,7 +658,7 @@ namespace Gala {
});
}
void animate_bottom_window_scale (Meta.WindowActor actor) {
private void animate_bottom_window_scale (Meta.WindowActor actor) {
const string[] PROPS = { "scale-x", "scale-y" };
foreach (string prop in PROPS) {
@ -1035,7 +1035,7 @@ namespace Gala {
* effects
*/
void handle_fullscreen_window (Meta.Window window, Meta.SizeChange which_change) {
private void handle_fullscreen_window (Meta.Window window, Meta.SizeChange which_change) {
// Only handle windows which are located on the primary monitor
if (!window.is_on_primary_monitor () || !behavior_settings.get_boolean ("move-fullscreened-workspace"))
return;
@ -1194,7 +1194,7 @@ namespace Gala {
}
}
void maximize (Meta.WindowActor actor, int ex, int ey, int ew, int eh) {
private void maximize (Meta.WindowActor actor, int ex, int ey, int ew, int eh) {
var duration = AnimationDuration.SNAP;
if (!enable_animations
@ -1578,7 +1578,7 @@ namespace Gala {
}
}
void unmaximize (Meta.WindowActor actor, int ex, int ey, int ew, int eh) {
private void unmaximize (Meta.WindowActor actor, int ex, int ey, int ew, int eh) {
var duration = AnimationDuration.SNAP;
if (!enable_animations
|| duration == 0) {
@ -1660,7 +1660,7 @@ namespace Gala {
}
}
void move_window_to_next_ws (Meta.Window window) {
private void move_window_to_next_ws (Meta.Window window) {
unowned Meta.Workspace win_ws = window.get_workspace ();
// Do nothing if the current workspace would be empty
@ -1714,7 +1714,7 @@ namespace Gala {
}
// Cancel attached animation of an actor and reset it
bool end_animation (ref Gee.HashSet<Meta.WindowActor> list, Meta.WindowActor actor) {
private bool end_animation (ref Gee.HashSet<Meta.WindowActor> list, Meta.WindowActor actor) {
if (!list.contains (actor))
return false;
@ -1748,9 +1748,9 @@ namespace Gala {
}
/*workspace switcher*/
List<Clutter.Actor>? windows;
List<Clutter.Actor>? parents;
List<Clutter.Actor>? tmp_actors;
private List<Clutter.Actor>? windows;
private List<Clutter.Actor>? parents;
private List<Clutter.Actor>? tmp_actors;
public override void switch_workspace (int from, int to, Meta.MotionDirection direction) {
if (!enable_animations
@ -2028,7 +2028,7 @@ namespace Gala {
}
}
void end_switch_workspace () {
private void end_switch_workspace () {
if (windows == null || parents == null)
return;
@ -2226,7 +2226,7 @@ namespace Gala {
* remove_child flags we will save the elapsed time of required transitions and
* then advance back to it when we're done reparenting.
*/
static void reparent_notification_window (Clutter.Actor actor, Clutter.Actor new_parent) {
private static void reparent_notification_window (Clutter.Actor actor, Clutter.Actor new_parent) {
unowned Clutter.Transition? entry_transition = actor.get_transition (NotificationStack.TRANSITION_ENTRY_NAME);
unowned Clutter.Transition? position_transition = actor.get_data<Clutter.Transition?> (NotificationStack.TRANSITION_MOVE_STACK_ID);
@ -2255,7 +2255,7 @@ namespace Gala {
}
}
static void clutter_actor_reparent (Clutter.Actor actor, Clutter.Actor new_parent) {
private static void clutter_actor_reparent (Clutter.Actor actor, Clutter.Actor new_parent) {
if (actor == new_parent)
return;

View File

@ -25,14 +25,14 @@ namespace Gala {
return instance;
}
static WorkspaceManager? instance = null;
private static WorkspaceManager? instance = null;
public WindowManager wm { get; construct; }
Gee.LinkedList<Meta.Workspace> workspaces_marked_removed;
int remove_freeze_count = 0;
private Gee.LinkedList<Meta.Workspace> workspaces_marked_removed;
private int remove_freeze_count = 0;
WorkspaceManager (WindowManager wm) {
private WorkspaceManager (WindowManager wm) {
Object (wm: wm);
}
@ -76,7 +76,7 @@ namespace Gala {
display.window_left_monitor.disconnect (window_left_monitor);
}
void workspace_added (Meta.WorkspaceManager manager, int index) {
private void workspace_added (Meta.WorkspaceManager manager, int index) {
var workspace = manager.get_workspace_by_index (index);
if (workspace == null)
return;
@ -85,7 +85,7 @@ namespace Gala {
workspace.window_removed.connect (window_removed);
}
void workspace_removed (Meta.WorkspaceManager manager, int index) {
private void workspace_removed (Meta.WorkspaceManager manager, int index) {
List<Meta.Workspace> existing_workspaces = null;
for (int i = 0; i < manager.get_n_workspaces (); i++) {
existing_workspaces.append (manager.get_workspace_by_index (i));
@ -100,7 +100,7 @@ namespace Gala {
}
}
void workspace_switched (Meta.WorkspaceManager manager, int from, int to, Meta.MotionDirection direction) {
private void workspace_switched (Meta.WorkspaceManager manager, int from, int to, Meta.MotionDirection direction) {
if (!Meta.Prefs.get_dynamic_workspaces ())
return;
@ -117,7 +117,7 @@ namespace Gala {
}
}
void window_added (Meta.Workspace? workspace, Meta.Window window) {
private void window_added (Meta.Workspace? workspace, Meta.Window window) {
if (workspace == null || !Meta.Prefs.get_dynamic_workspaces ()
|| window.on_all_workspaces)
return;
@ -132,7 +132,7 @@ namespace Gala {
append_workspace ();
}
void window_removed (Meta.Workspace? workspace, Meta.Window window) {
private void window_removed (Meta.Workspace? workspace, Meta.Window window) {
if (workspace == null || !Meta.Prefs.get_dynamic_workspaces () || window.on_all_workspaces)
return;
@ -160,19 +160,19 @@ namespace Gala {
}
}
void window_entered_monitor (Meta.Display display, int monitor, Meta.Window window) {
private void window_entered_monitor (Meta.Display display, int monitor, Meta.Window window) {
if (InternalUtils.workspaces_only_on_primary ()
&& monitor == display.get_primary_monitor ())
window_added (window.get_workspace (), window);
}
void window_left_monitor (Meta.Display display, int monitor, Meta.Window window) {
private void window_left_monitor (Meta.Display display, int monitor, Meta.Window window) {
if (InternalUtils.workspaces_only_on_primary ()
&& monitor == display.get_primary_monitor ())
window_removed (window.get_workspace (), window);
}
void prefs_listener (Meta.Preference pref) {
private void prefs_listener (Meta.Preference pref) {
unowned Meta.WorkspaceManager manager = wm.get_display ().get_workspace_manager ();
if (pref == Meta.Preference.DYNAMIC_WORKSPACES && Meta.Prefs.get_dynamic_workspaces ()) {
@ -182,7 +182,7 @@ namespace Gala {
}
}
void append_workspace () {
private void append_workspace () {
unowned Meta.Display display = wm.get_display ();
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
@ -194,7 +194,7 @@ namespace Gala {
*
* @param workspace The workspace to remove
*/
void remove_workspace (Meta.Workspace workspace) {
private void remove_workspace (Meta.Workspace workspace) {
unowned Meta.Display display = workspace.get_display ();
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
var time = display.get_current_time ();

View File

@ -6,17 +6,17 @@
*/
public class Gala.Zoom : Object {
const float MIN_ZOOM = 1.0f;
const float MAX_ZOOM = 10.0f;
const float SHORTCUT_DELTA = 0.5f;
const int ANIMATION_DURATION = 300;
const uint MOUSE_POLL_TIME = 50;
private const float MIN_ZOOM = 1.0f;
private const float MAX_ZOOM = 10.0f;
private const float SHORTCUT_DELTA = 0.5f;
private const int ANIMATION_DURATION = 300;
private const uint MOUSE_POLL_TIME = 50;
public WindowManager wm { get; construct; }
uint mouse_poll_timer = 0;
float current_zoom = MIN_ZOOM;
ulong wins_handler_id = 0UL;
private uint mouse_poll_timer = 0;
private float current_zoom = MIN_ZOOM;
private ulong wins_handler_id = 0UL;
private GestureTracker gesture_tracker;
@ -50,13 +50,13 @@ public class Gala.Zoom : Object {
}
[CCode (instance_pos = -1)]
void zoom_in (Meta.Display display, Meta.Window? window,
private void zoom_in (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) {
zoom (SHORTCUT_DELTA, true, wm.enable_animations);
}
[CCode (instance_pos = -1)]
void zoom_out (Meta.Display display, Meta.Window? window,
private void zoom_out (Meta.Display display, Meta.Window? window,
Clutter.KeyEvent event, Meta.KeyBinding binding) {
zoom (-SHORTCUT_DELTA, true, wm.enable_animations);
}
@ -99,7 +99,7 @@ public class Gala.Zoom : Object {
gesture_tracker.connect_handlers (null, (owned) on_animation_update, null);
}
void zoom (float delta, bool play_sound, bool animate) {
private void zoom (float delta, bool play_sound, bool animate) {
// Nothing to do if zooming out of our bounds is requested
if ((current_zoom <= MIN_ZOOM && delta < 0) || (current_zoom >= MAX_ZOOM && delta >= 0)) {
if (play_sound) {