Exemple #1
0
/**
 * crank_composite_steal_qdata:
 * @composite: A Composite.
 * @compositable: A Compositable.
 * @key: A Key.
 *
 * Gets a data with @key for @compositable.
 *
 * Returns: (transfer full): A Data.
 */
gpointer
crank_composite_steal_qdata (CrankComposite    *composite,
                             CrankCompositable *compositable,
                             const GQuark       key)
{
  CrankCompositePrivate *priv = crank_composite_get_instance_private (composite);
  Percompositable *percompositable;
  gint i = crank_composite_index_of_compositable (composite, compositable);

  if (i == -1)
    {
      g_warning ("Composite does not have Compositable.\n"
                 "  %s@%p : %s@%p",
                 G_OBJECT_TYPE_NAME (composite), composite,
                 G_OBJECT_TYPE_NAME (compositable), compositable);

      return NULL;
    }

  else
    {
      percompositable = & g_array_index (priv->data, Percompositable, i);
      return g_datalist_id_remove_no_notify (& percompositable->dictionary, key);
    }
}
Exemple #2
0
void
ibus_serializable_remove_qattachment (IBusSerializable *object,
                                      GQuark            key)
{

    g_return_if_fail (IBUS_IS_SERIALIZABLE (object));
    g_return_if_fail (key != 0);

    IBusSerializablePrivate *priv;
    priv = IBUS_SERIALIZABLE_GET_PRIVATE (object);

    g_datalist_id_remove_no_notify (&priv->attachments, key);
}