1 /* GIMP - The GNU Image Manipulation Program 2 * Copyright (C) 1995 Spencer Kimball and Peter Mattis 3 * 4 * gimpcontainertreeview.h 5 * Copyright (C) 2003-2004 Michael Natterer <mitch@gimp.org> 6 * 7 * This program is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program. If not, see <https://www.gnu.org/licenses/>. 19 */ 20 21 #ifndef __GIMP_CONTAINER_TREE_VIEW_H__ 22 #define __GIMP_CONTAINER_TREE_VIEW_H__ 23 24 25 #include "gimpcontainerbox.h" 26 27 28 #define GIMP_TYPE_CONTAINER_TREE_VIEW (gimp_container_tree_view_get_type ()) 29 #define GIMP_CONTAINER_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CONTAINER_TREE_VIEW, GimpContainerTreeView)) 30 #define GIMP_CONTAINER_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CONTAINER_TREE_VIEW, GimpContainerTreeViewClass)) 31 #define GIMP_IS_CONTAINER_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_CONTAINER_TREE_VIEW)) 32 #define GIMP_IS_CONTAINER_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CONTAINER_TREE_VIEW)) 33 #define GIMP_CONTAINER_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_CONTAINER_TREE_VIEW, GimpContainerTreeViewClass)) 34 35 36 typedef struct _GimpContainerTreeViewClass GimpContainerTreeViewClass; 37 typedef struct _GimpContainerTreeViewPrivate GimpContainerTreeViewPrivate; 38 39 struct _GimpContainerTreeView 40 { 41 GimpContainerBox parent_instance; 42 43 GtkTreeModel *model; 44 gint n_model_columns; 45 GType model_columns[16]; 46 47 GtkTreeView *view; 48 49 GtkTreeViewColumn *main_column; 50 GtkCellRenderer *renderer_cell; 51 52 Gimp *dnd_gimp; /* eek */ 53 54 GimpContainerTreeViewPrivate *priv; 55 }; 56 57 struct _GimpContainerTreeViewClass 58 { 59 GimpContainerBoxClass parent_class; 60 61 /* signals */ 62 63 void (* edit_name) (GimpContainerTreeView *tree_view); 64 65 /* virtual functions */ 66 67 gboolean (* drop_possible) (GimpContainerTreeView *tree_view, 68 GimpDndType src_type, 69 GimpViewable *src_viewable, 70 GimpViewable *dest_viewable, 71 GtkTreePath *drop_path, 72 GtkTreeViewDropPosition drop_pos, 73 GtkTreeViewDropPosition *return_drop_pos, 74 GdkDragAction *return_drag_action); 75 void (* drop_viewable) (GimpContainerTreeView *tree_view, 76 GimpViewable *src_viewable, 77 GimpViewable *dest_viewable, 78 GtkTreeViewDropPosition drop_pos); 79 void (* drop_color) (GimpContainerTreeView *tree_view, 80 const GimpRGB *src_color, 81 GimpViewable *dest_viewable, 82 GtkTreeViewDropPosition drop_pos); 83 void (* drop_uri_list) (GimpContainerTreeView *tree_view, 84 GList *uri_list, 85 GimpViewable *dest_viewable, 86 GtkTreeViewDropPosition drop_pos); 87 void (* drop_svg) (GimpContainerTreeView *tree_view, 88 const gchar *svg_data, 89 gsize svg_data_length, 90 GimpViewable *dest_viewable, 91 GtkTreeViewDropPosition drop_pos); 92 void (* drop_component) (GimpContainerTreeView *tree_view, 93 GimpImage *image, 94 GimpChannelType component, 95 GimpViewable *dest_viewable, 96 GtkTreeViewDropPosition drop_pos); 97 void (* drop_pixbuf) (GimpContainerTreeView *tree_view, 98 GdkPixbuf *pixbuf, 99 GimpViewable *dest_viewable, 100 GtkTreeViewDropPosition drop_pos); 101 }; 102 103 104 GType gimp_container_tree_view_get_type (void) G_GNUC_CONST; 105 106 GtkWidget * gimp_container_tree_view_new (GimpContainer *container, 107 GimpContext *context, 108 gint view_size, 109 gint view_border_width); 110 111 GtkCellRenderer * 112 gimp_container_tree_view_get_name_cell 113 (GimpContainerTreeView *tree_view); 114 115 void gimp_container_tree_view_set_main_column_title 116 (GimpContainerTreeView *tree_view, 117 const gchar *title); 118 119 void gimp_container_tree_view_add_toggle_cell 120 (GimpContainerTreeView *tree_view, 121 GtkCellRenderer *cell); 122 123 void gimp_container_tree_view_add_renderer_cell 124 (GimpContainerTreeView *tree_view, 125 GtkCellRenderer *cell); 126 127 void gimp_container_tree_view_set_dnd_drop_to_empty 128 (GimpContainerTreeView *tree_view, 129 gboolean dnd_drop_to_emtpy); 130 void gimp_container_tree_view_connect_name_edited 131 (GimpContainerTreeView *tree_view, 132 GCallback callback, 133 gpointer data); 134 gboolean gimp_container_tree_view_name_edited 135 (GtkCellRendererText *cell, 136 const gchar *path_str, 137 const gchar *new_name, 138 GimpContainerTreeView *tree_view); 139 140 141 #endif /* __GIMP_CONTAINER_TREE_VIEW_H__ */ 142