1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-02-02 15:09:23 -05:00

Bug 846: Comments on the relations between JSClasses and functions.

(Adapted from 670ad939c3f90c732942c9deb216e15e63907fff in ELinks 0.12.GIT.)
This commit is contained in:
Kalle Olavi Niemitalo 2006-11-25 20:48:29 +02:00 committed by Kalle Olavi Niemitalo
parent ffa24fd3e0
commit fcebd6d111
11 changed files with 45 additions and 0 deletions

View File

@ -68,6 +68,7 @@ const JSPropertySpec document_props[] = {
{ NULL }
};
/* @document_class.getProperty */
static JSBool
document_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -151,6 +152,7 @@ document_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
return JS_TRUE;
}
/* @document_class.setProperty */
static JSBool
document_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -198,6 +200,7 @@ const JSFunctionSpec document_funcs[] = {
{ NULL }
};
/* @document_funcs{"write"} */
static JSBool
document_write(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{

View File

@ -115,6 +115,7 @@ static const JSFunctionSpec input_funcs[] = {
{ NULL }
};
/* @input_class.getProperty */
static JSBool
input_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -227,6 +228,7 @@ input_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
return JS_TRUE;
}
/* @input_class.setProperty */
static JSBool
input_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -303,6 +305,7 @@ input_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
return JS_TRUE;
}
/* @input_funcs{"blur"} */
static JSBool
input_blur(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
@ -311,6 +314,7 @@ input_blur(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return JS_TRUE;
}
/* @input_funcs{"click"} */
static JSBool
input_click(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
@ -345,6 +349,7 @@ input_click(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return JS_TRUE;
}
/* @input_funcs{"focus"} */
static JSBool
input_focus(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
@ -374,6 +379,7 @@ input_focus(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return JS_TRUE;
}
/* @input_funcs{"select"} */
static JSBool
input_select(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
@ -456,6 +462,7 @@ static const JSPropertySpec form_elements_props[] = {
{ NULL }
};
/* @form_elements_class.getProperty */
static JSBool
form_elements_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -491,6 +498,7 @@ form_elements_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
return JS_TRUE;
}
/* @form_elements_funcs{"item"} */
static JSBool
form_elements_item(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
@ -528,6 +536,7 @@ form_elements_item(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval
return JS_TRUE;
}
/* @form_elements_funcs{"namedItem"} */
static JSBool
form_elements_namedItem(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
@ -608,6 +617,7 @@ static const JSFunctionSpec form_funcs[] = {
{ NULL }
};
/* @form_class.getProperty */
static JSBool
form_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -715,6 +725,7 @@ form_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
return JS_TRUE;
}
/* @form_class.setProperty */
static JSBool
form_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -773,6 +784,7 @@ form_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
return JS_TRUE;
}
/* @form_funcs{"reset"} */
static JSBool
form_reset(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
@ -793,6 +805,7 @@ form_reset(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return JS_TRUE;
}
/* @form_funcs{"submit"} */
static JSBool
form_submit(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
@ -857,6 +870,7 @@ const JSPropertySpec forms_props[] = {
{ NULL }
};
/* @forms_class.getProperty */
static JSBool
forms_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -887,6 +901,7 @@ forms_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
return JS_TRUE;
}
/* @forms_funcs{"item"} */
static JSBool
forms_item(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
@ -915,6 +930,7 @@ forms_item(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return JS_TRUE;
}
/* @forms_funcs{"namedItem"} */
static JSBool
forms_namedItem(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{

View File

@ -63,6 +63,7 @@ const JSFunctionSpec history_funcs[] = {
{ NULL }
};
/* @history_funcs{"back"} */
static JSBool
history_back(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
@ -79,6 +80,7 @@ history_back(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
return 2;
}
/* @history_funcs{"forward"} */
static JSBool
history_forward(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
@ -91,6 +93,7 @@ history_forward(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *r
return 2;
}
/* @history_funcs{"go"} */
static JSBool
history_go(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
@ -137,6 +140,7 @@ const JSPropertySpec location_props[] = {
{ NULL }
};
/* @location_class.getProperty */
static JSBool
location_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -160,6 +164,7 @@ location_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
return JS_TRUE;
}
/* @location_class.setProperty */
static JSBool
location_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -187,6 +192,7 @@ const JSFunctionSpec location_funcs[] = {
{ NULL }
};
/* @location_funcs{"toString"}, @location_funcs{"toLocaleString"} */
static JSBool
location_toString(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{

View File

@ -75,6 +75,7 @@ const JSPropertySpec navigator_props[] = {
};
/* @navigator_class.getProperty */
static JSBool
navigator_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{

View File

@ -69,6 +69,7 @@ const JSPropertySpec unibar_props[] = {
};
/* @menubar_class.getProperty, @statusbar_class.getProperty */
static JSBool
unibar_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -108,6 +109,7 @@ unibar_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
return JS_TRUE;
}
/* @menubar_class.setProperty, @statusbar_class.setProperty */
static JSBool
unibar_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{

View File

@ -114,6 +114,7 @@ find_child_frame(struct document_view *doc_view, struct frame_desc *tframe)
}
#endif
/* @window_class.getProperty */
static JSBool
window_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -230,6 +231,7 @@ found_parent:
void location_goto(struct document_view *doc_view, unsigned char *url);
/* @window_class.setProperty */
static JSBool
window_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -269,6 +271,7 @@ const JSFunctionSpec window_funcs[] = {
{ NULL }
};
/* @window_funcs{"alert"} */
static JSBool
window_alert(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
@ -317,6 +320,7 @@ delayed_goto_uri_frame(void *data)
mem_free(deo);
}
/* @window_funcs{"open"} */
static JSBool
window_open(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{

View File

@ -35,6 +35,7 @@ smjs_get_bookmark_generic_object(struct bookmark *bookmark, JSClass *clasp)
return NULL;
};
/* @bookmark_class.finalize, @bookmark_folder_class.finalize */
static void
bookmark_finalize(JSContext *ctx, JSObject *obj)
{
@ -61,6 +62,7 @@ static const JSPropertySpec bookmark_props[] = {
static JSObject *smjs_get_bookmark_folder_object(struct bookmark *bookmark);
/* @bookmark_class.getProperty */
static JSBool
bookmark_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -96,6 +98,7 @@ bookmark_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
return JS_FALSE;
}
/* @bookmark_class.setProperty */
static JSBool
bookmark_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -158,6 +161,7 @@ smjs_get_bookmark_object(struct bookmark *bookmark)
/*** bookmark folder object ***/
/* @bookmark_folder_class.getProperty */
static JSBool
bookmark_folder_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{

View File

@ -31,6 +31,7 @@ static const JSPropertySpec cache_entry_props[] = {
{ NULL }
};
/* @cache_entry_class.getProperty */
static JSBool
cache_entry_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -82,6 +83,7 @@ cache_entry_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
return JS_FALSE;
}
/* @cache_entry_class.setProperty */
static JSBool
cache_entry_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -129,6 +131,7 @@ cache_entry_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
return JS_FALSE;
}
/* @cache_entry_class.finalize */
static void
cache_entry_finalize(JSContext *ctx, JSObject *obj)
{

View File

@ -63,6 +63,7 @@ elinks_set_location(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
return JS_TRUE;
}
/* @elinks_funcs{"alert"} */
static JSBool
elinks_alert(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{

View File

@ -13,6 +13,7 @@
#include "scripting/smjs/elinks_object.h"
#include "util/memory.h"
/* @keymap_class.getProperty */
static JSBool
keymap_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -58,6 +59,7 @@ smjs_keybinding_action_callback(va_list ap, void *data)
return EVENT_HOOK_STATUS_LAST;
}
/* @keymap_class.setProperty */
static JSBool
keymap_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -127,6 +129,7 @@ keymap_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
return JS_TRUE;
}
/* @keymap_class.finalize */
static void
keymap_finalize(JSContext *ctx, JSObject *obj)
{

View File

@ -27,6 +27,7 @@ static const JSPropertySpec view_state_props[] = {
{ NULL }
};
/* @view_state_class.getProperty */
static JSBool
view_state_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
@ -55,6 +56,7 @@ view_state_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
return JS_FALSE;
}
/* @view_state_class.setProperty */
static JSBool
view_state_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{