Merge pull request #1133 from techee/readme_rst
[geany-mirror.git] / src / documentprivate.h
blob772e34466ab3ae6ec453c53511dacb2b0dad5025
1 /*
2 * document-private.h - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2008-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
5 * Copyright 2008-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef GEANY_DOCUMENT_PRIVATE_H
24 #define GEANY_DOCUMENT_PRIVATE_H 1
26 #include "gtkcompat.h"
28 G_BEGIN_DECLS
30 /* available UNDO actions, UNDO_SCINTILLA is a pseudo action to trigger Scintilla's
31 * undo management */
32 enum
34 UNDO_SCINTILLA = 0,
35 UNDO_ENCODING,
36 UNDO_BOM,
37 UNDO_RELOAD,
38 UNDO_EOL,
39 UNDO_ACTIONS_MAX
42 typedef struct UndoReloadData
44 guint actions_count; /* How many following undo/redo actions need to be applied. */
45 gint eol_mode; /* End-Of-Line mode before/after reloading. */
47 UndoReloadData;
49 typedef enum
51 FILE_OK,
52 FILE_CHANGED, /* also valid for deleted files */
53 FILE_IGNORE
55 FileDiskStatus;
58 typedef struct FileEncoding
60 gchar *encoding;
61 gboolean has_bom;
63 FileEncoding;
65 enum
67 MSG_TYPE_RELOAD,
68 MSG_TYPE_RESAVE,
69 MSG_TYPE_POST_RELOAD,
71 NUM_MSG_TYPES
74 /* Private GeanyDocument fields */
75 typedef struct GeanyDocumentPrivate
77 /* GtkLabel shown in the notebook header. */
78 GtkWidget *tab_label;
79 /* GtkTreeView object for this document within the Symbols treeview of the sidebar. */
80 GtkWidget *tag_tree;
81 /* GtkTreeStore object for this document within the Symbols treeview of the sidebar. */
82 GtkTreeStore *tag_store;
83 /* Indicates whether tag tree has to be updated */
84 gboolean tag_tree_dirty;
85 /* Iter for this document within the Open Files treeview of the sidebar. */
86 GtkTreeIter iter;
87 /* Used by the Undo/Redo management code. */
88 GTrashStack *undo_actions;
89 /* Used by the Undo/Redo management code. */
90 GTrashStack *redo_actions;
91 /* Used so Undo/Redo works for encoding changes. */
92 FileEncoding saved_encoding;
93 gboolean colourise_needed; /* use document.c:queue_colourise() instead */
94 guint keyword_hash; /* hash of keyword string used for typename colourisation */
95 gint line_count; /* Number of lines in the document. */
96 gint symbol_list_sort_mode;
97 /* indicates whether a file is on a remote filesystem, works only with GIO/GVfs */
98 gboolean is_remote;
99 /* File status on disk of the document */
100 FileDiskStatus file_disk_status;
101 /* Reference to a GFileMonitor object, only used when GIO file monitoring is used. */
102 gpointer monitor;
103 /* Time of the last disk check, only used when legacy file monitoring is used. */
104 time_t last_check;
105 /* Modification time of the document on disk, only used when legacy file monitoring is used. */
106 time_t mtime;
107 /* ID of the idle callback updating the tag list */
108 guint tag_list_update_source;
109 /* Whether it's temporarily protected (read-only and saving needs confirmation). Does
110 * not imply doc->readonly as writable files can be protected */
111 gint protected;
112 /* Save pointer to info bars allowing to cancel them programatically (to avoid multiple ones) */
113 GtkWidget *info_bars[NUM_MSG_TYPES];
115 GeanyDocumentPrivate;
117 G_END_DECLS
119 #endif /* GEANY_DOCUMENT_PRIVATE_H */