Thursday, August 04, 2005

Mail-remote plugin glue code and GAPI

After adding that LastModfied support to the ECal# bindings, I continued my journey of providing wrappers for the mail-remote plugin. With the enough homework that I did during the day time, started with writing the base prototype that exposes four signals, two for session, one for store and one for folder.

Defined functions to lookup and initialize all the necessary callbacks. We connect to signals provided by the listeners process them and emit our own signals that will be handled in the managed-code.

make && make install went through. Now, the final step, generating C# code for the mail-remote-glue object. *BANG*, gapi spit out something like

store_changed struct _EMailRemoteGlueClass {GObjectClass parent_class;void (*session_shutdown) (EMailRemoteGlue* emrg, gpointer data);void (*folder_changed) (EMailRemoteGlue* emrg, GSList* added, GSList* removed, GSList* changed);}; at /usr/bin/gapi2xml.pl line 881, line 92.


Tried few combinations of typedefs, positioning of "*" in a declaration etc. Nothing helped. Finally, opened the /usr/bin/gapi2xml.pl file to see what is happening in line 881. It clearly mentioned that it is failing while decoding/creating "Signal" definition.

With that clue, I read through the code once again and found out a typical "copy & paste" error, that resulted in the "registration" of same signal twice, which GAPI promptly pointed out.

I fixed that and GAPI and my glue-code lived happily thenafter.

No comments: