summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* GObject: fix building a class with non trivial accessor propertieswip/gdbus-2Giovanni Campagna2012-10-302-10/+11
| | | | The accessors would be invoked while traversing the prototype for vfuncs.
* GDBus: allow overriding _init in a Gio.DBusProxyClassGiovanni Campagna2012-10-304-35/+74
| | | | | | | | | | | A Gio.DBusProxyClass is a Lang.Class and should behave like one, including the _init handling. In particular, this allows for "slim proxies", that can be created without passing parameters (or with a subset of them). This is implemented by moving the special initialization of DBusProxy to an _init override, instead of hooking into init and init_async methods. https://bugzilla.gnome.org/show_bug.cgi?id=669350
* GDBus: use gio-style asyncs for the new bindingsGiovanni Campagna2012-10-302-113/+209
| | | | | | | | | | | | Split asynchronous result collection into a MethodFinish function, so that exceptions can be caught in the usual way instead of being passed as objects to the functions. Also, remove the flags parameter and make the cancellable argument compulsory, matching the code generated by gdbus-codegen. Finally, make proxy initialization explicit, reducing the amount of magic done by the bindings. https://bugzilla.gnome.org/show_bug.cgi?id=669350
* GDBus: introduce new convenience wrappersGiovanni Campagna2012-10-302-5/+759
| | | | | | | | Using the new metaclass system, introduce Gio.DBusProxyClass and Gio.DBusImplementerClass, that allow declaring specialized proxies/ implementations for specific interfaces. https://bugzilla.gnome.org/show_bug.cgi?id=669350
* Convert imported modules from UTF-8 to UTF-16 before executingGiovanni Campagna2012-10-301-25/+51
| | | | | | | | If JS_CStringsAreUTF8 is false, the JSAPI assumes C strings are ISO-8859-1. Unfortunately, we rely on that setting for byte arrays, so just do the conversion ourselves, like we do in gjs_context_eval(). https://bugzilla.gnome.org/show_bug.cgi?id=687095
* Rework dynamic class systemGiovanni Campagna2012-10-3011-561/+356
| | | | | | | | | | | Stop creating multiple JS classes on demand, and instead use the same JS class and create multiple constructors with different prototypes, but hand-rolling our own version of JS_InitClass, that also avoids polluting the global object. This means that JS_ConstructObject is no longer usable with dynamic classes, use gjs_construct_object_dynamic or JS_New instead. https://bugzilla.gnome.org/show_bug.cgi?id=679688
* Don't use JS_ConstructObjectGiovanni Campagna2012-10-3013-192/+128
| | | | | | | | | JS_ConstructObject is deprecated with modern JSAPI, and should be replaced by JS_NewObject and JS_New. Also, while we're there, replace constructors with functions that throw, as it is generally an error to call them from JS anyway. https://bugzilla.gnome.org/show_bug.cgi?id=679688
* Don't use deprecated JSCLASS_CONSTRUCT_PROTOTYPE flagsGiovanni Campagna2012-10-309-41/+1
| | | | | | | Not only that flag is removed in newer versions of libjs, it will break with the new dynamic class system. https://bugzilla.gnome.org/show_bug.cgi?id=679688
* WIP: GValue auto-unboxingGiovanni Campagna2012-10-301-2/+14
|
* GObject: don't use toggle references unless necessaryGiovanni Campagna2012-10-301-14/+61
| | | | | | | | | | Many GObject (such as widgets and actors) don't have JS state, but they're kept alive by C code. We can therefore save some memory by GCing these objects, and creating new wrappers when needed. If state is ever set, we transparently switch to toggle refs, so no change should be visible at the JS level. https://bugzilla.gnome.org/show_bug.cgi?id=679688
* Associate callbacks with the object on which their installedGiovanni Campagna2012-10-309-69/+169
| | | | | | | | | | | | Callbacks installed with GObject methods are now traced from that object instead of being rooted, so cycles no longer cause leaks. This implementing by making GjsCallbackTrampoline use GjsClosure internally, and generalizing the existing code that dealt with signal connections. Also, to keep tests ok, we now have class finalization functions for custom types (to unregister the closures). https://bugzilla.gnome.org/show_bug.cgi?id=679688
* Keep Alive: add a debugging method to print all active rootsGiovanni Campagna2012-10-301-1/+70
| | | | | | | | | | Adds a print_roots() to keep-alive objects (such as __gc_this_on_context_destroy, where GObjects are stored), which prints a dump of all objects known to it on stderr. This is primarily meant to debug GObject cycles and leaks that are not detected. https://bugzilla.gnome.org/show_bug.cgi?id=679688
* Assorted memory leak fixesGiovanni Campagna2012-10-302-1/+4
| | | | | | Spotted by valgrind. https://bugzilla.gnome.org/show_bug.cgi?id=679688
* Gjs: work around GType bug with dynamic typesGiovanni Campagna2012-10-302-3/+42
| | | | | | | | g_type_query() only works with static types, so it fails when inheriting from another JS class. Work around that by using the first static parent for GJS custom type (as we never override the instance or class type) https://bugzilla.gnome.org/show_bug.cgi?id=687184
* GObject: use correct variable nameCosimo Cecchi2012-10-301-1/+1
| | | | signal_name doesn't exist in scope, signalName does.
* Format: don't call toString() blindlyGiovanni Campagna2012-10-291-1/+1
| | | | | | | Instead, use String() as a function. It fixes passing null or undefined to format(). https://bugzilla.gnome.org/show_bug.cgi?id=687153
* Drop g_type_init () calls, bump required GLib versionColin Walters2012-10-287-18/+1
| | | | See http://git.gnome.org/browse/glib/commit/?id=7c42ab23b55c43ab96d0ac2124b550bf1f49c1ec
* byteArray: Remove JSCLASS_CONSTRUCT_PROTOTYPEJasper St. Pierre2012-10-031-38/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=685431
* Gio: Don't eat errors when trying to call the initial asyncCallbackJasper St. Pierre2012-10-031-2/+8
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=682290
* Release 1.34.0gnome-3-6Colin Walters2012-09-241-2/+2
|
* stack: Fix gjs_dumpstackJasper St. Pierre2012-09-191-1/+4
| | | | | | | We need to iterate the stack here at least once or the while loop will terminate early. https://bugzilla.gnome.org/show_bug.cgi?id=683992
* configure: Post-release version bumpColin Walters2012-09-181-1/+1
|
* Release 1.33.14GJS_1_33_14Colin Walters2012-09-181-1/+1
|
* build: Explicitly require libffiAlexandre Rostovtsev2012-09-181-1/+1
| | | | | | | | | In >=gobject-introspection-1.33.2, libffi was moved from Requires to Requires.private. Since gjs directly uses ffi functions, a missing PKG_CHECK_MODULES for libffi results in build failure when using GNU gold as the linker. https://bugzilla.gnome.org/show_bug.cgi?id=684064
* Gio: fix a typo in an error pathGiovanni Campagna2012-09-061-1/+1
| | | | | | | log must only be called with one argument. At the same time, improve the log message to be in the usual "prefix: message" format. https://bugzilla.gnome.org/show_bug.cgi?id=680759
* Release 1.33.10GJS_1_33_10Colin Walters2012-09-041-1/+1
|
* Object: don't access priv->info if it's NULLGiovanni Campagna2012-08-271-4/+5
| | | | | | | priv->info can be NULL if the object is known by it's interfaces only (like GDrive or GFile), or if the type is derived in JS, but object_instance_init accessed it anyway for the dtrace probe. A similar change is made to object_instance_finalize, to keep consistency.
* Throw an exception when registering a GType that already existsGiovanni Campagna2012-08-241-0/+5
| | | | | | | The GType system only logs a warning in that case, and it can make bugs harder to track. https://bugzilla.gnome.org/show_bug.cgi?id=669350
* arg: Fix error messageJasper St. Pierre2012-08-201-1/+1
| | | | Int arrays are not string arrays
* function: Use new convenience functions for is_method/can_throw_gerrorJasper St. Pierre2012-08-202-29/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=682305
* Release 1.33.9GJS_1_33_9Colin Walters2012-08-201-1/+1
|
* Squash a few compiler warningsColin Walters2012-08-203-1/+7
|
* Rework typechecking and private data accessGiovanni Campagna2012-08-0818-223/+592
| | | | | | | | | | | | | | | | | | Previously, all type safety checks were inside priv_from_js, which returned NULL if the object was of the wrong class. Except that a lot of code was not checking for NULL, causing potential crashes. Also, we were only checking the JSClass, not the actual type of object, so for example a function accepting a boxed would take in any boxed instance, not just the right one (and then that could crash JS code). Rework this by splitting typechecking and private data access. Internal API for typechecking is provided by all object classes (object, boxed, union, param, gerror) and it takes the necessary amount of information (GType, GIBaseInfo) to ensure type safety. priv_from_js becomes unsafe, and thus ok to call in dangerous data paths such as tracing and finalization. https://bugzilla.gnome.org/show_bug.cgi?id=679688
* function: Correct argument counting for array argumentsJasper St. Pierre2012-08-071-2/+3
| | | | | | | For an (out) array length argument, we were accidentally subtracting it from the expected argc. https://bugzilla.gnome.org/show_bug.cgi?id=680215
* GLib: Don't pass extra arguments to constructorsJasper St. Pierre2012-08-071-4/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=680215
* Boxed: cache the GType in the internal structureGiovanni Campagna2012-08-071-31/+20
| | | | | | | Accessing the GType from the GIRegisteredTypeInfo is not free, while caching it in the instance structure is also cleaner. https://bugzilla.gnome.org/show_bug.cgi?id=679688
* GIRepositoryFunction: don't install a resolve hookGiovanni Campagna2012-08-071-43/+2
| | | | | | | | GI functions don't have lazy properties, so they don't need a resolve hook. This is mainly a code cleanup. https://bugzilla.gnome.org/show_bug.cgi?id=679688
* Fix object countersGiovanni Campagna2012-08-077-1/+11
| | | | | | | | | | Previously object counters were defined as int, which allowed them to be negative. Replacing with unsigned int revealed a number of places where we weren't incrementing properly, in particular in dynamic class definitions (prototypes are finalized, and thus would decrement the counter). https://bugzilla.gnome.org/show_bug.cgi?id=679688
* Use a GTypeModule for registering custom typesGiovanni Campagna2012-08-074-8/+139
| | | | | | | | | | | | | This makes so that the types are installed as dynamic types, and thus loaded and unloaded on demand. In particular, resources such as signal class closures are now properly released when the use count of these types drops to zero. Additionally, to avoid unloading too early, each GObject prototype has a now a reference on the GObjectClass. This means that the above only applies at context destruction, and preserves previous semantics wrt property and signal installation. https://bugzilla.gnome.org/show_bug.cgi?id=679688
* Fix memory leaksGiovanni Campagna2012-08-072-2/+31
| | | | | | | GValues inside flat arrays must be unset when not transferring ownership, and GErrors must be freed after setting the exception. https://bugzilla.gnome.org/show_bug.cgi?id=669350
* build: Add --disable-testsColin Walters2012-07-202-0/+9
| | | | The regress test depends on cairo-gobject which isn't on RHEL6.
* Remove another gobject_required_versionColin Walters2012-07-201-1/+1
|
* Don't use gobject_required_versionColin Walters2012-07-201-1/+1
| | | | It was deleted in an earlier commit.
* Release 1.33.4GJS_1_33_4Colin Walters2012-07-161-1/+1
|
* Various bugs and issues caught by the Clang static analyzerJasper St. Pierre2012-07-134-4/+13
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=679897
* Do not call priv_from_js from the GObject tracerGiovanni Campagna2012-07-051-1/+5
| | | | | | | | priv_from_js calls JS_BeginRequest when it refers to a dynamic JSClass (such as that used by GObjects), and that causes a deadlock when called from the GC thread https://bugzilla.gnome.org/show_bug.cgi?id=678908
* fix mem leak in gjs_value_from_g_argument()Pavel Vasin2012-06-291-1/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=679138
* fix mem leak in gjs_value_to_g_argument()Pavel Vasin2012-06-291-1/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=679138
* build: Link everything to gioColin Walters2012-06-271-4/+3
| | | | | | | | | | Should fix a linker error building the test suite when using -Wl,--no-undefined. This is a fairly aggressive fix; we probably don't need to link all of the modules to gio, but on the other hand, there's really not a strong reason not to, and for people using -Wl,--as-needed any unnecessary linkage due to this will be removed. https://bugzilla.gnome.org/show_bug.cgi?id=678957
* Release 1.33.3GJS_1_33_3Colin Walters2012-06-261-1/+1
|