• Home
  • Raw
  • Download

Lines Matching refs:closure

101   GClosure closure;  member
113 _SET_OLD tmp.closure._field; \
114 tmp.closure._field _OP _value; \
115 _SET_NEW tmp.closure._field; \
196 GClosure *closure; in g_closure_new_simple() local
200 closure = g_malloc0 (sizeof_closure); in g_closure_new_simple()
201 SET (closure, ref_count, 1); in g_closure_new_simple()
202 SET (closure, meta_marshal, 0); in g_closure_new_simple()
203 SET (closure, n_guards, 0); in g_closure_new_simple()
204 SET (closure, n_fnotifiers, 0); in g_closure_new_simple()
205 SET (closure, n_inotifiers, 0); in g_closure_new_simple()
206 SET (closure, in_inotify, FALSE); in g_closure_new_simple()
207 SET (closure, floating, TRUE); in g_closure_new_simple()
208 SET (closure, derivative_flag, 0); in g_closure_new_simple()
209 SET (closure, in_marshal, FALSE); in g_closure_new_simple()
210 SET (closure, is_invalid, FALSE); in g_closure_new_simple()
211 closure->marshal = NULL; in g_closure_new_simple()
212 closure->data = data; in g_closure_new_simple()
213 closure->notifiers = NULL; in g_closure_new_simple()
214 memset (G_STRUCT_MEMBER_P (closure, sizeof (*closure)), 0, sizeof_closure - sizeof (*closure)); in g_closure_new_simple()
216 return closure; in g_closure_new_simple()
220 closure_invoke_notifiers (GClosure *closure, in closure_invoke_notifiers() argument
246 while (closure->n_fnotifiers) in closure_invoke_notifiers()
249 DEC_ASSIGN (closure, n_fnotifiers, &n); in closure_invoke_notifiers()
251 ndata = closure->notifiers + CLOSURE_N_MFUNCS (closure) + n; in closure_invoke_notifiers()
252 closure->marshal = (GClosureMarshal) ndata->notify; in closure_invoke_notifiers()
253 closure->data = ndata->data; in closure_invoke_notifiers()
254 ndata->notify (ndata->data, closure); in closure_invoke_notifiers()
256 closure->marshal = NULL; in closure_invoke_notifiers()
257 closure->data = NULL; in closure_invoke_notifiers()
260 SET (closure, in_inotify, TRUE); in closure_invoke_notifiers()
261 while (closure->n_inotifiers) in closure_invoke_notifiers()
264 DEC_ASSIGN (closure, n_inotifiers, &n); in closure_invoke_notifiers()
266 ndata = closure->notifiers + CLOSURE_N_MFUNCS (closure) + closure->n_fnotifiers + n; in closure_invoke_notifiers()
267 closure->marshal = (GClosureMarshal) ndata->notify; in closure_invoke_notifiers()
268 closure->data = ndata->data; in closure_invoke_notifiers()
269 ndata->notify (ndata->data, closure); in closure_invoke_notifiers()
271 closure->marshal = NULL; in closure_invoke_notifiers()
272 closure->data = NULL; in closure_invoke_notifiers()
273 SET (closure, in_inotify, FALSE); in closure_invoke_notifiers()
276 i = closure->n_guards; in closure_invoke_notifiers()
277 offs = closure->meta_marshal; in closure_invoke_notifiers()
280 ndata = closure->notifiers + offs + i; in closure_invoke_notifiers()
281 ndata->notify (ndata->data, closure); in closure_invoke_notifiers()
285 i = closure->n_guards; in closure_invoke_notifiers()
286 offs = closure->meta_marshal + i; in closure_invoke_notifiers()
289 ndata = closure->notifiers + offs + i; in closure_invoke_notifiers()
290 ndata->notify (ndata->data, closure); in closure_invoke_notifiers()
319 g_closure_set_meta_marshal (GClosure *closure, in g_closure_set_meta_marshal() argument
325 g_return_if_fail (closure != NULL); in g_closure_set_meta_marshal()
327 g_return_if_fail (closure->is_invalid == FALSE); in g_closure_set_meta_marshal()
328 g_return_if_fail (closure->in_marshal == FALSE); in g_closure_set_meta_marshal()
329 g_return_if_fail (closure->meta_marshal == 0); in g_closure_set_meta_marshal()
331 notifiers = closure->notifiers; in g_closure_set_meta_marshal()
332 closure->notifiers = g_renew (GClosureNotifyData, NULL, CLOSURE_N_NOTIFIERS (closure) + 1); in g_closure_set_meta_marshal()
338 …g_memmove (closure->notifiers + 1, notifiers, CLOSURE_N_NOTIFIERS (closure) * sizeof (notifiers[0]… in g_closure_set_meta_marshal()
341 closure->notifiers[0].data = marshal_data; in g_closure_set_meta_marshal()
342 closure->notifiers[0].notify = (GClosureNotify) meta_marshal; in g_closure_set_meta_marshal()
343 SET (closure, meta_marshal, 1); in g_closure_set_meta_marshal()
360 g_closure_add_marshal_guards (GClosure *closure, in g_closure_add_marshal_guards() argument
368 g_return_if_fail (closure != NULL); in g_closure_add_marshal_guards()
371 g_return_if_fail (closure->is_invalid == FALSE); in g_closure_add_marshal_guards()
372 g_return_if_fail (closure->in_marshal == FALSE); in g_closure_add_marshal_guards()
373 g_return_if_fail (closure->n_guards < CLOSURE_MAX_N_GUARDS); in g_closure_add_marshal_guards()
375closure->notifiers = g_renew (GClosureNotifyData, closure->notifiers, CLOSURE_N_NOTIFIERS (closure in g_closure_add_marshal_guards()
376 if (closure->n_inotifiers) in g_closure_add_marshal_guards()
377 closure->notifiers[(CLOSURE_N_MFUNCS (closure) + in g_closure_add_marshal_guards()
378 closure->n_fnotifiers + in g_closure_add_marshal_guards()
379 closure->n_inotifiers + 1)] = closure->notifiers[(CLOSURE_N_MFUNCS (closure) + in g_closure_add_marshal_guards()
380 closure->n_fnotifiers + 0)]; in g_closure_add_marshal_guards()
381 if (closure->n_inotifiers > 1) in g_closure_add_marshal_guards()
382 closure->notifiers[(CLOSURE_N_MFUNCS (closure) + in g_closure_add_marshal_guards()
383 closure->n_fnotifiers + in g_closure_add_marshal_guards()
384 closure->n_inotifiers)] = closure->notifiers[(CLOSURE_N_MFUNCS (closure) + in g_closure_add_marshal_guards()
385 closure->n_fnotifiers + 1)]; in g_closure_add_marshal_guards()
386 if (closure->n_fnotifiers) in g_closure_add_marshal_guards()
387 closure->notifiers[(CLOSURE_N_MFUNCS (closure) + in g_closure_add_marshal_guards()
388 closure->n_fnotifiers + 1)] = closure->notifiers[CLOSURE_N_MFUNCS (closure) + 0]; in g_closure_add_marshal_guards()
389 if (closure->n_fnotifiers > 1) in g_closure_add_marshal_guards()
390 closure->notifiers[(CLOSURE_N_MFUNCS (closure) + in g_closure_add_marshal_guards()
391 closure->n_fnotifiers)] = closure->notifiers[CLOSURE_N_MFUNCS (closure) + 1]; in g_closure_add_marshal_guards()
392 if (closure->n_guards) in g_closure_add_marshal_guards()
393 closure->notifiers[(closure->meta_marshal + in g_closure_add_marshal_guards()
394 closure->n_guards + in g_closure_add_marshal_guards()
395 closure->n_guards + 1)] = closure->notifiers[closure->meta_marshal + closure->n_guards]; in g_closure_add_marshal_guards()
396 i = closure->n_guards; in g_closure_add_marshal_guards()
397 closure->notifiers[closure->meta_marshal + i].data = pre_marshal_data; in g_closure_add_marshal_guards()
398 closure->notifiers[closure->meta_marshal + i].notify = pre_marshal_notify; in g_closure_add_marshal_guards()
399 closure->notifiers[closure->meta_marshal + i + 1].data = post_marshal_data; in g_closure_add_marshal_guards()
400 closure->notifiers[closure->meta_marshal + i + 1].notify = post_marshal_notify; in g_closure_add_marshal_guards()
401 INC (closure, n_guards); in g_closure_add_marshal_guards()
418 g_closure_add_finalize_notifier (GClosure *closure, in g_closure_add_finalize_notifier() argument
424 g_return_if_fail (closure != NULL); in g_closure_add_finalize_notifier()
426 g_return_if_fail (closure->n_fnotifiers < CLOSURE_MAX_N_FNOTIFIERS); in g_closure_add_finalize_notifier()
428closure->notifiers = g_renew (GClosureNotifyData, closure->notifiers, CLOSURE_N_NOTIFIERS (closure in g_closure_add_finalize_notifier()
429 if (closure->n_inotifiers) in g_closure_add_finalize_notifier()
430 closure->notifiers[(CLOSURE_N_MFUNCS (closure) + in g_closure_add_finalize_notifier()
431 closure->n_fnotifiers + in g_closure_add_finalize_notifier()
432 closure->n_inotifiers)] = closure->notifiers[(CLOSURE_N_MFUNCS (closure) + in g_closure_add_finalize_notifier()
433 closure->n_fnotifiers + 0)]; in g_closure_add_finalize_notifier()
434 i = CLOSURE_N_MFUNCS (closure) + closure->n_fnotifiers; in g_closure_add_finalize_notifier()
435 closure->notifiers[i].data = notify_data; in g_closure_add_finalize_notifier()
436 closure->notifiers[i].notify = notify_func; in g_closure_add_finalize_notifier()
437 INC (closure, n_fnotifiers); in g_closure_add_finalize_notifier()
452 g_closure_add_invalidate_notifier (GClosure *closure, in g_closure_add_invalidate_notifier() argument
458 g_return_if_fail (closure != NULL); in g_closure_add_invalidate_notifier()
460 g_return_if_fail (closure->is_invalid == FALSE); in g_closure_add_invalidate_notifier()
461 g_return_if_fail (closure->n_inotifiers < CLOSURE_MAX_N_INOTIFIERS); in g_closure_add_invalidate_notifier()
463closure->notifiers = g_renew (GClosureNotifyData, closure->notifiers, CLOSURE_N_NOTIFIERS (closure in g_closure_add_invalidate_notifier()
464 i = CLOSURE_N_MFUNCS (closure) + closure->n_fnotifiers + closure->n_inotifiers; in g_closure_add_invalidate_notifier()
465 closure->notifiers[i].data = notify_data; in g_closure_add_invalidate_notifier()
466 closure->notifiers[i].notify = notify_func; in g_closure_add_invalidate_notifier()
467 INC (closure, n_inotifiers); in g_closure_add_invalidate_notifier()
471 closure_try_remove_inotify (GClosure *closure, in closure_try_remove_inotify() argument
477 nlast = closure->notifiers + CLOSURE_N_NOTIFIERS (closure) - 1; in closure_try_remove_inotify()
478 for (ndata = nlast + 1 - closure->n_inotifiers; ndata <= nlast; ndata++) in closure_try_remove_inotify()
481 DEC (closure, n_inotifiers); in closure_try_remove_inotify()
491 closure_try_remove_fnotify (GClosure *closure, in closure_try_remove_fnotify() argument
497 nlast = closure->notifiers + CLOSURE_N_NOTIFIERS (closure) - closure->n_inotifiers - 1; in closure_try_remove_fnotify()
498 for (ndata = nlast + 1 - closure->n_fnotifiers; ndata <= nlast; ndata++) in closure_try_remove_fnotify()
501 DEC (closure, n_fnotifiers); in closure_try_remove_fnotify()
504 if (closure->n_inotifiers) in closure_try_remove_fnotify()
505 closure->notifiers[(CLOSURE_N_MFUNCS (closure) + in closure_try_remove_fnotify()
506 closure->n_fnotifiers)] = closure->notifiers[(CLOSURE_N_MFUNCS (closure) + in closure_try_remove_fnotify()
507 closure->n_fnotifiers + in closure_try_remove_fnotify()
508 closure->n_inotifiers)]; in closure_try_remove_fnotify()
524 g_closure_ref (GClosure *closure) in g_closure_ref() argument
527 g_return_val_if_fail (closure != NULL, NULL); in g_closure_ref()
528 g_return_val_if_fail (closure->ref_count > 0, NULL); in g_closure_ref()
529 g_return_val_if_fail (closure->ref_count < CLOSURE_MAX_REF_COUNT, NULL); in g_closure_ref()
531 INC_ASSIGN (closure, ref_count, &new_ref_count); in g_closure_ref()
534 return closure; in g_closure_ref()
556 g_closure_invalidate (GClosure *closure) in g_closure_invalidate() argument
558 g_return_if_fail (closure != NULL); in g_closure_invalidate()
560 if (!closure->is_invalid) in g_closure_invalidate()
563 g_closure_ref (closure); /* preserve floating flag */ in g_closure_invalidate()
564 SWAP (closure, is_invalid, TRUE, &was_invalid); in g_closure_invalidate()
567 closure_invoke_notifiers (closure, INOTIFY); in g_closure_invalidate()
568 g_closure_unref (closure); in g_closure_invalidate()
581 g_closure_unref (GClosure *closure) in g_closure_unref() argument
585 g_return_if_fail (closure != NULL); in g_closure_unref()
586 g_return_if_fail (closure->ref_count > 0); in g_closure_unref()
588 if (closure->ref_count == 1) /* last unref, invalidate first */ in g_closure_unref()
589 g_closure_invalidate (closure); in g_closure_unref()
591 DEC_ASSIGN (closure, ref_count, &new_ref_count); in g_closure_unref()
595 closure_invoke_notifiers (closure, FNOTIFY); in g_closure_unref()
596 g_free (closure->notifiers); in g_closure_unref()
597 g_free (closure); in g_closure_unref()
648 g_closure_sink (GClosure *closure) in g_closure_sink() argument
650 g_return_if_fail (closure != NULL); in g_closure_sink()
651 g_return_if_fail (closure->ref_count > 0); in g_closure_sink()
658 if (closure->floating) in g_closure_sink()
661 SWAP (closure, floating, FALSE, &was_floating); in g_closure_sink()
664 g_closure_unref (closure); in g_closure_sink()
680 g_closure_remove_invalidate_notifier (GClosure *closure, in g_closure_remove_invalidate_notifier() argument
684 g_return_if_fail (closure != NULL); in g_closure_remove_invalidate_notifier()
687 …if (closure->is_invalid && closure->in_inotify && /* account removal of notify_func() while it's c… in g_closure_remove_invalidate_notifier()
688 ((gpointer) closure->marshal) == ((gpointer) notify_func) && in g_closure_remove_invalidate_notifier()
689 closure->data == notify_data) in g_closure_remove_invalidate_notifier()
690 closure->marshal = NULL; in g_closure_remove_invalidate_notifier()
691 else if (!closure_try_remove_inotify (closure, notify_data, notify_func)) in g_closure_remove_invalidate_notifier()
708 g_closure_remove_finalize_notifier (GClosure *closure, in g_closure_remove_finalize_notifier() argument
712 g_return_if_fail (closure != NULL); in g_closure_remove_finalize_notifier()
715 …if (closure->is_invalid && !closure->in_inotify && /* account removal of notify_func() while it's … in g_closure_remove_finalize_notifier()
716 ((gpointer) closure->marshal) == ((gpointer) notify_func) && in g_closure_remove_finalize_notifier()
717 closure->data == notify_data) in g_closure_remove_finalize_notifier()
718 closure->marshal = NULL; in g_closure_remove_finalize_notifier()
719 else if (!closure_try_remove_fnotify (closure, notify_data, notify_func)) in g_closure_remove_finalize_notifier()
737 g_closure_invoke (GClosure *closure, in g_closure_invoke() argument
743 g_return_if_fail (closure != NULL); in g_closure_invoke()
745 g_closure_ref (closure); /* preserve floating flag */ in g_closure_invoke()
746 if (!closure->is_invalid) in g_closure_invoke()
750 gboolean in_marshal = closure->in_marshal; in g_closure_invoke()
752 g_return_if_fail (closure->marshal || closure->meta_marshal); in g_closure_invoke()
754 SET (closure, in_marshal, TRUE); in g_closure_invoke()
755 if (closure->meta_marshal) in g_closure_invoke()
757 marshal_data = closure->notifiers[0].data; in g_closure_invoke()
758 marshal = (GClosureMarshal) closure->notifiers[0].notify; in g_closure_invoke()
763 marshal = closure->marshal; in g_closure_invoke()
766 closure_invoke_notifiers (closure, PRE_NOTIFY); in g_closure_invoke()
767 marshal (closure, in g_closure_invoke()
773 closure_invoke_notifiers (closure, POST_NOTIFY); in g_closure_invoke()
774 SET (closure, in_marshal, in_marshal); in g_closure_invoke()
776 g_closure_unref (closure); in g_closure_invoke()
792 g_closure_set_marshal (GClosure *closure, in g_closure_set_marshal() argument
795 g_return_if_fail (closure != NULL); in g_closure_set_marshal()
798 if (closure->marshal && closure->marshal != marshal) in g_closure_set_marshal()
800 closure->marshal, marshal); in g_closure_set_marshal()
802 closure->marshal = marshal; in g_closure_set_marshal()
821 GClosure *closure; in g_cclosure_new() local
825 closure = g_closure_new_simple (sizeof (GCClosure), user_data); in g_cclosure_new()
827 g_closure_add_finalize_notifier (closure, user_data, destroy_data); in g_cclosure_new()
828 ((GCClosure*) closure)->callback = (gpointer) callback_func; in g_cclosure_new()
830 return closure; in g_cclosure_new()
849 GClosure *closure; in g_cclosure_new_swap() local
853 closure = g_closure_new_simple (sizeof (GCClosure), user_data); in g_cclosure_new_swap()
855 g_closure_add_finalize_notifier (closure, user_data, destroy_data); in g_cclosure_new_swap()
856 ((GCClosure*) closure)->callback = (gpointer) callback_func; in g_cclosure_new_swap()
857 SET (closure, derivative_flag, TRUE); in g_cclosure_new_swap()
859 return closure; in g_cclosure_new_swap()
863 g_type_class_meta_marshal (GClosure *closure, in g_type_class_meta_marshal() argument
878 closure->marshal (closure, in g_type_class_meta_marshal()
886 g_type_iface_meta_marshal (GClosure *closure, in g_type_iface_meta_marshal() argument
895 GType itype = (GType) closure->data; in g_type_iface_meta_marshal()
901 closure->marshal (closure, in g_type_iface_meta_marshal()
924 GClosure *closure; in g_signal_type_cclosure_new() local
929 closure = g_closure_new_simple (sizeof (GClosure), (gpointer) itype); in g_signal_type_cclosure_new()
931 … g_closure_set_meta_marshal (closure, GUINT_TO_POINTER (struct_offset), g_type_iface_meta_marshal); in g_signal_type_cclosure_new()
933 … g_closure_set_meta_marshal (closure, GUINT_TO_POINTER (struct_offset), g_type_class_meta_marshal); in g_signal_type_cclosure_new()
935 return closure; in g_signal_type_cclosure_new()