mirror of
https://github.com/elementary/gala.git
synced 2024-12-25 18:24:05 +03:00
libmutter.vapi: drop some further properties and useless things, adapt source to it
This commit is contained in:
parent
3893fe6eda
commit
b2684d7939
@ -165,12 +165,13 @@ namespace Gala
|
|||||||
public Window get_next_window (Meta.Workspace workspace, bool backward=false)
|
public Window get_next_window (Meta.Workspace workspace, bool backward=false)
|
||||||
{
|
{
|
||||||
var screen = get_screen ();
|
var screen = get_screen ();
|
||||||
|
var display = screen.get_display ();
|
||||||
|
|
||||||
var window = screen.get_display ().get_tab_next (Meta.TabList.NORMAL, screen,
|
var window = display.get_tab_next (Meta.TabList.NORMAL, screen,
|
||||||
screen.get_active_workspace (), null, backward);
|
screen.get_active_workspace (), null, backward);
|
||||||
|
|
||||||
if (window == null)
|
if (window == null)
|
||||||
window = screen.get_display ().get_tab_current (Meta.TabList.NORMAL, screen, workspace);
|
window = display.get_tab_current (Meta.TabList.NORMAL, screen, workspace);
|
||||||
|
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
@ -251,7 +252,7 @@ namespace Gala
|
|||||||
//stolen from original mutter plugin
|
//stolen from original mutter plugin
|
||||||
public override void maximize (WindowActor actor, int ex, int ey, int ew, int eh)
|
public override void maximize (WindowActor actor, int ex, int ey, int ew, int eh)
|
||||||
{
|
{
|
||||||
if (actor.meta_window.window_type == WindowType.NORMAL) {
|
if (actor.get_meta_window ().window_type == WindowType.NORMAL) {
|
||||||
float x, y, width, height;
|
float x, y, width, height;
|
||||||
actor.get_size (out width, out height);
|
actor.get_size (out width, out height);
|
||||||
actor.get_position (out x, out y);
|
actor.get_position (out x, out y);
|
||||||
@ -281,14 +282,14 @@ namespace Gala
|
|||||||
var screen = get_screen ();
|
var screen = get_screen ();
|
||||||
|
|
||||||
unowned Rectangle rect; //some useful infos
|
unowned Rectangle rect; //some useful infos
|
||||||
actor.meta_window.get_outer_rect (out rect);
|
actor.get_meta_window ().get_outer_rect (out rect);
|
||||||
int width, height;
|
int width, height;
|
||||||
screen.get_size (out width, out height);
|
screen.get_size (out width, out height);
|
||||||
|
|
||||||
if (actor.meta_window.window_type == WindowType.NORMAL) {
|
if (actor.get_meta_window ().window_type == WindowType.NORMAL) {
|
||||||
|
|
||||||
if (rect.x < 100 && rect.y < 100) { //guess the window is placed at a bad spot
|
if (rect.x < 100 && rect.y < 100) { //guess the window is placed at a bad spot
|
||||||
actor.meta_window.move_frame (true, (int)(width/2.0f - rect.width/2.0f),
|
actor.get_meta_window ().move_frame (true, (int)(width/2.0f - rect.width/2.0f),
|
||||||
(int)(height/2.0f - rect.height/2.0f));
|
(int)(height/2.0f - rect.height/2.0f));
|
||||||
actor.x = width/2.0f - rect.width/2.0f - 10;
|
actor.x = width/2.0f - rect.width/2.0f - 10;
|
||||||
actor.y = height/2.0f - rect.height/2.0f - 10;
|
actor.y = height/2.0f - rect.height/2.0f - 10;
|
||||||
@ -297,7 +298,7 @@ namespace Gala
|
|||||||
|
|
||||||
actor.show ();
|
actor.show ();
|
||||||
|
|
||||||
switch (actor.meta_window.window_type) {
|
switch (actor.get_meta_window ().window_type) {
|
||||||
case WindowType.NORMAL:
|
case WindowType.NORMAL:
|
||||||
actor.scale_gravity = Clutter.Gravity.CENTER;
|
actor.scale_gravity = Clutter.Gravity.CENTER;
|
||||||
actor.rotation_center_x = {0, 0, 10};
|
actor.rotation_center_x = {0, 0, 10};
|
||||||
@ -309,7 +310,7 @@ namespace Gala
|
|||||||
scale_x:1.0f, scale_y:1.0f, rotation_angle_x:0.0f, opacity:255)
|
scale_x:1.0f, scale_y:1.0f, rotation_angle_x:0.0f, opacity:255)
|
||||||
.completed.connect ( () => {
|
.completed.connect ( () => {
|
||||||
map_completed (actor);
|
map_completed (actor);
|
||||||
actor.meta_window.activate (screen.get_display ().get_current_time ());
|
actor.get_meta_window ().activate (screen.get_display ().get_current_time ());
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case WindowType.MENU:
|
case WindowType.MENU:
|
||||||
@ -324,7 +325,7 @@ namespace Gala
|
|||||||
scale_x:1.0f, scale_y:1.0f, opacity:255)
|
scale_x:1.0f, scale_y:1.0f, opacity:255)
|
||||||
.completed.connect ( () => {
|
.completed.connect ( () => {
|
||||||
map_completed (actor);
|
map_completed (actor);
|
||||||
actor.meta_window.activate (screen.get_display ().get_current_time ());
|
actor.get_meta_window ().activate (screen.get_display ().get_current_time ());
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case WindowType.MODAL_DIALOG:
|
case WindowType.MODAL_DIALOG:
|
||||||
@ -333,8 +334,8 @@ namespace Gala
|
|||||||
get_current_cursor_position (null, out y);
|
get_current_cursor_position (null, out y);
|
||||||
|
|
||||||
if (rect.y >= y - 10 ||
|
if (rect.y >= y - 10 ||
|
||||||
actor.meta_window.window_type == WindowType.MODAL_DIALOG ||
|
actor.get_meta_window ().window_type == WindowType.MODAL_DIALOG ||
|
||||||
actor.meta_window.window_type == WindowType.DIALOG)
|
actor.get_meta_window ().window_type == WindowType.DIALOG)
|
||||||
actor.scale_gravity = Clutter.Gravity.NORTH;
|
actor.scale_gravity = Clutter.Gravity.NORTH;
|
||||||
else
|
else
|
||||||
actor.scale_gravity = Clutter.Gravity.SOUTH;
|
actor.scale_gravity = Clutter.Gravity.SOUTH;
|
||||||
@ -355,7 +356,7 @@ namespace Gala
|
|||||||
|
|
||||||
public override void destroy (WindowActor actor)
|
public override void destroy (WindowActor actor)
|
||||||
{
|
{
|
||||||
switch (actor.meta_window.window_type) {
|
switch (actor.get_meta_window ().window_type) {
|
||||||
case WindowType.NORMAL:
|
case WindowType.NORMAL:
|
||||||
actor.scale_gravity = Clutter.Gravity.CENTER;
|
actor.scale_gravity = Clutter.Gravity.CENTER;
|
||||||
actor.rotation_center_x = {0, actor.height, 10};
|
actor.rotation_center_x = {0, actor.height, 10};
|
||||||
@ -389,14 +390,14 @@ namespace Gala
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GLib.List<Clutter.Actor>? win;
|
GLib.List<Meta.WindowActor>? win;
|
||||||
GLib.List<Clutter.Actor>? par; //class space for kill func
|
GLib.List<Clutter.Actor>? par; //class space for kill func
|
||||||
Clutter.Actor in_group;
|
Clutter.Actor in_group;
|
||||||
Clutter.Actor out_group;
|
Clutter.Actor out_group;
|
||||||
|
|
||||||
public override void switch_workspace (int from, int to, MotionDirection direction)
|
public override void switch_workspace (int from, int to, MotionDirection direction)
|
||||||
{
|
{
|
||||||
unowned List<Clutter.Actor> windows = Compositor.get_window_actors (get_screen ());
|
unowned List<Meta.WindowActor> windows = Compositor.get_window_actors (get_screen ());
|
||||||
//FIXME js/ui/windowManager.js line 430
|
//FIXME js/ui/windowManager.js line 430
|
||||||
int w, h;
|
int w, h;
|
||||||
get_screen ().get_size (out w, out h);
|
get_screen ().get_size (out w, out h);
|
||||||
@ -426,19 +427,19 @@ namespace Gala
|
|||||||
group.add_actor (in_group);
|
group.add_actor (in_group);
|
||||||
group.add_actor (out_group);
|
group.add_actor (out_group);
|
||||||
|
|
||||||
win = new List<Clutter.Actor> ();
|
win = new List<Meta.WindowActor> ();
|
||||||
par = new List<Clutter.Actor> ();
|
par = new List<Clutter.Actor> ();
|
||||||
|
|
||||||
for (var i=0;i<windows.length ();i++) {
|
for (var i=0;i<windows.length ();i++) {
|
||||||
var window = windows.nth_data (i);
|
var window = windows.nth_data (i);
|
||||||
if (!(window as WindowActor).meta_window.showing_on_its_workspace ())
|
if (!window.get_meta_window ().showing_on_its_workspace ())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
win.append (window);
|
win.append (window);
|
||||||
par.append (window.get_parent ());
|
par.append (window.get_parent ());
|
||||||
if ((window as WindowActor).get_workspace () == from) {
|
if (window.get_workspace () == from) {
|
||||||
clutter_actor_reparent (window, out_group);
|
clutter_actor_reparent (window, out_group);
|
||||||
} else if ((window as WindowActor).get_workspace () == to) {
|
} else if (window.get_workspace () == to) {
|
||||||
clutter_actor_reparent (window, in_group);
|
clutter_actor_reparent (window, in_group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -474,7 +475,7 @@ namespace Gala
|
|||||||
|
|
||||||
for (var i=0;i<win.length ();i++) {
|
for (var i=0;i<win.length ();i++) {
|
||||||
var window = win.nth_data (i);
|
var window = win.nth_data (i);
|
||||||
if ((window as WindowActor).is_destroyed ())
|
if (window.is_destroyed ())
|
||||||
continue;
|
continue;
|
||||||
if (window.get_parent () == out_group) {
|
if (window.get_parent () == out_group) {
|
||||||
clutter_actor_reparent (window, par.nth_data (i));
|
clutter_actor_reparent (window, par.nth_data (i));
|
||||||
@ -510,7 +511,7 @@ namespace Gala
|
|||||||
|
|
||||||
public override void unmaximize (Meta.WindowActor actor, int ex, int ey, int ew, int eh)
|
public override void unmaximize (Meta.WindowActor actor, int ex, int ey, int ew, int eh)
|
||||||
{
|
{
|
||||||
if (actor.meta_window.window_type == WindowType.NORMAL) {
|
if (actor.get_meta_window ().window_type == WindowType.NORMAL) {
|
||||||
float x, y, width, height;
|
float x, y, width, height;
|
||||||
actor.get_size (out width, out height);
|
actor.get_size (out width, out height);
|
||||||
actor.get_position (out x, out y);
|
actor.get_position (out x, out y);
|
||||||
@ -565,7 +566,7 @@ namespace Gala
|
|||||||
Meta.exit (Meta.ExitCode.SUCCESS);
|
Meta.exit (Meta.ExitCode.SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clutter_actor_reparent (Clutter.Actor actor, Clutter.Actor new_parent)
|
static void clutter_actor_reparent (Clutter.Actor actor, Clutter.Actor new_parent)
|
||||||
{
|
{
|
||||||
if (actor == new_parent)
|
if (actor == new_parent)
|
||||||
return;
|
return;
|
||||||
|
@ -234,6 +234,7 @@ namespace Gala
|
|||||||
{
|
{
|
||||||
current_workspace_style.get_style_context ().render_activity (cr, 0, 0,
|
current_workspace_style.get_style_context ().render_activity (cr, 0, 0,
|
||||||
current_workspace.width, current_workspace.height);
|
current_workspace.width, current_workspace.height);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,7 +308,7 @@ namespace Gala
|
|||||||
public override bool key_release_event (Clutter.KeyEvent event)
|
public override bool key_release_event (Clutter.KeyEvent event)
|
||||||
{
|
{
|
||||||
if (event.keyval == Clutter.Key.Alt_L) {
|
if (event.keyval == Clutter.Key.Alt_L) {
|
||||||
this.hide ();
|
hide ();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ namespace Meta {
|
|||||||
[CCode (cheader_filename = "meta/compositor.h", cname = "meta_get_stage_for_screen")]
|
[CCode (cheader_filename = "meta/compositor.h", cname = "meta_get_stage_for_screen")]
|
||||||
public static unowned Clutter.Actor get_stage_for_screen (Meta.Screen screen);
|
public static unowned Clutter.Actor get_stage_for_screen (Meta.Screen screen);
|
||||||
[CCode (cheader_filename = "meta/compositor.h", cname = "meta_get_window_actors")]
|
[CCode (cheader_filename = "meta/compositor.h", cname = "meta_get_window_actors")]
|
||||||
public static unowned GLib.List<Clutter.Actor> get_window_actors (Meta.Screen screen);
|
public static unowned GLib.List<Meta.WindowActor> get_window_actors (Meta.Screen screen);
|
||||||
[CCode (cheader_filename = "meta/compositor.h", cname = "meta_get_window_group_for_screen")]
|
[CCode (cheader_filename = "meta/compositor.h", cname = "meta_get_window_group_for_screen")]
|
||||||
public static unowned Clutter.Actor get_window_group_for_screen (Meta.Screen screen);
|
public static unowned Clutter.Actor get_window_group_for_screen (Meta.Screen screen);
|
||||||
public void hide_window (Meta.Window window, Meta.CompEffect effect);
|
public void hide_window (Meta.Window window, Meta.CompEffect effect);
|
||||||
@ -373,7 +373,6 @@ namespace Meta {
|
|||||||
public static unowned Meta.Screen? for_x_screen (X.Screen xscreen);
|
public static unowned Meta.Screen? for_x_screen (X.Screen xscreen);
|
||||||
public unowned Meta.Workspace get_active_workspace ();
|
public unowned Meta.Workspace get_active_workspace ();
|
||||||
public int get_active_workspace_index ();
|
public int get_active_workspace_index ();
|
||||||
public void* get_compositor_data ();
|
|
||||||
public unowned Meta.Display get_display ();
|
public unowned Meta.Display get_display ();
|
||||||
public void get_monitor_geometry (int monitor, out unowned Meta.Rectangle geometry);
|
public void get_monitor_geometry (int monitor, out unowned Meta.Rectangle geometry);
|
||||||
public int get_n_monitors ();
|
public int get_n_monitors ();
|
||||||
@ -381,7 +380,6 @@ namespace Meta {
|
|||||||
public int get_primary_monitor ();
|
public int get_primary_monitor ();
|
||||||
public int get_screen_number ();
|
public int get_screen_number ();
|
||||||
public void get_size (out int width, out int height);
|
public void get_size (out int width, out int height);
|
||||||
public unowned GLib.SList<void*> get_startup_sequences ();
|
|
||||||
public unowned Meta.Workspace? get_workspace_by_index (int index);
|
public unowned Meta.Workspace? get_workspace_by_index (int index);
|
||||||
public unowned GLib.List<Meta.Workspace> get_workspaces ();
|
public unowned GLib.List<Meta.Workspace> get_workspaces ();
|
||||||
public X.Window get_xroot ();
|
public X.Window get_xroot ();
|
||||||
@ -575,15 +573,9 @@ namespace Meta {
|
|||||||
public bool is_override_redirect ();
|
public bool is_override_redirect ();
|
||||||
public bool showing_on_its_workspace ();
|
public bool showing_on_its_workspace ();
|
||||||
[NoAccessorMethod]
|
[NoAccessorMethod]
|
||||||
public void* meta_screen { get; set construct; }
|
|
||||||
[NoAccessorMethod]
|
|
||||||
public Meta.Window meta_window { owned get; set construct; }
|
|
||||||
[NoAccessorMethod]
|
|
||||||
public bool no_shadow { get; set; }
|
public bool no_shadow { get; set; }
|
||||||
[NoAccessorMethod]
|
[NoAccessorMethod]
|
||||||
public string shadow_class { owned get; set; }
|
public string shadow_class { owned get; set; }
|
||||||
[NoAccessorMethod]
|
|
||||||
public ulong x_window { get; set construct; }
|
|
||||||
public signal void position_changed ();
|
public signal void position_changed ();
|
||||||
public signal void size_changed ();
|
public signal void size_changed ();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user