1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ 2 /* 3 * This file is part of GtkSourceView 4 * 5 * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence 6 * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi 7 * Copyright (C) 2002, 2003 Paolo Maggi 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License as published by the Free Software Foundation; either 12 * version 2.1 of the License, or (at your option) any later version. 13 * 14 * This library is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * Lesser General Public License for more details. 18 * 19 * You should have received a copy of the GNU Lesser General Public License 20 * along with this library; if not, see <http://www.gnu.org/licenses/>. 21 */ 22 23 #ifndef GTK_SOURCE_UNDO_MANAGER_H 24 #define GTK_SOURCE_UNDO_MANAGER_H 25 26 #if !defined (GTK_SOURCE_H_INSIDE) && !defined (GTK_SOURCE_COMPILATION) 27 #error "Only <gtksourceview/gtksource.h> can be included directly." 28 #endif 29 30 #include <gtk/gtk.h> 31 #include <gtksourceview/gtksourcetypes.h> 32 33 G_BEGIN_DECLS 34 35 #define GTK_SOURCE_TYPE_UNDO_MANAGER (gtk_source_undo_manager_get_type ()) 36 #define GTK_SOURCE_UNDO_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_SOURCE_TYPE_UNDO_MANAGER, GtkSourceUndoManager)) 37 #define GTK_SOURCE_IS_UNDO_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_SOURCE_TYPE_UNDO_MANAGER)) 38 #define GTK_SOURCE_UNDO_MANAGER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_SOURCE_TYPE_UNDO_MANAGER, GtkSourceUndoManagerIface)) 39 40 typedef struct _GtkSourceUndoManagerIface GtkSourceUndoManagerIface; 41 42 struct _GtkSourceUndoManagerIface 43 { 44 GTypeInterface parent; 45 46 /* Interface functions */ 47 gboolean (*can_undo) (GtkSourceUndoManager *manager); 48 gboolean (*can_redo) (GtkSourceUndoManager *manager); 49 50 void (*undo) (GtkSourceUndoManager *manager); 51 void (*redo) (GtkSourceUndoManager *manager); 52 53 void (*begin_not_undoable_action) (GtkSourceUndoManager *manager); 54 void (*end_not_undoable_action) (GtkSourceUndoManager *manager); 55 56 /* Signals */ 57 void (*can_undo_changed) (GtkSourceUndoManager *manager); 58 void (*can_redo_changed) (GtkSourceUndoManager *manager); 59 }; 60 61 GTK_SOURCE_AVAILABLE_IN_ALL 62 GType gtk_source_undo_manager_get_type (void) G_GNUC_CONST; 63 64 GTK_SOURCE_AVAILABLE_IN_ALL 65 gboolean gtk_source_undo_manager_can_undo (GtkSourceUndoManager *manager); 66 67 GTK_SOURCE_AVAILABLE_IN_ALL 68 gboolean gtk_source_undo_manager_can_redo (GtkSourceUndoManager *manager); 69 70 GTK_SOURCE_AVAILABLE_IN_ALL 71 void gtk_source_undo_manager_undo (GtkSourceUndoManager *manager); 72 73 GTK_SOURCE_AVAILABLE_IN_ALL 74 void gtk_source_undo_manager_redo (GtkSourceUndoManager *manager); 75 76 GTK_SOURCE_AVAILABLE_IN_ALL 77 void gtk_source_undo_manager_begin_not_undoable_action (GtkSourceUndoManager *manager); 78 79 GTK_SOURCE_AVAILABLE_IN_ALL 80 void gtk_source_undo_manager_end_not_undoable_action (GtkSourceUndoManager *manager); 81 82 GTK_SOURCE_AVAILABLE_IN_ALL 83 void gtk_source_undo_manager_can_undo_changed (GtkSourceUndoManager *manager); 84 85 GTK_SOURCE_AVAILABLE_IN_ALL 86 void gtk_source_undo_manager_can_redo_changed (GtkSourceUndoManager *manager); 87 88 G_END_DECLS 89 90 #endif /* GTK_SOURCE_UNDO_MANAGER_H */ 91