Exemple #1
0
//FIXME this looks weird
void
sheet_release_selected_objects (Sheet *sheet)
{
	GList *list, *copy;
	GooCanvasGroup *group;
	gint   item_nbr;
	
	g_return_if_fail (sheet != NULL);
	g_return_if_fail (IS_SHEET (sheet));

	group = sheet->priv->selected_group;
	copy = g_list_copy (sheet->priv->selected_objects);
	
	// Remove all the selected_objects into selected_group
	for (list = copy; list; list = list->next) {
		item_nbr = goo_canvas_item_find_child (GOO_CANVAS_ITEM (group),
		                                      GOO_CANVAS_ITEM (list->data));
		goo_canvas_item_remove_child (GOO_CANVAS_ITEM (group),
		                              item_nbr);
	}
	g_list_free (copy);
		
	g_list_free (sheet->priv->selected_objects);
	sheet->priv->selected_objects = NULL;
}
Exemple #2
0
static VALUE
rg_remove_child(VALUE self, VALUE child)
{
    gint child_num;

    child_num = goo_canvas_item_find_child(SELF(self), SELF(child));
    goo_canvas_item_remove_child(SELF(self), child_num);
    G_CHILD_REMOVE(self, child);

    return self;
}
Exemple #3
0
static gint
goo_canvas_item_accessible_get_index_in_parent (AtkObject *accessible)
{
  GooCanvasItem *item, *parent;
  GooCanvas *canvas;
  GObject *object;

  g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (accessible), -1);

  if (accessible->accessible_parent)
    {
      gint n_children, i;
      gboolean found = FALSE;

      n_children = atk_object_get_n_accessible_children (accessible->accessible_parent);
      for (i = 0; i < n_children; i++)
        {
          AtkObject *child;

          child = atk_object_ref_accessible_child (accessible->accessible_parent, i);
          if (child == accessible)
            found = TRUE;

          g_object_unref (child);
          if (found)
            return i;
        }
      return -1;
    }

  object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible));
  if (object == NULL)
    return -1;

  item = GOO_CANVAS_ITEM (object);
  parent = goo_canvas_item_get_parent (item);

  if (parent)
    return goo_canvas_item_find_child (parent, item);

  canvas = goo_canvas_item_get_canvas (item);
  if (canvas)
    return 0;

  return -1;
}