signals handlers need to have a very specific signature, which is not
the case of _lib_tag_gui_update


according to glib documentation

return_type function_callback (gpointer instance, ... , gpointer user_data);

in your case
* return type is void
* ... is empty

user_data is something you have passed when registering the callback
instance is (in our case) some internal DT data you don't need

none of these are the "self" you are looking for. If you need to pass
a gpointer through a signal, this is possible, but a bit tricky

you need to pass "self" as an extra parameter when sending the signal

you need to change signal.c to accept the parameter

  
{"dt-control-profile-changed",NULL,NULL,G_TYPE_NONE,g_cclosure_marshal_VOID__VOID,0,NULL},

becomes

  
{"dt-control-profile-changed",NULL,NULL,G_TYPE_NONE,g_cclosure_marshal_VOID__GPOINTER,1,gpointer_param},

with gpointer_param defined in a way similar to the existing uint_param

and remember to document in signal.h

hope this helps...
Boucman

On Fri, Nov 30, 2012 at 3:02 PM, Ivan Tarozzi <[email protected]> wrote:
> Hi,
> I'm working on bug#8710 to refresh keyword module when add/del/mod tags.
>
> I created a new signal DT_SIGNAL_TAG_CHANGED raised in /src/common/tags.c
>
> Then I reworked the /src/libs/keywords.c.
> Created a new _lib_tag_gui_update  and moved the code inside to populate
> the gtk tree.
>
> In gui_init I connected new function to DT_SIGNAL_TAG_CHANGED.
>
> Now, when I call _lib_tag_gui_update from gui_init (passing self) it
> works (when darktable starts).
>
> When I add/del/mod tags, the signal is raised and function is called,
> but I obtain a segfault:
>
> http://pastebin.com/sEgQsWbE
>
> I fear the problem is at line 345, where d = 0x00.
>
> Seems when function is called by callback signal, self is not passed
> with a right value.
>
> Could please someone tell me where I'm wrong? I'm going crazy :)
>
>
> I pushed the code at:
> https://github.com/itarozzi/darktable  -> branch "bug#8710"
>
> Thanks in advance.
>
> Ivan
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> TUNE You got it built. Now make it sing. Tune shows you how.
> http://goparallel.sourceforge.net
> _______________________________________________
> darktable-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/darktable-devel

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
TUNE You got it built. Now make it sing. Tune shows you how.
http://goparallel.sourceforge.net
_______________________________________________
darktable-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/darktable-devel

Reply via email to