Rename TiledWindow* to WindowClone*

This commit is contained in:
Rico Tzschichholz 2014-06-29 13:30:47 +02:00
parent 058b076ca5
commit 61b558e407
7 changed files with 60 additions and 60 deletions

View File

@ -52,8 +52,8 @@ gala_VALASOURCES = \
Widgets/IconGroupContainer.vala \
Widgets/MonitorClone.vala \
Widgets/MultitaskingView.vala \
Widgets/TiledWindow.vala \
Widgets/TiledWindowContainer.vala \
Widgets/WindowClone.vala \
Widgets/WindowCloneContainer.vala \
Widgets/WindowOverview.vala \
Widgets/WindowSwitcher.vala \
Widgets/WorkspaceClone.vala \

View File

@ -21,7 +21,7 @@ using Meta;
namespace Gala
{
/**
* More or less utility class to contain a TiledWindowContainer for each
* More or less utility class to contain a WindowCloneContainer for each
* non-primary monitor. It's the pendant to the WorkspaceClone which is
* only placed on the primary monitor. It also draws a wallpaper behind itself
* as the WindowGroup is hidden while the view is active. Only used when
@ -34,7 +34,7 @@ namespace Gala
public Screen screen { get; construct; }
public int monitor { get; construct; }
TiledWindowContainer window_container;
WindowCloneContainer window_container;
Background background;
public MonitorClone (Screen screen, int monitor)
@ -49,7 +49,7 @@ namespace Gala
background = new Background (screen, monitor, BackgroundSettings.get_default ().schema);
background.set_easing_duration (300);
window_container = new TiledWindowContainer ();
window_container = new WindowCloneContainer ();
window_container.window_selected.connect ((w) => { window_selected (w); });
screen.restacked.connect (window_container.restack_windows);

View File

@ -318,7 +318,7 @@ namespace Gala
}
/**
* Collect key events, mainly for redirecting them to the TiledWindowContainers to
* Collect key events, mainly for redirecting them to the WindowCloneContainers to
* select the active window.
*/
public override bool key_press_event (Clutter.KeyEvent event)
@ -350,7 +350,7 @@ namespace Gala
}
/**
* Inform the current TiledWindowContainer that we want to move the focus in
* Inform the current WindowCloneContainer that we want to move the focus in
* a specific direction.
*
* @param direction The direction in which to move the focus to

View File

@ -22,9 +22,9 @@ namespace Gala
{
/**
* A container for a clone of the texture of a MetaWindow, a WindowIcon,
* a close button and a shadow. Used together with the TiledWindowContainer.
* a close button and a shadow. Used together with the WindowCloneContainer.
*/
public class TiledWindow : Actor
public class WindowClone : Actor
{
const int WINDOW_ICON_SIZE = 64;
const int ACTIVE_SHAPE_SIZE = 12;
@ -51,7 +51,7 @@ namespace Gala
bool _active = false;
/**
* When active fades a white border around the window in. Used for the visually
* indicating the TiledWindowContainer's current_window.
* indicating the WindowCloneContainer's current_window.
*/
public bool active {
get {
@ -83,7 +83,7 @@ namespace Gala
Actor active_shape;
GtkClutter.Texture window_icon;
public TiledWindow (Meta.Window window, bool overview_mode = false)
public WindowClone (Meta.Window window, bool overview_mode = false)
{
Object (window: window, overview_mode: overview_mode);
}
@ -143,7 +143,7 @@ namespace Gala
load_clone ();
}
~TiledWindow ()
~WindowClone ()
{
window.unmanaged.disconnect (unmanaged);
@ -235,7 +235,7 @@ namespace Gala
/**
* Sets a timeout of 500ms after which, if no new resize action reset it,
* the shadow will be resized and a request_reposition() will be emitted to
* make the TiledWindowContainer calculate a new layout to honor the new size.
* make the WindowCloneContainer calculate a new layout to honor the new size.
*/
void update_shadow_size ()
{
@ -466,7 +466,7 @@ namespace Gala
/**
* A drag action has been initiated on us, we reparent ourselves to the stage so
* we can move freely, scale ourselves to a smaller scale and request that the
* position we just freed is immediately filled by the TiledWindowContainer.
* position we just freed is immediately filled by the WindowCloneContainer.
*/
Actor drag_begin (float click_x, float click_y)
{

View File

@ -21,9 +21,9 @@ using Meta;
namespace Gala
{
/**
* Container which controls the layout of a set of TiledWindows.
* Container which controls the layout of a set of WindowClones.
*/
public class TiledWindowContainer : Actor
public class WindowCloneContainer : Actor
{
public signal void window_selected (Window window);
@ -40,9 +40,9 @@ namespace Gala
* The window that is currently selected via keyboard shortcuts. It is not
* necessarily the same as the active window.
*/
TiledWindow? current_window;
WindowClone? current_window;
public TiledWindowContainer (bool overview_mode = false)
public WindowCloneContainer (bool overview_mode = false)
{
Object (overview_mode: overview_mode);
}
@ -54,9 +54,9 @@ namespace Gala
}
/**
* Create a TiledWindow for a MetaWindow and add it to the group
* Create a WindowClone for a MetaWindow and add it to the group
*
* @param window The window for which to create the TiledWindow for
* @param window The window for which to create the WindowClone for
*/
public void add_window (Window window)
{
@ -65,7 +65,7 @@ namespace Gala
GLib.SList<unowned Meta.Window> windows = new GLib.SList<unowned Meta.Window> ();
foreach (unowned Actor child in children) {
unowned TiledWindow tw = (TiledWindow) child;
unowned WindowClone tw = (WindowClone) child;
windows.prepend (tw.window);
}
windows.prepend (window);
@ -73,7 +73,7 @@ namespace Gala
var windows_ordered = display.sort_windows_by_stacking (windows);
var new_window = new TiledWindow (window, overview_mode);
var new_window = new WindowClone (window, overview_mode);
new_window.selected.connect (window_selected_cb);
new_window.destroy.connect (window_destroyed);
@ -90,7 +90,7 @@ namespace Gala
}
foreach (unowned Actor child in children) {
unowned TiledWindow tw = (TiledWindow) child;
unowned WindowClone tw = (WindowClone) child;
if (target == tw.window) {
insert_child_above (new_window, tw);
added = true;
@ -106,12 +106,12 @@ namespace Gala
}
/**
* Find and remove the TiledWindow for a MetaWindow
* Find and remove the WindowClone for a MetaWindow
*/
public void remove_window (Window window)
{
foreach (var child in get_children ()) {
if (((TiledWindow) child).window == window) {
if (((WindowClone) child).window == window) {
remove_child (child);
break;
}
@ -120,14 +120,14 @@ namespace Gala
reflow ();
}
void window_selected_cb (TiledWindow tiled)
void window_selected_cb (WindowClone tiled)
{
window_selected (tiled.window);
}
void window_destroyed (Actor actor)
{
var window = actor as TiledWindow;
var window = actor as WindowClone;
if (window == null)
return;
@ -151,7 +151,7 @@ namespace Gala
GLib.SList<unowned Meta.Window> windows = new GLib.SList<unowned Meta.Window> ();
foreach (unowned Actor child in children) {
unowned TiledWindow tw = (TiledWindow) child;
unowned WindowClone tw = (WindowClone) child;
windows.prepend (tw.window);
}
@ -161,7 +161,7 @@ namespace Gala
foreach (unowned Meta.Window window in windows_ordered) {
var i = 0;
foreach (unowned Actor child in children) {
if (((TiledWindow) child).window == window) {
if (((WindowClone) child).window == window) {
set_child_at_index (child, i);
children.remove (child);
i++;
@ -182,7 +182,7 @@ namespace Gala
var windows = new List<InternalUtils.TilableWindow?> ();
foreach (var child in get_children ()) {
unowned TiledWindow window = (TiledWindow) child;
unowned WindowClone window = (WindowClone) child;
#if HAS_MUTTER312
windows.prepend ({ window.window.get_frame_rect (), window });
#else
@ -197,8 +197,8 @@ namespace Gala
// doesn't give us different slots based on stacking order, which can lead
// to windows flying around weirdly
windows.sort ((a, b) => {
var seq_a = ((TiledWindow) a.id).window.get_stable_sequence ();
var seq_b = ((TiledWindow) b.id).window.get_stable_sequence ();
var seq_a = ((WindowClone) a.id).window.get_stable_sequence ();
var seq_b = ((WindowClone) b.id).window.get_stable_sequence ();
return (int) (seq_b - seq_a);
});
@ -212,7 +212,7 @@ namespace Gala
var window_positions = InternalUtils.calculate_grid_placement (area, windows);
foreach (var tilable in window_positions) {
unowned TiledWindow window = (TiledWindow) tilable.id;
unowned WindowClone window = (WindowClone) tilable.id;
window.take_slot (tilable.rect);
window.place_widgets (tilable.rect.width, tilable.rect.height);
}
@ -230,18 +230,18 @@ namespace Gala
return;
if (current_window == null) {
current_window = (TiledWindow) get_child_at_index (0);
current_window = (WindowClone) get_child_at_index (0);
return;
}
var current_rect = current_window.slot;
TiledWindow? closest = null;
WindowClone? closest = null;
foreach (var window in get_children ()) {
if (window == current_window)
continue;
var window_rect = ((TiledWindow) window).slot;
var window_rect = ((WindowClone) window).slot;
switch (direction) {
case MotionDirection.LEFT:
@ -254,7 +254,7 @@ namespace Gala
if (closest == null
|| closest.slot.x < window_rect.x)
closest = (TiledWindow) window;
closest = (WindowClone) window;
}
break;
case MotionDirection.RIGHT:
@ -267,7 +267,7 @@ namespace Gala
if (closest == null
|| closest.slot.x > window_rect.x)
closest = (TiledWindow) window;
closest = (WindowClone) window;
}
break;
case MotionDirection.UP:
@ -280,7 +280,7 @@ namespace Gala
if (closest == null
|| closest.slot.y < window_rect.y)
closest = (TiledWindow) window;
closest = (WindowClone) window;
}
break;
case MotionDirection.DOWN:
@ -293,7 +293,7 @@ namespace Gala
if (closest == null
|| closest.slot.y > window_rect.y)
closest = (TiledWindow) window;
closest = (WindowClone) window;
}
break;
}
@ -319,7 +319,7 @@ namespace Gala
}
/**
* When opened the TiledWindows are animated to a tiled layout
* When opened the WindowClones are animated to a tiled layout
*/
public void open (Window? selected_window = null)
{
@ -331,7 +331,7 @@ namespace Gala
// hide the highlight when opened
if (selected_window != null) {
foreach (var child in get_children ()) {
unowned TiledWindow tiled_window = (TiledWindow) child;
unowned WindowClone tiled_window = (WindowClone) child;
if (tiled_window.window == selected_window) {
current_window = tiled_window;
break;
@ -345,7 +345,7 @@ namespace Gala
// make sure our windows are where they belong in case they were moved
// while were closed.
foreach (var window in get_children ())
((TiledWindow) window).transition_to_original_state (false);
((WindowClone) window).transition_to_original_state (false);
reflow ();
}
@ -362,7 +362,7 @@ namespace Gala
opened = false;
foreach (var window in get_children ())
((TiledWindow) window).transition_to_original_state (true);
((WindowClone) window).transition_to_original_state (true);
}
}
}

View File

@ -148,7 +148,7 @@ namespace Gala
for (var i = 0; i < screen.get_n_monitors (); i++) {
var geometry = screen.get_monitor_geometry (i);
var container = new TiledWindowContainer (true);
var container = new WindowCloneContainer (true);
container.padding_top = TOP_GAP;
container.padding_left = container.padding_right = BORDER;
container.padding_bottom = BOTTOM_GAP;
@ -165,11 +165,11 @@ namespace Gala
return;
actor.hide ();
((TiledWindowContainer) get_child_at_index (window.get_monitor ())).add_window (window);
((WindowCloneContainer) get_child_at_index (window.get_monitor ())).add_window (window);
}
foreach (var child in get_children ())
((TiledWindowContainer) child).open ();
((WindowCloneContainer) child).open ();
ready = true;
}
@ -177,7 +177,7 @@ namespace Gala
void restack_windows (Screen screen)
{
foreach (var child in get_children ())
((TiledWindowContainer) child).restack_windows (screen);
((WindowCloneContainer) child).restack_windows (screen);
}
void window_left_monitor (int num, Window window)
@ -190,7 +190,7 @@ namespace Gala
if (window.get_workspace () == workspace ||
(window.is_on_all_workspaces () && window.get_screen () == workspace.get_screen ())) {
#endif
((TiledWindowContainer) get_child_at_index (num)).remove_window (window);
((WindowCloneContainer) get_child_at_index (num)).remove_window (window);
return;
}
}
@ -205,12 +205,12 @@ namespace Gala
// make sure the window belongs to one of our workspaces
foreach (var workspace in workspaces)
if (window.get_workspace () == workspace)
((TiledWindowContainer) get_child_at_index (window.get_monitor ())).add_window (window);
((WindowCloneContainer) get_child_at_index (window.get_monitor ())).add_window (window);
}
void remove_window (Window window)
{
((TiledWindowContainer) get_child_at_index (window.get_monitor ())).remove_window (window);
((WindowCloneContainer) get_child_at_index (window.get_monitor ())).remove_window (window);
}
void thumb_selected (Window window)
@ -246,7 +246,7 @@ namespace Gala
wm.update_input_area ();
foreach (var child in get_children ()) {
((TiledWindowContainer) child).close ();
((WindowCloneContainer) child).close ();
}
if (animate) {

View File

@ -55,7 +55,7 @@ namespace Gala
/**
* This is the container which manages a clone of the background which will
* be scaled and animated inwards, a TiledWindowContainer for the windows on
* be scaled and animated inwards, a WindowCloneContainer for the windows on
* this workspace and also holds the instance for this workspace's IconGroup.
* The latter is not added to the WorkspaceClone itself though but to a container
* of the MultitaskingView.
@ -94,7 +94,7 @@ namespace Gala
public Workspace workspace { get; construct; }
public IconGroup icon_group { get; private set; }
public TiledWindowContainer window_container { get; private set; }
public WindowCloneContainer window_container { get; private set; }
bool _active = false;
/**
@ -135,7 +135,7 @@ namespace Gala
return false;
});
window_container = new TiledWindowContainer ();
window_container = new WindowCloneContainer ();
window_container.window_selected.connect ((w) => { window_selected (w); });
window_container.width = monitor_geometry.width;
window_container.height = monitor_geometry.height;
@ -201,7 +201,7 @@ namespace Gala
}
/**
* Add a window to the TiledWindowContainer and the IconGroup if it really
* Add a window to the WindowCloneContainer and the IconGroup if it really
* belongs to this workspace and this monitor.
*/
void add_window (Window window)
@ -212,7 +212,7 @@ namespace Gala
return;
foreach (var child in window_container.get_children ())
if (((TiledWindow) child).window == window)
if (((WindowClone) child).window == window)
return;
window_container.add_window (window);
@ -220,7 +220,7 @@ namespace Gala
}
/**
* Remove a window from the TiledWindowContainer and the IconGroup
* Remove a window from the WindowCloneContainer and the IconGroup
*/
void remove_window (Window window)
{
@ -255,8 +255,8 @@ namespace Gala
/**
* Animates the background to its scale, causes a redraw on the IconGroup and
* makes sure the TiledWindowContainer animates its windows to their tiled layout.
* Also sets the current_window of the TiledWindowContainer to the active window
* makes sure the WindowCloneContainer animates its windows to their tiled layout.
* Also sets the current_window of the WindowCloneContainer to the active window
* if it belongs to this workspace.
*/
public void open ()