gtk2/gtk/gtktreeview.h

547 lines
25 KiB
C
Raw Normal View History

/* gtktreeview.h
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb@redhat.com>
*
* 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
2012-02-27 13:01:10 +00:00
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GTK_TREE_VIEW_H__
#define __GTK_TREE_VIEW_H__
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#include <gtk/gtkwidget.h>
#include <gtk/gtktreemodel.h>
#include <gtk/gtktreeviewcolumn.h>
#include <gtk/gtkentry.h>
G_BEGIN_DECLS
/**
* GtkTreeViewDropPosition:
* @GTK_TREE_VIEW_DROP_BEFORE: dropped row is inserted before
* @GTK_TREE_VIEW_DROP_AFTER: dropped row is inserted after
* @GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: dropped row becomes a child or is inserted before
* @GTK_TREE_VIEW_DROP_INTO_OR_AFTER: dropped row becomes a child or is inserted after
*
* An enum for determining where a dropped row goes.
*/
sync to tree changes 2001-01-19 Havoc Pennington <hp@redhat.com> * demos/gtk-demo/main.c (button_press_event_cb): sync to tree changes * gtk/gtkrbtree.c (_gtk_rbtree_node_find_offset): fix this function * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_widget): implement * gtk/gtktreeview.c (gtk_tree_view_move_to): rename scroll_to_cell, matches TextView scroll functions better (gtk_tree_view_tree_to_widget_coords): new function (gtk_tree_view_widget_to_tree_coords): new function (gtk_tree_view_get_visible_rect): new function (gtk_tree_view_get_path_at_pos): accept negative coordinates (gtk_tree_view_draw_node_focus_rect): new function moved from draw_focus, also, use width of bin_window as width of the focus rect (gtk_tree_view_expand_row): fix bug where it didn't recognize already-expanded rows (gtk_tree_view_get_cell_rect): new function (gtk_tree_view_get_path_at_pos): return the click position relative to the passed-in cell (gtk_tree_view_set_expander_column): new function * configure.in: remove gtk-config-2.0 chmod * gtk/gtktextview.c (gtk_text_view_drag_motion): small cleanups, and properly handle drags with targets we don't understand (gtk_text_view_drag_end): don't stop scrolling, the source isn't scrolling anyway (gtk_text_view_drag_drop): stop scrolling here though, and set the mark invisible * gtk/gtkdnd.c (gtk_drag_dest_find_target): export as a public function (gtk_drag_dest_get_target_list): new function (gtk_drag_dest_set_target_list): new function * gtk/gtktreeview.c: Add a bunch of drag-and-drop implementation * gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add fields related to drag-and-drop
2001-01-19 22:39:19 +00:00
typedef enum
{
/* drop before/after this row */
GTK_TREE_VIEW_DROP_BEFORE,
GTK_TREE_VIEW_DROP_AFTER,
/* drop as a child of this row (with fallback to before or after
* if into is not possible)
*/
GTK_TREE_VIEW_DROP_INTO_OR_BEFORE,
GTK_TREE_VIEW_DROP_INTO_OR_AFTER
} GtkTreeViewDropPosition;
#define GTK_TYPE_TREE_VIEW (gtk_tree_view_get_type ())
#define GTK_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE_VIEW, GtkTreeView))
#define GTK_IS_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TREE_VIEW))
#define GTK_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_VIEW, GtkTreeViewClass))
#define GTK_IS_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE_VIEW))
#define GTK_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TREE_VIEW, GtkTreeViewClass))
typedef struct _GtkTreeView GtkTreeView;
typedef struct _GtkTreeViewClass GtkTreeViewClass;
typedef struct _GtkTreeSelection GtkTreeSelection;
/**
* GtkTreeViewColumnDropFunc:
* @tree_view: A `GtkTreeView`
* @column: The `GtkTreeViewColumn` being dragged
* @prev_column: A `GtkTreeViewColumn` on one side of @column
* @next_column: A `GtkTreeViewColumn` on the other side of @column
* @data: (closure): user data
*
* Function type for determining whether @column can be dropped in a
* particular spot (as determined by @prev_column and @next_column). In
* left to right locales, @prev_column is on the left of the potential drop
* spot, and @next_column is on the right. In right to left mode, this is
* reversed. This function should return %TRUE if the spot is a valid drop
* spot. Please note that returning %TRUE does not actually indicate that
* the column drop was made, but is meant only to indicate a possible drop
* spot to the user.
*
* Returns: %TRUE, if @column can be dropped in this spot
*/
typedef gboolean (* GtkTreeViewColumnDropFunc) (GtkTreeView *tree_view,
GtkTreeViewColumn *column,
GtkTreeViewColumn *prev_column,
GtkTreeViewColumn *next_column,
gpointer data);
/**
* GtkTreeViewMappingFunc:
* @tree_view: A `GtkTreeView`
* @path: The path thats expanded
* @user_data: user data
*
* Function used for gtk_tree_view_map_expanded_rows().
*/
typedef void (* GtkTreeViewMappingFunc) (GtkTreeView *tree_view,
GtkTreePath *path,
gpointer user_data);
/**
* GtkTreeViewSearchEqualFunc:
* @model: the `GtkTreeModel` being searched
* @column: the search column set by gtk_tree_view_set_search_column()
* @key: the key string to compare with
* @iter: a `GtkTreeIter` pointing the row of @model that should be compared
* with @key.
* @search_data: (closure): user data from gtk_tree_view_set_search_equal_func()
*
* A function used for checking whether a row in @model matches
* a search key string entered by the user. Note the return value
* is reversed from what you would normally expect, though it
* has some similarity to strcmp() returning 0 for equal strings.
*
* Returns: %FALSE if the row matches, %TRUE otherwise.
*/
typedef gboolean (*GtkTreeViewSearchEqualFunc) (GtkTreeModel *model,
2020-07-24 13:54:49 +00:00
int column,
2020-07-24 18:40:36 +00:00
const char *key,
GtkTreeIter *iter,
gpointer search_data);
/**
* GtkTreeViewRowSeparatorFunc:
* @model: the `GtkTreeModel`
* @iter: a `GtkTreeIter` pointing at a row in @model
* @data: (closure): user data
*
* Function type for determining whether the row pointed to by @iter should
* be rendered as a separator. A common way to implement this is to have a
* boolean column in the model, whose values the `GtkTreeViewRowSeparatorFunc`
* returns.
*
* Returns: %TRUE if the row is a separator
*/
Support separators in combo boxes and more generally in tree views 2004-07-07 Matthias Clasen <mclasen@redhat.com> Support separators in combo boxes and more generally in tree views (#135873): * gtk/gtkcombobox.h: * gtk/gtkcombobox.c (gtk_combo_box_get_row_separator_column): * gtk/gtkcombobox.c (gtk_combo_box_set_row_separator_column): Add a ::row-separator-column property with getter and setter, which can indicate a boolean model column to determine which rows are separators. * gtk/gtkcombobox.c: Display separator rows as separator menu items in menu mode, and by using the new treeview separator functionality in list mode. * gtk/gtktreeview.h: * gtk/gtktreeview.c (gtk_tree_view_get_row_separator_func): * gtk/gtktreeview.c (gtk_tree_view_set_row_separator_func): Add a callback to determine whether a row is a separator. * gtk/gtktreeview.c (gtk_tree_view_bin_expose): * gtk/gtktreeview.c (gtk_tree_view_create_row_drag_icon): * gtk/gtktreeview.c (validate_row): Use the new callback to determine whether a row is a separator, and draw it as a separator then. Since separators should take up less vertical space than regular rows, this requires removing the redundant MAX(...,expander_size) calls which appear in many places. Instead, the MAX() is now only done in validate_row(), and only if the row is not a separator. To catch possible side effects of this intrusive change, I have left EXPANDER_MAX() calls in place of the MAX() calls which will emit a warning if something breaks. They should be removed before 2.6. * gtk/gtktreeselection.c (row_is_selectable): Don't let separator rows be selected. * tests/testcombo.c (create_blaat): Add a separator column.
2004-07-07 15:15:35 +00:00
typedef gboolean (*GtkTreeViewRowSeparatorFunc) (GtkTreeModel *model,
GtkTreeIter *iter,
gpointer data);
struct _GtkTreeView
{
GtkWidget parent_instance;
};
struct _GtkTreeViewClass
{
GtkWidgetClass parent_class;
void (* row_activated) (GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewColumn *column);
gboolean (* test_expand_row) (GtkTreeView *tree_view,
GtkTreeIter *iter,
GtkTreePath *path);
gboolean (* test_collapse_row) (GtkTreeView *tree_view,
GtkTreeIter *iter,
GtkTreePath *path);
void (* row_expanded) (GtkTreeView *tree_view,
GtkTreeIter *iter,
GtkTreePath *path);
void (* row_collapsed) (GtkTreeView *tree_view,
GtkTreeIter *iter,
GtkTreePath *path);
void (* columns_changed) (GtkTreeView *tree_view);
void (* cursor_changed) (GtkTreeView *tree_view);
/* Key Binding signals */
gboolean (* move_cursor) (GtkTreeView *tree_view,
GtkMovementStep step,
2020-07-24 13:54:49 +00:00
int count,
gboolean extend,
gboolean modify);
gboolean (* select_all) (GtkTreeView *tree_view);
gboolean (* unselect_all) (GtkTreeView *tree_view);
gboolean (* select_cursor_row) (GtkTreeView *tree_view,
gboolean start_editing);
gboolean (* toggle_cursor_row) (GtkTreeView *tree_view);
gboolean (* expand_collapse_cursor_row) (GtkTreeView *tree_view,
gboolean logical,
gboolean expand,
gboolean open_all);
gboolean (* select_cursor_parent) (GtkTreeView *tree_view);
gboolean (* start_interactive_search) (GtkTreeView *tree_view);
/*< private >*/
gpointer _reserved[16];
};
GDK_AVAILABLE_IN_ALL
Mark as const. 2004-11-23 Matthias Clasen <mclasen@redhat.com> * gtk/gtkuimanager.h (gtk_ui_manager_get_type): * gtk/gtktreeview.h (gtk_tree_view_get_type): * gtk/gtktreeviewcolumn.h (gtk_tree_view_column_get_type): * gtk/gtktreestore.h (gtk_tree_store_get_type): * gtk/gtktreeselection.h (gtk_tree_selection_get_type): * gtk/gtktreemodelfilter.h (gtk_tree_model_filter_get_type): * gtk/gtktreemodel.h (gtk_tree_iter_get_type): (gtk_tree_path_get_type): (gtk_tree_row_reference_get_type): * gtk/gtktoolitem.h (gtk_tool_item_get_type): * gtk/gtktoolbutton.h (gtk_tool_button_get_type): * gtk/gtktoggleaction.h (gtk_toggle_action_get_type): * gtk/gtkthemes.h (gtk_theme_engine_get_type): * gtk/gtktextiter.h (gtk_text_iter_get_type): * gtk/gtksettings.h (gtk_settings_get_type): * gtk/gtkselection.h (gtk_selection_data_get_type): * gtk/gtkradioaction.h (gtk_radio_action_get_type): * gtk/gtkmenutoolbutton.h (gtk_menu_tool_button_get_type): * gtk/gtkliststore.h (gtk_list_store_get_type): * gtk/gtkiconview.h (gtk_icon_view_get_type): * gtk/gtkicontheme.h (gtk_icon_info_get_type): * gtk/gtkiconfactory.h (gtk_icon_factory_get_type): (gtk_icon_set_get_type): (gtk_icon_source_get_type): * gtk/gtkfilesystemwin32.h (gtk_file_system_win32_get_type): * gtk/gtkfilesystemunix.h (gtk_file_system_unix_get_type): * gtk/gtkfilesystem.h (gtk_file_folder_get_type): (gtk_file_info_get_type, gtk_file_path_get_type): (gtk_file_system_get_type): * gtk/gtkfilefilter.h (gtk_file_filter_get_type): * gtk/gtkfilechooserwidget.h (gtk_file_chooser_widget_get_type): * gtk/gtkfilechooser.h (gtk_file_chooser_get_type): * gtk/gtkfilechooserdialog.h (gtk_file_chooser_dialog_get_type): * gtk/gtkexpander.h (gtk_expander_get_type): * gtk/gtkentrycompletion.h (gtk_entry_completion_get_type): * gtk/gtkcombobox.h (gtk_combo_box_get_type): * gtk/gtkcomboboxentry.h (gtk_combo_box_entry_get_type): * gtk/gtkclipboard.h (gtk_clipboard_get_type): * gtk/gtkcellview.h (gtk_cell_view_get_type): * gtk/gtkcellrenderertoggle.h (gtk_cell_renderer_toggle_get_type): * gtk/gtkcellrenderertext.h (gtk_cell_renderer_text_get_type): * gtk/gtkcellrendererprogress.h (gtk_cell_renderer_progress_get_type): * gtk/gtkcellrendererpixbuf.h (gtk_cell_renderer_pixbuf_get_type): * gtk/gtkcellrenderercombo.h (gtk_cell_renderer_combo_get_type): * gtk/gtkcelllayout.h (gtk_cell_layout_get_type): * gtk/gtkactiongroup.h (gtk_action_group_get_type): * gtk/gtkaction.h (gtk_action_get_type): * gtk/gtkaccessible.h (gtk_accessible_get_type): * gtk/gtkaccelmap.h (gtk_accel_map_get_type): * gtk/gtkaccelgroup.h (gtk_accel_group_get_type): * gtk/gtkmessagedialog.h (gtk_message_dialog_get_type): Mark as const. * gtk/gtkicontheme.h: Don't mark gtk_icon_theme_error_quark() as const, to be consistent with all the other error_quark functions. (technically they are const, but since these are called only in error paths, giving the compiler better optimization opportunities doesn't matter much) * gtk/gtk.symbols: * gdk/gdk.symbols: Add attribute annotations. * gtk/makegtkalias.pl: * gdk/makegdkalias.pl: Keep attribute annotations, but strip PRIVATE. * gtk/Makefile.am (gtk.def): * gdk/Makefile.am (gdk.def): Strip attribute annotations, but keep PRIVATE.
2004-11-23 20:02:15 +00:00
GType gtk_tree_view_get_type (void) G_GNUC_CONST;
/* Creators */
GDK_AVAILABLE_IN_ALL
GtkWidget *gtk_tree_view_new (void);
GDK_AVAILABLE_IN_ALL
GtkWidget *gtk_tree_view_new_with_model (GtkTreeModel *model);
/* Accessors */
GDK_AVAILABLE_IN_ALL
GtkTreeModel *gtk_tree_view_get_model (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_model (GtkTreeView *tree_view,
GtkTreeModel *model);
GDK_AVAILABLE_IN_ALL
GtkTreeSelection *gtk_tree_view_get_selection (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_get_headers_visible (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_headers_visible (GtkTreeView *tree_view,
gboolean headers_visible);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_columns_autosize (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_get_headers_clickable (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_headers_clickable (GtkTreeView *tree_view,
gboolean setting);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_get_activate_on_single_click (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_activate_on_single_click (GtkTreeView *tree_view,
gboolean single);
2020-05-28 08:00:03 +00:00
/* Column functions */
GDK_AVAILABLE_IN_ALL
2020-07-24 13:54:49 +00:00
int gtk_tree_view_append_column (GtkTreeView *tree_view,
GtkTreeViewColumn *column);
GDK_AVAILABLE_IN_ALL
2020-07-24 13:54:49 +00:00
int gtk_tree_view_remove_column (GtkTreeView *tree_view,
GtkTreeViewColumn *column);
GDK_AVAILABLE_IN_ALL
2020-07-24 13:54:49 +00:00
int gtk_tree_view_insert_column (GtkTreeView *tree_view,
GtkTreeViewColumn *column,
2020-07-24 13:54:49 +00:00
int position);
GDK_AVAILABLE_IN_ALL
2020-07-24 13:54:49 +00:00
int gtk_tree_view_insert_column_with_attributes (GtkTreeView *tree_view,
int position,
2020-07-24 18:40:36 +00:00
const char *title,
GtkCellRenderer *cell,
...) G_GNUC_NULL_TERMINATED;
GDK_AVAILABLE_IN_ALL
2020-07-24 13:54:49 +00:00
int gtk_tree_view_insert_column_with_data_func (GtkTreeView *tree_view,
int position,
2020-07-24 18:40:36 +00:00
const char *title,
GtkCellRenderer *cell,
GtkTreeCellDataFunc func,
gpointer data,
GDestroyNotify dnotify);
GDK_AVAILABLE_IN_ALL
guint gtk_tree_view_get_n_columns (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
GtkTreeViewColumn *gtk_tree_view_get_column (GtkTreeView *tree_view,
2020-07-24 13:54:49 +00:00
int n);
GDK_AVAILABLE_IN_ALL
GList *gtk_tree_view_get_columns (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_move_column_after (GtkTreeView *tree_view,
GtkTreeViewColumn *column,
GtkTreeViewColumn *base_column);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_expander_column (GtkTreeView *tree_view,
GtkTreeViewColumn *column);
GDK_AVAILABLE_IN_ALL
GtkTreeViewColumn *gtk_tree_view_get_expander_column (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_column_drag_function (GtkTreeView *tree_view,
GtkTreeViewColumnDropFunc func,
gpointer user_data,
GDestroyNotify destroy);
sync to tree changes 2001-01-19 Havoc Pennington <hp@redhat.com> * demos/gtk-demo/main.c (button_press_event_cb): sync to tree changes * gtk/gtkrbtree.c (_gtk_rbtree_node_find_offset): fix this function * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_widget): implement * gtk/gtktreeview.c (gtk_tree_view_move_to): rename scroll_to_cell, matches TextView scroll functions better (gtk_tree_view_tree_to_widget_coords): new function (gtk_tree_view_widget_to_tree_coords): new function (gtk_tree_view_get_visible_rect): new function (gtk_tree_view_get_path_at_pos): accept negative coordinates (gtk_tree_view_draw_node_focus_rect): new function moved from draw_focus, also, use width of bin_window as width of the focus rect (gtk_tree_view_expand_row): fix bug where it didn't recognize already-expanded rows (gtk_tree_view_get_cell_rect): new function (gtk_tree_view_get_path_at_pos): return the click position relative to the passed-in cell (gtk_tree_view_set_expander_column): new function * configure.in: remove gtk-config-2.0 chmod * gtk/gtktextview.c (gtk_text_view_drag_motion): small cleanups, and properly handle drags with targets we don't understand (gtk_text_view_drag_end): don't stop scrolling, the source isn't scrolling anyway (gtk_text_view_drag_drop): stop scrolling here though, and set the mark invisible * gtk/gtkdnd.c (gtk_drag_dest_find_target): export as a public function (gtk_drag_dest_get_target_list): new function (gtk_drag_dest_set_target_list): new function * gtk/gtktreeview.c: Add a bunch of drag-and-drop implementation * gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add fields related to drag-and-drop
2001-01-19 22:39:19 +00:00
/* Actions */
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_scroll_to_point (GtkTreeView *tree_view,
2020-07-24 13:54:49 +00:00
int tree_x,
int tree_y);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_scroll_to_cell (GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewColumn *column,
gboolean use_align,
2020-07-24 20:25:56 +00:00
float row_align,
float col_align);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_row_activated (GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewColumn *column);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_expand_all (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_collapse_all (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_expand_to_path (GtkTreeView *tree_view,
GtkTreePath *path);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_expand_row (GtkTreeView *tree_view,
GtkTreePath *path,
gboolean open_all);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_collapse_row (GtkTreeView *tree_view,
GtkTreePath *path);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_map_expanded_rows (GtkTreeView *tree_view,
GtkTreeViewMappingFunc func,
gpointer data);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_row_expanded (GtkTreeView *tree_view,
GtkTreePath *path);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_reorderable (GtkTreeView *tree_view,
gboolean reorderable);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_get_reorderable (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_cursor (GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewColumn *focus_column,
gboolean start_editing);
GDK_AVAILABLE_IN_ALL
The "big treeview focus patch". Fixes several issues and adds some Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org> The "big treeview focus patch". Fixes several issues and adds some goodies. Related bugs: #73676, #73734, #78660. * gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell * gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell if applicable, (gtk_tree_view_bin_expose): set_cell_data before iterating columns, add support for row-spanning focus rectangles, (gtk_tree_view_has_special_cell): new function, (gtk_tree_view_move_cursor_left_right): add support for multiple focusable cells in one column, (gtk_tree_view_set_cursor): call _set_cursor_on_cell now, (gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended with focus_cell parameter, (gtk_tree_view_search_iter): removed unused column variable, (gtk_tree_view_start_editing): add neighbor size code to allow for multiple editable cells in one column. * gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add in_editing_mode field, (gtk_tree_view_column_get_edited_cell): new function, removed _get_editable_cell, (_gtk_tree_view_column_get_cell_at_pos): new function, (gtk_tree_view_column_pack_end): s/g_new/g_new0/ ..., (gtk_tree_view_column_cell_process_action): loads of changes to get it right and to allow for multiple special cells, etc, (gtk_tree_view_column_cell_first): new function, (gtk_tree_view_column_cell_last): ditto, (gtk_tree_view_column_cell_next): ditto, (gtk_tree_view_column_cell_prev): ditto, (gtk_tree_view_column_cell_focus): add left and right parameters, allow for multiple special cells, (gtk_tree_view_column_cell_is_visible): add assertion, (gtk_tree_view_column_focus_cell): new function, (gtk_tree_view_column_stop_editing): unset in_editing_mode flag, (_gtk_tree_view_column_get_neighbor_sizes): iterate through cells correctly * gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell * gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add _gtk_tree_view_column_get_cell_at_pos, add new parameters to _gtk_tree_view_column_cell_focus. * tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
void gtk_tree_view_set_cursor_on_cell (GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewColumn *focus_column,
GtkCellRenderer *focus_cell,
gboolean start_editing);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_get_cursor (GtkTreeView *tree_view,
GtkTreePath **path,
GtkTreeViewColumn **focus_column);
/* Layout information */
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view,
2020-07-24 13:54:49 +00:00
int x,
int y,
GtkTreePath **path,
GtkTreeViewColumn **column,
2020-07-24 13:54:49 +00:00
int *cell_x,
int *cell_y);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_get_cell_area (GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewColumn *column,
GdkRectangle *rect);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_get_background_area (GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewColumn *column,
GdkRectangle *rect);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_get_visible_rect (GtkTreeView *tree_view,
GdkRectangle *visible_rect);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_get_visible_range (GtkTreeView *tree_view,
GtkTreePath **start_path,
GtkTreePath **end_path);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_is_blank_at_pos (GtkTreeView *tree_view,
2020-07-24 13:54:49 +00:00
int x,
int y,
GtkTreePath **path,
GtkTreeViewColumn **column,
2020-07-24 13:54:49 +00:00
int *cell_x,
int *cell_y);
sync to tree changes 2001-01-19 Havoc Pennington <hp@redhat.com> * demos/gtk-demo/main.c (button_press_event_cb): sync to tree changes * gtk/gtkrbtree.c (_gtk_rbtree_node_find_offset): fix this function * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_widget): implement * gtk/gtktreeview.c (gtk_tree_view_move_to): rename scroll_to_cell, matches TextView scroll functions better (gtk_tree_view_tree_to_widget_coords): new function (gtk_tree_view_widget_to_tree_coords): new function (gtk_tree_view_get_visible_rect): new function (gtk_tree_view_get_path_at_pos): accept negative coordinates (gtk_tree_view_draw_node_focus_rect): new function moved from draw_focus, also, use width of bin_window as width of the focus rect (gtk_tree_view_expand_row): fix bug where it didn't recognize already-expanded rows (gtk_tree_view_get_cell_rect): new function (gtk_tree_view_get_path_at_pos): return the click position relative to the passed-in cell (gtk_tree_view_set_expander_column): new function * configure.in: remove gtk-config-2.0 chmod * gtk/gtktextview.c (gtk_text_view_drag_motion): small cleanups, and properly handle drags with targets we don't understand (gtk_text_view_drag_end): don't stop scrolling, the source isn't scrolling anyway (gtk_text_view_drag_drop): stop scrolling here though, and set the mark invisible * gtk/gtkdnd.c (gtk_drag_dest_find_target): export as a public function (gtk_drag_dest_get_target_list): new function (gtk_drag_dest_set_target_list): new function * gtk/gtktreeview.c: Add a bunch of drag-and-drop implementation * gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add fields related to drag-and-drop
2001-01-19 22:39:19 +00:00
/* Drag-and-Drop support */
GDK_AVAILABLE_IN_ALL
2020-01-07 00:38:05 +00:00
void gtk_tree_view_enable_model_drag_source (GtkTreeView *tree_view,
GdkModifierType start_button_mask,
GdkContentFormats *formats,
GdkDragAction actions);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_enable_model_drag_dest (GtkTreeView *tree_view,
GdkContentFormats *formats,
GdkDragAction actions);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_unset_rows_drag_source (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_unset_rows_drag_dest (GtkTreeView *tree_view);
sync to tree changes 2001-01-19 Havoc Pennington <hp@redhat.com> * demos/gtk-demo/main.c (button_press_event_cb): sync to tree changes * gtk/gtkrbtree.c (_gtk_rbtree_node_find_offset): fix this function * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_widget): implement * gtk/gtktreeview.c (gtk_tree_view_move_to): rename scroll_to_cell, matches TextView scroll functions better (gtk_tree_view_tree_to_widget_coords): new function (gtk_tree_view_widget_to_tree_coords): new function (gtk_tree_view_get_visible_rect): new function (gtk_tree_view_get_path_at_pos): accept negative coordinates (gtk_tree_view_draw_node_focus_rect): new function moved from draw_focus, also, use width of bin_window as width of the focus rect (gtk_tree_view_expand_row): fix bug where it didn't recognize already-expanded rows (gtk_tree_view_get_cell_rect): new function (gtk_tree_view_get_path_at_pos): return the click position relative to the passed-in cell (gtk_tree_view_set_expander_column): new function * configure.in: remove gtk-config-2.0 chmod * gtk/gtktextview.c (gtk_text_view_drag_motion): small cleanups, and properly handle drags with targets we don't understand (gtk_text_view_drag_end): don't stop scrolling, the source isn't scrolling anyway (gtk_text_view_drag_drop): stop scrolling here though, and set the mark invisible * gtk/gtkdnd.c (gtk_drag_dest_find_target): export as a public function (gtk_drag_dest_get_target_list): new function (gtk_drag_dest_set_target_list): new function * gtk/gtktreeview.c: Add a bunch of drag-and-drop implementation * gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add fields related to drag-and-drop
2001-01-19 22:39:19 +00:00
sync to tree changes 2001-01-19 Havoc Pennington <hp@redhat.com> * demos/gtk-demo/main.c (button_press_event_cb): sync to tree changes * gtk/gtkrbtree.c (_gtk_rbtree_node_find_offset): fix this function * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_widget): implement * gtk/gtktreeview.c (gtk_tree_view_move_to): rename scroll_to_cell, matches TextView scroll functions better (gtk_tree_view_tree_to_widget_coords): new function (gtk_tree_view_widget_to_tree_coords): new function (gtk_tree_view_get_visible_rect): new function (gtk_tree_view_get_path_at_pos): accept negative coordinates (gtk_tree_view_draw_node_focus_rect): new function moved from draw_focus, also, use width of bin_window as width of the focus rect (gtk_tree_view_expand_row): fix bug where it didn't recognize already-expanded rows (gtk_tree_view_get_cell_rect): new function (gtk_tree_view_get_path_at_pos): return the click position relative to the passed-in cell (gtk_tree_view_set_expander_column): new function * configure.in: remove gtk-config-2.0 chmod * gtk/gtktextview.c (gtk_text_view_drag_motion): small cleanups, and properly handle drags with targets we don't understand (gtk_text_view_drag_end): don't stop scrolling, the source isn't scrolling anyway (gtk_text_view_drag_drop): stop scrolling here though, and set the mark invisible * gtk/gtkdnd.c (gtk_drag_dest_find_target): export as a public function (gtk_drag_dest_get_target_list): new function (gtk_drag_dest_set_target_list): new function * gtk/gtktreeview.c: Add a bunch of drag-and-drop implementation * gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): add fields related to drag-and-drop
2001-01-19 22:39:19 +00:00
/* These are useful to implement your own custom stuff. */
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_drag_dest_row (GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewDropPosition pos);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_get_drag_dest_row (GtkTreeView *tree_view,
GtkTreePath **path,
GtkTreeViewDropPosition *pos);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_get_dest_row_at_pos (GtkTreeView *tree_view,
2020-07-24 13:54:49 +00:00
int drag_x,
int drag_y,
GtkTreePath **path,
GtkTreeViewDropPosition *pos);
GDK_AVAILABLE_IN_ALL
GdkPaintable *gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view,
GtkTreePath *path);
/* Interactive search */
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_enable_search (GtkTreeView *tree_view,
gboolean enable_search);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_get_enable_search (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
2020-07-24 13:54:49 +00:00
int gtk_tree_view_get_search_column (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_search_column (GtkTreeView *tree_view,
2020-07-24 13:54:49 +00:00
int column);
GDK_AVAILABLE_IN_ALL
GtkTreeViewSearchEqualFunc gtk_tree_view_get_search_equal_func (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_search_equal_func (GtkTreeView *tree_view,
GtkTreeViewSearchEqualFunc search_equal_func,
gpointer search_user_data,
GDestroyNotify search_destroy);
GDK_AVAILABLE_IN_ALL
GtkEditable *gtk_tree_view_get_search_entry (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_search_entry (GtkTreeView *tree_view,
GtkEditable *entry);
/* Convert between the different coordinate systems */
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_convert_widget_to_tree_coords (GtkTreeView *tree_view,
2020-07-24 13:54:49 +00:00
int wx,
int wy,
int *tx,
int *ty);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_convert_tree_to_widget_coords (GtkTreeView *tree_view,
2020-07-24 13:54:49 +00:00
int tx,
int ty,
int *wx,
int *wy);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_convert_widget_to_bin_window_coords (GtkTreeView *tree_view,
2020-07-24 13:54:49 +00:00
int wx,
int wy,
int *bx,
int *by);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_convert_bin_window_to_widget_coords (GtkTreeView *tree_view,
2020-07-24 13:54:49 +00:00
int bx,
int by,
int *wx,
int *wy);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_convert_tree_to_bin_window_coords (GtkTreeView *tree_view,
2020-07-24 13:54:49 +00:00
int tx,
int ty,
int *bx,
int *by);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_convert_bin_window_to_tree_coords (GtkTreeView *tree_view,
2020-07-24 13:54:49 +00:00
int bx,
int by,
int *tx,
int *ty);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_fixed_height_mode (GtkTreeView *tree_view,
gboolean enable);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_get_fixed_height_mode (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_hover_selection (GtkTreeView *tree_view,
gboolean hover);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_get_hover_selection (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_hover_expand (GtkTreeView *tree_view,
gboolean expand);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_get_hover_expand (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_rubber_banding (GtkTreeView *tree_view,
gboolean enable);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_get_rubber_banding (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_is_rubber_banding_active (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
Support separators in combo boxes and more generally in tree views 2004-07-07 Matthias Clasen <mclasen@redhat.com> Support separators in combo boxes and more generally in tree views (#135873): * gtk/gtkcombobox.h: * gtk/gtkcombobox.c (gtk_combo_box_get_row_separator_column): * gtk/gtkcombobox.c (gtk_combo_box_set_row_separator_column): Add a ::row-separator-column property with getter and setter, which can indicate a boolean model column to determine which rows are separators. * gtk/gtkcombobox.c: Display separator rows as separator menu items in menu mode, and by using the new treeview separator functionality in list mode. * gtk/gtktreeview.h: * gtk/gtktreeview.c (gtk_tree_view_get_row_separator_func): * gtk/gtktreeview.c (gtk_tree_view_set_row_separator_func): Add a callback to determine whether a row is a separator. * gtk/gtktreeview.c (gtk_tree_view_bin_expose): * gtk/gtktreeview.c (gtk_tree_view_create_row_drag_icon): * gtk/gtktreeview.c (validate_row): Use the new callback to determine whether a row is a separator, and draw it as a separator then. Since separators should take up less vertical space than regular rows, this requires removing the redundant MAX(...,expander_size) calls which appear in many places. Instead, the MAX() is now only done in validate_row(), and only if the row is not a separator. To catch possible side effects of this intrusive change, I have left EXPANDER_MAX() calls in place of the MAX() calls which will emit a warning if something breaks. They should be removed before 2.6. * gtk/gtktreeselection.c (row_is_selectable): Don't let separator rows be selected. * tests/testcombo.c (create_blaat): Add a separator column.
2004-07-07 15:15:35 +00:00
GtkTreeViewRowSeparatorFunc gtk_tree_view_get_row_separator_func (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
Support separators in combo boxes and more generally in tree views 2004-07-07 Matthias Clasen <mclasen@redhat.com> Support separators in combo boxes and more generally in tree views (#135873): * gtk/gtkcombobox.h: * gtk/gtkcombobox.c (gtk_combo_box_get_row_separator_column): * gtk/gtkcombobox.c (gtk_combo_box_set_row_separator_column): Add a ::row-separator-column property with getter and setter, which can indicate a boolean model column to determine which rows are separators. * gtk/gtkcombobox.c: Display separator rows as separator menu items in menu mode, and by using the new treeview separator functionality in list mode. * gtk/gtktreeview.h: * gtk/gtktreeview.c (gtk_tree_view_get_row_separator_func): * gtk/gtktreeview.c (gtk_tree_view_set_row_separator_func): Add a callback to determine whether a row is a separator. * gtk/gtktreeview.c (gtk_tree_view_bin_expose): * gtk/gtktreeview.c (gtk_tree_view_create_row_drag_icon): * gtk/gtktreeview.c (validate_row): Use the new callback to determine whether a row is a separator, and draw it as a separator then. Since separators should take up less vertical space than regular rows, this requires removing the redundant MAX(...,expander_size) calls which appear in many places. Instead, the MAX() is now only done in validate_row(), and only if the row is not a separator. To catch possible side effects of this intrusive change, I have left EXPANDER_MAX() calls in place of the MAX() calls which will emit a warning if something breaks. They should be removed before 2.6. * gtk/gtktreeselection.c (row_is_selectable): Don't let separator rows be selected. * tests/testcombo.c (create_blaat): Add a separator column.
2004-07-07 15:15:35 +00:00
void gtk_tree_view_set_row_separator_func (GtkTreeView *tree_view,
GtkTreeViewRowSeparatorFunc func,
gpointer data,
GDestroyNotify destroy);
Support separators in combo boxes and more generally in tree views 2004-07-07 Matthias Clasen <mclasen@redhat.com> Support separators in combo boxes and more generally in tree views (#135873): * gtk/gtkcombobox.h: * gtk/gtkcombobox.c (gtk_combo_box_get_row_separator_column): * gtk/gtkcombobox.c (gtk_combo_box_set_row_separator_column): Add a ::row-separator-column property with getter and setter, which can indicate a boolean model column to determine which rows are separators. * gtk/gtkcombobox.c: Display separator rows as separator menu items in menu mode, and by using the new treeview separator functionality in list mode. * gtk/gtktreeview.h: * gtk/gtktreeview.c (gtk_tree_view_get_row_separator_func): * gtk/gtktreeview.c (gtk_tree_view_set_row_separator_func): Add a callback to determine whether a row is a separator. * gtk/gtktreeview.c (gtk_tree_view_bin_expose): * gtk/gtktreeview.c (gtk_tree_view_create_row_drag_icon): * gtk/gtktreeview.c (validate_row): Use the new callback to determine whether a row is a separator, and draw it as a separator then. Since separators should take up less vertical space than regular rows, this requires removing the redundant MAX(...,expander_size) calls which appear in many places. Instead, the MAX() is now only done in validate_row(), and only if the row is not a separator. To catch possible side effects of this intrusive change, I have left EXPANDER_MAX() calls in place of the MAX() calls which will emit a warning if something breaks. They should be removed before 2.6. * gtk/gtktreeselection.c (row_is_selectable): Don't let separator rows be selected. * tests/testcombo.c (create_blaat): Add a separator column.
2004-07-07 15:15:35 +00:00
GDK_AVAILABLE_IN_ALL
GtkTreeViewGridLines gtk_tree_view_get_grid_lines (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_grid_lines (GtkTreeView *tree_view,
GtkTreeViewGridLines grid_lines);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_get_enable_tree_lines (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_enable_tree_lines (GtkTreeView *tree_view,
gboolean enabled);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_show_expanders (GtkTreeView *tree_view,
gboolean enabled);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_get_show_expanders (GtkTreeView *tree_view);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_level_indentation (GtkTreeView *tree_view,
2020-07-24 13:54:49 +00:00
int indentation);
GDK_AVAILABLE_IN_ALL
2020-07-24 13:54:49 +00:00
int gtk_tree_view_get_level_indentation (GtkTreeView *tree_view);
/* Convenience functions for setting tooltips */
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_tooltip_row (GtkTreeView *tree_view,
GtkTooltip *tooltip,
GtkTreePath *path);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_tooltip_cell (GtkTreeView *tree_view,
GtkTooltip *tooltip,
GtkTreePath *path,
GtkTreeViewColumn *column,
GtkCellRenderer *cell);
GDK_AVAILABLE_IN_ALL
gboolean gtk_tree_view_get_tooltip_context(GtkTreeView *tree_view,
int x,
int y,
gboolean keyboard_tip,
GtkTreeModel **model,
GtkTreePath **path,
GtkTreeIter *iter);
GDK_AVAILABLE_IN_ALL
void gtk_tree_view_set_tooltip_column (GtkTreeView *tree_view,
2020-07-24 13:54:49 +00:00
int column);
GDK_AVAILABLE_IN_ALL
2020-07-24 13:54:49 +00:00
int gtk_tree_view_get_tooltip_column (GtkTreeView *tree_view);
G_END_DECLS
#endif /* __GTK_TREE_VIEW_H__ */