1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 Copyright (C) 2006 Sebastien Granjoux
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef _SPARSE_VIEW_H
22 #define _SPARSE_VIEW_H
24 #include "sparse_buffer.h"
30 #define DMA_SPARSE_VIEW_TYPE (dma_sparse_view_get_type ())
31 #define DMA_SPARSE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DMA_SPARSE_VIEW_TYPE, DmaSparseView))
32 #define DMA_SPARSE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DMA_SPARSE_VIEW_TYPE, DmaSparseViewClass))
33 #define DMA_IS_SPARSE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DMA_SPARSE_VIEW_TYPE))
34 #define DMA_IS_SPARSE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DMA_SPARSE_VIEW_TYPE))
35 #define DMA_GET_SPARSE_VIEW_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DMA_SPARSE_VIEW_TYPE, DmaSparseViewClass))
37 typedef struct _DmaSparseView DmaSparseView
;
38 typedef struct _DmaSparseViewClass DmaSparseViewClass
;
40 typedef struct _DmaSparseViewPrivate DmaSparseViewPrivate
;
46 DmaSparseViewPrivate
*priv
;
49 struct _DmaSparseViewClass
51 GtkTextViewClass parent_class
;
53 void (*insert_lines
) (DmaSparseView
*view
, DmaSparseIter
*src
, GtkTextIter
*dst
, guint count
);
54 gboolean (*forward_lines
) (DmaSparseView
*view
, DmaSparseIter
*iter
, gint count
);
57 GType
dma_sparse_view_get_type (void);
59 GtkWidget
*dma_sparse_view_new_with_buffer (DmaSparseBuffer
*buffer
);
61 void dma_sparse_view_set_show_line_numbers (DmaSparseView
*view
, gboolean show
);
62 gboolean
dma_sparse_view_get_show_line_numbers (DmaSparseView
*view
);
63 void dma_sparse_view_set_show_line_markers (DmaSparseView
*view
, gboolean show
);
64 gboolean
dma_sparse_view_get_show_line_markers (DmaSparseView
*view
);
66 void dma_sparse_view_refresh (DmaSparseView
*view
);
68 DmaSparseBuffer
* dma_sparse_view_get_sparse_buffer (DmaSparseView
*view
);
69 void dma_sparse_view_set_sparse_buffer (DmaSparseView
*view
, DmaSparseBuffer
*buffer
);
71 void dma_sparse_view_goto (DmaSparseView
*view
, guint location
);
72 guint
dma_sparse_view_get_location (DmaSparseView
*view
);
74 gint
dma_sparse_view_mark (DmaSparseView
*view
, guint location
, gint marker
);
75 void dma_sparse_view_unmark (DmaSparseView
*view
, guint location
, gint marker
);
76 void dma_sparse_view_delete_all_markers (DmaSparseView
*view
, gint marker
);
79 #endif /* _SPARSE_VIEW_H */