Exemplo n.º 1
0
static void
set_disabled (RutPropInspector *inspector, DisabledState state)
{
  if (inspector->disabled_state == state)
    return;

  if (inspector->disabled_state == DISABLED_STATE_FULLY)
    {
      rut_graphable_remove_child (inspector->input_region);
      rut_graphable_remove_child (inspector->disabled_overlay);
    }
  else if (inspector->disabled_state == DISABLED_STATE_WIDGET)
    {
      rut_graphable_remove_child (inspector->input_region);
      rut_graphable_remove_child (inspector->disabled_overlay);
    }

  if (state == DISABLED_STATE_FULLY)
    {
      rut_stack_add (inspector->top_stack, inspector->input_region);
      rut_stack_add (inspector->top_stack, inspector->disabled_overlay);
    }
  else if (state == DISABLED_STATE_WIDGET)
    {
      rut_stack_add (inspector->widget_stack, inspector->input_region);
      rut_stack_add (inspector->widget_stack, inspector->disabled_overlay);
    }
}
Exemplo n.º 2
0
static void
entity_state_destroy(entity_state_t *entity_state)
{
    c_llist_t *l;

    for (l = entity_state->control_points; l; l = l->next) {
        control_point_t *point = l->data;
        rut_graphable_remove_child(point->input_region);
        rut_graphable_remove_child(point->transform);
    }

    rut_object_unref(entity_state->entity);

    c_slice_free(entity_state_t, entity_state);
}
Exemplo n.º 3
0
void
rut_bin_set_child (RutBin *bin,
                   RutObject *child_widget)
{
    if (child_widget)
        rut_refable_ref (child_widget);

    if (bin->child)
    {
        rut_graphable_remove_child (bin->child);
        rut_closure_disconnect (bin->child_preferred_size_closure);
        bin->child_preferred_size_closure = NULL;
        rut_refable_unref (bin->child);
    }

    bin->child = child_widget;

    if (child_widget)
    {
        rut_graphable_add_child (bin->child_transform, child_widget);
        bin->child_preferred_size_closure =
            rut_sizable_add_preferred_size_callback (child_widget,
                    child_preferred_size_cb,
                    bin,
                    NULL /* destroy */);
        queue_allocation (bin);
    }

    preferred_size_changed (bin);
}
Exemplo n.º 4
0
Arquivo: rut-shim.c Projeto: cee1/rig
void
rut_shim_set_child (RutShim *shim, RutObject *child)
{
  g_return_if_fail (rut_object_get_type (shim) == &rut_shim_type);

  if (shim->child == child)
    return;

  if (shim->child)
    {
      rut_graphable_remove_child (shim->child);
      rut_closure_disconnect (shim->child_preferred_size_closure);
      shim->child_preferred_size_closure = NULL;
      rut_refable_unref (shim->child);
    }

  if (child)
    {
      shim->child = rut_refable_ref (child);
      rut_graphable_add_child (shim, child);

      shim->child_preferred_size_closure =
        rut_sizable_add_preferred_size_callback (child,
                                                 child_preferred_size_cb,
                                                 shim,
                                                 NULL /* destroy */);
      queue_allocation (shim);
    }
  else
    shim->child = NULL;

  rut_shell_queue_redraw (shim->context->shell);
}
Exemplo n.º 5
0
void
rut_graphable_add_child (RutObject *parent, RutObject *child)
{
  RutGraphableProps *parent_props =
    rut_object_get_properties (parent, RUT_INTERFACE_ID_GRAPHABLE);
  RutGraphableVTable *parent_vtable =
    rut_object_get_vtable (parent, RUT_INTERFACE_ID_GRAPHABLE);
  RutGraphableProps *child_props =
    rut_object_get_properties (child, RUT_INTERFACE_ID_GRAPHABLE);
  RutGraphableVTable *child_vtable =
    rut_object_get_vtable (child, RUT_INTERFACE_ID_GRAPHABLE);
  RutObject *old_parent = child_props->parent;

  rut_refable_claim (child, parent);

  if (old_parent)
    rut_graphable_remove_child (child);

  child_props->parent = parent;
  if (child_vtable && child_vtable->parent_changed)
    child_vtable->parent_changed (child, old_parent, parent);

  if (parent_vtable && parent_vtable->child_added)
    parent_vtable->child_added (parent, child);

  /* XXX: maybe this should be deferred to parent_vtable->child_added ? */
  g_queue_push_tail (&parent_props->children, child);
}
Exemplo n.º 6
0
static void
entity_state_destroy (EntityState *entity_state)
{
  GList *l;

  for (l = entity_state->control_points; l; l = l->next)
    {
      ControlPoint *point = l->data;
      rut_graphable_remove_child (point->input_region);
      rut_graphable_remove_child (point->transform);
    }

  rut_refable_unref (entity_state->entity);

  g_slice_free (EntityState, entity_state);
}
Exemplo n.º 7
0
static void
_rut_button_free (void *object)
{
  RutButton *button = object;

  rut_closure_list_disconnect_all (&button->on_click_cb_list);

  destroy_button_slices (button);

  if (button->normal_texture)
    {
      cogl_object_unref (button->normal_texture);
      button->normal_texture = NULL;
    }

  if (button->hover_texture)
    {
      cogl_object_unref (button->hover_texture);
      button->hover_texture = NULL;
    }

  if (button->active_texture)
    {
      cogl_object_unref (button->active_texture);
      button->active_texture = NULL;
    }

  if (button->disabled_texture)
    {
      cogl_object_unref (button->disabled_texture);
      button->disabled_texture = NULL;
    }

  rut_graphable_remove_child (button->text);
  rut_refable_unref (button->text);

  rut_graphable_remove_child (button->text_transform);
  rut_refable_unref (button->text_transform);

  rut_graphable_destroy (button);

  rut_shell_remove_pre_paint_callback_by_graphable (button->ctx->shell, button);

  g_slice_free (RutButton, object);
}
Exemplo n.º 8
0
void
rut_graphable_remove_all_children (RutObject *parent)
{
  RutGraphableProps *parent_props =
    rut_object_get_properties (parent, RUT_INTERFACE_ID_GRAPHABLE);
  RutObject *child;

  while ((child = g_queue_pop_tail (&parent_props->children)))
    rut_graphable_remove_child (child);
}
Exemplo n.º 9
0
static void
_rut_bin_free (void *object)
{
    RutBin *bin = object;

    rut_closure_list_disconnect_all (&bin->preferred_size_cb_list);

    rut_bin_set_child (bin, NULL);

    rut_shell_remove_pre_paint_callback (bin->context->shell, bin);

    rut_refable_unref (bin->context);

    rut_graphable_remove_child (bin->child_transform);
    rut_refable_unref (bin->child_transform);

    rut_graphable_destroy (bin);

    g_slice_free (RutBin, bin);
}
Exemplo n.º 10
0
static void
_rut_icon_button_free (void *object)
{
  RutIconButton *button = object;

  rut_closure_list_disconnect_all (&button->on_click_cb_list);

  destroy_icons (button);

  if (button->label)
    {
      rut_graphable_remove_child (button->label);
      rut_refable_unref (button->label);
    }

  /* NB: This will destroy the stack, layout and input_region which
   * we don't hold extra references for... */
  rut_graphable_destroy (button);

  g_slice_free (RutIconButton, object);
}
Exemplo n.º 11
0
Arquivo: rut-bin.c Projeto: cee1/rig
void
rut_bin_set_child (RutBin *bin,
                   RutObject *child_widget)
{
  g_return_if_fail (rut_object_get_type (bin) == &rut_bin_type);

  if (bin->child == child_widget)
    return;

  if (child_widget)
    rut_refable_claim (child_widget, bin);

  if (bin->child)
    {
      rut_graphable_remove_child (bin->child);
      rut_closure_disconnect (bin->child_preferred_size_closure);
      bin->child_preferred_size_closure = NULL;
      rut_refable_release (bin->child, bin);
    }

  bin->child = child_widget;

  if (child_widget)
    {
      rut_graphable_add_child (bin->child_transform, child_widget);
      bin->child_preferred_size_closure =
        rut_sizable_add_preferred_size_callback (child_widget,
                                                 child_preferred_size_cb,
                                                 bin,
                                                 NULL /* destroy */);
      queue_allocation (bin);
    }

  preferred_size_changed (bin);
  rut_shell_queue_redraw (bin->context->shell);
}
Exemplo n.º 12
0
Arquivo: rut-shim.c Projeto: cee1/rig
void
rut_shim_remove_child (RutShim *shim, RutObject *child)
{
  g_return_if_fail (rut_object_get_type (shim) == &rut_shim_type);
  rut_graphable_remove_child (child);
}
Exemplo n.º 13
0
Arquivo: rut-fixed.c Projeto: cee1/rig
void
rut_fixed_remove_child (RutFixed *fixed, RutObject *child)
{
  g_return_if_fail (rut_object_get_type (fixed) == &rut_fixed_type);
  rut_graphable_remove_child (child);
}