2 Copyright (C) 2008 Christian Dywan <christian@twotoasts.de>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 See the file COPYING for the full license text.
15 #include <JavaScriptCore/JavaScript.h>
16 #include <glib-object.h>
20 #define GJS_TYPE_VALUE \
21 (gjs_value_get_type ())
22 #define GJS_VALUE(obj) \
23 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GJS_TYPE_VALUE, GjsValue))
24 #define GJS_VALUE_CLASS(klass) \
25 (G_TYPE_CHECK_CLASS_CAST ((klass), GJS_TYPE_VALUE, GjsValueClass))
26 #define GJS_IS_VALUE(obj) \
27 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GJS_TYPE_VALUE))
28 #define GJS_IS_VALUE_CLASS(klass) \
29 (G_TYPE_CHECK_CLASS_TYPE ((klass), GJS_TYPE_VALUE))
30 #define GJS_VALUE_GET_CLASS(obj) \
31 (G_TYPE_INSTANCE_GET_CLASS ((obj), GJS_TYPE_VALUE, GjsValueClass))
33 typedef struct _GjsValue GjsValue
;
34 typedef struct _GjsValueClass GjsValueClass
;
38 GObjectClass parent_class
;
42 gjs_value_get_type (void);
45 gjs_value_new (JSContextRef js_context
,
49 gjs_value_is_valid (GjsValue
* value
);
52 gjs_value_is_object (GjsValue
* value
);
55 gjs_value_has_attribute (GjsValue
* value
,
59 gjs_value_get_attribute (GjsValue
* value
,
63 gjs_value_get_string (GjsValue
* value
);
66 gjs_value_get_attribute_string (GjsValue
* value
,
70 gjs_value_get_nth_attribute (GjsValue
* value
,
74 (*GjsCallback
) (GjsValue
* value
,
78 gjs_value_foreach (GjsValue
* value
,
83 gjs_value_forall (GjsValue
* value
,
88 gjs_value_get_by_name (GjsValue
* value
,
92 gjs_value_get_elements_by_tag_name (GjsValue
* value
,
96 gjs_value_execute (GjsValue
* value
,
101 gjs_script_eval (JSContextRef js_context
,
106 gjs_script_check_syntax (JSContextRef js_context
,
111 gjs_script_from_file (JSContextRef js_context
,
112 const gchar
* filename
,
116 gjs_string_utf8 (JSStringRef js_string
);
119 gjs_object_new (JSContextRef context
,
124 gjs_global_context_new (void);
128 #endif /* __GJS_H__ */