Skip to content

Commit

Permalink
Use the .metadata to regenerate the .vapi files (#642)
Browse files Browse the repository at this point in the history
  • Loading branch information
Corentin Noël authored and danirabbit committed Nov 21, 2019
1 parent f0d2b2d commit 309d594
Show file tree
Hide file tree
Showing 18 changed files with 429 additions and 247 deletions.
4 changes: 2 additions & 2 deletions plugins/notify/NormalNotification.vala
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,9 @@ namespace Gala.Plugins.Notify
return null;

#if HAS_MUTTER330
unowned GLib.List<weak Meta.WindowActor>? actors = Meta.Compositor.get_window_actors (display);
unowned GLib.List<Meta.WindowActor> actors = display.get_window_actors ();
#else
unowned GLib.List<weak Meta.WindowActor>? actors = Meta.Compositor.get_window_actors (screen);
unowned GLib.List<Meta.WindowActor> actors = screen.get_window_actors ();
#endif
foreach (unowned Meta.WindowActor actor in actors) {
if (actor.is_destroyed ())
Expand Down
8 changes: 4 additions & 4 deletions plugins/pip/Main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ public class Gala.Plugins.PIP.Plugin : Gala.Plugin
{
#if HAS_MUTTER330
unowned Meta.Display display = wm.get_display ();
unowned List<weak Meta.WindowActor> actors = Meta.Compositor.get_window_actors (display);
unowned List<Meta.WindowActor> actors = display.get_window_actors ();
#else
var screen = wm.get_screen ();
unowned List<weak Meta.WindowActor> actors = Meta.Compositor.get_window_actors (screen);
unowned List<Meta.WindowActor> actors = screen.get_window_actors ();
#endif

var copy = actors.copy ();
Expand All @@ -175,10 +175,10 @@ public class Gala.Plugins.PIP.Plugin : Gala.Plugin
{
#if HAS_MUTTER330
unowned Meta.Display display = wm.get_display ();
unowned List<weak Meta.WindowActor> actors = Meta.Compositor.get_window_actors (display);
unowned List<Meta.WindowActor> actors = display.get_window_actors ();
#else
var screen = wm.get_screen ();
unowned List<weak Meta.WindowActor> actors = Meta.Compositor.get_window_actors (screen);
unowned List<Meta.WindowActor> actors = screen.get_window_actors ();
#endif

var copy = actors.copy ();
Expand Down
2 changes: 1 addition & 1 deletion plugins/pip/PopupWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor
});
});

clone = new Clutter.Clone (window_actor.get_texture ());
clone = new Clutter.Clone (window_actor);

move_action = new MoveAction ();
move_action.drag_begin.connect (on_move_begin);
Expand Down
8 changes: 8 additions & 0 deletions src/DBusAccelerator.vala
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,20 @@ namespace Gala
#endif
}

#if HAS_MUTTER334
void on_accelerator_activated (uint action, Clutter.InputDevice device, uint timestamp)
#else
void on_accelerator_activated (uint action, uint device_id, uint timestamp)
#endif
{
foreach (string accelerator in grabbed_accelerators.get_keys ()) {
if (grabbed_accelerators[accelerator] == action) {
var parameters = new GLib.HashTable<string, Variant> (null, null);
#if HAS_MUTTER334
parameters.set ("device-id", new Variant.uint32 (device.id));
#else
parameters.set ("device-id", new Variant.uint32 (device_id));
#endif
parameters.set ("timestamp", new Variant.uint32 (timestamp));

accelerator_activated (action, parameters);
Expand Down
10 changes: 5 additions & 5 deletions src/InternalUtils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace Gala
unowned Meta.X11Display x11display = display.get_x11_display ();
x11display.clear_stage_input_region ();
#else
Util.empty_stage_input_region (display);
display.empty_stage_input_region ();
#endif
return;
}
Expand Down Expand Up @@ -167,12 +167,12 @@ namespace Gala
break;
case InputArea.NONE:
default:
Util.empty_stage_input_region (screen);
screen.empty_stage_input_region ();
return;
}

var xregion = X.Fixes.create_region (display.get_xdisplay (), rects);
Util.set_stage_input_region (screen, xregion);
screen.set_stage_input_region (xregion);
}
#endif

Expand All @@ -191,9 +191,9 @@ namespace Gala
new_window.change_workspace_by_index (index, false);

#if HAS_MUTTER330
unowned List<unowned WindowActor> actors = Compositor.get_window_actors (new_window.get_display ());
unowned List<WindowActor> actors = new_window.get_display ().get_window_actors ();
#else
unowned List<unowned WindowActor> actors = Compositor.get_window_actors (new_window.get_screen ());
unowned List<WindowActor> actors = new_window.get_screen ().get_window_actors ();
#endif
foreach (unowned Meta.WindowActor actor in actors) {
if (actor.is_destroyed ())
Expand Down
4 changes: 2 additions & 2 deletions src/Main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ namespace Gala
Meta.exit (Meta.ExitCode.ERROR);
}

Meta.Plugin.manager_set_plugin_type (new WindowManagerGala ().get_type ());
Meta.Plugin.manager_set_plugin_type (typeof (WindowManagerGala));

Meta.set_wm_name ("Mutter(Gala)");
Meta.Util.set_wm_name ("Mutter(Gala)");

/**
* Prevent Meta.init () from causing gtk to load gail and at-bridge
Expand Down
4 changes: 2 additions & 2 deletions src/ScreenshotManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ namespace Gala
Cairo.ImageSurface composite_stage_cursor (Cairo.ImageSurface image, Cairo.RectangleInt image_rect)
{
#if HAS_MUTTER330
unowned Meta.CursorTracker cursor_tracker = Meta.CursorTracker.get_for_display (wm.get_display ());
unowned Meta.CursorTracker cursor_tracker = wm.get_display ().get_cursor_tracker ();
#else
unowned Meta.CursorTracker cursor_tracker = Meta.CursorTracker.get_for_screen (wm.get_screen ());
unowned Meta.CursorTracker cursor_tracker = wm.get_screen ().get_cursor_tracker ();
#endif

int x, y;
Expand Down
4 changes: 2 additions & 2 deletions src/Widgets/MonitorClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ namespace Gala
#endif

#if HAS_MUTTER330
unowned GLib.List<weak Meta.WindowActor>? window_actors = Meta.Compositor.get_window_actors (display);
unowned GLib.List<Meta.WindowActor> window_actors = display.get_window_actors ();
#else
unowned GLib.List<weak Meta.WindowActor>? window_actors = Meta.Compositor.get_window_actors (screen);
unowned GLib.List<Meta.WindowActor> window_actors = screen.get_window_actors ();
#endif
foreach (unowned Meta.WindowActor window_actor in window_actors) {
if (window_actor.is_destroyed ())
Expand Down
4 changes: 2 additions & 2 deletions src/Widgets/MultitaskingView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -656,9 +656,9 @@ namespace Gala

if (opening) {
#if HAS_MUTTER330
unowned GLib.List<weak Meta.WindowActor>? window_actors = Meta.Compositor.get_window_actors (display);
unowned GLib.List<Meta.WindowActor> window_actors = display.get_window_actors ();
#else
unowned GLib.List<weak Meta.WindowActor>? window_actors = Meta.Compositor.get_window_actors (screen);
unowned GLib.List<Meta.WindowActor> window_actors = screen.get_window_actors ();
#endif
foreach (unowned Meta.WindowActor actor in window_actors) {
const int MAX_OFFSET = 100;
Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/WindowClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ namespace Gala
if (overview_mode)
actor.hide ();

clone = new Clone (actor.get_texture ());
clone = new Clone (actor);
add_child (clone);

set_child_below_sibling (active_shape, clone);
Expand Down
8 changes: 4 additions & 4 deletions src/Widgets/WindowSwitcher.vala
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,9 @@ namespace Gala

// need to go through all the windows because of hidden dialogs
#if HAS_MUTTER330
unowned GLib.List<weak Meta.WindowActor>? window_actors = Meta.Compositor.get_window_actors (display);
unowned GLib.List<Meta.WindowActor> window_actors = display.get_window_actors ();
#else
unowned GLib.List<weak Meta.WindowActor>? window_actors = Meta.Compositor.get_window_actors (screen);
unowned GLib.List<Meta.WindowActor> window_actors = screen.get_window_actors ();
#endif
foreach (unowned Meta.WindowActor actor in window_actors) {
if (actor.is_destroyed ())
Expand Down Expand Up @@ -721,9 +721,9 @@ namespace Gala

// hide the others
#if HAS_MUTTER330
unowned GLib.List<weak Meta.WindowActor>? window_actors = Meta.Compositor.get_window_actors (display);
unowned GLib.List<Meta.WindowActor> window_actors = display.get_window_actors ();
#else
unowned GLib.List<weak Meta.WindowActor>? window_actors = Meta.Compositor.get_window_actors (screen);
unowned GLib.List<Meta.WindowActor> window_actors = screen.get_window_actors ();
#endif
foreach (unowned Meta.WindowActor actor in window_actors) {
if (actor.is_destroyed ())
Expand Down
4 changes: 2 additions & 2 deletions src/WindowListener.vala
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace Gala

instance = new WindowListener ();

foreach (unowned Meta.WindowActor actor in Meta.Compositor.get_window_actors (display)) {
foreach (unowned Meta.WindowActor actor in display.get_window_actors ()) {
if (actor.is_destroyed ())
continue;

Expand All @@ -59,7 +59,7 @@ namespace Gala

instance = new WindowListener ();

foreach (unowned Meta.WindowActor actor in Meta.Compositor.get_window_actors (screen)) {
foreach (unowned Meta.WindowActor actor in screen.get_window_actors ()) {
if (actor.is_destroyed ())
continue;

Expand Down
28 changes: 14 additions & 14 deletions src/WindowManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ namespace Gala
}

#if HAS_MUTTER330
stage = Compositor.get_stage_for_display (display) as Clutter.Stage;
stage = display.get_stage () as Clutter.Stage;
#else
stage = Compositor.get_stage_for_screen (screen) as Clutter.Stage;
stage = screen.get_stage () as Clutter.Stage;
#endif

var color = BackgroundSettings.get_default ().primary_color;
Expand Down Expand Up @@ -224,9 +224,9 @@ namespace Gala
stage.add_child (ui_group);

#if HAS_MUTTER330
window_group = Compositor.get_window_group_for_display (display);
window_group = display.get_window_group ();
#else
window_group = Compositor.get_window_group_for_screen (screen);
window_group = screen.get_window_group ();
#endif
stage.remove_child (window_group);
ui_group.add_child (window_group);
Expand All @@ -240,9 +240,9 @@ namespace Gala
window_group.set_child_below_sibling (background_group, null);

#if HAS_MUTTER330
top_window_group = Compositor.get_top_window_group_for_display (display);
top_window_group = display.get_top_window_group ();
#else
top_window_group = Compositor.get_top_window_group_for_screen (screen);
top_window_group = screen.get_top_window_group ();
#endif
stage.remove_child (top_window_group);
ui_group.add_child (top_window_group);
Expand Down Expand Up @@ -391,9 +391,9 @@ namespace Gala
void add_hotcorner (float x, float y, string key)
{
#if HAS_MUTTER330
unowned Clutter.Actor? stage = Compositor.get_stage_for_display (get_display ());
unowned Clutter.Actor? stage = get_display ().get_stage ();
#else
unowned Clutter.Actor? stage = Compositor.get_stage_for_screen (get_screen ());
unowned Clutter.Actor? stage = get_screen ().get_stage ();
#endif
return_if_fail (stage != null);

Expand Down Expand Up @@ -799,9 +799,9 @@ namespace Gala
begin_modal (0, time);

#if HAS_MUTTER330
Meta.Util.disable_unredirect_for_display (display);
display.disable_unredirect ();
#else
Meta.Util.disable_unredirect_for_screen (screen);
screen.disable_unredirect ();
#endif

return proxy;
Expand All @@ -826,12 +826,12 @@ namespace Gala
unowned Meta.Display display = get_display ();
end_modal (display.get_current_time ());

Meta.Util.enable_unredirect_for_display (display);
display.enable_unredirect ();
#else
var screen = get_screen ();
end_modal (screen.get_display ().get_current_time ());

Meta.Util.enable_unredirect_for_screen (screen);
screen.enable_unredirect ();
#endif
}

Expand Down Expand Up @@ -1961,9 +1961,9 @@ namespace Gala

// collect all windows and put them in the appropriate containers
#if HAS_MUTTER330
foreach (unowned Meta.WindowActor actor in Meta.Compositor.get_window_actors (display)) {
foreach (unowned Meta.WindowActor actor in display.get_window_actors ()) {
#else
foreach (unowned Meta.WindowActor actor in Meta.Compositor.get_window_actors (screen)) {
foreach (unowned Meta.WindowActor actor in screen.get_window_actors ()) {
#endif
if (actor.is_destroyed ())
continue;
Expand Down
33 changes: 24 additions & 9 deletions vapi/Meta-2.metadata
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
* skip=false
*.* skip=false
* cheader_filename="meta/main.h"

Backend cheader_filename="meta/meta-backend.h"
get_backend parent="Meta.Backend" cheader_filename="meta/meta-backend.h"
Background cheader_filename="meta/meta-background.h"
Background.set_file.file nullable
BackgroundActor cheader_filename="meta/meta-background-actor.h"
BackgroundGroup cheader_filename="meta/meta-background-group.h"
BackgroundImage cheader_filename="meta/meta-background-image.h"
Expand All @@ -14,6 +16,7 @@ BarrierEvent cheader_filename="meta/barrier.h"
ButtonFunction cheader_filename="meta/common.h"
ButtonLayout cheader_filename="meta/common.h"
Compositor cheader_filename="meta/compositor.h"
Compositor.process_event.event type="X.Event" ref
Compositor.sync_stack.stack type_arguments="Meta.Window"
compositor_new cheader_filename="meta/compositor.h"
get_feedback_group_for_screen parent="Meta.Screen" symbol_type="method" name="get_feedback_group" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
Expand All @@ -23,17 +26,21 @@ get_window_group_for_screen parent="Meta.Screen" symbol_type="method" name="get_
disable_unredirect_for_screen parent="Meta.Screen" symbol_type="method" name="disable_unredirect" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
enable_unredirect_for_screen parent="Meta.Screen" symbol_type="method" name="enable_unredirect" instance_idx=0 cheader_filename="meta/compositor-mutter.h"

get_window_actors parent="Meta.Display" symbol_type="method" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
get_overlay_window parent="Meta.Display" symbol_type="method" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
set_stage_input_region parent="Meta.Display" symbol_type="method" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
empty_stage_input_region parent="Meta.Display" symbol_type="method" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
focus_stage_window parent="Meta.Display" symbol_type="method" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
get_window_actors parent="Meta.Screen" symbol_type="method" instance_idx=0 cheader_filename="meta/compositor-mutter.h" type_arguments="Meta.WindowActor"
get_overlay_window parent="Meta.Screen" symbol_type="method" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
set_stage_input_region parent="Meta.Screen" symbol_type="method" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
empty_stage_input_region parent="Meta.Screen" symbol_type="method" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
focus_stage_window parent="Meta.Screen" symbol_type="method" instance_idx=0 cheader_filename="meta/compositor-mutter.h"

CompEffect cheader_filename="meta/compositor.h"
CloseDialog cheader_filename="meta/meta-close-dialog.h"
CloseDialogResponse cheader_filename="meta/meta-close-dialog.h"
Cursor cheader_filename="meta/common.h"
CursorTracker cheader_filename="meta/meta-cursor-tracker.h"
CursorTracker.get_for_screen parent="Meta.Screen" symbol_type="method" instance_idx=0 name="get_cursor_tracker"
CursorTracker.get_pointer.x out
CursorTracker.get_pointer.y out
CursorTracker.get_pointer.mods out
DBusDisplayConfigSkeleton cheader_filename="meta/meta-monitor-manager.h"
DebugTopic cheader_filename="meta/util.h"
Direction cheader_filename="meta/common.h"
Expand All @@ -47,6 +54,7 @@ FrameFlags cheader_filename="meta/common.h"
FrameType cheader_filename="meta/common.h"
GrabOp cheader_filename="meta/common.h"
Group cheader_filename="meta/group.h"
Group.property_notify.event type="X.Event" ref
IdleMonitor cheader_filename="meta/meta-idle-monitor.h"
IdleMonitorWatchFunc cheader_filename="meta/meta-idle-monitor.h"
InhibitShortcutsDialog cheader_filename="meta/meta-inhibit-shortcuts-dialog.h"
Expand All @@ -66,11 +74,12 @@ MonitorSwitchConfigType cheader_filename="meta/meta-monitor-manager.h"
MotionDirection cheader_filename="meta/common.h"
PadActionType cheader_filename="meta/display.h"
Plugin cheader_filename="meta/meta-plugin.h"
Plugin.xevent_filter.event type="X.Event" ref
PluginInfo cheader_filename="meta/meta-plugin.h"
PluginVersion cheader_filename="meta/meta-plugin.h"
Preference cheader_filename="meta/prefs.h"
PrefsChangedFunc cheader_filename="meta/prefs.h"
Rectangle cheader_filename="meta/boxes.h"
Rectangle cheader_filename="meta/boxes.h" struct
Screen cheader_filename="meta/screen.h"
ScreenCorner cheader_filename="meta/screen.h"
ScreenDirection cheader_filename="meta/screen.h"
Expand Down Expand Up @@ -105,7 +114,7 @@ WindowMenuType cheader_filename="meta/compositor.h"
WindowShape cheader_filename="meta/meta-window-shape.h"
WindowType cheader_filename="meta/window.h"

rect parent="Meta.Rectangle" cheader_filename="meta/boxes.h" symbol_type="constructor" name="new"
rect skip
prefs_* parent="Meta.Prefs" name="prefs_(.+)" cheader_filename="meta/prefs.h"

g_utf8_strndup skip
Expand Down Expand Up @@ -148,6 +157,14 @@ pop_no_msg_prefix parent="Meta.Util" cheader_filename="meta/util.h"
push_no_msg_prefix parent="Meta.Util" cheader_filename="meta/util.h"
remove_verbose_topic parent="Meta.Util" cheader_filename="meta/util.h"
show_dialog parent="Meta.Util" cheader_filename="meta/util.h"
show_dialog.columns type_arguments="string" nullable default=null
show_dialog.entries type_arguments="string" nullable default=null
show_dialog.transient_for default=0
show_dialog.icon_name nullable default=null
show_dialog.cancel_text nullable default=null
show_dialog.ok_text nullable default=null
show_dialog.display nullable default=null
show_dialog.timeout nullable default=null
topic_real parent="Meta.Util" cheader_filename="meta/util.h"
unsigned_long_equal parent="Meta.Util" name="ulong_equal" cheader_filename="meta/util.h"
unsigned_long_equal.v1 type="ulong?"
Expand All @@ -156,8 +173,6 @@ unsigned_long_hash parent="Meta.Util" name="ulong_hash" cheader_filename="meta/u
unsigned_long_hash.v type="ulong?"
verbose_real parent="Meta.Util" cheader_filename="meta/util.h"
warning parent="Meta.Util" cheader_filename="meta/util.h"
show_dialog.columns type_arguments="string"
show_dialog.entries type_arguments="string"
set_gnome_wm_keybindings parent="Meta.Util"
set_wm_name parent="Meta.Util"

Expand Down

0 comments on commit 309d594

Please sign in to comment.