doc/SIGNAL-HOWTO.dox

branch
soc.2013.gobjectification
changeset 34960
c28b627a2900
parent 34800
00331d95b7d0
equal deleted inserted replaced
34959:50b5a20e3595 34960:c28b627a2900
23 23
24 @code 24 @code
25 purple_signal_register( purple_plugins_get_handle(), /* Instance */ 25 purple_signal_register( purple_plugins_get_handle(), /* Instance */
26 "plugin-load", /* Signal name */ 26 "plugin-load", /* Signal name */
27 purple_marshal_VOID__POINTER,/* Marshal function */ 27 purple_marshal_VOID__POINTER,/* Marshal function */
28 NULL, /* Callback return value type */ 28 G_TYPE_NONE, /* Callback return type */
29 1, /* Number of callback arguments (not including void *data) */ 29 1, /* Number of callback arguments (not including void *data) */
30 purple_value_new(PURPLE_TYPE_SUBTYPE,PURPLE_SUBTYPE_PLUGIN) /* Type of first callback argument */ 30 PURPLE_TYPE_PLUGIN /* Type of first callback argument */
31 ); 31 );
32 @endcode 32 @endcode
33 33
34 @subsection Instance 34 @subsection Instance
35 A reference to the object from which this signal is emitted, and to which 35 A reference to the object from which this signal is emitted, and to which
60 @endcode 60 @endcode
61 61
62 The @c void @c *data argument at the end of each callback function 62 The @c void @c *data argument at the end of each callback function
63 provides the data argument given to purple_signal_connect() . 63 provides the data argument given to purple_signal_connect() .
64 64
65 @subsubsection cb_ret_type Callback return value type 65 @subsubsection cb_ret_type Callback return type
66 In our case, this is NULL, meaning "returns void". 66 In our case, this is G_TYPE_NONE, meaning "returns void".
67 @todo This could be described better. 67 @todo This could be described better.
68 68
69 @subsubsection num_args Number of arguments 69 @subsubsection num_args Number of arguments
70 The number of arguments (not including @c data ) that the callback function 70 The number of arguments (not including @c data ) that the callback function
71 will take. 71 will take.
72 72
73 @subsubsection type_arg Type of argument 73 @subsubsection type_arg Type of argument
74 @c purple_value_new(PURPLE_TYPE_SUBTYPE,PURPLE_SUBTYPE_PLUGIN) specifies that 74 @c PURPLE_TYPE_PLUGIN specifies that the first argument given to the callback
75 the first argument given to the callback will be a @c PurplePlugin* . You 75 will be a @c PurplePlugin* . You will need as many "type of argument"
76 will need as many "type of argument" arguments to purple_signal_register() as 76 arguments to purple_signal_register() as you specified in
77 you specified in "Number of arguments" above. 77 "Number of arguments" above.
78 78
79 @todo Describe this more. 79 @todo Describe this more.
80 80
81 @section connect Connecting to the signal 81 @section connect Connecting to the signal
82 Once the signal is registered, you can connect callbacks to it. First, you 82 Once the signal is registered, you can connect callbacks to it. First, you

mercurial