RutPropertyClosure * rut_property_connect_callback_full (RutProperty *property, RutBindingCallback callback, void *user_data, GDestroyNotify destroy_notify) { RutPropertyClosure *closure; g_return_val_if_fail (callback != NULL, NULL); closure = g_slice_new (RutPropertyClosure); rut_property_init (&closure->dummy_prop, &dummy_property_spec, NULL); /* no object */ closure->callback = callback; closure->destroy_notify = destroy_notify; closure->user_data = user_data; rut_property_set_binding_full (&closure->dummy_prop, dummy_property_binding_wrapper_cb, closure, dummy_property_destroy_notify_cb, property, NULL); /* null terminator */ return closure; }
void rut_simple_introspectable_init (RutObject *object, RutPropertySpec *specs, RutProperty *properties) { RutSimpleIntrospectableProps *props = rut_object_get_properties (object, RUT_INTERFACE_ID_SIMPLE_INTROSPECTABLE); int n; for (n = 0; specs[n].name; n++) { rut_property_init (&properties[n], &specs[n], object); } props->first_property = properties; props->n_properties = n; }