Port everything to class framework

The last patch in the sequence. Every place that was previously
setting prototype has been ported to Lang.Class, to make code more
concise and allow for better toString().

https://bugzilla.gnome.org/show_bug.cgi?id=664436
This commit is contained in:
Giovanni Campagna
2011-11-20 18:56:27 +01:00
parent 0996174b3d
commit 17c46c2452
48 changed files with 295 additions and 489 deletions

View File

@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Gio = imports.gi.Gio;
const Lang = imports.lang;
const Main = imports.ui.main;
const MAG_SERVICE_NAME = 'org.gnome.Magnifier';
@ -95,11 +96,9 @@ const ZoomRegionIface = <interface name={ZOOM_SERVICE_NAME}>
// '/org/gnome/Magnifier/ZoomRegion/zoomer1', etc.
let _zoomRegionInstanceCount = 0;
function ShellMagnifier() {
this._init();
}
const ShellMagnifier = new Lang.Class({
Name: 'ShellMagnifier',
ShellMagnifier.prototype = {
_init: function() {
this._zoomers = {};
@ -325,7 +324,7 @@ ShellMagnifier.prototype = {
// Drop the leading '#'.
return parseInt(colorString.slice(1), 16);
}
};
});
/**
* ShellMagnifierZoomRegion:
@ -333,11 +332,9 @@ ShellMagnifier.prototype = {
* @zoomerObjectPath: String that is the path to a DBus ZoomRegion.
* @zoomRegion: The actual zoom region associated with the object path.
*/
function ShellMagnifierZoomRegion(zoomerObjectPath, zoomRegion) {
this._init(zoomerObjectPath, zoomRegion);
}
const ShellMagnifierZoomRegion = new Lang.Class({
Name: 'ShellMagnifierZoomRegion',
ShellMagnifierZoomRegion.prototype = {
_init: function(zoomerObjectPath, zoomRegion) {
this._zoomRegion = zoomRegion;
@ -422,4 +419,4 @@ ShellMagnifierZoomRegion.prototype = {
destroy: function() {
this._dbusImpl.unexport();
}
};
});