Esempio n. 1
0
static void
gimp_vectors_tree_view_class_init (GimpVectorsTreeViewClass *klass)
{
  GObjectClass               *object_class = G_OBJECT_CLASS (klass);
  GimpContainerTreeViewClass *view_class   = GIMP_CONTAINER_TREE_VIEW_CLASS (klass);
  GimpItemTreeViewClass      *iv_class     = GIMP_ITEM_TREE_VIEW_CLASS (klass);

  object_class->constructor = gimp_vectors_tree_view_constructor;

  view_class->drop_svg      = gimp_vectors_tree_view_drop_svg;

  iv_class->item_type       = GIMP_TYPE_VECTORS;
  iv_class->signal_name     = "active-vectors-changed";

  iv_class->get_container   = gimp_image_get_vectors;
  iv_class->get_active_item = (GimpGetItemFunc) gimp_image_get_active_vectors;
  iv_class->set_active_item = (GimpSetItemFunc) gimp_image_set_active_vectors;
  iv_class->reorder_item    = (GimpReorderItemFunc) gimp_image_position_vectors;
  iv_class->add_item        = (GimpAddItemFunc) gimp_image_add_vectors;
  iv_class->remove_item     = (GimpRemoveItemFunc) gimp_image_remove_vectors;
  iv_class->new_item        = gimp_vectors_tree_view_item_new;

  iv_class->action_group        = "vectors";
  iv_class->activate_action     = "vectors-path-tool";
  iv_class->edit_action         = "vectors-edit-attributes";
  iv_class->new_action          = "vectors-new";
  iv_class->new_default_action  = "vectors-new-last-values";
  iv_class->raise_action        = "vectors-raise";
  iv_class->raise_top_action    = "vectors-raise-to-top";
  iv_class->lower_action        = "vectors-lower";
  iv_class->lower_bottom_action = "vectors-lower-to-bottom";
  iv_class->duplicate_action    = "vectors-duplicate";
  iv_class->delete_action       = "vectors-delete";
  iv_class->reorder_desc        = _("Reorder path");
}
Esempio n. 2
0
static void
gimp_vectors_tree_view_class_init (GimpVectorsTreeViewClass *klass)
{
  GObjectClass               *object_class = G_OBJECT_CLASS (klass);
  GimpContainerTreeViewClass *view_class   = GIMP_CONTAINER_TREE_VIEW_CLASS (klass);
  GimpItemTreeViewClass      *iv_class     = GIMP_ITEM_TREE_VIEW_CLASS (klass);

  object_class->constructed = gimp_vectors_tree_view_constructed;

  view_class->drop_svg      = gimp_vectors_tree_view_drop_svg;

  iv_class->item_type       = GIMP_TYPE_VECTORS;
  iv_class->signal_name     = "active-vectors-changed";

  iv_class->get_container   = gimp_image_get_vectors;
  iv_class->get_active_item = (GimpGetItemFunc) gimp_image_get_active_vectors;
  iv_class->set_active_item = (GimpSetItemFunc) gimp_image_set_active_vectors;
  iv_class->add_item        = (GimpAddItemFunc) gimp_image_add_vectors;
  iv_class->remove_item     = (GimpRemoveItemFunc) gimp_image_remove_vectors;
  iv_class->new_item        = gimp_vectors_tree_view_item_new;

  iv_class->action_group           = "vectors";
  iv_class->activate_action        = "vectors-path-tool";
  iv_class->edit_action            = "vectors-edit-attributes";
  iv_class->new_action             = "vectors-new";
  iv_class->new_default_action     = "vectors-new-last-values";
  iv_class->raise_action           = "vectors-raise";
  iv_class->raise_top_action       = "vectors-raise-to-top";
  iv_class->lower_action           = "vectors-lower";
  iv_class->lower_bottom_action    = "vectors-lower-to-bottom";
  iv_class->duplicate_action       = "vectors-duplicate";
  iv_class->delete_action          = "vectors-delete";
  iv_class->lock_content_stock_id  = GIMP_STOCK_TOOL_PATH;
  iv_class->lock_content_tooltip   = _("Lock path strokes");
  iv_class->lock_content_help_id   = GIMP_HELP_PATH_LOCK_STROKES;
  iv_class->lock_position_stock_id = GIMP_STOCK_TOOL_MOVE;
  iv_class->lock_position_tooltip  = _("Lock path position");
  iv_class->lock_position_help_id  = GIMP_HELP_PATH_LOCK_POSITION;
}
Esempio n. 3
0
static gboolean
gimp_drawable_tree_view_drop_possible (GimpContainerTreeView   *tree_view,
                                       GimpDndType              src_type,
                                       GimpViewable            *src_viewable,
                                       GimpViewable            *dest_viewable,
                                       GtkTreePath             *drop_path,
                                       GtkTreeViewDropPosition  drop_pos,
                                       GtkTreeViewDropPosition *return_drop_pos,
                                       GdkDragAction           *return_drag_action)
{
  if (GIMP_CONTAINER_TREE_VIEW_CLASS (parent_class)->drop_possible (tree_view,
                                                                    src_type,
                                                                    src_viewable,
                                                                    dest_viewable,
                                                                    drop_path,
                                                                    drop_pos,
                                                                    return_drop_pos,
                                                                    return_drag_action))
    {
      if (src_type == GIMP_DND_TYPE_COLOR ||
          src_type == GIMP_DND_TYPE_PATTERN)
        {
          if (! dest_viewable ||
              gimp_item_is_content_locked (GIMP_ITEM (dest_viewable)) ||
              gimp_viewable_get_children (GIMP_VIEWABLE (dest_viewable)))
            return FALSE;

          if (return_drop_pos)
            {
              *return_drop_pos = GTK_TREE_VIEW_DROP_INTO_OR_AFTER;
            }
        }

      return TRUE;
    }

  return FALSE;
}
Esempio n. 4
0
static void
gimp_drawable_tree_view_drop_viewable (GimpContainerTreeView   *view,
                                       GimpViewable            *src_viewable,
                                       GimpViewable            *dest_viewable,
                                       GtkTreeViewDropPosition  drop_pos)
{
  if (dest_viewable && GIMP_IS_PATTERN (src_viewable))
    {
      gimp_edit_fill_full (gimp_item_get_image (GIMP_ITEM (dest_viewable)),
                           GIMP_DRAWABLE (dest_viewable),
                           NULL, GIMP_PATTERN (src_viewable),
                           GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE,
                           C_("undo-type", "Drop pattern to layer"));

      gimp_image_flush (gimp_item_get_image (GIMP_ITEM (dest_viewable)));
      return;
    }

  GIMP_CONTAINER_TREE_VIEW_CLASS (parent_class)->drop_viewable (view,
                                                                src_viewable,
                                                                dest_viewable,
                                                                drop_pos);
}
Esempio n. 5
0
static void
gimp_drawable_tree_view_class_init (GimpDrawableTreeViewClass *klass)
{
  GObjectClass               *object_class;
  GimpContainerTreeViewClass *tree_view_class;
  GimpItemTreeViewClass      *item_view_class;

  object_class    = G_OBJECT_CLASS (klass);
  tree_view_class = GIMP_CONTAINER_TREE_VIEW_CLASS (klass);
  item_view_class = GIMP_ITEM_TREE_VIEW_CLASS (klass);

  object_class->constructed      = gimp_drawable_tree_view_constructed;

  tree_view_class->drop_possible = gimp_drawable_tree_view_drop_possible;
  tree_view_class->drop_viewable = gimp_drawable_tree_view_drop_viewable;
  tree_view_class->drop_color    = gimp_drawable_tree_view_drop_color;

  item_view_class->set_image     = gimp_drawable_tree_view_set_image;

  item_view_class->lock_content_icon_name  = GIMP_STOCK_TOOL_PAINTBRUSH;
  item_view_class->lock_content_tooltip    = _("Lock pixels");
  item_view_class->lock_position_icon_name = GIMP_STOCK_TOOL_MOVE;
  item_view_class->lock_position_tooltip   = _("Lock position and size");
}