boxed.h | boxed.h | |||
---|---|---|---|---|
skipping to change at line 58 | skipping to change at line 58 | |||
void* gjs_c_struct_from_boxed (JSContext *context, | void* gjs_c_struct_from_boxed (JSContext *context, | |||
JSObject *obj); | JSObject *obj); | |||
JSObject* gjs_boxed_from_c_struct (JSContext *context, | JSObject* gjs_boxed_from_c_struct (JSContext *context, | |||
GIStructInfo *info, | GIStructInfo *info, | |||
void *gboxed, | void *gboxed, | |||
GjsBoxedCreationFlags flags); | GjsBoxedCreationFlags flags); | |||
JSBool gjs_typecheck_boxed (JSContext *context, | JSBool gjs_typecheck_boxed (JSContext *context, | |||
JSObject *obj, | JSObject *obj, | |||
GIStructInfo *expected_inf o, | GIStructInfo *expected_inf o, | |||
GType expected_typ e, | GType expected_typ e, | |||
JSBool throw); | JSBool throw_error) ; | |||
G_END_DECLS | G_END_DECLS | |||
#endif /* __GJS_BOXED_H__ */ | #endif /* __GJS_BOXED_H__ */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
byteArray.h | byteArray.h | |||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
#error "Only <gjs/gjs.h> can be included directly." | #error "Only <gjs/gjs.h> can be included directly." | |||
#endif | #endif | |||
#include <glib.h> | #include <glib.h> | |||
#include "gjs/jsapi-util.h" | #include "gjs/jsapi-util.h" | |||
G_BEGIN_DECLS | G_BEGIN_DECLS | |||
JSBool gjs_typecheck_bytearray (JSContext *context, | JSBool gjs_typecheck_bytearray (JSContext *context, | |||
JSObject *obj, | JSObject *obj, | |||
JSBool throw); | JSBool throw_error); | |||
JSBool gjs_define_byte_array_stuff (JSContext *context, | JSBool gjs_define_byte_array_stuff (JSContext *context, | |||
JSObject *in_object); | JSObject **module_out); | |||
JSObject * gjs_byte_array_from_byte_array (JSContext *context, | JSObject * gjs_byte_array_from_byte_array (JSContext *context, | |||
GByteArray *array); | GByteArray *array); | |||
JSObject * gjs_byte_array_from_bytes (JSContext *context, | JSObject * gjs_byte_array_from_bytes (JSContext *context, | |||
GBytes *bytes); | GBytes *bytes); | |||
GByteArray * gjs_byte_array_get_byte_array (JSContext *context, | GByteArray * gjs_byte_array_get_byte_array (JSContext *context, | |||
JSObject *object); | JSObject *object); | |||
GBytes * gjs_byte_array_get_bytes (JSContext *context, | GBytes * gjs_byte_array_get_bytes (JSContext *context, | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
foreign.h | foreign.h | |||
---|---|---|---|---|
skipping to change at line 52 | skipping to change at line 52 | |||
typedef JSBool (*GjsArgOverrideReleaseGArgumentFunc) (JSContext *context, | typedef JSBool (*GjsArgOverrideReleaseGArgumentFunc) (JSContext *context, | |||
GITransfer transfer, | GITransfer transfer, | |||
GArgument *arg); | GArgument *arg); | |||
typedef struct { | typedef struct { | |||
GjsArgOverrideToGArgumentFunc to_func; | GjsArgOverrideToGArgumentFunc to_func; | |||
GjsArgOverrideFromGArgumentFunc from_func; | GjsArgOverrideFromGArgumentFunc from_func; | |||
GjsArgOverrideReleaseGArgumentFunc release_func; | GjsArgOverrideReleaseGArgumentFunc release_func; | |||
} GjsForeignInfo; | } GjsForeignInfo; | |||
JSBool gjs_struct_foreign_register (const char *nam espace, | JSBool gjs_struct_foreign_register (const char *gi_ namespace, | |||
const char *typ e_name, | const char *typ e_name, | |||
GjsForeignInfo *info); | GjsForeignInfo *info); | |||
JSBool gjs_struct_foreign_convert_to_g_argument (JSContext *con text, | JSBool gjs_struct_foreign_convert_to_g_argument (JSContext *con text, | |||
jsval val ue, | jsval val ue, | |||
GIBaseInfo *int erface_info, | GIBaseInfo *int erface_info, | |||
const char *arg _name, | const char *arg _name, | |||
GjsArgumentType arg ument_type, | GjsArgumentType arg ument_type, | |||
GITransfer tra nsfer, | GITransfer tra nsfer, | |||
gboolean may _be_null, | gboolean may _be_null, | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
gerror.h | gerror.h | |||
---|---|---|---|---|
skipping to change at line 44 | skipping to change at line 44 | |||
void gjs_define_error_class (JSContext *context, | void gjs_define_error_class (JSContext *context, | |||
JSObject *in_object, | JSObject *in_object, | |||
GIEnumInfo *info); | GIEnumInfo *info); | |||
GError* gjs_gerror_from_error (JSContext *context, | GError* gjs_gerror_from_error (JSContext *context, | |||
JSObject *obj); | JSObject *obj); | |||
JSObject* gjs_error_from_gerror (JSContext *context, | JSObject* gjs_error_from_gerror (JSContext *context, | |||
GError *gerror, | GError *gerror, | |||
gboolean add_stack); | gboolean add_stack); | |||
JSBool gjs_typecheck_gerror (JSContext *context, | JSBool gjs_typecheck_gerror (JSContext *context, | |||
JSObject *obj, | JSObject *obj, | |||
JSBool throw); | JSBool throw_error) ; | |||
G_END_DECLS | G_END_DECLS | |||
#endif /* __GJS_ERROR_H__ */ | #endif /* __GJS_ERROR_H__ */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
gtype.h | gtype.h | |||
---|---|---|---|---|
skipping to change at line 47 | skipping to change at line 47 | |||
JSObject *parent); | JSObject *parent); | |||
JSObject * gjs_gtype_create_gtype_wrapper (JSContext *context, | JSObject * gjs_gtype_create_gtype_wrapper (JSContext *context, | |||
GType gtype); | GType gtype); | |||
GType gjs_gtype_get_actual_gtype (JSContext *context, | GType gjs_gtype_get_actual_gtype (JSContext *context, | |||
JSObject *object); | JSObject *object); | |||
JSBool gjs_typecheck_gtype (JSContext *context, | JSBool gjs_typecheck_gtype (JSContext *context, | |||
JSObject *obj, | JSObject *obj, | |||
JSBool throw); | JSBool throw_error); | |||
G_END_DECLS | G_END_DECLS | |||
#endif /* __GJS_INTERFACE_H__ */ | #endif /* __GJS_INTERFACE_H__ */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
jsapi-util.h | jsapi-util.h | |||
---|---|---|---|---|
skipping to change at line 77 | skipping to change at line 77 | |||
* do_base_typecheck: checks that object has the right JSClass, and possibl y | * do_base_typecheck: checks that object has the right JSClass, and possibl y | |||
* throw a TypeError exception if the check fails | * throw a TypeError exception if the check fails | |||
* priv_from_js: accesses the object private field; as a debug measure, | * priv_from_js: accesses the object private field; as a debug measure, | |||
* it also checks that the object is of a compatible | * it also checks that the object is of a compatible | |||
* JSClass, but it doesn't raise an exception (it | * JSClass, but it doesn't raise an exception (it | |||
* wouldn't be of much use, if subsequent code crashes on | * wouldn't be of much use, if subsequent code crashes on | |||
* NULL) | * NULL) | |||
* priv_from_js_with_typecheck: a convenience function to call | * priv_from_js_with_typecheck: a convenience function to call | |||
* do_base_typecheck and priv_from_js | * do_base_typecheck and priv_from_js | |||
*/ | */ | |||
#define GJS_DEFINE_PRIV_FROM_JS(type, class) \ | #define GJS_DEFINE_PRIV_FROM_JS(type, klass) \ | |||
__attribute__((unused)) static inline JSBool \ | __attribute__((unused)) static inline JSBool \ | |||
do_base_typecheck(JSContext *context, \ | do_base_typecheck(JSContext *context, \ | |||
JSObject *object, \ | JSObject *object, \ | |||
JSBool throw) \ | JSBool throw_error) \ | |||
{ \ | { \ | |||
return gjs_typecheck_instance(context, object, &class, throw); \ | return gjs_typecheck_instance(context, object, &klass, throw_error) ; \ | |||
} \ | } \ | |||
static inline type * \ | static inline type * \ | |||
priv_from_js(JSContext *context, \ | priv_from_js(JSContext *context, \ | |||
JSObject *object) \ | JSObject *object) \ | |||
{ \ | { \ | |||
type *priv; \ | type *priv; \ | |||
JS_BeginRequest(context); \ | JS_BeginRequest(context); \ | |||
priv = JS_GetInstancePrivate(context, object, &class, NULL); \ | priv = (type*) JS_GetInstancePrivate(context, object, &klass, NULL) ; \ | |||
JS_EndRequest(context); \ | JS_EndRequest(context); \ | |||
return priv; \ | return priv; \ | |||
} \ | } \ | |||
__attribute__((unused)) static JSBool \ | __attribute__((unused)) static JSBool \ | |||
priv_from_js_with_typecheck(JSContext *context, \ | priv_from_js_with_typecheck(JSContext *context, \ | |||
JSObject *object, \ | JSObject *object, \ | |||
type **out) \ | type **out) \ | |||
{ \ | { \ | |||
if (!do_base_typecheck(context, object, JS_FALSE)) \ | if (!do_base_typecheck(context, object, JS_FALSE)) \ | |||
return JS_FALSE; \ | return JS_FALSE; \ | |||
skipping to change at line 130 | skipping to change at line 130 | |||
* @cn: The name of the prototype, separated by _ | * @cn: The name of the prototype, separated by _ | |||
* | * | |||
* A convenience macro for prototype implementations. | * A convenience macro for prototype implementations. | |||
* Similar to GJS_DEFINE_PROTO but marks the prototype as abstract, | * Similar to GJS_DEFINE_PROTO but marks the prototype as abstract, | |||
* you won't be able to instantiate it using the new keyword | * you won't be able to instantiate it using the new keyword | |||
*/ | */ | |||
#define GJS_DEFINE_PROTO_ABSTRACT(tn, cn) \ | #define GJS_DEFINE_PROTO_ABSTRACT(tn, cn) \ | |||
_GJS_DEFINE_PROTO_FULL(tn, cn, NULL) | _GJS_DEFINE_PROTO_FULL(tn, cn, NULL) | |||
#define _GJS_DEFINE_PROTO_FULL(type_name, cname, ctor) \ | #define _GJS_DEFINE_PROTO_FULL(type_name, cname, ctor) \ | |||
static JSPropertySpec gjs_##cname##_proto_props[]; \ | extern JSPropertySpec gjs_##cname##_proto_props[]; \ | |||
static JSFunctionSpec gjs_##cname##_proto_funcs[]; \ | extern JSFunctionSpec gjs_##cname##_proto_funcs[]; \ | |||
static void gjs_##cname##_finalize(JSFreeOp *fop, JSObject *obj); \ | static void gjs_##cname##_finalize(JSFreeOp *fop, JSObject *obj); \ | |||
static JSBool gjs_##cname##_new_resolve(JSContext *context, \ | static JSBool gjs_##cname##_new_resolve(JSContext *context, \ | |||
JSObject *obj, \ | JSObject *obj, \ | |||
jsval id, \ | jsval id, \ | |||
unsigned flags, \ | unsigned flags, \ | |||
JSObject **objp) \ | JSObject **objp) \ | |||
{ \ | { \ | |||
return JS_TRUE; \ | return JS_TRUE; \ | |||
} \ | } \ | |||
static struct JSClass gjs_##cname##_class = { \ | static struct JSClass gjs_##cname##_class = { \ | |||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 6 lines changed or added | |||
native.h | native.h | |||
---|---|---|---|---|
skipping to change at line 36 | skipping to change at line 36 | |||
#if !defined (__GJS_GJS_MODULE_H__) && !defined (GJS_COMPILATION) | #if !defined (__GJS_GJS_MODULE_H__) && !defined (GJS_COMPILATION) | |||
#error "Only <gjs/gjs-module.h> can be included directly." | #error "Only <gjs/gjs-module.h> can be included directly." | |||
#endif | #endif | |||
#include <glib.h> | #include <glib.h> | |||
#include "gjs/jsapi-util.h" | #include "gjs/jsapi-util.h" | |||
G_BEGIN_DECLS | G_BEGIN_DECLS | |||
typedef enum { | typedef JSBool (* GjsDefineModuleFunc) (JSContext *context, | |||
/* This means that the GjsDefineModuleFunc defines the module | JSObject **module_out); | |||
* name in the parent module, as opposed to the normal process | ||||
* where the GjsDefineModuleFunc defines module contents. When | ||||
* importing imports.foo.bar, this flag means the native module is | ||||
* given foo and defines bar in it, while normally the native | ||||
* module is given bar and defines stuff in that. | ||||
* | ||||
* The purpose of this is to allow a module with lazy properties | ||||
* by allowing module objects to be custom classes. It's used for | ||||
* the gobject-introspection module for example. | ||||
*/ | ||||
GJS_NATIVE_SUPPLIES_MODULE_OBJ = 1 << 0 | ||||
} GjsNativeFlags; | ||||
typedef JSBool (* GjsDefineModuleFunc) (JSContext *context, | ||||
JSObject *module_obj); | ||||
/* called on context init */ | /* called on context init */ | |||
void gjs_register_native_module (const char *module_id, | void gjs_register_native_module (const char *module_id, | |||
GjsDefineModuleFunc func, | GjsDefineModuleFunc func); | |||
GjsNativeFlags flags); | ||||
/* called by importer.c to to check for already loaded modules */ | /* called by importer.c to to check for already loaded modules */ | |||
gboolean gjs_is_registered_native_module(JSContext *context, | gboolean gjs_is_registered_native_module(JSContext *context, | |||
JSObject *parent, | JSObject *parent, | |||
const char *name); | const char *name); | |||
/* called by importer.c to load a statically linked native module */ | /* called by importer.c to load a statically linked native module */ | |||
JSBool gjs_import_native_module (JSContext *context, | JSBool gjs_import_native_module (JSContext *context, | |||
JSObject *module_obj, | const char *name, | |||
const char *name); | JSObject **module_out); | |||
G_END_DECLS | G_END_DECLS | |||
#endif /* __GJS_NATIVE_H__ */ | #endif /* __GJS_NATIVE_H__ */ | |||
End of changes. 3 change blocks. | ||||
23 lines changed or deleted | 6 lines changed or added | |||
object.h | object.h | |||
---|---|---|---|---|
skipping to change at line 45 | skipping to change at line 45 | |||
GIObjectInfo *info, | GIObjectInfo *info, | |||
GType gtype, | GType gtype, | |||
JSObject **constructor_p); | JSObject **constructor_p); | |||
JSObject* gjs_object_from_g_object (JSContext *context, | JSObject* gjs_object_from_g_object (JSContext *context, | |||
GObject *gobj); | GObject *gobj); | |||
GObject* gjs_g_object_from_object (JSContext *context, | GObject* gjs_g_object_from_object (JSContext *context, | |||
JSObject *obj); | JSObject *obj); | |||
JSBool gjs_typecheck_object (JSContext *context, | JSBool gjs_typecheck_object (JSContext *context, | |||
JSObject *obj, | JSObject *obj, | |||
GType expected_type, | GType expected_type, | |||
JSBool throw); | JSBool throw_error); | |||
void gjs_object_process_pending_toggles (void); | void gjs_object_process_pending_toggles (void); | |||
G_END_DECLS | G_END_DECLS | |||
#endif /* __GJS_OBJECT_H__ */ | #endif /* __GJS_OBJECT_H__ */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
param.h | param.h | |||
---|---|---|---|---|
skipping to change at line 42 | skipping to change at line 42 | |||
void gjs_define_param_class (JSContext *context, | void gjs_define_param_class (JSContext *context, | |||
JSObject *in_object); | JSObject *in_object); | |||
GParamSpec* gjs_g_param_from_param (JSContext *context, | GParamSpec* gjs_g_param_from_param (JSContext *context, | |||
JSObject *obj); | JSObject *obj); | |||
JSObject* gjs_param_from_g_param (JSContext *context, | JSObject* gjs_param_from_g_param (JSContext *context, | |||
GParamSpec *param); | GParamSpec *param); | |||
JSBool gjs_typecheck_param (JSContext *context, | JSBool gjs_typecheck_param (JSContext *context, | |||
JSObject *obj, | JSObject *obj, | |||
GType expected_type, | GType expected_type, | |||
JSBool throw); | JSBool throw_error); | |||
G_END_DECLS | G_END_DECLS | |||
#endif /* __GJS_PARAM_H__ */ | #endif /* __GJS_PARAM_H__ */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
repo.h | repo.h | |||
---|---|---|---|---|
skipping to change at line 36 | skipping to change at line 36 | |||
#include <glib.h> | #include <glib.h> | |||
#include <girepository.h> | #include <girepository.h> | |||
#include <gjs/gjs-module.h> | #include <gjs/gjs-module.h> | |||
G_BEGIN_DECLS | G_BEGIN_DECLS | |||
JSBool gjs_define_repo (JSContext *context, | JSBool gjs_define_repo (JSContext *context, | |||
JSObject *module_obj , | JSObject **module_out , | |||
const char *name); | const char *name); | |||
const char* gjs_info_type_name (GIInfoType type); | const char* gjs_info_type_name (GIInfoType type); | |||
JSObject* gjs_lookup_private_namespace (JSContext *context); | JSObject* gjs_lookup_private_namespace (JSContext *context); | |||
JSObject* gjs_lookup_namespace_object (JSContext *context, | JSObject* gjs_lookup_namespace_object (JSContext *context, | |||
GIBaseInfo *info); | GIBaseInfo *info); | |||
JSObject* gjs_lookup_namespace_object_by_name (JSContext *context, | JSObject* gjs_lookup_namespace_object_by_name (JSContext *context, | |||
jsid name); | jsid name); | |||
JSObject* gjs_lookup_function_object (JSContext *context, | JSObject* gjs_lookup_function_object (JSContext *context, | |||
GIFunctionInfo *info); | GIFunctionInfo *info); | |||
JSObject * gjs_lookup_generic_prototype (JSContext *context, | JSObject * gjs_lookup_generic_prototype (JSContext *context, | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
type-module.h | type-module.h | |||
---|---|---|---|---|
skipping to change at line 34 | skipping to change at line 34 | |||
#ifndef GJS_TYPE_MODULE_H | #ifndef GJS_TYPE_MODULE_H | |||
#define GJS_TYPE_MODULE_H | #define GJS_TYPE_MODULE_H | |||
#include <glib-object.h> | #include <glib-object.h> | |||
typedef struct _GjsTypeModule GjsTypeModule; | typedef struct _GjsTypeModule GjsTypeModule; | |||
typedef struct _GjsTypeModuleClass GjsTypeModuleClass; | typedef struct _GjsTypeModuleClass GjsTypeModuleClass; | |||
#define GJS_TYPE_TYPE_MODULE (gjs_type_module_get_type ()) | #define GJS_TYPE_TYPE_MODULE (gjs_type_module_get_type ()) | |||
#define GJS_TYPE_MODULE(module) (G_TYPE_CHECK_INSTANCE_CAST ((mod ule), GJS_TYPE_TYPE_MODULE, GjsTypeModule)) | #define GJS_TYPE_MODULE(module) (G_TYPE_CHECK_INSTANCE_CAST ((mod ule), GJS_TYPE_TYPE_MODULE, GjsTypeModule)) | |||
#define GJS_TYPE_MODULE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class) , GJS_TYPE_TYPE_MODULE, GjsTypeModuleClass)) | #define GJS_TYPE_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass) , GJS_TYPE_TYPE_MODULE, GjsTypeModuleClass)) | |||
#define GJS_IS_TYPE_MODULE(module) (G_TYPE_CHECK_INSTANCE_TYPE ((mod ule), GJS_TYPE_TYPE_MODULE)) | #define GJS_IS_TYPE_MODULE(module) (G_TYPE_CHECK_INSTANCE_TYPE ((mod ule), GJS_TYPE_TYPE_MODULE)) | |||
#define GJS_IS_TYPE_MODULE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class) , GJS_TYPE_TYPE_MODULE)) | #define GJS_IS_TYPE_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass) , GJS_TYPE_TYPE_MODULE)) | |||
#define GJS_TYPE_MODULE_GET_CLASS(module) (G_TYPE_INSTANCE_GET_CLASS ((modu le), GJS_TYPE_TYPE_MODULE, GjsTypeModuleClass)) | #define GJS_TYPE_MODULE_GET_CLASS(module) (G_TYPE_INSTANCE_GET_CLASS ((modu le), GJS_TYPE_TYPE_MODULE, GjsTypeModuleClass)) | |||
GType gjs_type_module_get_type (void) G_GNUC_CONST; | GType gjs_type_module_get_type (void) G_GNUC_CONST; | |||
GjsTypeModule *gjs_type_module_get (void); | GjsTypeModule *gjs_type_module_get (void); | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
union.h | union.h | |||
---|---|---|---|---|
skipping to change at line 45 | skipping to change at line 45 | |||
GIUnionInfo *info); | GIUnionInfo *info); | |||
void* gjs_c_union_from_union (JSContext *context, | void* gjs_c_union_from_union (JSContext *context, | |||
JSObject *obj); | JSObject *obj); | |||
JSObject* gjs_union_from_c_union (JSContext *context, | JSObject* gjs_union_from_c_union (JSContext *context, | |||
GIUnionInfo *info, | GIUnionInfo *info, | |||
void *gboxed); | void *gboxed); | |||
JSBool gjs_typecheck_union (JSContext *context, | JSBool gjs_typecheck_union (JSContext *context, | |||
JSObject *obj, | JSObject *obj, | |||
GIStructInfo *expected_inf o, | GIStructInfo *expected_inf o, | |||
GType expected_typ e, | GType expected_typ e, | |||
JSBool throw); | JSBool throw_error) ; | |||
G_END_DECLS | G_END_DECLS | |||
#endif /* __GJS_UNION_H__ */ | #endif /* __GJS_UNION_H__ */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||