79
/* the saved selection in a document */
84
guint has_selection : 1;
87
/* This is the type of each document */
95
/************************/
97
/************************/
104
GList *highlightlist;
105
gboolean editable; /* this a type that can be edited by Bluefish */
106
gint autoclosingtag; /* 0=off, 1=xml mode, 2=html mode */
107
gchar *content_regex; /* a regex pattern to test the filetype using the content */
110
/*******************/
111
/* document struct */
112
/*******************/
113
#define BFWIN(var) ((Tbfwin *)(var))
114
#define DOCUMENT(var) ((Tdocument *)(var))
117
gchar *filename; /* this is the UTF-8 encoded filename, before you use it on disk you need convert to disk-encoding! */
91
time_t mtime; /* from stat() */
92
uid_t owner_uid; /* user ID of owner */
93
gid_t owner_gid; /* group ID of owner */
94
mode_t mode; /* mode field in stat() format so any stat macro's will work*/
120
/* time_t mtime; */ /* from stat() */
121
#ifdef HAVE_GNOME_VFS
122
GnomeVFSFileInfo *fileinfo;
123
#else /* HAVE_GNOME_VFS */
125
#endif /* HAVE_GNOME_VFS */
95
126
gint is_symlink; /* file is a symbolic link */
127
gulong del_txt_id; /* text delete signal */
128
gulong ins_txt_id; /* text insert signal */
129
gulong ins_aft_txt_id; /* text insert-after signal, for auto-indenting */
101
GList *undolist; /* Copyright (C) 1998 Andy C. Kahn <kahn@zk3.dec.com> */
102
GList *undotail; /* undo/redo part is copied from gnotepad code */
107
132
GtkWidget *tab_label;
109
gint need_highlighting; /* +1 means a '"' is added, +2 means a '<' is added, 4 means a '>' is added */
110
TSelection saved_sel;
112
int dtd_doctype; /* index of the doc's doctype in the array HTML_doctypes */
113
int dtd_loaded; /* loaded doctype (may not be the same as above) */
133
GtkWidget *tab_eventbox;
135
GtkTextBuffer *buffer;
136
gpointer paste_operation;
137
gint last_rbutton_event; /* index of last 3rd button click */
138
Tfiletype *hl; /* filetype & highlighting set to use for this document */
139
gint need_highlighting; /* if you open 10+ documents you don't need immediate highlighting, just set this var, and notebook_switch() will trigger the actual highlighting when needed */
140
gboolean highlightstate; /* does this document use highlighting ? */
141
gboolean wrapstate; /* does this document use wrap?*/
142
gboolean linenumberstate; /* does this document use linenumbers? */
143
gboolean overwrite_mode; /* is document in overwrite mode */
144
gboolean autoclosingtag; /* does the document use autoclosing of tags */
145
gpointer floatingview; /* a 2nd textview widget that has its own window */
147
GtkTreeIter *bmark_parent; /* if NULL this document doesn't have bookmarks, if
148
it does have bookmarks they are children of this GtkTreeIter */
117
/* This is the current project */
135
gint v_html_tb; /* view html toolbar */
136
gint v_custom_tb; /* view custom menubar */
137
gint v_main_tb; /* view main toolbar */
138
gint v_filebrowser; /* view filebrowser */
152
gint view_html_toolbar; /* view html toolbar */
153
gint view_custom_menu; /* view custom menubar */
154
gint view_main_toolbar; /* view main toolbar */
155
gint view_left_panel; /* view filebrowser/functionbrowser etc. */
156
gint view_line_numbers; /* view line numbers on the left side by default */
157
gint filebrowser_show_hidden_files;
158
gint filebrowser_show_backup_files;
159
gint filebrowser_two_pane_view; /* have one or two panes in the filebrowser */
160
gint filebrowser_focus_follow; /* have the directory of the current document in focus */
161
gchar *filebrowser_unknown_icon;
162
gchar *filebrowser_dir_icon;
163
gchar *editor_font_string; /* editor font */
164
gint editor_tab_width; /* editor tabwidth */
165
gint editor_indent_wspaces; /* indent with spaces, not tabs */
166
gchar *tab_font_string; /* notebook tabs font */
167
GList *browsers; /* browsers array */
168
GList *external_commands; /* external commands array */
169
GList *cust_menu; /* DEPRECATED entries in the custom menu */
170
GList *cmenu_insert; /* custom menu inserts */
171
GList *cmenu_replace; /* custom menu replaces */
172
gint highlight_num_lines_count; /* number of lines to highlight in continous highlighting */
173
gint defaulthighlight; /* highlight documents by default */
174
GList *filetypes; /* filetypes for highlighting and filtering */
175
gint numcharsforfiletype; /* maximum number of characters in the file to use to find the filetype */
176
GList *filefilters; /* filebrowser.c filtering */
177
gchar *last_filefilter; /* last filelist filter type */
178
GList *highlight_patterns; /* the highlight patterns */
139
179
gint transient_htdialogs; /* set html dialogs transient ro the main window */
140
gint main_window_h; /* main window height */
141
gint main_window_w; /* main window width */
142
gint main_filelist_size; /* width of filelist */
180
gint restore_dimensions; /* use the dimensions as used the previous run */
181
gint left_panel_width; /* width of filelist */
182
gint left_panel_left; /* 1 = left, 0 = right */
143
183
gint max_recent_files; /* length of Open Recent list */
144
184
gint max_dir_history; /* length of directory history */
145
gchar *filelist_filter; /* filelist filter type */
146
gchar *filebrowser_filter_image; /* the image type */
147
gchar *filebrowser_filter_php; /* the php type */
148
gchar *filebrowser_filter_html; /* the html type */
149
gchar *filebrowser_filter_jscript; /* the jscript type */
150
gchar *filebrowser_filter_css; /* the css type */
151
gchar *filebrowser_filter_other; /* the other type */
152
gchar *cfg_browser_cline; /* browser commandline */
185
gint backup_file; /* wheather to use a backup file */
186
gchar *backup_filestring; /* the string to append to the backup file */
187
gint backup_abort_action; /* if the backup fails, continue save, abort save, or ask the user */
188
gint backup_cleanuponclose; /* remove the backupfile after close ? */
189
gchar *image_thumbnailstring; /* string to append to thumbnail filenames */
190
gchar *image_thumbnailtype; /* fileformat to use for thumbnails, "jpeg" or "png" can be handled by gdkpixbuf*/
191
gint image_thumbnail_refresh_quality; /* 1=GDK_INTERP_BILINEAR, 0=GDK_INTERP_NEAREST*/
192
gint image_thumbnailsizing_type; /* scaling ratio=0, fixed width=1, height=2, width+height (discard aspect ratio)=3 */
193
gint image_thumbnailsizing_val1; /* the width, height or ratio, depending on the value above */
194
gint image_thumbnailsizing_val2; /* height if the type=3 */
195
gchar *image_thumnailformatstring; /* like <a href="%r"><img src="%t"></a> or more advanced */
196
gint allow_multi_instances; /* allow multiple instances of the same file */
197
gint modified_check_type; /* 0=no check, 1=by mtime and size, 2=by mtime, 3=by size, 4,5,...not implemented (md5sum?) */
198
gint num_undo_levels; /* number of undo levels per document */
199
gint clear_undo_on_save; /* clear all undo information on file save */
200
gchar *newfile_default_encoding; /* if you open a new file, what encoding will it use */
201
GList *encodings; /* all encodings you can choose from */
202
gint auto_set_encoding_meta; /* auto set metatag for the encoding */
203
gint auto_update_meta; /* auto update author and generator meta tags on save */
204
gint encoding_search_Nbytes; /* number of bytes to look for the encoding meta tag */
205
GList *outputbox; /* all outputbox commands */
206
gint ext_browsers_in_submenu;
207
gint ext_commands_in_submenu;
208
gint ext_outputbox_in_submenu;
209
GList *reference_files; /* all reference files */
210
gint bookmarks_default_store; /* 0= temporary by default, 1= permanent by default */
211
gint bookmarks_filename_mode; /* 0=FULLPATH, 1=DIR FROM BASE 2=BASENAME */
212
gint document_tabposition;
213
gint leftpanel_tabposition;
214
gchar *default_basedir;
215
gchar *project_suffix;
216
#ifdef HAVE_LIBASPELL
217
gchar *spell_default_lang;
218
#endif /* HAVE_LIBASPELL */
153
220
gchar *image_editor_cline; /* image editor commandline */
154
gchar *cfg_weblint_cline; /* weblint command line */
155
gchar *cfg_editor_font; /* editor font */
156
gint cfg_editor_tabwidth; /* editor tabwidth */
157
gchar *cfg_tab_pos; /* notebook tabs positioning */
158
gchar *cfg_tab_font; /* notebook tabs font */
159
gchar *cfg_thumbnailstring; /* string to append to thumbnail filenames */
160
gchar *cfg_thumbnailtype; /* fileformat to use for thumbnails */
161
gint full_p; /* use </p> */
162
gint full_li; /* use </li> */
163
gint allow_css; /* CSS allowed */
164
221
gint allow_dep; /* allow <FONT>... */
165
222
gint format_by_context; /* use <strong> instead of <b>, <emphasis instead of <i> etc. (W3C reccomendation) */
166
223
gint xhtml; /* write <br /> */
167
224
gint allow_ruby; /* allow <ruby> */
168
gint allow_h4; /* allow <Q>... */
169
gint allow_frames; /* allow <FRAME> */
170
225
gint force_dtd; /* write <!DOCTYPE...> */
171
226
gint dtd_url; /* URL in DTD */
172
227
gint xml_start; /* <?XML...> */
173
228
gint lowercase_tags; /* use lowercase tags */
174
229
gint word_wrap; /* use wordwrap */
175
230
gint autoindent; /* autoindent code */
176
gint line_wrap; /* use line wrap */
177
gint fontset; /* load fontset (0 = load font) */
178
gint force_def_style; /* force white editor background */
179
231
gint drop_at_drop_pos; /* drop at drop position instead of cursor position */
180
232
gint link_management; /* perform link management */
181
gint defaulthighlight; /* highlight documents by default */
182
gint cont_highlight_full; /* if you want to highlight the full text or just the line */
183
233
gint cont_highlight_update; /* update the syntax highlighting continuous */
185
GList *external_filters; /* external filter in list */
186
GList *external_commands; /* external filter in list */
187
GList *cust_menu; /* entries in the custom menu */
188
GList *syntax_configstrings; /* the strings containing the colors and patters */
191
/* spell checker options */
192
gchar *cfg_spc_cline ; /* spell checker command line */
193
gchar *cfg_spc_lang ; /* language */
194
gint spc_accept_compound ; /* accept compound words ? */
195
gint spc_use_esc_chars ; /* specify aditional characters that
196
may be part of a word ? */
197
gchar* spc_esc_chars ; /* which ones ? */
198
gint spc_use_pers_dict ; /* use a personal dictionary */
199
gchar* spc_pers_dict ; /* which one ? */
200
gint spc_use_input_encoding ; /* use input encoding */
201
gchar* spc_input_encoding ; /* wich one ? */
202
gint spc_output_html_chars ; /* output html chars ? (like á)*/
204
gchar *backup_filestring; /* the string to append to the backup file */
205
gint backup_file; /* wheather to use a backup file */
206
gint backup_by_copy; /* make a copy instead of renaming the file */
207
gchar *backup_abort_style; /* if the backup fails, continue 'save', 'abort' save, or 'ask' user */
208
gint auto_convert_CR; /* auto remove carriage returns from input files */
209
gint allow_multi_instances; /* allow multiple instances of the same file */
210
gint num_undo_levels; /* number of undo levels per document */
211
gint clear_undo_on_save; /* clear all undo information on file save */
212
234
/* key conversion */
213
gint conv_ctrl_enter; /* convert control-enter key press */
214
gchar *ctrl_enter_text; /* inserted text */
215
gint conv_shift_enter; /* convert shift-enter key press */
216
gchar *shift_enter_text; /* inserted text */
217
gint conv_special_char; /* convert ctrl-'<','>','&' */
218
#ifdef WITH_MSG_QUEUE
219
235
gint open_in_running_bluefish; /* open commandline documents in already running session*/
220
#endif /* WITH_MSG_QUEUE */
222
gint autocomplet_html; /* Shows autocompletion window when editing HTML */
223
gint autocomplet_delay; /* Delay to show the autocompletion window */
236
#ifdef HAVE_GNOME_VFS
237
gint server_zope_compat; /* add 'document_src' to uri when reading remote files */
232
#ifdef WITH_INTERNAL_PREVIEW
244
} Tfilebrowser_filter;
248
GtkWidget *hpane; /* it needs to be in here so it can be destroyed when the filebrowser is removed */
250
GtkWidget *dir_history;
252
gint dir_list_lastrow;
253
GtkWidget *file_list;
254
gint file_list_lastrow;
255
gint file_list_selectedrow;
256
GList *dir_history_menu;
257
Tfilebrowser_filter filter_type;
258
GList *directory_history;
262
GtkWidget *w_img_preview_win;
264
gint max_width; /* make this configurable */
266
GtkWidget *w_scrolledwin;
267
char *current_img_filename;
275
/* identifying files */
276
#define TYPE_UNKNOWN 0
281
#define TYPE_JSCRIPT 5
284
#define TYPES_COUNT 8
287
Tproject current_project;
289
Tdocument *current_document; /* This is always the current visible one */
290
GList *documentlist; /* The documents are now placed in a Glist */
292
gint last_notebook_page; /* this is the last used, this can be used to track down if the notebook page really changed */
293
GtkWidget *statusbar;
295
Tfilebrowser filebrowser;
296
gchar **identify_filters[TYPES_COUNT];
297
GtkWidget *main_window;
298
GtkWidget *middlebox; /* the hbox which contains the notebook or the notebook and the filebrowser */
300
GList *cmenu_arrays; /* custom menu strctures */
301
#ifdef WITH_INTERNAL_PREVIEW
304
void *syntax_structs; /* pointer to an array of struct : the props.syntax_configstrings parsed into structs with GdkColor and regex pattern */
305
gint syntax_structs_n; /* number of structs pointed by syntax_structs */
306
GList *command_strings;
307
GList *filter_strings;
309
GdkColormap *colormap;
310
#ifdef WITH_MSG_QUEUE
312
#endif /* WITH_MSG_QUEUE */
313
Tlast_insert last_insert;
314
Timage_preview *img_preview;
315
Ttoolbar_buttons toolb;
317
GtkWidget *attrpage_window;
241
/* the Tglobalsession contains all settings that can change
242
over every time you run Bluefish, so things that *need* to be
243
saved after every run! */
245
GList *quickbar_items; /* items in the quickbar toolbar */
246
gint main_window_h; /* main window height */
247
gint main_window_w; /* main window width */
248
gint two_pane_filebrowser_height; /* position of the pane separater on the two paned file browser */
249
gint fref_ldoubleclick_action; /* left doubleclick in the function reference */
250
gint fref_info_type; /* type of info shown in a small function reference window */
251
gint lasttime_cust_menu; /* the last time the defaultfile was checked for new entries */
252
gint lasttime_highlighting; /* see above */
253
gint lasttime_filetypes; /* see above */
254
gint lasttime_encodings; /* see above */
255
GList *recent_projects;
264
GList *dtd_cblist; /* is this used ?? */
265
GList *headerlist; /* is this used ?? */
266
GList *positionlist; /* is this used ?? */
267
GList *searchlist; /* used in snr2 */
268
GList *replacelist; /* used in snr2 */
284
gint view_main_toolbar;
285
gint view_left_panel;
286
gint view_custom_menu;
287
gint view_html_toolbar;
289
Tsessionvars *session;
290
GtkTreeStore *bookmarkstore; /* project bookmarks */
294
Tsessionvars *session; /* points to the global session, or to the project session */
295
Tdocument *current_document; /* one object out of the documentlist, the current visible document */
296
GList *documentlist; /* document.c and others: all Tdocument objects */
297
Tdocument *last_activated_doc;
298
Tproject *project; /* might be NULL for a default project */
299
GtkWidget *main_window;
301
gint last_notebook_page; /* a check to see if the notebook changed to a new page */
302
gulong notebook_switch_signal;
304
GtkWidget *notebook_fake;
305
GtkWidget *notebook_box; /* Container for notebook and notebook_fake */
306
GtkWidget *middlebox; /* we need this to show/hide the filebrowser */
307
GtkWidget *hpane; /* we need this to show/hide the filebrowser */
308
GtkWidget *statusbar;
309
GtkWidget *statusbar_lncol; /* where we have the line number */
310
GtkWidget *statusbar_insovr; /* insert/overwrite indicator */
311
GtkWidget *statusbar_editmode; /* editor mode and doc encoding */
312
/* the following list contains toolbar widgets we like to reference later on */
313
GtkWidget *toolbar_undo;
314
GtkWidget *toolbar_redo;
315
GtkWidget *toolbar_quickbar; /* the quickbar widget */
316
GList *toolbar_quickbar_children; /* this list is needed to remove widgets from the quickbar */
317
/* following widgets are used to show/hide stuff */
318
GtkWidget *main_toolbar_hb;
319
GtkWidget *html_toolbar_hb;
320
GtkWidget *custom_menu_hb; /* handle box for custom menu */
321
GtkWidget *output_box;
322
GtkWidget *leftpanel_notebook;
323
/* following are lists with dynamic menu entries */
324
GList *menu_recent_files;
325
GList *menu_recent_projects;
326
GList *menu_external;
327
GList *menu_encodings;
328
GList *menu_outputbox;
330
GtkWidget *menu_cmenu;
331
GList *menu_cmenu_entries;
332
GList *menu_filetypes;
333
/* following is a new approach, that we have only a gpointer here, whioh is typecasted
334
in the file where it is needed */
337
gpointer filebrowser;
341
GtkTreeStore *bookmarkstore; /* this is a link to project->bookmarkstore OR main_v->bookmarkstore
342
and it is only here for convenience !!!! */
343
GHashTable *bmark_files; /* no way, I have to have list of file iters. Other way I
344
cannot properly load bmarks for closed files */
348
Tproperties props; /* preferences */
349
Tglobalsession globses; /* global session */
350
GList *filetypelist; /* highlighting.c: a list of all filetypes with their icons and highlighting sets */
352
GList *recent_directories; /* a stringlist with the most recently used directories */
353
Tsessionvars *session; /* holds all session variables for non-project windows */
354
gpointer filebrowserconfig;
357
GtkTreeStore *bookmarkstore; /* the global bookmarks from the global session */
358
gint num_untitled_documents;
359
GtkTooltips *tooltips;
360
guint16 lastkp_hardware_keycode; /* for the autoclosing, we need to know the last pressed key, in the key release callback, */
361
guint lastkp_keyval; /* this is different if the modifier key is not pressed anymore during the key-release */
362
pcre *autoclosingtag_regc; /* the regular expression to check for a valid tag in tag autoclosing*/
321
365
extern Tmain *main_v;
323
/* for exiting bluefish */
324
void cya_later(GtkWidget * widget, gpointer data);
326
void load_identify_filters();
327
gint identify_by_filename(gchar *filename);
329
/* runs through all the events in the gtk and gdk queue */
330
void flush_queue(void);
332
#endif /* __BLUEFISH_H_ */
367
/* public functions from bluefish.c */
368
void bluefish_exit_request(void);
369
#endif /* __BLUEFISH_H_ */