2010-07-01 11:49:22 -07:00
|
|
|
#ifndef _EPHOTO_H_
|
2015-11-24 14:21:21 -08:00
|
|
|
# define _EPHOTO_H_
|
|
|
|
|
|
|
|
# ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
# endif
|
|
|
|
|
2016-03-24 10:16:05 -07:00
|
|
|
# include <stdio.h>
|
|
|
|
# include <stdlib.h>
|
|
|
|
# include <string.h>
|
|
|
|
# include <dirent.h>
|
|
|
|
# include <unistd.h>
|
|
|
|
# include <limits.h>
|
|
|
|
# include <math.h>
|
2015-11-24 14:21:21 -08:00
|
|
|
# include <Eet.h>
|
|
|
|
# include <Ecore.h>
|
|
|
|
# include <Ecore_Evas.h>
|
2016-03-24 10:16:05 -07:00
|
|
|
# include <Ecore_Ipc.h>
|
2015-11-24 14:21:21 -08:00
|
|
|
# include <Ecore_File.h>
|
|
|
|
# include <Efreet_Mime.h>
|
|
|
|
# include <Elementary.h>
|
|
|
|
# include <Elementary_Cursor.h>
|
|
|
|
# include <Eina.h>
|
|
|
|
# include <Edje.h>
|
|
|
|
# include <Evas.h>
|
|
|
|
# include <Eio.h>
|
|
|
|
|
|
|
|
# ifdef HAVE_PO
|
|
|
|
# include <locale.h>
|
|
|
|
# endif
|
|
|
|
|
|
|
|
#if HAVE_GETTEXT && ENABLE_NLS
|
2016-01-22 13:24:32 -08:00
|
|
|
# include <libintl.h>
|
|
|
|
# define _(string) gettext (string)
|
2015-11-24 14:21:21 -08:00
|
|
|
#else
|
2016-01-22 13:24:32 -08:00
|
|
|
# define _(string) (string)
|
|
|
|
# define ngettext(String1, String2, Var) Var == 1 ? String1 : String2
|
2015-08-10 13:58:16 -07:00
|
|
|
#endif
|
2010-07-01 11:49:22 -07:00
|
|
|
|
2016-03-24 10:16:05 -07:00
|
|
|
# define USE_IPC
|
|
|
|
|
|
|
|
/*local types*/
|
2011-02-24 14:26:47 -08:00
|
|
|
typedef struct _Ephoto_Config Ephoto_Config;
|
|
|
|
typedef struct _Ephoto Ephoto;
|
|
|
|
typedef struct _Ephoto_Entry Ephoto_Entry;
|
|
|
|
typedef struct _Ephoto_Event_Entry_Create Ephoto_Event_Entry_Create;
|
|
|
|
|
|
|
|
typedef enum _Ephoto_State Ephoto_State;
|
|
|
|
typedef enum _Ephoto_Orient Ephoto_Orient;
|
2015-11-24 14:21:21 -08:00
|
|
|
typedef enum _Ephoto_Sort Ephoto_Sort;
|
2016-03-24 10:16:05 -07:00
|
|
|
typedef enum _Ephoto_Ipc_Domain Ephoto_Ipc_Domain;
|
2011-02-24 14:26:47 -08:00
|
|
|
|
2016-03-24 10:16:05 -07:00
|
|
|
/*main window functions*/
|
2011-02-24 14:26:47 -08:00
|
|
|
Evas_Object *ephoto_window_add(const char *path);
|
2015-11-24 14:21:21 -08:00
|
|
|
void ephoto_title_set(Ephoto *ephoto, const char *title);
|
|
|
|
void ephoto_thumb_size_set(Ephoto *ephoto, int size);
|
|
|
|
Evas_Object *ephoto_thumb_add(Ephoto *ephoto, Evas_Object *parent,
|
2016-08-15 10:36:50 -07:00
|
|
|
Ephoto_Entry *entry);
|
2015-11-24 14:21:21 -08:00
|
|
|
void ephoto_directory_set(Ephoto *ephoto, const char *path,
|
2015-12-01 15:02:19 -08:00
|
|
|
Elm_Object_Item *expanded, Eina_Bool dirs_only, Eina_Bool thumbs_only);
|
2016-05-26 15:44:43 -07:00
|
|
|
void ephoto_show_folders(Ephoto *ephoto, Eina_Bool toggle);
|
2015-11-24 14:21:21 -08:00
|
|
|
|
2016-03-24 10:16:05 -07:00
|
|
|
/*config panel functions*/
|
2015-11-24 14:21:21 -08:00
|
|
|
Eina_Bool ephoto_config_init(Ephoto *em);
|
|
|
|
void ephoto_config_save(Ephoto *em);
|
|
|
|
void ephoto_config_free(Ephoto *em);
|
2016-01-13 13:48:11 -08:00
|
|
|
void ephoto_config_main(Ephoto *em);
|
2011-02-24 14:26:47 -08:00
|
|
|
|
2016-03-24 10:16:05 -07:00
|
|
|
/*single image functions*/
|
2011-05-17 13:02:53 -07:00
|
|
|
Evas_Object *ephoto_single_browser_add(Ephoto *ephoto, Evas_Object *parent);
|
2016-05-26 15:44:43 -07:00
|
|
|
void ephoto_single_browser_show_controls(Ephoto *ephoto);
|
2015-12-02 18:45:35 -08:00
|
|
|
void ephoto_single_browser_entries_set(Evas_Object *obj, Eina_List *entries);
|
2015-11-24 14:21:21 -08:00
|
|
|
void ephoto_single_browser_entry_set(Evas_Object *obj, Ephoto_Entry *entry);
|
2016-04-01 13:29:46 -07:00
|
|
|
void ephoto_single_browser_focus_set(Ephoto *ephoto);
|
2015-11-24 14:21:21 -08:00
|
|
|
void ephoto_single_browser_path_pending_set(Evas_Object *obj,
|
|
|
|
const char *path);
|
2016-03-25 13:45:18 -07:00
|
|
|
void ephoto_single_browser_path_pending_unset(Evas_Object *obj);
|
2016-02-24 14:47:39 -08:00
|
|
|
void ephoto_single_browser_path_created(Evas_Object *obj, Ephoto_Entry *entry);
|
2015-11-24 14:21:21 -08:00
|
|
|
void ephoto_single_browser_image_data_update(Evas_Object *main,
|
2016-04-08 09:49:40 -07:00
|
|
|
Evas_Object *image, unsigned int *image_data, Evas_Coord w, Evas_Coord h);
|
2016-04-05 17:30:25 -07:00
|
|
|
void ephoto_single_browser_image_data_done(Evas_Object *main,
|
2016-04-08 09:49:40 -07:00
|
|
|
unsigned int *image_data, Evas_Coord w, Evas_Coord h);
|
2016-04-05 17:30:25 -07:00
|
|
|
void ephoto_single_browser_cancel_editing(Evas_Object *main);
|
2016-05-26 15:44:43 -07:00
|
|
|
void ephoto_single_browser_slideshow(Evas_Object *obj);
|
|
|
|
void ephoto_single_browser_adjust_offsets(Ephoto *ephoto);
|
2015-11-24 14:21:21 -08:00
|
|
|
/* smart callbacks called: "back" - the user wants to go back to the previous
|
|
|
|
* screen. */
|
2016-03-24 10:16:05 -07:00
|
|
|
|
|
|
|
/*slideshow functions*/
|
2011-06-28 15:26:16 -07:00
|
|
|
Evas_Object *ephoto_slideshow_add(Ephoto *ephoto, Evas_Object *parent);
|
2015-12-02 18:45:35 -08:00
|
|
|
void ephoto_slideshow_entries_set(Evas_Object *obj, Eina_List *entries);
|
2015-11-24 14:21:21 -08:00
|
|
|
void ephoto_slideshow_entry_set(Evas_Object *obj, Ephoto_Entry *entry);
|
2016-05-26 15:44:43 -07:00
|
|
|
void ephoto_slideshow_show_controls(Ephoto *ephoto);
|
2016-07-21 15:12:29 -07:00
|
|
|
void ephoto_slideshow_adjust_offsets(Ephoto *ephoto);
|
2015-11-24 14:21:21 -08:00
|
|
|
/* smart callbacks called: "back" - the user wants to go back to the previous
|
|
|
|
* screen. */
|
2016-03-24 10:16:05 -07:00
|
|
|
|
|
|
|
/*thumbnail browser functions*/
|
2015-11-24 14:21:21 -08:00
|
|
|
Evas_Object *ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object *parent);
|
2016-05-26 15:44:43 -07:00
|
|
|
void ephoto_thumb_browser_show_controls(Ephoto *ephoto);
|
2016-01-19 11:58:28 -08:00
|
|
|
void ephoto_thumb_browser_insert(Ephoto *ephoto, Ephoto_Entry *entry);
|
|
|
|
void ephoto_thumb_browser_remove(Ephoto *ephoto, Ephoto_Entry *entry);
|
2016-02-24 14:47:39 -08:00
|
|
|
void ephoto_thumb_browser_update(Ephoto *ephoto, Ephoto_Entry *entry);
|
2016-05-26 15:44:43 -07:00
|
|
|
void ephoto_thumb_browser_update_info_label(Ephoto *ephoto);
|
|
|
|
void ephoto_thumb_browser_slideshow(Evas_Object *obj);
|
|
|
|
void ephoto_thumb_browser_paste(Ephoto *ephoto, Elm_Object_Item *item);
|
2016-08-03 14:05:48 -07:00
|
|
|
void ephoto_thumb_browser_clear(Ephoto *ephoto);
|
2016-08-09 07:26:41 -07:00
|
|
|
void ephoto_thumb_browser_dirs_only_set(Ephoto *ephoto, Eina_Bool dirs_only);
|
2015-11-24 14:21:21 -08:00
|
|
|
/* smart callbacks called: "selected" - an item in the thumb browser is
|
|
|
|
* selected. The selected Ephoto_Entry is passed as event_info argument. */
|
|
|
|
|
2016-05-26 15:44:43 -07:00
|
|
|
/*directory browser functions*/
|
|
|
|
Evas_Object *ephoto_directory_browser_add(Ephoto *ephoto, Evas_Object *parent);
|
|
|
|
void ephoto_directory_browser_initialize_structure(Ephoto *ephoto);
|
|
|
|
void ephoto_directory_browser_top_dir_set(Ephoto *ephoto, const char *dir);
|
2016-08-03 14:05:48 -07:00
|
|
|
void ephoto_directory_browser_clear(Ephoto *ephoto);
|
2016-05-26 15:44:43 -07:00
|
|
|
|
2016-03-24 10:16:05 -07:00
|
|
|
/*thumbnailing functions taken from enlightenment*/
|
|
|
|
int e_thumb_init(void);
|
|
|
|
int e_thumb_shutdown(void);
|
|
|
|
Evas_Object *e_thumb_icon_add(Evas *evas);
|
|
|
|
void e_thumb_icon_file_set(Evas_Object *obj, const char *file, const char *key);
|
2016-04-08 09:49:40 -07:00
|
|
|
void e_thumb_icon_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
|
2016-03-24 10:16:05 -07:00
|
|
|
void e_thumb_icon_begin(Evas_Object *obj);
|
|
|
|
void e_thumb_icon_end(Evas_Object *obj);
|
|
|
|
void e_thumb_icon_rethumb(Evas_Object *obj);
|
|
|
|
const char *e_thumb_sort_id_get(Evas_Object *obj);
|
|
|
|
void e_thumb_client_data(Ecore_Ipc_Event_Client_Data *e);
|
|
|
|
void e_thumb_client_del(Ecore_Ipc_Event_Client_Del *e);
|
|
|
|
int e_ipc_init(void);
|
|
|
|
int e_ipc_shutdown(void);
|
|
|
|
|
|
|
|
/*editing functions*/
|
2016-05-26 15:44:43 -07:00
|
|
|
Evas_Object *ephoto_editor_add(Ephoto *ephoto, const char *title,
|
2016-03-23 13:14:21 -07:00
|
|
|
const char *data_name, void *data);
|
|
|
|
void ephoto_editor_del(Evas_Object *obj);
|
2016-05-26 15:44:43 -07:00
|
|
|
void ephoto_cropper_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
|
2015-11-24 14:21:21 -08:00
|
|
|
Evas_Object *image_parent, Evas_Object *image);
|
2016-05-26 15:44:43 -07:00
|
|
|
void ephoto_bcg_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
|
2015-11-24 14:21:21 -08:00
|
|
|
Evas_Object *image);
|
2016-05-26 15:44:43 -07:00
|
|
|
void ephoto_hsv_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
|
2015-11-24 14:21:21 -08:00
|
|
|
Evas_Object *image);
|
2016-05-26 15:44:43 -07:00
|
|
|
void ephoto_color_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
|
2016-04-04 13:50:56 -07:00
|
|
|
Evas_Object *image);
|
2016-05-26 15:44:43 -07:00
|
|
|
void ephoto_red_eye_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
|
2015-11-24 14:21:21 -08:00
|
|
|
Evas_Object *image);
|
2016-07-25 20:19:58 -07:00
|
|
|
void ephoto_scale_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
|
|
|
|
Evas_Object *image, const char *file);
|
2016-08-30 07:31:40 -07:00
|
|
|
void ephoto_filter_blur(Ephoto *ephoto, Evas_Object *image);
|
|
|
|
void ephoto_filter_sharpen(Ephoto *ephoto, Evas_Object *image);
|
|
|
|
void ephoto_filter_dither(Ephoto *ephoto, Evas_Object *image);
|
|
|
|
void ephoto_filter_black_and_white(Ephoto *ephoto, Evas_Object *image);
|
|
|
|
void ephoto_filter_old_photo(Ephoto *ephoto, Evas_Object *image);
|
|
|
|
void ephoto_filter_painting(Ephoto *ephoto, Evas_Object *image);
|
|
|
|
void ephoto_filter_posterize(Ephoto *ephoto, Evas_Object *image);
|
|
|
|
void ephoto_filter_sketch(Ephoto *ephoto, Evas_Object *image);
|
|
|
|
void ephoto_filter_invert(Ephoto *ephoto, Evas_Object *image);
|
|
|
|
void ephoto_filter_edge(Ephoto *ephoto, Evas_Object *image);
|
|
|
|
void ephoto_filter_emboss(Ephoto *ephoto, Evas_Object *image);
|
|
|
|
void ephoto_filter_histogram_eq(Ephoto *ephoto, Evas_Object *image);
|
2015-08-17 14:18:33 -07:00
|
|
|
|
2016-03-25 13:45:18 -07:00
|
|
|
/*file functions*/
|
2016-10-10 22:41:45 -07:00
|
|
|
void ephoto_file_save_image(Ephoto *ephoto, Ephoto_Entry *entry,
|
2016-03-25 13:45:18 -07:00
|
|
|
Evas_Object *image);
|
2016-10-10 22:41:45 -07:00
|
|
|
void ephoto_file_save_image_as(Ephoto *ephoto, Ephoto_Entry *entry,
|
2016-03-25 13:45:18 -07:00
|
|
|
Evas_Object *image);
|
|
|
|
void ephoto_file_upload_image(Ephoto *ephoto, Ephoto_Entry *entry);
|
|
|
|
void ephoto_file_new_dir(Ephoto *ephoto, const char *path);
|
|
|
|
void ephoto_file_rename(Ephoto *ephoto, const char *path);
|
|
|
|
void ephoto_file_move(Ephoto *ephoto, Eina_List *files, const char *path);
|
|
|
|
void ephoto_file_copy(Ephoto *ephoto, Eina_List *files, const char *path);
|
|
|
|
void ephoto_file_paste(Ephoto *ephoto, Eina_List *files, Eina_Bool copy,
|
|
|
|
const char *path);
|
|
|
|
void ephoto_file_delete(Ephoto *ephoto, Eina_List *files,
|
|
|
|
Eina_File_Type type);
|
|
|
|
void ephoto_file_empty_trash(Ephoto *ephoto, Eina_List *files);
|
|
|
|
|
2016-03-24 10:16:05 -07:00
|
|
|
/*data types and structures*/
|
|
|
|
|
2010-09-13 09:40:33 -07:00
|
|
|
enum _Ephoto_State
|
|
|
|
{
|
2015-11-24 14:21:21 -08:00
|
|
|
EPHOTO_STATE_THUMB,
|
|
|
|
EPHOTO_STATE_SINGLE,
|
|
|
|
EPHOTO_STATE_SLIDESHOW
|
2011-02-24 14:26:47 -08:00
|
|
|
};
|
|
|
|
|
2015-11-24 14:21:21 -08:00
|
|
|
enum _Ephoto_Orient
|
2011-02-24 14:26:47 -08:00
|
|
|
{
|
2015-11-24 14:21:21 -08:00
|
|
|
EPHOTO_ORIENT_0 = 1,
|
|
|
|
EPHOTO_ORIENT_FLIP_HORIZ = 2,
|
|
|
|
EPHOTO_ORIENT_180 = 3,
|
|
|
|
EPHOTO_ORIENT_FLIP_VERT = 4,
|
|
|
|
EPHOTO_ORIENT_FLIP_VERT_90 = 5,
|
|
|
|
EPHOTO_ORIENT_90 = 6,
|
|
|
|
EPHOTO_ORIENT_FLIP_HORIZ_90 = 7,
|
|
|
|
EPHOTO_ORIENT_270 = 8
|
|
|
|
};
|
|
|
|
|
|
|
|
enum _Ephoto_Sort
|
|
|
|
{
|
|
|
|
EPHOTO_SORT_ALPHABETICAL_ASCENDING,
|
|
|
|
EPHOTO_SORT_ALPHABETICAL_DESCENDING,
|
|
|
|
EPHOTO_SORT_MODTIME_ASCENDING,
|
2016-08-15 10:36:50 -07:00
|
|
|
EPHOTO_SORT_MODTIME_DESCENDING,
|
|
|
|
EPHOTO_SORT_SIMILARITY
|
2011-02-24 14:26:47 -08:00
|
|
|
};
|
|
|
|
|
2016-03-24 10:16:05 -07:00
|
|
|
enum _Ephoto_Ipc_Domain
|
|
|
|
{
|
|
|
|
EPHOTO_IPC_DOMAIN_THUMB
|
|
|
|
};
|
|
|
|
|
2011-02-24 14:26:47 -08:00
|
|
|
struct _Ephoto_Config
|
|
|
|
{
|
|
|
|
int config_version;
|
2011-03-15 13:09:37 -07:00
|
|
|
int thumb_size;
|
|
|
|
int thumb_gen_size;
|
2011-02-24 14:26:47 -08:00
|
|
|
const char *directory;
|
2014-11-18 19:18:22 -08:00
|
|
|
double slideshow_timeout;
|
|
|
|
const char *slideshow_transition;
|
|
|
|
int window_width;
|
|
|
|
int window_height;
|
2016-01-13 13:48:11 -08:00
|
|
|
Eina_Bool fsel_hide;
|
2016-04-08 09:49:40 -07:00
|
|
|
double lpane_size;
|
2015-11-02 21:37:35 -08:00
|
|
|
const char *open;
|
2016-01-13 13:48:11 -08:00
|
|
|
Eina_Bool prompts;
|
|
|
|
Eina_Bool drop;
|
2016-07-21 15:12:29 -07:00
|
|
|
Eina_Bool movess;
|
2016-08-04 14:36:58 -07:00
|
|
|
Eina_Bool smooth;
|
2016-08-03 14:05:48 -07:00
|
|
|
Eina_Bool firstrun;
|
2016-08-07 20:54:08 -07:00
|
|
|
Eina_Bool folders;
|
2014-11-21 14:40:09 -08:00
|
|
|
Evas_Object *slide_time;
|
|
|
|
Evas_Object *slide_trans;
|
2015-11-02 21:37:35 -08:00
|
|
|
Evas_Object *open_dir;
|
|
|
|
Evas_Object *open_dir_custom;
|
2015-11-24 14:21:21 -08:00
|
|
|
Evas_Object *show_prompts;
|
|
|
|
Evas_Object *move_drop;
|
2016-08-04 14:36:58 -07:00
|
|
|
Evas_Object *smooth_scale;
|
2016-07-21 15:12:29 -07:00
|
|
|
Evas_Object *slide_move;
|
2016-08-07 20:54:08 -07:00
|
|
|
Evas_Object *show_folders;
|
2010-09-13 15:24:59 -07:00
|
|
|
};
|
|
|
|
|
2010-07-01 11:49:22 -07:00
|
|
|
struct _Ephoto
|
|
|
|
{
|
2010-10-09 18:13:53 -07:00
|
|
|
Evas_Object *win;
|
2016-05-26 15:44:43 -07:00
|
|
|
Evas_Object *layout;
|
2010-10-12 15:54:20 -07:00
|
|
|
Evas_Object *pager;
|
2016-05-26 15:44:43 -07:00
|
|
|
Evas_Object *statusbar;
|
|
|
|
Evas_Object *controls_left;
|
|
|
|
Evas_Object *controls_right;
|
|
|
|
Evas_Object *infolabel;
|
2016-12-09 08:16:40 -08:00
|
|
|
Evas_Object *exit;
|
2010-10-09 18:13:53 -07:00
|
|
|
|
|
|
|
Evas_Object *thumb_browser;
|
2011-02-24 14:26:47 -08:00
|
|
|
Evas_Object *single_browser;
|
2010-10-09 18:13:53 -07:00
|
|
|
Evas_Object *slideshow;
|
2016-05-26 15:44:43 -07:00
|
|
|
Evas_Object *dir_browser;
|
|
|
|
Evas_Object *right_menu;
|
2016-10-10 11:43:40 -07:00
|
|
|
Evas_Object *file_popup;
|
2015-01-25 14:47:58 -08:00
|
|
|
Elm_Object_Item *tb;
|
|
|
|
Elm_Object_Item *sb;
|
|
|
|
Elm_Object_Item *sl;
|
2010-10-09 18:13:53 -07:00
|
|
|
|
2011-02-21 17:55:08 -08:00
|
|
|
Eina_List *entries;
|
2015-12-02 18:45:35 -08:00
|
|
|
Eina_List *selentries;
|
2016-01-01 15:04:25 -08:00
|
|
|
Eina_List *searchentries;
|
2015-11-24 14:21:21 -08:00
|
|
|
Eina_List *thumbs;
|
2011-02-24 14:26:47 -08:00
|
|
|
|
2016-05-26 15:44:43 -07:00
|
|
|
Eina_Bool blocking;
|
|
|
|
Eina_Bool menu_blocking;
|
|
|
|
Eina_Bool hover_blocking;
|
|
|
|
Eina_Bool right_blocking;
|
|
|
|
Eina_Bool folders_toggle;
|
|
|
|
Eina_Bool editor_blocking;
|
|
|
|
|
2016-08-02 11:27:01 -07:00
|
|
|
Eio_Monitor *monitor;
|
|
|
|
Eina_List *monitor_handlers;
|
2016-06-23 12:36:58 -07:00
|
|
|
Ecore_Thread *file_thread;
|
|
|
|
Eina_List *file_pos;
|
2016-03-25 13:45:18 -07:00
|
|
|
Eina_List *upload_handlers;
|
2016-05-26 15:44:43 -07:00
|
|
|
Ecore_Timer *overlay_timer;
|
2016-03-25 13:45:18 -07:00
|
|
|
Ecore_Con_Url *url_up;
|
|
|
|
char *url_ret;
|
|
|
|
char *upload_error;
|
2016-10-10 22:41:45 -07:00
|
|
|
int file_errors;
|
2016-01-20 07:56:10 -08:00
|
|
|
|
2016-01-19 11:58:28 -08:00
|
|
|
const char *top_directory;
|
2016-10-10 11:43:40 -07:00
|
|
|
const char *destination;
|
2016-01-19 11:58:28 -08:00
|
|
|
|
2015-11-24 14:21:21 -08:00
|
|
|
int thumb_gen_size;
|
2016-03-06 09:02:21 -08:00
|
|
|
|
2015-11-24 14:21:21 -08:00
|
|
|
struct
|
|
|
|
{
|
2011-02-24 14:26:47 -08:00
|
|
|
Ecore_Timer *thumb_regen;
|
|
|
|
} timer;
|
2015-11-24 14:21:21 -08:00
|
|
|
struct
|
|
|
|
{
|
2011-02-24 14:26:47 -08:00
|
|
|
Ecore_Job *change_dir;
|
|
|
|
} job;
|
|
|
|
|
|
|
|
Eio_File *ls;
|
|
|
|
|
|
|
|
Evas_Object *prefs_win;
|
2010-10-11 20:40:14 -07:00
|
|
|
Ephoto_State state, prev_state;
|
2011-02-24 14:26:47 -08:00
|
|
|
|
|
|
|
Ephoto_Config *config;
|
2016-08-15 15:21:04 -07:00
|
|
|
Ephoto_Sort sort;
|
2010-11-13 17:51:16 -08:00
|
|
|
};
|
|
|
|
|
2011-02-21 17:55:08 -08:00
|
|
|
struct _Ephoto_Entry
|
|
|
|
{
|
|
|
|
const char *path;
|
2015-11-24 14:21:21 -08:00
|
|
|
const char *basename;
|
2011-02-21 17:55:08 -08:00
|
|
|
const char *label;
|
2016-08-15 10:36:50 -07:00
|
|
|
const char *sort_id;
|
2016-01-19 11:58:28 -08:00
|
|
|
double size;
|
2011-02-24 14:26:47 -08:00
|
|
|
Ephoto *ephoto;
|
2016-08-02 11:27:01 -07:00
|
|
|
Eio_Monitor *monitor;
|
|
|
|
Eina_List *monitor_handlers;
|
2012-01-30 16:58:19 -08:00
|
|
|
Elm_Object_Item *item;
|
2015-11-24 14:21:21 -08:00
|
|
|
Elm_Object_Item *parent;
|
2011-02-21 17:55:08 -08:00
|
|
|
Eina_List *free_listeners;
|
2015-01-24 13:19:25 -08:00
|
|
|
Eina_Bool is_dir;
|
2016-08-09 15:10:47 -07:00
|
|
|
Eina_Bool is_link;
|
2016-01-19 11:58:28 -08:00
|
|
|
Eina_Bool no_delete;
|
|
|
|
Evas_Object *genlist;
|
2016-08-29 12:33:20 -07:00
|
|
|
Evas_Object *gengrid;
|
2016-08-15 10:36:50 -07:00
|
|
|
Evas_Object *thumb;
|
2011-02-21 17:55:08 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Ephoto_Event_Entry_Create
|
|
|
|
{
|
|
|
|
Ephoto_Entry *entry;
|
|
|
|
};
|
|
|
|
|
2016-03-24 10:16:05 -07:00
|
|
|
/*ephoto file functions*/
|
2015-11-24 14:21:21 -08:00
|
|
|
Ephoto_Entry *ephoto_entry_new(Ephoto *ephoto, const char *path,
|
|
|
|
const char *label, Eina_File_Type type);
|
2016-03-15 14:45:20 -07:00
|
|
|
Eina_Bool ephoto_entry_exists(Ephoto *ephoto, const char *path);
|
2015-12-02 17:11:29 -08:00
|
|
|
void ephoto_entry_free(Ephoto *ephoto, Ephoto_Entry *entry);
|
2015-11-24 14:21:21 -08:00
|
|
|
void ephoto_entry_free_listener_add(Ephoto_Entry *entry,
|
|
|
|
void (*cb) (void *data, const Ephoto_Entry *entry), const void *data);
|
|
|
|
void ephoto_entry_free_listener_del(Ephoto_Entry *entry,
|
|
|
|
void (*cb) (void *data, const Ephoto_Entry *entry), const void *data);
|
|
|
|
void ephoto_entries_free(Ephoto *ephoto);
|
|
|
|
int ephoto_entries_cmp(const void *pa, const void *pb);
|
2011-02-24 14:26:47 -08:00
|
|
|
|
2016-03-24 10:16:05 -07:00
|
|
|
/*check if image can be loaded*/
|
2011-02-24 14:26:47 -08:00
|
|
|
static inline Eina_Bool
|
|
|
|
_ephoto_eina_file_direct_info_image_useful(const Eina_File_Direct_Info *info)
|
|
|
|
{
|
2014-08-04 16:55:49 -07:00
|
|
|
const char *type, *bname;
|
|
|
|
int i = 0;
|
|
|
|
|
2015-11-24 14:21:21 -08:00
|
|
|
const char *filters[] = {
|
2016-01-20 07:56:10 -08:00
|
|
|
"png", "jpeg", "jpg", "eet", "xpm", "tiff", "gif", "svg", "webp",
|
|
|
|
"pmaps", "bmp", "tga", "wbmp", "ico", "psd", "jp2k", "generic", "3fr",
|
|
|
|
"ari", "arw", "bay", "crw", "cr2", "cap", "dcs", "dcr", "dng", "drf",
|
|
|
|
"eip", "erf", "fff", "iiq", "k25", "kdc", "mdc", "mef", "mos", "mrw",
|
|
|
|
"nef", "nrw", "obm", "orf", "pef", "ptx", "pxn", "r3d", "raf", "raw",
|
|
|
|
"rwl", "rw2", "rwz", "sr2", "srf", "srw", "tif", "x3f"
|
2014-08-04 16:55:49 -07:00
|
|
|
};
|
2011-02-24 14:26:47 -08:00
|
|
|
|
|
|
|
bname = info->path + info->name_start;
|
2015-11-24 14:21:21 -08:00
|
|
|
if (bname[0] == '.')
|
|
|
|
return EINA_FALSE;
|
2016-08-05 19:34:35 -07:00
|
|
|
if ((info->type != EINA_FILE_REG) && (info->type != EINA_FILE_UNKNOWN) &&
|
2016-08-05 19:36:11 -07:00
|
|
|
(info->type != EINA_FILE_LNK))
|
2015-11-24 14:21:21 -08:00
|
|
|
return EINA_FALSE;
|
2011-02-24 14:26:47 -08:00
|
|
|
|
2014-08-06 21:33:30 -07:00
|
|
|
type = strrchr(bname, '.');
|
2015-11-24 14:21:21 -08:00
|
|
|
if (!type)
|
|
|
|
return EINA_FALSE;
|
|
|
|
int count = sizeof(filters) / sizeof(filters[0]);
|
|
|
|
|
|
|
|
for (i = 0; i < count; i++)
|
2014-08-04 16:55:49 -07:00
|
|
|
{
|
2015-11-24 14:21:21 -08:00
|
|
|
if (!strcasecmp(type + 1, filters[i]))
|
|
|
|
return evas_object_image_extension_can_load_get(bname);
|
2014-08-04 16:55:49 -07:00
|
|
|
}
|
|
|
|
return EINA_FALSE;
|
2011-02-24 14:26:47 -08:00
|
|
|
}
|
|
|
|
|
2016-03-24 10:16:05 -07:00
|
|
|
/*check if image can be saved*/
|
2016-02-17 08:50:32 -08:00
|
|
|
static inline Eina_Bool
|
|
|
|
_ephoto_file_image_can_save(const char *ext)
|
|
|
|
{
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
const char *filters[] = {
|
|
|
|
"png", "jpeg", "jpg", "eet", "xpm", "tiff", "tif", "gif", "svg", "webp",
|
|
|
|
"pmaps", "bmp", "wbmp", "ico", "generic"
|
|
|
|
};
|
|
|
|
|
|
|
|
int count = sizeof(filters) / sizeof(filters[0]);
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
{
|
|
|
|
if (!strcasecmp(ext, filters[i]))
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2016-03-24 10:16:05 -07:00
|
|
|
/*event types*/
|
2011-06-28 15:26:16 -07:00
|
|
|
extern int EPHOTO_EVENT_ENTRY_CREATE;
|
2011-02-21 17:55:08 -08:00
|
|
|
extern int EPHOTO_EVENT_POPULATE_START;
|
|
|
|
extern int EPHOTO_EVENT_POPULATE_END;
|
|
|
|
extern int EPHOTO_EVENT_POPULATE_ERROR;
|
2016-03-23 13:14:21 -07:00
|
|
|
extern int EPHOTO_EVENT_EDITOR_RESET;
|
|
|
|
extern int EPHOTO_EVENT_EDITOR_APPLY;
|
|
|
|
extern int EPHOTO_EVENT_EDITOR_CANCEL;
|
2016-08-11 11:49:34 -07:00
|
|
|
extern int EPHOTO_EVENT_EDITOR_BACK;
|
2011-02-21 17:55:08 -08:00
|
|
|
|
2016-09-25 08:56:23 -07:00
|
|
|
|
|
|
|
#define CRIT(...) EINA_LOG_CRIT(__VA_ARGS__)
|
|
|
|
#define ERR(...) EINA_LOG_ERR(__VA_ARGS__)
|
|
|
|
#define WRN(...) EINA_LOG_WARN(__VA_ARGS__)
|
|
|
|
#define INF(...) EINA_LOG_INFO(__VA_ARGS__)
|
|
|
|
#define DBG(...) EINA_LOG_DBG(__VA_ARGS__)
|
|
|
|
|
2010-09-13 15:24:59 -07:00
|
|
|
#endif
|