Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Commit

Permalink
Latest filesystem.widl and bondi.widl as examples.
Browse files Browse the repository at this point in the history
git-svn-id: http://widl.webvm.net/svn/widlproc/trunk@345 b2e84630-a466-403e-8074-5faad0055f28
  • Loading branch information
tpr committed Jul 15, 2009
1 parent 01aa73b commit 5bb03f7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
24 changes: 18 additions & 6 deletions examples/bondi.widl
Expand Up @@ -38,7 +38,7 @@ module bondi {
/**
* \brief Array of 16-bit signed integer values.
*/
typedef sequence<short> ShortArray;
typedef sequence<short> ShortArray;

/**
* \brief Array of 32-bit signed integer values.
Expand All @@ -50,20 +50,32 @@ module bondi {
*/
typedef sequence<float> FloatArray;

/**
* \brief Generic Map object.
*/
typedef Object Map;

/**
* \brief Generic success callback interface.
*/
[Callback] interface SuccessCallback {
[Callback=FunctionOnly, NoInterfaceObject] interface SuccessCallback {
void onSuccess(in Object ob);
};

/**
* \brief Generic error callback interface.
*/
[Callback] interface ErrorCallback {
void onError(in Error error);
[Callback=FunctionOnly, NoInterfaceObject] interface ErrorCallback {
void onError(in GenericError error);
};

/**
* \brief Generic error interface.
*
*
*/


interface GenericError {

/**
Expand All @@ -72,12 +84,12 @@ module bondi {
readonly attribute unsigned short code;
};


/**
* \brief Generic error interface.
* \brief DeviceApiError error interface.
*
* The error codes must be in the range 10000-19999.
*/

interface DeviceAPIError : GenericError {

/**
Expand Down
16 changes: 8 additions & 8 deletions examples/filesystem.widl
Expand Up @@ -75,7 +75,7 @@
* var docLocation = bondi.filesystem.getDefaultLocation("documents");
* var docDir = bondi.filesystem.resolve(docLocation);
* var docFiles = docDir.listFiles();
* for(var i = 0; i < docFiles.length; i++) {
* for(var i = 0; i &lt; docFiles.length; i++) {
* // displays name of each image file in image directory
* alert(docFiles[i].name);
* }
Expand Down Expand Up @@ -130,7 +130,7 @@ module filesystem {
* taking a File object as input argument. It is used in asynchronous
* operations such as copying, moving and deleting files.
*/
[Callback] interface FileSystemSuccessCallback {
[Callback=FunctionOnly, NoInterfaceObject] interface FileSystemSuccessCallback {
void onSuccess(in File file);
};

Expand All @@ -151,7 +151,7 @@ module filesystem {
* var docLocation = bondi.filesystem.getDefaultLocation("documents");
* var docDir = bondi.filesystem.resolve(docLocation);
* var docFiles = docDir.listFiles();
* for(var i = 0; i < docFiles.length; i++) {
* for(var i = 0; i &lt; docFiles.length; i++) {
* // displays name of each image file in image directory
* alert(docFiles[i].name);
* }
Expand Down Expand Up @@ -235,7 +235,7 @@ module filesystem {
*
* \code
* var locations = bondi.filesystem.getRootLocations();
* for(var i = 0; i < locations.length; i++) {
* for(var i = 0; i &lt; locations.length; i++) {
* // locations[i] is a resolvable root location
* }
* \endcode
Expand Down Expand Up @@ -365,7 +365,7 @@ module filesystem {
*
* // list directory contents
* var files = dir.listFiles();
* for(var i = 0; i < files.length; i++) {
* for(var i = 0; i &lt; files.length; i++) {
* // alerts each name of dir's contents
* alert(files[i].name);
* }
Expand Down Expand Up @@ -570,7 +570,7 @@ module filesystem {
*
* \code
* var files = dir.listFiles();
* for(var i = 0; i < files.length; i++) {
* for(var i = 0; i &lt; files.length; i++) {
* // files[i] iterate over all files of this directory
* }
* \endcode
Expand Down Expand Up @@ -626,7 +626,7 @@ module filesystem {
*
* \code
* // copies this file to /temp/file.copy
* var op = file.copyTo(function(copiedFile) { ... }, null, "/temp/file.copy", false);
* var op = file.copyTo(function(copiedFile) { alert("file copied"); }, null, "/temp/file.copy", false);
* \endcode
*
* \param successCallback called when the file has been copied.
Expand Down Expand Up @@ -937,7 +937,7 @@ module filesystem {
* \code
* // reads up to 256 bytes from the stream
* var raw = stream.readBytes(256);
* for(var i = 0; i < raw.length; i++) {
* for(var i = 0; i &lt; raw.length; i++) {
* // raw[i] contains the i-th byte of the current data chunk
* }
* \endcode
Expand Down

0 comments on commit 5bb03f7

Please sign in to comment.