Use util_clip_triangle() in pan_item_tri_new()
[geeqie.git] / src / editors.h
index 83da3a8..1b581d0 100644 (file)
 #ifndef EDITORS_H
 #define EDITORS_H
 
+#include <glib.h>
+#include <gtk/gtk.h>
 
-typedef enum {
+struct FileData;
+
+enum EditorFlags {
        EDITOR_KEEP_FS            = 0x00000001,
        EDITOR_VERBOSE            = 0x00000002,
        EDITOR_VERBOSE_MULTI      = 0x00000004,
@@ -42,10 +46,10 @@ typedef enum {
        EDITOR_ERROR_STATUS       = 0x00400000,
        EDITOR_ERROR_SKIPPED      = 0x00800000,
        /**< mask to match errors only */
-       EDITOR_ERROR_MASK         = 0xffff0000,
-} EditorFlags;
+       EDITOR_ERROR_MASK         = ~0xffff,
+};
 
-struct _EditorDescription {
+struct EditorDescription {
        gchar *key;             /**< desktop file name, not including path, including extension */
        gchar *name;            /**< Name, localized name presented to user */
        gchar *icon;            /**< Icon */
@@ -61,13 +65,13 @@ struct _EditorDescription {
        gboolean disabled;      /**< display disabled by user */
 };
 
-#define EDITOR_ERRORS(flags) ((flags) & EDITOR_ERROR_MASK)
-#define EDITOR_ERRORS_BUT_SKIPPED(flags) (!!(((flags) & EDITOR_ERROR_MASK) && !((flags) & EDITOR_ERROR_SKIPPED)))
+inline gint editor_errors(EditorFlags flags) { return flags & EDITOR_ERROR_MASK; }
+inline gboolean editor_errors_but_skipped(EditorFlags flags) { return !!(editor_errors(flags) && !(flags & EDITOR_ERROR_SKIPPED)); }
 
 
 /**
- * \enum
- * return values from callback function
+ * @note EDITOR_CB_*:
+ * Return values from callback function
  */
 enum {
        EDITOR_CB_CONTINUE = 0, /**< continue multiple editor execution on remaining files*/
@@ -91,26 +95,26 @@ extern GtkListStore *desktop_file_list;
 
 extern GHashTable *editors;
 
-void editor_table_finish(void);
-void editor_table_clear(void);
-GList *editor_get_desktop_files(void);
+void editor_table_finish();
+void editor_table_clear();
+GList *editor_get_desktop_files();
 gboolean editor_read_desktop_file(const gchar *path);
 
-GList *editor_list_get(void);
+GList *editor_list_get();
 
 
 /**
- * \typedef EditorCallback
+ * @typedef EditorCallback
  *
  * Callback is called even on skipped files, with the #EDITOR_ERROR_SKIPPED flag set.
  * It is a good place to call file_data_change_info_free().
  *
- * \param ed - pointer that can be used for editor_resume/editor_skip or NULL if all files were already processed \n
- * \param flags - flags above \n
- * \param list - list of processed #FileData structures, typically single file or whole list passed to start_editor_* \n
- * \param data - generic pointer
+ * @param ed - pointer that can be used for editor_resume/editor_skip or NULL if all files were already processed \n
+ * @param flags - flags above \n
+ * @param list - list of processed #FileData structures, typically single file or whole list passed to start_editor_* @n
+ * @param data - generic pointer
 */
-typedef gint (*EditorCallback) (gpointer ed, EditorFlags flags, GList *list, gpointer data);
+using EditorCallback = gint (*)(gpointer, EditorFlags, GList *, gpointer);
 
 
 void editor_resume(gpointer ed);
@@ -128,8 +132,6 @@ gboolean editor_is_filter(const gchar *key);
 gboolean editor_no_param(const gchar *key);
 const gchar *editor_get_error_str(EditorFlags flags);
 
-const gchar *editor_get_name(const gchar *key);
-
 gboolean is_valid_editor_command(const gchar *key);
 gboolean editor_blocks_file(const gchar *key);