After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 627338 - Allow PeasExtension instances to be used with interface methods.
Allow PeasExtension instances to be used with interface methods.
Status: RESOLVED FIXED
Product: libpeas
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: libpeas-maint
libpeas-maint
Depends on:
Blocks:
 
 
Reported: 2010-08-19 06:52 UTC by Steve Frécinaux
Modified: 2010-08-31 22:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make the various loaders define static types. (9.08 KB, patch)
2010-08-19 06:53 UTC, Steve Frécinaux
committed Details | Review
WIP proxys with interfaces (16.55 KB, patch)
2010-08-19 06:53 UTC, Steve Frécinaux
none Details | Review
Allow PeasExtension instances to be used with interface methods (19.57 KB, patch)
2010-08-24 16:17 UTC, Garrett Regier
none Details | Review
Make PeasExtension implement extension interfaces. (19.49 KB, patch)
2010-08-31 19:17 UTC, Steve Frécinaux
committed Details | Review

Description Steve Frécinaux 2010-08-19 06:52:36 UTC
This would
- require less changes in new applications wishing to use libpeas
- make the overall usage of libpeas nicer and more type safe.
- look like if we were actually using the underlying extension instead of a proxy.
Comment 1 Steve Frécinaux 2010-08-19 06:53:41 UTC
Created attachment 168264 [details] [review]
Make the various loaders define static types.

The main reason for this change is that g_type_query() doesn't return
correct values for dynamic types, and the next commit is going to
introduce a requirement for it.
Comment 2 Steve Frécinaux 2010-08-19 06:53:44 UTC
Created attachment 168265 [details] [review]
WIP proxys with interfaces
Comment 3 Johannes Schmid 2010-08-19 07:31:06 UTC
Review of attachment 168265 [details] [review]:

I really don't know if this change is compatible with the way libpeas used to work before but it looks really good for the use in anjuta.

::: peas-demo/peas-demo-window.c
@@ +48,3 @@
                     DemoWindow       *dw)
 {
+  peas_activatable_activate (PEAS_ACTIVATABLE (exten));

Yeah, this looks much much better!

It would be really nice to get this API in before 3.0 as it will allow to use libpeas for C plugins with interfaces without too much pain.

Thanks a lot!
Comment 4 Steve Frécinaux 2010-08-19 07:38:32 UTC
This is a 100% backward-compatible change to libpeas: new api (as there are new runtime types with interfaces implemented) but no change in behaviour.

I sure hope to get this in before 3.0!
Comment 5 Garrett Regier 2010-08-24 16:17:17 UTC
Created attachment 168653 [details] [review]
Allow PeasExtension instances to be used with interface methods
Comment 6 Steve Frécinaux 2010-08-31 19:17:30 UTC
Created attachment 169188 [details] [review]
Make PeasExtension implement extension interfaces.

This version changes the way the ginterface struct is initialized: we now use g_interface_info_get_vfuncs() like bindings do. Also I didn't implement the class finalization as we don't support it right now (static types) and I'd rather not have unused code. It will come back if/when we use a gtypemodule for the runtime implementations.
Comment 7 Steve Frécinaux 2010-08-31 22:28:04 UTC
Attachment 168264 [details] pushed as f4b3f98 - Make the various loaders define static types.
Attachment 169188 [details] pushed as 4f24c6c - Make PeasExtension implement extension interfaces.