Mercurial > geeqie.yaz
annotate src/editors.h @ 1404:de06d83e1adc
save and restore the keyword tree
author | nadvornik |
---|---|
date | Sun, 08 Mar 2009 23:09:27 +0000 |
parents | 67573155210c |
children | 03384485676d |
rev | line source |
---|---|
9 | 1 /* |
196 | 2 * Geeqie |
9 | 3 * (C) 2004 John Ellis |
1284 | 4 * Copyright (C) 2008 - 2009 The Geeqie Team |
9 | 5 * |
6 * Author: John Ellis | |
7 * | |
8 * This software is released under the GNU General Public License (GNU GPL). | |
9 * Please read the included file COPYING for more information. | |
10 * This software comes with no warranty of any kind, use at your own risk! | |
11 */ | |
12 | |
13 | |
14 #ifndef EDITORS_H | |
15 #define EDITORS_H | |
16 | |
442 | 17 |
976
cee16cea5f23
Use constants instead of enum since value (0xffff0000) overflow INT_MAX on some platforms (seen on Solaris 10 SPARC system using the native Sun version 5.9 compilers). Reported by Jeffery Small.
zas_
parents:
768
diff
changeset
|
18 #define EDITOR_KEEP_FS 0x00000001 |
cee16cea5f23
Use constants instead of enum since value (0xffff0000) overflow INT_MAX on some platforms (seen on Solaris 10 SPARC system using the native Sun version 5.9 compilers). Reported by Jeffery Small.
zas_
parents:
768
diff
changeset
|
19 #define EDITOR_VERBOSE 0x00000002 |
cee16cea5f23
Use constants instead of enum since value (0xffff0000) overflow INT_MAX on some platforms (seen on Solaris 10 SPARC system using the native Sun version 5.9 compilers). Reported by Jeffery Small.
zas_
parents:
768
diff
changeset
|
20 #define EDITOR_VERBOSE_MULTI 0x00000004 |
1272 | 21 #define EDITOR_TERMINAL 0x00000008 |
976
cee16cea5f23
Use constants instead of enum since value (0xffff0000) overflow INT_MAX on some platforms (seen on Solaris 10 SPARC system using the native Sun version 5.9 compilers). Reported by Jeffery Small.
zas_
parents:
768
diff
changeset
|
22 |
cee16cea5f23
Use constants instead of enum since value (0xffff0000) overflow INT_MAX on some platforms (seen on Solaris 10 SPARC system using the native Sun version 5.9 compilers). Reported by Jeffery Small.
zas_
parents:
768
diff
changeset
|
23 #define EDITOR_DEST 0x00000100 |
cee16cea5f23
Use constants instead of enum since value (0xffff0000) overflow INT_MAX on some platforms (seen on Solaris 10 SPARC system using the native Sun version 5.9 compilers). Reported by Jeffery Small.
zas_
parents:
768
diff
changeset
|
24 #define EDITOR_FOR_EACH 0x00000200 |
cee16cea5f23
Use constants instead of enum since value (0xffff0000) overflow INT_MAX on some platforms (seen on Solaris 10 SPARC system using the native Sun version 5.9 compilers). Reported by Jeffery Small.
zas_
parents:
768
diff
changeset
|
25 #define EDITOR_SINGLE_COMMAND 0x00000400 |
442 | 26 |
976
cee16cea5f23
Use constants instead of enum since value (0xffff0000) overflow INT_MAX on some platforms (seen on Solaris 10 SPARC system using the native Sun version 5.9 compilers). Reported by Jeffery Small.
zas_
parents:
768
diff
changeset
|
27 #define EDITOR_ERROR_EMPTY 0x00020000 |
cee16cea5f23
Use constants instead of enum since value (0xffff0000) overflow INT_MAX on some platforms (seen on Solaris 10 SPARC system using the native Sun version 5.9 compilers). Reported by Jeffery Small.
zas_
parents:
768
diff
changeset
|
28 #define EDITOR_ERROR_SYNTAX 0x00040000 |
cee16cea5f23
Use constants instead of enum since value (0xffff0000) overflow INT_MAX on some platforms (seen on Solaris 10 SPARC system using the native Sun version 5.9 compilers). Reported by Jeffery Small.
zas_
parents:
768
diff
changeset
|
29 #define EDITOR_ERROR_INCOMPATIBLE 0x00080000 |
cee16cea5f23
Use constants instead of enum since value (0xffff0000) overflow INT_MAX on some platforms (seen on Solaris 10 SPARC system using the native Sun version 5.9 compilers). Reported by Jeffery Small.
zas_
parents:
768
diff
changeset
|
30 #define EDITOR_ERROR_NO_FILE 0x00100000 |
cee16cea5f23
Use constants instead of enum since value (0xffff0000) overflow INT_MAX on some platforms (seen on Solaris 10 SPARC system using the native Sun version 5.9 compilers). Reported by Jeffery Small.
zas_
parents:
768
diff
changeset
|
31 #define EDITOR_ERROR_CANT_EXEC 0x00200000 |
cee16cea5f23
Use constants instead of enum since value (0xffff0000) overflow INT_MAX on some platforms (seen on Solaris 10 SPARC system using the native Sun version 5.9 compilers). Reported by Jeffery Small.
zas_
parents:
768
diff
changeset
|
32 #define EDITOR_ERROR_STATUS 0x00400000 |
cee16cea5f23
Use constants instead of enum since value (0xffff0000) overflow INT_MAX on some platforms (seen on Solaris 10 SPARC system using the native Sun version 5.9 compilers). Reported by Jeffery Small.
zas_
parents:
768
diff
changeset
|
33 #define EDITOR_ERROR_SKIPPED 0x00800000 |
140 | 34 |
976
cee16cea5f23
Use constants instead of enum since value (0xffff0000) overflow INT_MAX on some platforms (seen on Solaris 10 SPARC system using the native Sun version 5.9 compilers). Reported by Jeffery Small.
zas_
parents:
768
diff
changeset
|
35 #define EDITOR_ERROR_MASK 0xffff0000 |
442 | 36 |
1400
67573155210c
Add helper macros EDITOR_ERRORS() and EDITOR_ERRORS_BUT_SKIPPED() to clean up the code a bit. Minor tidy up.
zas_
parents:
1397
diff
changeset
|
37 #define EDITOR_ERRORS(flags) ((flags) & EDITOR_ERROR_MASK) |
67573155210c
Add helper macros EDITOR_ERRORS() and EDITOR_ERRORS_BUT_SKIPPED() to clean up the code a bit. Minor tidy up.
zas_
parents:
1397
diff
changeset
|
38 #define EDITOR_ERRORS_BUT_SKIPPED(flags) (((flags) & EDITOR_ERROR_MASK) && !((flags) & EDITOR_ERROR_SKIPPED)) |
140 | 39 |
40 /* return values from callback function */ | |
41 enum { | |
42 EDITOR_CB_CONTINUE = 0, /* continue multiple editor execution on remaining files*/ | |
43 EDITOR_CB_SKIP, /* skip the remaining files */ | |
44 EDITOR_CB_SUSPEND /* suspend execution, one of editor_resume or editor_skip | |
442 | 45 must be called later */ |
140 | 46 }; |
47 | |
1272 | 48 extern GHashTable *editors; |
49 | |
50 void editor_load_descriptions(void); | |
51 GList *editor_list_get(void); | |
52 | |
140 | 53 |
54 /* | |
442 | 55 Callback is called even on skipped files, with the EDITOR_ERROR_SKIPPED flag set. |
140 | 56 It is a good place to call file_data_change_info_free(). |
57 | |
58 ed - pointer that can be used for editor_resume/editor_skip or NULL if all files were already processed | |
59 flags - flags above | |
60 list - list of procesed FileData structures, typically single file or whole list passed to start_editor_* | |
61 data - generic pointer | |
62 */ | |
63 typedef gint (*EditorCallback) (gpointer ed, gint flags, GList *list, gpointer data); | |
64 | |
65 | |
66 void editor_resume(gpointer ed); | |
67 void editor_skip(gpointer ed); | |
68 | |
69 | |
9 | 70 |
1272 | 71 gint start_editor_from_file(const gchar *key, FileData *fd); |
72 gint start_editor_from_filelist(const gchar *key, GList *list); | |
73 gint start_editor_from_file_full(const gchar *key, FileData *fd, EditorCallback cb, gpointer data); | |
74 gint start_editor_from_filelist_full(const gchar *key, GList *list, EditorCallback cb, gpointer data); | |
75 gint editor_window_flag_set(const gchar *key); | |
76 gint editor_is_filter(const gchar *key); | |
140 | 77 const gchar *editor_get_error_str(gint flags); |
9 | 78 |
1272 | 79 const gchar *editor_get_name(const gchar *key); |
731
fa8f7d7396cf
Introduce an helper function that returns the name of an editor.
zas_
parents:
475
diff
changeset
|
80 |
1272 | 81 gboolean is_valid_editor_command(const gchar *key); |
1397
a0bd58a6535f
In various Edit context menus, only display editors that match the file types in the selection.
zas_
parents:
1284
diff
changeset
|
82 gint editor_command_parse(const EditorDescription *editor, GList *list, gchar **output); |
766
7148e125bf23
Check for existing editor command using is_valid_editor_command().
zas_
parents:
753
diff
changeset
|
83 |
9 | 84 #endif |
1055
1646720364cf
Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents:
976
diff
changeset
|
85 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |