medit/moo/mooutils/moofileview/mooiconview.h

166 lines
8.2 KiB
C
Raw Normal View History

2005-09-06 09:21:05 -07:00
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4; coding: utf-8 -*-
* mooiconview.h
2005-08-07 08:11:48 -07:00
*
* Copyright (C) 2004-2005 by Yevgen Muntyan <muntyan@math.tamu.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* See COPYING file that comes with this distribution.
*/
2005-08-25 02:29:01 -07:00
#ifndef __MOO_ICON_VIEW_H__
#define __MOO_ICON_VIEW_H__
2005-08-07 08:11:48 -07:00
#include <gtk/gtkvbox.h>
#include <gtk/gtktreemodel.h>
#include <gtk/gtkcellrenderer.h>
#include <gtk/gtkdnd.h>
2005-08-07 08:11:48 -07:00
G_BEGIN_DECLS
#define MOO_TYPE_ICON_VIEW (moo_icon_view_get_type ())
#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))
typedef struct _MooIconView MooIconView;
typedef struct _MooIconViewPrivate MooIconViewPrivate;
typedef struct _MooIconViewClass MooIconViewClass;
struct _MooIconView
{
GtkVBox vbox;
MooIconViewPrivate *priv;
};
struct _MooIconViewClass
{
GtkVBoxClass vbox_class;
2005-08-25 02:29:01 -07:00
void (*set_scroll_adjustments) (GtkWidget *widget,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
2005-08-07 08:11:48 -07:00
2005-08-25 02:29:01 -07: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 08:11:48 -07: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 08:11:48 -07:00
GType moo_icon_view_get_type (void) G_GNUC_CONST;
GtkWidget *moo_icon_view_new (void);
GtkWidget *moo_icon_view_new_with_model (GtkTreeModel *model);
GtkTreeModel *moo_icon_view_get_model (MooIconView *view);
void moo_icon_view_set_model (MooIconView *view,
GtkTreeModel *model);
void moo_icon_view_set_cell (MooIconView *view,
MooIconViewCell cell_type,
GtkCellRenderer*cell);
GtkCellRenderer *moo_icon_view_get_cell (MooIconView *view,
MooIconViewCell cell_type);
void moo_icon_view_set_attributes (MooIconView *view,
MooIconViewCell cell_type,
const char *first_attr,
...);
void moo_icon_view_clear_attributes (MooIconView *view,
MooIconViewCell cell_type);
void moo_icon_view_set_cell_data_func(MooIconView *view,
MooIconViewCell cell,
MooIconCellDataFunc func,
gpointer func_data,
GDestroyNotify destroy);
void moo_icon_view_set_adjustment (MooIconView *view,
GtkAdjustment *adjustment);
2005-08-25 02:29:01 -07:00
/* TreeView-like selection and cursor interface */
void moo_icon_view_set_selection_mode (MooIconView *view,
GtkSelectionMode mode);
gboolean moo_icon_view_get_selected (MooIconView *view,
GtkTreeIter *iter);
GtkTreePath *moo_icon_view_get_selected_path (MooIconView *view);
void moo_icon_view_selected_foreach (MooIconView *view,
MooIconViewForeachFunc func,
2005-08-25 02:29:01 -07:00
gpointer data);
GList* moo_icon_view_get_selected_rows (MooIconView *view);
gint moo_icon_view_count_selected_rows (MooIconView *view);
void moo_icon_view_select_path (MooIconView *view,
GtkTreePath *path);
void moo_icon_view_unselect_path (MooIconView *view,
GtkTreePath *path);
void moo_icon_view_select_range (MooIconView *view,
GtkTreePath *start,
GtkTreePath *end);
gboolean moo_icon_view_path_is_selected (MooIconView *view,
GtkTreePath *path);
void moo_icon_view_select_all (MooIconView *view);
void moo_icon_view_unselect_all (MooIconView *view);
void moo_icon_view_scroll_to_cell (MooIconView *view,
GtkTreePath *path);
void moo_icon_view_set_cursor (MooIconView *view,
GtkTreePath *path,
gboolean start_editing);
GtkTreePath* moo_icon_view_get_cursor (MooIconView *view);
void moo_icon_view_row_activated (MooIconView *view,
GtkTreePath *path);
gboolean moo_icon_view_get_path_at_pos (MooIconView *view,
int x,
int y,
GtkTreePath **path,
MooIconViewCell *cell,
int *cell_x,
int *cell_y);
2005-08-07 08:11:48 -07:00
void moo_icon_view_enable_drag_source (MooIconView *view,
GdkModifierType start_button_mask,
GtkTargetEntry *targets,
gint n_targets,
GdkDragAction actions);
GtkTargetList *moo_icon_view_get_source_targets (MooIconView *view);
void moo_icon_view_disable_drag_source (MooIconView *view);
2005-08-07 08:11:48 -07:00
void moo_icon_view_enable_drag_dest (MooIconView *view,
GtkTargetEntry *targets,
gint n_targets,
GdkDragAction actions);
GtkTargetList *moo_icon_view_get_dest_targets (MooIconView *view);
void moo_icon_view_disable_drag_dest (MooIconView *view);
2005-08-07 08:11:48 -07:00
G_END_DECLS
2005-08-25 02:29:01 -07:00
#endif /* __MOO_ICON_VIEW_H__ */