add Text interface

This commit is contained in:
Vincent Sanders 2012-11-07 18:52:30 +00:00
parent 43fb761f45
commit ca24b238ed
4 changed files with 57 additions and 0 deletions

View File

@ -19,6 +19,7 @@ JSAPI_BINDING_console := javascript/jsapi/console.bnd
JSAPI_BINDING_location := javascript/jsapi/location.bnd
JSAPI_BINDING_htmlcollection := javascript/jsapi/htmlcollection.bnd
JSAPI_BINDING_nodelist := javascript/jsapi/nodelist.bnd
JSAPI_BINDING_text := javascript/jsapi/text.bnd
# 1: input file
# 2: output file

View File

@ -2,6 +2,8 @@
webidlfile "dom.idl";
/* interface Node members */
getter textContent %{
dom_exception exc;
@ -21,3 +23,8 @@ getter textContent %{
operation appendChild %{
%}
operation createTextNode %{
%}

44
javascript/jsapi/text.bnd Normal file
View File

@ -0,0 +1,44 @@
/* Binding to generate Text interface
*
* Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
* Released under the terms of the MIT License,
* http://www.opensource.org/licenses/mit-license
*/
#include "dom.bnd"
webidlfile "html.idl";
hdrcomment "Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>";
hdrcomment "This file is part of NetSurf, http://www.netsurf-browser.org/";
hdrcomment "Released under the terms of the MIT License,";
hdrcomment " http://www.opensource.org/licenses/mit-license";
preamble %{
#include <dom/dom.h>
#include "utils/config.h"
#include "utils/log.h"
#include "javascript/jsapi.h"
#include "javascript/jsapi/binding.h"
%}
binding text {
type js_libdom; /* the binding type */
interface Text; /* Web IDL interface to generate */
private "dom_node *" node;
}
api finalise %{
if (private != NULL) {
dom_node_unref(private->node);
}
%}

View File

@ -130,6 +130,11 @@ api init %{
return NULL;
}
user_proto = jsapi_InitClass_Text(cx, prototype);
if (user_proto == NULL) {
return NULL;
}
%}
api new %{