Commit e5beeb65 authored by rdsmith@chromium.org's avatar rdsmith@chromium.org

Revert 182285

> Revert 182242
> > Files.app: Add missing JSdoc for member methods/variables #1.
> > 
> > All the changes are in comment. No semantics are changed.
> > 
> > BUG=175657
> > TEST=none
> > TBR=mtomasz@chromium.org
> > 
> > Review URL: https://codereview.chromium.org/12254009
> 
> TBR=yoshiki@chromium.org
> Review URL: https://codereview.chromium.org/12254015

TBR=rdsmith@chromium.org
Review URL: https://codereview.chromium.org/12262017

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182298 0039d316-1c4b-4281-b951-d872f2087c98
parent 02983a05
...@@ -30,7 +30,9 @@ ImageEditor.Mode.Adjust.prototype.cleanUpUI = function() { ...@@ -30,7 +30,9 @@ ImageEditor.Mode.Adjust.prototype.cleanUpUI = function() {
this.hidePreview(); this.hidePreview();
}; };
//TODO(JSDOC) /**
* TODO(JSDOC)
*/
ImageEditor.Mode.Adjust.prototype.hidePreview = function() { ImageEditor.Mode.Adjust.prototype.hidePreview = function() {
if (this.canvas_) { if (this.canvas_) {
this.canvas_.parentNode.removeChild(this.canvas_); this.canvas_.parentNode.removeChild(this.canvas_);
...@@ -38,20 +40,27 @@ ImageEditor.Mode.Adjust.prototype.hidePreview = function() { ...@@ -38,20 +40,27 @@ ImageEditor.Mode.Adjust.prototype.hidePreview = function() {
} }
}; };
//TODO(JSDOC) /**
* TODO(JSDOC)
*/
ImageEditor.Mode.Adjust.prototype.cleanUpCaches = function() { ImageEditor.Mode.Adjust.prototype.cleanUpCaches = function() {
this.filter_ = null; this.filter_ = null;
this.previewImageData_ = null; this.previewImageData_ = null;
}; };
//TODO(JSDOC) /**
* TODO(JSDOC)
*/
ImageEditor.Mode.Adjust.prototype.reset = function() { ImageEditor.Mode.Adjust.prototype.reset = function() {
ImageEditor.Mode.prototype.reset.call(this); ImageEditor.Mode.prototype.reset.call(this);
this.hidePreview(); this.hidePreview();
this.cleanUpCaches(); this.cleanUpCaches();
}; };
//TODO(JSDOC) /**
* TODO(JSDOC)
* @param {Object} options //TODO(JSDOC).
*/
ImageEditor.Mode.Adjust.prototype.update = function(options) { ImageEditor.Mode.Adjust.prototype.update = function(options) {
ImageEditor.Mode.prototype.update.apply(this, arguments); ImageEditor.Mode.prototype.update.apply(this, arguments);
...@@ -90,7 +99,11 @@ ImageEditor.Mode.Adjust.prototype.updatePreviewImage = function() { ...@@ -90,7 +99,11 @@ ImageEditor.Mode.Adjust.prototype.updatePreviewImage = function() {
* Own methods * Own methods
*/ */
//TODO(JSDOC) /**
* TODO(JSDOC)
* @param {Object} options //TODO(JSDOC).
* @return {function(ImageData,ImageData,number,number)} Created function.
*/
ImageEditor.Mode.Adjust.prototype.createFilter = function(options) { ImageEditor.Mode.Adjust.prototype.createFilter = function(options) {
return filter.create(this.name, options); return filter.create(this.name, options);
}; };
...@@ -106,6 +119,11 @@ ImageEditor.Mode.ColorFilter = function() { ...@@ -106,6 +119,11 @@ ImageEditor.Mode.ColorFilter = function() {
ImageEditor.Mode.ColorFilter.prototype = ImageEditor.Mode.ColorFilter.prototype =
{__proto__: ImageEditor.Mode.Adjust.prototype}; {__proto__: ImageEditor.Mode.Adjust.prototype};
/**
* TODO(JSDOC)
* @return {{r: Array.<number>, g: Array.<number>, b: Array.<number>}}
* histogram.
*/
ImageEditor.Mode.ColorFilter.prototype.getHistogram = function() { ImageEditor.Mode.ColorFilter.prototype.getHistogram = function() {
return filter.getHistogram(this.getImageView().getThumbnail()); return filter.getHistogram(this.getImageView().getThumbnail());
}; };
...@@ -121,6 +139,10 @@ ImageEditor.Mode.Exposure = function() { ...@@ -121,6 +139,10 @@ ImageEditor.Mode.Exposure = function() {
ImageEditor.Mode.Exposure.prototype = ImageEditor.Mode.Exposure.prototype =
{__proto__: ImageEditor.Mode.ColorFilter.prototype}; {__proto__: ImageEditor.Mode.ColorFilter.prototype};
/**
* TODO(JSDOC)
* @param {ImageEditor.Toolbar} toolbar The toolbar to populate.
*/
ImageEditor.Mode.Exposure.prototype.createTools = function(toolbar) { ImageEditor.Mode.Exposure.prototype.createTools = function(toolbar) {
toolbar.addRange('brightness', -1, 0, 1, 100); toolbar.addRange('brightness', -1, 0, 1, 100);
toolbar.addRange('contrast', -1, 0, 1, 100); toolbar.addRange('contrast', -1, 0, 1, 100);
...@@ -138,16 +160,27 @@ ImageEditor.Mode.Autofix = function() { ...@@ -138,16 +160,27 @@ ImageEditor.Mode.Autofix = function() {
ImageEditor.Mode.Autofix.prototype = ImageEditor.Mode.Autofix.prototype =
{__proto__: ImageEditor.Mode.ColorFilter.prototype}; {__proto__: ImageEditor.Mode.ColorFilter.prototype};
/**
* TODO(JSDOC)
* @param {ImageEditor.Toolbar} toolbar The toolbar to populate.
*/
ImageEditor.Mode.Autofix.prototype.createTools = function(toolbar) { ImageEditor.Mode.Autofix.prototype.createTools = function(toolbar) {
var self = this; var self = this;
toolbar.addButton('Apply', this.apply.bind(this)); toolbar.addButton('Apply', this.apply.bind(this));
}; };
/**
* TODO(JSDOC)
* @return {boolean} //TODO(JSDOC)
*/
ImageEditor.Mode.Autofix.prototype.isApplicable = function() { ImageEditor.Mode.Autofix.prototype.isApplicable = function() {
return this.getImageView().hasValidImage() && return this.getImageView().hasValidImage() &&
filter.autofix.isApplicable(this.getHistogram()); filter.autofix.isApplicable(this.getHistogram());
}; };
/**
* TODO(JSDOC)
*/
ImageEditor.Mode.Autofix.prototype.apply = function() { ImageEditor.Mode.Autofix.prototype.apply = function() {
this.update({histogram: this.getHistogram()}); this.update({histogram: this.getHistogram()});
}; };
...@@ -164,6 +197,9 @@ ImageEditor.Mode.InstantAutofix = function() { ...@@ -164,6 +197,9 @@ ImageEditor.Mode.InstantAutofix = function() {
ImageEditor.Mode.InstantAutofix.prototype = ImageEditor.Mode.InstantAutofix.prototype =
{__proto__: ImageEditor.Mode.Autofix.prototype}; {__proto__: ImageEditor.Mode.Autofix.prototype};
/**
* TODO(JSDOC)
*/
ImageEditor.Mode.InstantAutofix.prototype.setUp = function() { ImageEditor.Mode.InstantAutofix.prototype.setUp = function() {
ImageEditor.Mode.Autofix.prototype.setUp.apply(this, arguments); ImageEditor.Mode.Autofix.prototype.setUp.apply(this, arguments);
this.apply(); this.apply();
...@@ -180,6 +216,10 @@ ImageEditor.Mode.Blur = function() { ...@@ -180,6 +216,10 @@ ImageEditor.Mode.Blur = function() {
ImageEditor.Mode.Blur.prototype = ImageEditor.Mode.Blur.prototype =
{__proto__: ImageEditor.Mode.Adjust.prototype}; {__proto__: ImageEditor.Mode.Adjust.prototype};
/**
* TODO(JSDOC)
* @param {ImageEditor.Toolbar} toolbar The toolbar to populate.
*/
ImageEditor.Mode.Blur.prototype.createTools = function(toolbar) { ImageEditor.Mode.Blur.prototype.createTools = function(toolbar) {
toolbar.addRange('strength', 0, 0, 1, 100); toolbar.addRange('strength', 0, 0, 1, 100);
toolbar.addRange('radius', 1, 1, 3); toolbar.addRange('radius', 1, 1, 3);
...@@ -196,6 +236,10 @@ ImageEditor.Mode.Sharpen = function() { ...@@ -196,6 +236,10 @@ ImageEditor.Mode.Sharpen = function() {
ImageEditor.Mode.Sharpen.prototype = ImageEditor.Mode.Sharpen.prototype =
{__proto__: ImageEditor.Mode.Adjust.prototype}; {__proto__: ImageEditor.Mode.Adjust.prototype};
/**
* TODO(JSDOC)
* @param {ImageEditor.Toolbar} toolbar The toolbar to populate.
*/
ImageEditor.Mode.Sharpen.prototype.createTools = function(toolbar) { ImageEditor.Mode.Sharpen.prototype.createTools = function(toolbar) {
toolbar.addRange('strength', 0, 0, 1, 100); toolbar.addRange('strength', 0, 0, 1, 100);
toolbar.addRange('radius', 1, 1, 3); toolbar.addRange('radius', 1, 1, 3);
......
...@@ -13,7 +13,10 @@ function ImageBuffer() { ...@@ -13,7 +13,10 @@ function ImageBuffer() {
this.overlays_ = []; this.overlays_ = [];
} }
//TODO(JSDOC) /**
* TODO(JSDOC).
* @param {ImageBuffer.Overlay} overlay //TODO(JSDOC).
*/
ImageBuffer.prototype.addOverlay = function(overlay) { ImageBuffer.prototype.addOverlay = function(overlay) {
var zIndex = overlay.getZIndex(); var zIndex = overlay.getZIndex();
// Store the overlays in the ascending Z-order. // Store the overlays in the ascending Z-order.
...@@ -24,7 +27,10 @@ ImageBuffer.prototype.addOverlay = function(overlay) { ...@@ -24,7 +27,10 @@ ImageBuffer.prototype.addOverlay = function(overlay) {
this.overlays_.splice(i, 0, overlay); this.overlays_.splice(i, 0, overlay);
}; };
//TODO(JSDOC) /**
* TODO(JSDOC).
* @param {ImageBuffer.Overlay} overlay //TODO(JSDOC).
*/
ImageBuffer.prototype.removeOverlay = function(overlay) { ImageBuffer.prototype.removeOverlay = function(overlay) {
for (var i = 0; i != this.overlays_.length; i++) { for (var i = 0; i != this.overlays_.length; i++) {
if (this.overlays_[i] == overlay) { if (this.overlays_[i] == overlay) {
...@@ -119,25 +125,58 @@ ImageBuffer.DoubleTapAction = { ...@@ -119,25 +125,58 @@ ImageBuffer.DoubleTapAction = {
* and the behavior of the ImageBuffer instance. * and the behavior of the ImageBuffer instance.
* @class * @class
*/ */
//TODO(JSDOC)
ImageBuffer.Overlay = function() {}; ImageBuffer.Overlay = function() {};
//TODO(JSDOC) /**
* TODO(JSDOC).
* @return {number} //TODO(JSDOC).
*/
ImageBuffer.Overlay.prototype.getZIndex = function() { return 0 }; ImageBuffer.Overlay.prototype.getZIndex = function() { return 0 };
//TODO(JSDOC) /**
* TODO(JSDOC).
*/
ImageBuffer.Overlay.prototype.draw = function() {}; ImageBuffer.Overlay.prototype.draw = function() {};
//TODO(JSDOC) /**
ImageBuffer.Overlay.prototype.getCursorStyle = function() { return null }; * TODO(JSDOC).
* @param {number} x X coordinate for cursor.
* @param {number} y Y coordinate for cursor.
* @param {boolean} mouseDown If mouse button is down.
* @return {?string} A value for style.cursor CSS property or null for
* default.
*/
ImageBuffer.Overlay.prototype.getCursorStyle = function(x, y, mouseDown) {
return null;
};
//TODO(JSDOC) /**
ImageBuffer.Overlay.prototype.onClick = function() { return false }; * TODO(JSDOC).
* @param {number} x //TODO(JSDOC).
* @param {number} y //TODO(JSDOC).
* @return {boolean} //TODO(JSDOC).
*/
ImageBuffer.Overlay.prototype.onClick = function(x, y) {
return false;
};
//TODO(JSDOC) /**
ImageBuffer.Overlay.prototype.getDragHandler = function() { return null }; * TODO(JSDOC).
* @param {number} x Event X coordinate.
* @param {number} y Event Y coordinate.
* @param {boolean} touch True if it's a touch event, false if mouse.
* @return {function(number,number)} A function to be called on mouse drag.
*/
ImageBuffer.Overlay.prototype.getDragHandler = function(x, y, touch) {
return null;
};
//TODO(JSDOC) /**
* TODO(JSDOC).
* @param {number} x //TODO(JSDOC).
* @param {number} y //TODO(JSDOC).
* @return {ImageBuffer.DoubleTapAction} //TODO(JSDOC).
*/
ImageBuffer.Overlay.prototype.getDoubleTapAction = function(x, y) { ImageBuffer.Overlay.prototype.getDoubleTapAction = function(x, y) {
return ImageBuffer.DoubleTapAction.NOTHING; return ImageBuffer.DoubleTapAction.NOTHING;
}; };
...@@ -7,10 +7,16 @@ ...@@ -7,10 +7,16 @@
*/ */
function ImageEncoder() {} function ImageEncoder() {}
//TODO(JSDOC) /**
* @type {Array.<Object>}
*/
ImageEncoder.metadataEncoders = {}; ImageEncoder.metadataEncoders = {};
//TODO(JSDOC) /**
* @param {function(new:ImageEncoder.MetadataEncoder)} constructor
* //TODO(JSDOC).
* @param {string} mimeType //TODO(JSDOC).
*/
ImageEncoder.registerMetadataEncoder = function(constructor, mimeType) { ImageEncoder.registerMetadataEncoder = function(constructor, mimeType) {
ImageEncoder.metadataEncoders[mimeType] = constructor; ImageEncoder.metadataEncoders[mimeType] = constructor;
}; };
...@@ -141,6 +147,13 @@ ImageEncoder.createThumbnail = function(canvas, opt_shrinkage) { ...@@ -141,6 +147,13 @@ ImageEncoder.createThumbnail = function(canvas, opt_shrinkage) {
return thumbnailCanvas; return thumbnailCanvas;
}; };
/**
* TODO(JSDOC)
* @param {string} string //TODO(JSDOC).
* @param {number} from //TODO(JSDOC).
* @param {number} to //TODO(JSDOC).
* @return {ArrayBuffer} //TODO(JSDOC).
*/
ImageEncoder.stringToArrayBuffer = function(string, from, to) { ImageEncoder.stringToArrayBuffer = function(string, from, to) {
var size = to - from; var size = to - from;
var array = new Uint8Array(size); var array = new Uint8Array(size);
...@@ -168,6 +181,10 @@ ImageEncoder.MetadataEncoder = function(original_metadata) { ...@@ -168,6 +181,10 @@ ImageEncoder.MetadataEncoder = function(original_metadata) {
} }
}; };
/**
* TODO(JSDOC)
* @return {Object} //TODO(JSDOC).
*/
ImageEncoder.MetadataEncoder.prototype.getMetadata = function() { ImageEncoder.MetadataEncoder.prototype.getMetadata = function() {
return this.metadata_; return this.metadata_;
}; };
......
...@@ -12,6 +12,9 @@ ImageEditor.Mode.Crop = function() { ...@@ -12,6 +12,9 @@ ImageEditor.Mode.Crop = function() {
ImageEditor.Mode.Crop.prototype = {__proto__: ImageEditor.Mode.prototype}; ImageEditor.Mode.Crop.prototype = {__proto__: ImageEditor.Mode.prototype};
/**
* TODO(JSDOC).
*/
ImageEditor.Mode.Crop.prototype.setUp = function() { ImageEditor.Mode.Crop.prototype.setUp = function() {
ImageEditor.Mode.prototype.setUp.apply(this, arguments); ImageEditor.Mode.prototype.setUp.apply(this, arguments);
...@@ -65,11 +68,17 @@ ImageEditor.Mode.Crop.prototype.setUp = function() { ...@@ -65,11 +68,17 @@ ImageEditor.Mode.Crop.prototype.setUp = function() {
this.createDefaultCrop(); this.createDefaultCrop();
}; };
/**
* TODO(JSDOC).
*/
ImageEditor.Mode.Crop.prototype.reset = function() { ImageEditor.Mode.Crop.prototype.reset = function() {
ImageEditor.Mode.prototype.reset.call(this); ImageEditor.Mode.prototype.reset.call(this);
this.createDefaultCrop(); this.createDefaultCrop();
}; };
/**
* TODO(JSDOC).
*/
ImageEditor.Mode.Crop.prototype.positionDOM = function() { ImageEditor.Mode.Crop.prototype.positionDOM = function() {
var screenClipped = this.viewport_.getScreenClipped(); var screenClipped = this.viewport_.getScreenClipped();
...@@ -95,6 +104,9 @@ ImageEditor.Mode.Crop.prototype.positionDOM = function() { ...@@ -95,6 +104,9 @@ ImageEditor.Mode.Crop.prototype.positionDOM = function() {
(screenCrop.top + screenCrop.height) + 'px'; (screenCrop.top + screenCrop.height) + 'px';
}; };
/**
* TODO(JSDOC).
*/
ImageEditor.Mode.Crop.prototype.cleanUpUI = function() { ImageEditor.Mode.Crop.prototype.cleanUpUI = function() {
ImageEditor.Mode.prototype.cleanUpUI.apply(this, arguments); ImageEditor.Mode.prototype.cleanUpUI.apply(this, arguments);
this.domOverlay_.parentNode.removeChild(this.domOverlay_); this.domOverlay_.parentNode.removeChild(this.domOverlay_);
...@@ -102,14 +114,29 @@ ImageEditor.Mode.Crop.prototype.cleanUpUI = function() { ...@@ -102,14 +114,29 @@ ImageEditor.Mode.Crop.prototype.cleanUpUI = function() {
this.editor_.hideOverlappingTools(); this.editor_.hideOverlappingTools();
}; };
/**
* @const
* @type {number}
*/
ImageEditor.Mode.Crop.MOUSE_GRAB_RADIUS = 6; ImageEditor.Mode.Crop.MOUSE_GRAB_RADIUS = 6;
/**
* @const
* @type {number}
*/
ImageEditor.Mode.Crop.TOUCH_GRAB_RADIUS = 20; ImageEditor.Mode.Crop.TOUCH_GRAB_RADIUS = 20;
/**
* TODO(JSDOC).
* @return {Command.Crop} //TODO(JSDOC).
*/
ImageEditor.Mode.Crop.prototype.getCommand = function() { ImageEditor.Mode.Crop.prototype.getCommand = function() {
var cropImageRect = this.cropRect_.getRect(); var cropImageRect = this.cropRect_.getRect();
return new Command.Crop(cropImageRect); return new Command.Crop(cropImageRect);
}; };
/**
* TODO(JSDOC).
*/
ImageEditor.Mode.Crop.prototype.createDefaultCrop = function() { ImageEditor.Mode.Crop.prototype.createDefaultCrop = function() {
var rect = new Rect(this.getViewport().getImageClipped()); var rect = new Rect(this.getViewport().getImageClipped());
rect = rect.inflate( rect = rect.inflate(
...@@ -118,10 +145,24 @@ ImageEditor.Mode.Crop.prototype.createDefaultCrop = function() { ...@@ -118,10 +145,24 @@ ImageEditor.Mode.Crop.prototype.createDefaultCrop = function() {
this.positionDOM(); this.positionDOM();
}; };
/**
* TODO(JSDOC).
* @param {number} x X coordinate for cursor.
* @param {number} y Y coordinate for cursor.
* @param {boolean} mouseDown If mouse button is down.
* @return {string} A value for style.cursor CSS property.
*/
ImageEditor.Mode.Crop.prototype.getCursorStyle = function(x, y, mouseDown) { ImageEditor.Mode.Crop.prototype.getCursorStyle = function(x, y, mouseDown) {
return this.cropRect_.getCursorStyle(x, y, mouseDown); return this.cropRect_.getCursorStyle(x, y, mouseDown);
}; };
/**
* TODO(JSDOC).
* @param {number} x Event X coordinate.
* @param {number} y Event Y coordinate.
* @param {boolean} touch True if it's a touch event, false if mouse.
* @return {function(number,number)} A function to be called on mouse drag.
*/
ImageEditor.Mode.Crop.prototype.getDragHandler = function(x, y, touch) { ImageEditor.Mode.Crop.prototype.getDragHandler = function(x, y, touch) {
var cropDragHandler = this.cropRect_.getDragHandler(x, y, touch); var cropDragHandler = this.cropRect_.getDragHandler(x, y, touch);
if (!cropDragHandler) return null; if (!cropDragHandler) return null;
...@@ -134,6 +175,12 @@ ImageEditor.Mode.Crop.prototype.getDragHandler = function(x, y, touch) { ...@@ -134,6 +175,12 @@ ImageEditor.Mode.Crop.prototype.getDragHandler = function(x, y, touch) {
}; };
}; };
/**
* TODO(JSDOC).
* @param {number} x X coordinate of the event.
* @param {number} y Y coordinate of the event.
* @return {ImageBuffer.DoubleTapAction} Action to perform as result.
*/
ImageEditor.Mode.Crop.prototype.getDoubleTapAction = function(x, y) { ImageEditor.Mode.Crop.prototype.getDoubleTapAction = function(x, y) {
return this.cropRect_.getDoubleTapAction(x, y); return this.cropRect_.getDoubleTapAction(x, y);
}; };
...@@ -141,7 +188,7 @@ ImageEditor.Mode.Crop.prototype.getDoubleTapAction = function(x, y) { ...@@ -141,7 +188,7 @@ ImageEditor.Mode.Crop.prototype.getDoubleTapAction = function(x, y) {
/* /*
* A draggable rectangle over the image. * A draggable rectangle over the image.
*/ */
//TODO(JSDOC) //TODO(JSDOC).
function DraggableRect(rect, viewport, sensitivity) { function DraggableRect(rect, viewport, sensitivity) {
// The bounds are not held in a regular rectangle (with width/height). // The bounds are not held in a regular rectangle (with width/height).
...@@ -171,36 +218,79 @@ function DraggableRect(rect, viewport, sensitivity) { ...@@ -171,36 +218,79 @@ function DraggableRect(rect, viewport, sensitivity) {
} }
// Static members to simplify reflective access to the bounds. // Static members to simplify reflective access to the bounds.
/**
* @const
* @type {string}
*/
DraggableRect.LEFT = 'left'; DraggableRect.LEFT = 'left';
/**
* @const
* @type {string}
*/
DraggableRect.RIGHT = 'right'; DraggableRect.RIGHT = 'right';
/**
* @const
* @type {string}
*/
DraggableRect.TOP = 'top'; DraggableRect.TOP = 'top';
/**
* @const
* @type {string}
*/
DraggableRect.BOTTOM = 'bottom'; DraggableRect.BOTTOM = 'bottom';
/**
* @const
* @type {string}
*/
DraggableRect.NONE = 'none'; DraggableRect.NONE = 'none';
//TODO(JSDOC) /**
* TODO(JSDOC)
* @return {number} //TODO(JSDOC).
*/
DraggableRect.prototype.getLeft = function() { DraggableRect.prototype.getLeft = function() {
return this.bounds_[DraggableRect.LEFT]; return this.bounds_[DraggableRect.LEFT];
}; };
//TODO(JSDOC) /**
* TODO(JSDOC)
* @return {number} //TODO(JSDOC).
*/
DraggableRect.prototype.getRight = function() { DraggableRect.prototype.getRight = function() {
return this.bounds_[DraggableRect.RIGHT]; return this.bounds_[DraggableRect.RIGHT];
}; };
//TODO(JSDOC) /**
* TODO(JSDOC)
* @return {number} //TODO(JSDOC).
*/
DraggableRect.prototype.getTop = function() { DraggableRect.prototype.getTop = function() {
return this.bounds_[DraggableRect.TOP]; return this.bounds_[DraggableRect.TOP];
}; };
//TODO(JSDOC) /**
* TODO(JSDOC)
* @return {number} //TODO(JSDOC).
*/
DraggableRect.prototype.getBottom = function() { DraggableRect.prototype.getBottom = function() {
return this.bounds_[DraggableRect.BOTTOM]; return this.bounds_[DraggableRect.BOTTOM];
}; };
//TODO(JSDOC) /**
DraggableRect.prototype.getRect = function() { return new Rect(this.bounds_) }; * TODO(JSDOC)
* @return {Rect} //TODO(JSDOC).
*/
DraggableRect.prototype.getRect = function() {
return new Rect(this.bounds_);
};
//TODO(JSDOC) /**
* TODO(JSDOC)
* @param {number} x X coordinate for cursor.
* @param {number} y Y coordinate for cursor.
* @param {boolean} touch //TODO(JSDOC).
* @return {Object} //TODO(JSDOC).
*/
DraggableRect.prototype.getDragMode = function(x, y, touch) { DraggableRect.prototype.getDragMode = function(x, y, touch) {
var result = { var result = {
xSide: DraggableRect.NONE, xSide: DraggableRect.NONE,
...@@ -248,6 +338,13 @@ DraggableRect.prototype.getDragMode = function(x, y, touch) { ...@@ -248,6 +338,13 @@ DraggableRect.prototype.getDragMode = function(x, y, touch) {
return result; return result;
}; };
/**
* TODO(JSDOC)
* @param {number} x X coordinate for cursor.
* @param {number} y Y coordinate for cursor.
* @param {boolean} mouseDown If mouse button is down.
* @return {string} //TODO(JSDOC).
*/
DraggableRect.prototype.getCursorStyle = function(x, y, mouseDown) { DraggableRect.prototype.getCursorStyle = function(x, y, mouseDown) {
var mode; var mode;
if (mouseDown) { if (mouseDown) {
...@@ -261,6 +358,13 @@ DraggableRect.prototype.getCursorStyle = function(x, y, mouseDown) { ...@@ -261,6 +358,13 @@ DraggableRect.prototype.getCursorStyle = function(x, y, mouseDown) {
return this.cssSide_[mode.ySide] + this.cssSide_[mode.xSide] + '-resize'; return this.cssSide_[mode.ySide] + this.cssSide_[mode.xSide] + '-resize';
}; };
/**
* TODO(JSDOC)
* @param {number} x X coordinate for cursor.
* @param {number} y Y coordinate for cursor.
* @param {boolean} touch //TODO(JSDOC).
* @return {function(number,number)} //TODO(JSDOC).
*/
DraggableRect.prototype.getDragHandler = function(x, y, touch) { DraggableRect.prototype.getDragHandler = function(x, y, touch) {
x = this.viewport_.screenToImageX(x); x = this.viewport_.screenToImageX(x);
y = this.viewport_.screenToImageY(y); y = this.viewport_.screenToImageY(y);
...@@ -355,6 +459,13 @@ DraggableRect.prototype.getDragHandler = function(x, y, touch) { ...@@ -355,6 +459,13 @@ DraggableRect.prototype.getDragHandler = function(x, y, touch) {
}; };
}; };
/**
* TODO(JSDOC)
* @param {number} x X coordinate for cursor.
* @param {number} y Y coordinate for cursor.
* @param {boolean} touch //TODO(JSDOC).
* @return {ImageBuffer.DoubleTapAction} //TODO(JSDOC).
*/
DraggableRect.prototype.getDoubleTapAction = function(x, y, touch) { DraggableRect.prototype.getDoubleTapAction = function(x, y, touch) {
x = this.viewport_.screenToImageX(x); x = this.viewport_.screenToImageX(x);
y = this.viewport_.screenToImageY(y); y = this.viewport_.screenToImageY(y);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment