gtkiconviewprivate.h 4.41 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/* gtkiconview.h
 * Copyright (C) 2002, 2004  Anders Carlsson <andersca@gnome.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
Javier Jardón's avatar
Javier Jardón committed
15
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
 */

#include "gtk/gtkiconview.h"

#ifndef __GTK_ICON_VIEW_PRIVATE_H__
#define __GTK_ICON_VIEW_PRIVATE_H__

typedef struct _GtkIconViewItem GtkIconViewItem;
struct _GtkIconViewItem
{
  GdkRectangle cell_area;

  gint index;
  
  gint row, col;

  guint selected : 1;
  guint selected_before_rubberbanding : 1;

};

struct _GtkIconViewPrivate
{
  GtkCellArea        *cell_area;
  GtkCellAreaContext *cell_area_context;

  gulong              add_editable_id;
  gulong              remove_editable_id;
44 45 46
  gulong              context_changed_id;

  GPtrArray          *row_contexts;
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116

  gint width, height;

  GtkSelectionMode selection_mode;

  GdkWindow *bin_window;

  GList *children;

  GtkTreeModel *model;

  GList *items;

  GtkAdjustment *hadjustment;
  GtkAdjustment *vadjustment;

  gint rubberband_x1, rubberband_y1;
  gint rubberband_x2, rubberband_y2;
  GdkDevice *rubberband_device;

  guint scroll_timeout_id;
  gint scroll_value_diff;
  gint event_last_x, event_last_y;

  GtkIconViewItem *anchor_item;
  GtkIconViewItem *cursor_item;

  GtkIconViewItem *last_single_clicked;
  GtkIconViewItem *last_prelight;

  GtkOrientation item_orientation;

  gint columns;
  gint item_width;
  gint spacing;
  gint row_spacing;
  gint column_spacing;
  gint margin;
  gint item_padding;

  gint text_column;
  gint markup_column;
  gint pixbuf_column;
  gint tooltip_column;

  GtkCellRenderer *pixbuf_cell;
  GtkCellRenderer *text_cell;

  /* Drag-and-drop. */
  GdkModifierType start_button_mask;
  gint pressed_button;
  gint press_start_x;
  gint press_start_y;

  GdkDragAction source_actions;
  GdkDragAction dest_actions;

  GtkTreeRowReference *dest_item;
  GtkIconViewDropPosition dest_pos;

  /* scroll to */
  GtkTreeRowReference *scroll_to_path;
  gfloat scroll_to_row_align;
  gfloat scroll_to_col_align;
  guint scroll_to_use_align : 1;

  guint source_set : 1;
  guint dest_set : 1;
  guint reorderable : 1;
  guint empty_view_drop :1;
117
  guint activate_on_single_click : 1;
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150

  guint modify_selection_pressed : 1;
  guint extend_selection_pressed : 1;

  guint draw_focus : 1;

  /* GtkScrollablePolicy needs to be checked when
   * driving the scrollable adjustment values */
  guint hscroll_policy : 1;
  guint vscroll_policy : 1;

  guint doing_rubberband : 1;

};

void                 _gtk_icon_view_set_cell_data                  (GtkIconView            *icon_view,
                                                                    GtkIconViewItem        *item);
void                 _gtk_icon_view_set_cursor_item                (GtkIconView            *icon_view,
                                                                    GtkIconViewItem        *item,
                                                                    GtkCellRenderer        *cursor_cell);
GtkIconViewItem *    _gtk_icon_view_get_item_at_coords             (GtkIconView            *icon_view,
                                                                    gint                    x,
                                                                    gint                    y,
                                                                    gboolean                only_in_cell,
                                                                    GtkCellRenderer       **cell_at_pos);
void                 _gtk_icon_view_select_item                    (GtkIconView            *icon_view,
                                                                    GtkIconViewItem        *item);
void                 _gtk_icon_view_unselect_item                  (GtkIconView            *icon_view,
                                                                    GtkIconViewItem        *item);

G_END_DECLS

#endif /* __GTK_ICON_VIEW_PRIVATE_H__ */