Skip to content

Commit

Permalink
Move FileSystem API classes to js.html.fs.
Browse files Browse the repository at this point in the history
  • Loading branch information
aduros committed Dec 16, 2012
1 parent 43ae3a9 commit 7b34fee
Show file tree
Hide file tree
Showing 30 changed files with 111 additions and 78 deletions.
97 changes: 65 additions & 32 deletions bin/haxerenderer.py
Expand Up @@ -129,36 +129,66 @@
"VideoElement": "video",
}

# Web Audio classes (by grepping for WEB_AUDIO in the IDL database)
audio_classes = [
"AnalyserNode",
"AudioBuffer",
"AudioBufferCallback",
"AudioBufferSourceNode",
"AudioContext",
"AudioDestinationNode",
"AudioGain",
"AudioListener",
"AudioNode",
"AudioParam",
"AudioProcessingEvent",
"AudioSourceNode",
"BiquadFilterNode",
"ChannelMergerNode",
"ChannelSplitterNode",
"ConvolverNode",
"DelayNode",
"DynamicsCompressorNode",
"GainNode",
"MediaElementAudioSourceNode",
"MediaStreamAudioSourceNode",
"OfflineAudioCompletionEvent",
"OscillatorNode",
"PannerNode",
"ScriptProcessorNode",
"WaveShaperNode",
"WaveTable",
]
packaged_classes = {
"audio": [
# Web Audio classes (by grepping for WEB_AUDIO in the IDL database)
"AnalyserNode",
"AudioBuffer",
"AudioBufferCallback",
"AudioBufferSourceNode",
"AudioContext",
"AudioDestinationNode",
"AudioGain",
"AudioListener",
"AudioNode",
"AudioParam",
"AudioProcessingEvent",
"AudioSourceNode",
"BiquadFilterNode",
"ChannelMergerNode",
"ChannelSplitterNode",
"ConvolverNode",
"DelayNode",
"DynamicsCompressorNode",
"GainNode",
"MediaElementAudioSourceNode",
"MediaStreamAudioSourceNode",
"OfflineAudioCompletionEvent",
"OscillatorNode",
"PannerNode",
"ScriptProcessorNode",
"WaveShaperNode",
"WaveTable",
],
"fs": [
# FileSystem API classes (grep for FILE_SYSTEM)
# "DataTransferItem",
"DOMFileSystem",
"DOMFileSystemSync",
"DirectoryEntry",
"DirectoryEntrySync",
"DirectoryReader",
"DirectoryReaderSync",
"EntriesCallback",
"Entry",
"EntryArray",
"EntryArraySync",
"EntryCallback",
"EntrySync",
"ErrorCallback",
"FileCallback",
"FileEntry",
"FileEntrySync",
"FileError",
"FileException",
"FileSystemCallback",
"FileWriter",
"FileWriterCallback",
"FileWriterSync",
"Metadata",
"MetadataCallback",
],
}

# Merged class pairs
merged_targets = {
Expand Down Expand Up @@ -210,8 +240,11 @@ def to_haxe(id):
id = id[len("IDB"):]
path += ["idb"]

elif id in audio_classes:
path += ["audio"]
else:
for package, names in packaged_classes.iteritems():
if id in names:
path += [package]
break

path += [id]

Expand Down
4 changes: 2 additions & 2 deletions generated/js/html/DOMWindow.hx
Expand Up @@ -419,13 +419,13 @@ extern class DOMWindow extends EventTarget
@:overload(function (callback_ :RequestAnimationFrameCallback) :Int {})
function requestAnimationFrame (callback_ :RequestAnimationFrameCallback) :Int;

function requestFileSystem (type :Int, size :Int, successCallback :FileSystemCallback, ?errorCallback :ErrorCallback) :Void;
function requestFileSystem (type :Int, size :Int, successCallback :js.html.fs.FileSystemCallback, ?errorCallback :js.html.fs.ErrorCallback) :Void;

function resizeBy (x :Float, y :Float) :Void;

function resizeTo (width :Float, height :Float) :Void;

function resolveLocalFileSystemURL (url :String, successCallback :EntryCallback, ?errorCallback :ErrorCallback) :Void;
function resolveLocalFileSystemURL (url :String, successCallback :js.html.fs.EntryCallback, ?errorCallback :js.html.fs.ErrorCallback) :Void;

function scroll (x :Int, y :Int) :Void;

Expand Down
2 changes: 1 addition & 1 deletion generated/js/html/DataTransferItem.hx
Expand Up @@ -30,7 +30,7 @@ extern class DataTransferItem

var type (default,null) :String;

function getAsEntry () :Entry;
function getAsEntry () :js.html.fs.Entry;

function getAsFile () :Blob;

Expand Down
2 changes: 1 addition & 1 deletion generated/js/html/FileReader.hx
Expand Up @@ -46,7 +46,7 @@ extern class FileReader extends EventTarget
static inline var LOADING :Int = 1;

/** The error that occurred while reading the file. <strong>Read only.</strong> */
var error (default,null) :FileError;
var error (default,null) :js.html.fs.FileError;

/** Called when the read operation is aborted. */
var onabort :EventListener;
Expand Down
2 changes: 1 addition & 1 deletion generated/js/html/InputElement.hx
Expand Up @@ -75,7 +75,7 @@ extern class InputElement extends Element
HTML attribute, indicating that the control is not available for interaction. */
var disabled :Bool;

var entries (default,null) :EntryArray;
var entries (default,null) :js.html.fs.EntryArray;

/** A list of selected files. */
var files :FileList;
Expand Down
8 changes: 4 additions & 4 deletions generated/js/html/WorkerContext.hx
Expand Up @@ -54,13 +54,13 @@ extern class WorkerContext extends EventTarget

function openDatabaseSync (name :String, version :String, displayName :String, estimatedSize :Int, ?creationCallback :DatabaseCallback) :DatabaseSync;

function requestFileSystem (type :Int, size :Int, ?successCallback :FileSystemCallback, ?errorCallback :ErrorCallback) :Void;
function requestFileSystem (type :Int, size :Int, ?successCallback :js.html.fs.FileSystemCallback, ?errorCallback :js.html.fs.ErrorCallback) :Void;

function requestFileSystemSync (type :Int, size :Int) :DOMFileSystemSync;
function requestFileSystemSync (type :Int, size :Int) :js.html.fs.DOMFileSystemSync;

function resolveLocalFileSystemSyncURL (url :String) :EntrySync;
function resolveLocalFileSystemSyncURL (url :String) :js.html.fs.EntrySync;

function resolveLocalFileSystemURL (url :String, successCallback :EntryCallback, ?errorCallback :ErrorCallback) :Void;
function resolveLocalFileSystemURL (url :String, successCallback :js.html.fs.EntryCallback, ?errorCallback :js.html.fs.ErrorCallback) :Void;

function setInterval (handler :Void->Void, timeout :Int) :Int;

Expand Down
Expand Up @@ -21,7 +21,7 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

@:native("DOMFileSystem")
extern class DOMFileSystem
Expand Down
Expand Up @@ -21,7 +21,7 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

@:native("DOMFileSystemSync")
extern class DOMFileSystemSync
Expand Down
Expand Up @@ -21,7 +21,7 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

/** <div><strong>DRAFT</strong> <div>This page is not complete.</div>
</div>
Expand All @@ -36,6 +36,6 @@ extern class DirectoryEntry extends Entry

function getFile (path :String, ?options :Dynamic, ?successCallback :EntryCallback, ?errorCallback :ErrorCallback) :Void;

function removeRecursively (successCallback :VoidCallback, ?errorCallback :ErrorCallback) :Void;
function removeRecursively (successCallback :js.html.VoidCallback, ?errorCallback :ErrorCallback) :Void;

}
Expand Up @@ -21,7 +21,7 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

/** <div><strong>DRAFT</strong> <div>This page is not complete.</div>
</div>
Expand Down
Expand Up @@ -21,7 +21,7 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

/** <div><strong>`DRAFT</strong> <div>This page is not complete.</div>
</div>
Expand Down
Expand Up @@ -21,7 +21,7 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

/** <div><strong>`DRAFT</strong> <div>This page is not complete.</div>
</div>
Expand Down
Expand Up @@ -21,6 +21,6 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

typedef EntriesCallback = EntryArray -> Bool;
4 changes: 2 additions & 2 deletions generated/js/html/Entry.hx → generated/js/html/fs/Entry.hx
Expand Up @@ -21,7 +21,7 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

/** <div><strong>DRAFT</strong> <div>This page is not complete.</div>
</div>
Expand Down Expand Up @@ -52,7 +52,7 @@ extern class Entry

function moveTo (parent :DirectoryEntry, ?name :String, ?successCallback :EntryCallback, ?errorCallback :ErrorCallback) :Void;

function remove (successCallback :VoidCallback, ?errorCallback :ErrorCallback) :Void;
function remove (successCallback :js.html.VoidCallback, ?errorCallback :ErrorCallback) :Void;

function toURL () :String;

Expand Down
Expand Up @@ -21,7 +21,7 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

@:native("EntryArray")
extern class EntryArray implements ArrayAccess<Entry>
Expand Down
Expand Up @@ -21,7 +21,7 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

@:native("EntryArraySync")
extern class EntryArraySync implements ArrayAccess<EntrySync>
Expand Down
Expand Up @@ -21,6 +21,6 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

typedef EntryCallback = Entry -> Bool;
Expand Up @@ -21,7 +21,7 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

/** <div><strong>DRAFT</strong> <div>This page is not complete.</div>
</div>
Expand Down
Expand Up @@ -21,6 +21,6 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

typedef ErrorCallback = FileError -> Bool;
Expand Up @@ -21,6 +21,6 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

typedef FileCallback = File -> Bool;
typedef FileCallback = js.html.File -> Bool;
Expand Up @@ -21,7 +21,7 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

/** <div><strong>DRAFT</strong> <div>This page is not complete.</div>
</div>
Expand Down
Expand Up @@ -21,7 +21,7 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

/** <div><strong>DRAFT</strong> <div>This page is not complete.</div>
</div>
Expand All @@ -32,6 +32,6 @@ extern class FileEntrySync extends EntrySync
{
function createWriter () :FileWriterSync;

function file () :File;
function file () :js.html.File;

}
Expand Up @@ -21,7 +21,7 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

/** Represents an error that occurs while using the <code><a rel="custom" href="https://developer.mozilla.org/en/DOM/FileReader">FileReader</a></code>
interface.<br><br>
Expand Down
Expand Up @@ -21,7 +21,7 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

/** <strong>DRAFT</strong> <div>This page is not complete.</div><br><br>
Documentation for this class was provided by <a href="https://developer.mozilla.org/en/DOM/File_API/File_System_API/FileException">MDN</a>. */
Expand Down
Expand Up @@ -21,6 +21,6 @@
*/

// This file is generated, do not edit!
package js.html;
package js.html.fs;

typedef FileSystemCallback = DOMFileSystem -> Bool;

0 comments on commit 7b34fee

Please sign in to comment.