cleanup: Remove erroneous vfunc parameters

Unlike in C or signal handlers, vfuncs don't include the this-object
in their arguments.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/388
This commit is contained in:
Florian Müllner 2019-01-31 22:07:38 +01:00 committed by Florian Müllner
parent cdd2803498
commit 15e7625c80
7 changed files with 17 additions and 17 deletions

View File

@ -158,15 +158,15 @@ you to inherit from a type to use it, you can do so:
var MyClutterActor = GObject.registerClass( var MyClutterActor = GObject.registerClass(
class MyClutterActor extends Clutter.Actor { class MyClutterActor extends Clutter.Actor {
vfunc_get_preferred_width(actor, forHeight) { vfunc_get_preferred_width(forHeight) {
return [100, 100]; return [100, 100];
} }
vfunc_get_preferred_height(actor, forWidth) { vfunc_get_preferred_height(forWidth) {
return [100, 100]; return [100, 100];
} }
vfunc_paint(actor) { vfunc_paint() {
let alloc = this.get_allocation_box(); let alloc = this.get_allocation_box();
Cogl.set_source_color4ub(255, 0, 0, 255); Cogl.set_source_color4ub(255, 0, 0, 255);
Cogl.rectangle(alloc.x1, alloc.y1, Cogl.rectangle(alloc.x1, alloc.y1,

View File

@ -377,13 +377,13 @@ class IndicatorPad extends St.Widget {
super._init(); super._init();
} }
vfunc_get_preferred_width(container, forHeight) { vfunc_get_preferred_width(forHeight) {
if (this._source.visible) if (this._source.visible)
return this._source.get_preferred_width(forHeight); return this._source.get_preferred_width(forHeight);
return [0, 0]; return [0, 0];
} }
vfunc_get_preferred_height(container, forWidth) { vfunc_get_preferred_height(forWidth) {
if (this._source.visible) if (this._source.visible)
return this._source.get_preferred_height(forWidth); return this._source.get_preferred_height(forWidth);
return [0, 0]; return [0, 0];

View File

@ -30,7 +30,7 @@ var EdgeDragAction = GObject.registerClass({
return global.display.get_monitor_geometry(monitorIndex); return global.display.get_monitor_geometry(monitorIndex);
} }
vfunc_gesture_prepare(action, actor) { vfunc_gesture_prepare(actor) {
if (this.get_n_current_points() == 0) if (this.get_n_current_points() == 0)
return false; return false;
@ -46,7 +46,7 @@ var EdgeDragAction = GObject.registerClass({
(this._side == St.Side.BOTTOM && y > monitorRect.y + monitorRect.height - EDGE_THRESHOLD)); (this._side == St.Side.BOTTOM && y > monitorRect.y + monitorRect.height - EDGE_THRESHOLD));
} }
vfunc_gesture_progress(action, actor) { vfunc_gesture_progress(actor) {
let [startX, startY] = this.get_press_coords(0); let [startX, startY] = this.get_press_coords(0);
let [x, y] = this.get_motion_coords(0); let [x, y] = this.get_motion_coords(0);
let offsetX = Math.abs (x - startX); let offsetX = Math.abs (x - startX);
@ -66,7 +66,7 @@ var EdgeDragAction = GObject.registerClass({
return true; return true;
} }
vfunc_gesture_end(action, actor) { vfunc_gesture_end(actor) {
let [startX, startY] = this.get_press_coords(0); let [startX, startY] = this.get_press_coords(0);
let [x, y] = this.get_motion_coords(0); let [x, y] = this.get_motion_coords(0);
let monitorRect = this._getMonitorRect(startX, startY); let monitorRect = this._getMonitorRect(startX, startY);

View File

@ -62,14 +62,14 @@ var MouseSpriteContent = GObject.registerClass({
this._texture = null; this._texture = null;
} }
vfunc_get_preferred_size(content) { vfunc_get_preferred_size() {
if (!this._texture) if (!this._texture)
return [0, 0]; return [0, 0];
return [this._texture.get_width(), this._texture.get_height()]; return [this._texture.get_width(), this._texture.get_height()];
} }
vfunc_paint_content(content, actor, node) { vfunc_paint_content(actor, node) {
if (!this._texture) if (!this._texture)
return; return;

View File

@ -835,7 +835,7 @@ class Panel extends St.Widget {
this._updateSolidStyle(); this._updateSolidStyle();
} }
vfunc_get_preferred_width(actor, forHeight) { vfunc_get_preferred_width(forHeight) {
let primaryMonitor = Main.layoutManager.primaryMonitor; let primaryMonitor = Main.layoutManager.primaryMonitor;
if (primaryMonitor) if (primaryMonitor)

View File

@ -81,7 +81,7 @@ var ShowOverviewAction = GObject.registerClass({
}); });
} }
vfunc_gesture_prepare(action, actor) { vfunc_gesture_prepare(actor) {
return Main.actionMode == Shell.ActionMode.NORMAL && return Main.actionMode == Shell.ActionMode.NORMAL &&
this.get_n_current_points() == this.get_n_touch_points(); this.get_n_current_points() == this.get_n_touch_points();
} }
@ -115,12 +115,12 @@ var ShowOverviewAction = GObject.registerClass({
height: maxY - minY }); height: maxY - minY });
} }
vfunc_gesture_begin(action, actor) { vfunc_gesture_begin(actor) {
this._initialRect = this._getBoundingRect(false); this._initialRect = this._getBoundingRect(false);
return true; return true;
} }
vfunc_gesture_end(action, actor) { vfunc_gesture_end(actor) {
let rect = this._getBoundingRect(true); let rect = this._getBoundingRect(true);
let oldArea = this._initialRect.width * this._initialRect.height; let oldArea = this._initialRect.width * this._initialRect.height;
let newArea = rect.width * rect.height; let newArea = rect.width * rect.height;

View File

@ -599,7 +599,7 @@ var AppSwitchAction = GObject.registerClass({
}); });
} }
vfunc_gesture_prepare(action, actor) { vfunc_gesture_prepare(actor) {
if (Main.actionMode != Shell.ActionMode.NORMAL) { if (Main.actionMode != Shell.ActionMode.NORMAL) {
this.cancel(); this.cancel();
return false; return false;
@ -608,7 +608,7 @@ var AppSwitchAction = GObject.registerClass({
return this.get_n_current_points() <= 4; return this.get_n_current_points() <= 4;
} }
vfunc_gesture_begin(action, actor) { vfunc_gesture_begin(actor) {
// in milliseconds // in milliseconds
const LONG_PRESS_TIMEOUT = 250; const LONG_PRESS_TIMEOUT = 250;
@ -632,7 +632,7 @@ var AppSwitchAction = GObject.registerClass({
return this.get_n_current_points() <= 4; return this.get_n_current_points() <= 4;
} }
vfunc_gesture_progress(action, actor) { vfunc_gesture_progress(actor) {
const MOTION_THRESHOLD = 30; const MOTION_THRESHOLD = 30;
if (this.get_n_current_points() == 3) { if (this.get_n_current_points() == 3) {