medit/moo/moofileview/mooiconview.h

151 lines
7.3 KiB
C
Raw Normal View History

2006-05-21 18:11:05 -05:00
/*
2005-09-06 16:21:05 +00:00
* mooiconview.h
2005-08-07 15:11:48 +00:00
*
2010-12-21 20:15:45 -08:00
* Copyright (C) 2004-2010 by Yevgen Muntyan <emuntyan@users.sourceforge.net>
2005-08-07 15:11:48 +00:00
*
* This file is part of medit. medit is free software; you can
* redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the
* Free Software Foundation; either version 2.1 of the License,
* or (at your option) any later version.
2005-08-07 15:11:48 +00:00
*
* You should have received a copy of the GNU Lesser General Public
* License along with medit. If not, see <http://www.gnu.org/licenses/>.
2005-08-07 15:11:48 +00:00
*/
#ifndef MOO_ICON_VIEW_H
#define MOO_ICON_VIEW_H
2005-08-07 15:11:48 +00:00
#include <gtk/gtk.h>
2005-08-07 15:11:48 +00:00
G_BEGIN_DECLS
#define MOO_TYPE_ICON_VIEW (_moo_icon_view_get_type ())
2005-08-07 15:11:48 +00:00
#define MOO_ICON_VIEW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MOO_TYPE_ICON_VIEW, MooIconView))
#define MOO_ICON_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOO_TYPE_ICON_VIEW, MooIconViewClass))
#define MOO_IS_ICON_VIEW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MOO_TYPE_ICON_VIEW))
#define MOO_IS_ICON_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOO_TYPE_ICON_VIEW))
#define MOO_ICON_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOO_TYPE_ICON_VIEW, MooIconViewClass))
2010-12-08 01:25:34 -08:00
typedef struct _MooIconView MooIconView;
typedef struct _MooIconViewPrivate MooIconViewPrivate;
typedef struct _MooIconViewClass MooIconViewClass;
2005-08-07 15:11:48 +00:00
2010-12-08 01:25:34 -08:00
struct _MooIconView
2005-08-07 15:11:48 +00:00
{
GtkVBox vbox;
MooIconViewPrivate *priv;
};
2010-12-08 01:25:34 -08:00
struct _MooIconViewClass
2005-08-07 15:11:48 +00:00
{
GtkVBoxClass vbox_class;
2005-08-25 09:29:01 +00:00
void (*set_scroll_adjustments) (GtkWidget *widget,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
2005-08-07 15:11:48 +00:00
2005-08-25 09:29:01 +00:00
void (*row_activated) (MooIconView *iconview,
const GtkTreePath *path);
void (*selection_changed) (MooIconView *iconview);
void (*cursor_moved) (MooIconView *iconview,
const GtkTreePath *path);
2005-08-07 15:11:48 +00:00
};
typedef enum {
MOO_ICON_VIEW_CELL_PIXBUF,
MOO_ICON_VIEW_CELL_TEXT
} MooIconViewCell;
typedef void (*MooIconCellDataFunc) (MooIconView *view,
GtkCellRenderer *cell,
GtkTreeModel *model,
GtkTreeIter *iter,
gpointer data);
typedef void (*MooIconViewForeachFunc) (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data);
2005-08-07 15:11:48 +00:00
GType _moo_icon_view_get_type (void) G_GNUC_CONST;
2005-08-07 15:11:48 +00:00
GtkWidget *_moo_icon_view_new (GtkTreeModel *model);
2005-08-07 15:11:48 +00:00
GtkTreeModel *_moo_icon_view_get_model (MooIconView *view);
void _moo_icon_view_set_model (MooIconView *view,
2005-08-07 15:11:48 +00:00
GtkTreeModel *model);
GtkCellRenderer *_moo_icon_view_get_cell (MooIconView *view,
2005-08-07 15:11:48 +00:00
MooIconViewCell cell_type);
void _moo_icon_view_set_cell_data_func(MooIconView *view,
2005-08-07 15:11:48 +00:00
MooIconViewCell cell,
MooIconCellDataFunc func,
gpointer func_data,
GDestroyNotify destroy);
2005-08-25 09:29:01 +00:00
/* TreeView-like selection and cursor interface */
void _moo_icon_view_set_selection_mode (MooIconView *view,
2005-08-25 09:29:01 +00:00
GtkSelectionMode mode);
gboolean _moo_icon_view_get_selected (MooIconView *view,
2005-08-25 09:29:01 +00:00
GtkTreeIter *iter);
GtkTreePath *_moo_icon_view_get_selected_path (MooIconView *view);
void _moo_icon_view_selected_foreach (MooIconView *view,
MooIconViewForeachFunc func,
2005-08-25 09:29:01 +00:00
gpointer data);
GList* _moo_icon_view_get_selected_rows (MooIconView *view);
gboolean _moo_icon_view_path_is_selected (MooIconView *view,
2005-08-25 09:29:01 +00:00
GtkTreePath *path);
void _moo_icon_view_select_all (MooIconView *view);
void _moo_icon_view_unselect_all (MooIconView *view);
2005-08-25 09:29:01 +00:00
void _moo_icon_view_scroll_to_cell (MooIconView *view,
2005-08-25 09:29:01 +00:00
GtkTreePath *path);
void _moo_icon_view_set_cursor (MooIconView *view,
2005-08-25 09:29:01 +00:00
GtkTreePath *path,
gboolean start_editing);
void _moo_icon_view_widget_to_abs_coords (MooIconView *view,
int wx,
int wy,
int *absx,
int *absy);
void _moo_icon_view_abs_to_widget_coords (MooIconView *view,
int absx,
int absy,
int *wx,
int *wy);
gboolean _moo_icon_view_get_path_at_pos (MooIconView *view,
2005-08-25 09:29:01 +00:00
int x,
int y,
GtkTreePath **path,
MooIconViewCell *cell,
int *cell_x,
int *cell_y);
2005-08-07 15:11:48 +00:00
void _moo_icon_view_enable_drag_source (MooIconView *view,
GdkModifierType start_button_mask,
GtkTargetEntry *targets,
gint n_targets,
GdkDragAction actions);
2005-08-07 15:11:48 +00:00
void _moo_icon_view_enable_drag_dest (MooIconView *view,
GtkTargetEntry *targets,
gint n_targets,
GdkDragAction actions);
void _moo_icon_view_set_dest_targets (MooIconView *view,
GtkTargetList *targets);
void _moo_icon_view_set_drag_dest_row (MooIconView *view,
GtkTreePath *path);
GtkTreePath *_moo_icon_view_get_drag_dest_row (MooIconView *view);
2005-08-07 15:11:48 +00:00
G_END_DECLS
#endif /* MOO_ICON_VIEW_H */