forked from enlightenment/ephoto
Ephoto: Add a gadget config so that ephoto can work as an Enlightenment sandboxed gadget.
This commit is contained in:
parent
f16212869f
commit
aec1b6516d
|
@ -2,3 +2,19 @@ install_data('ephoto.desktop',
|
|||
install_dir: join_paths(dir_data, 'applications'))
|
||||
install_data('ephoto.png',
|
||||
install_dir: join_paths(dir_data, 'icons'))
|
||||
host_os = host_machine.system()
|
||||
if host_os == 'linux'
|
||||
if cc.has_header_symbol('features.h', '__UCLIBC__')
|
||||
host_os = 'linux-uclibc'
|
||||
elif cc.has_header_symbol('features.h', '__dietlibc__')
|
||||
host_os = 'linux-dietlibc'
|
||||
else
|
||||
host_os = 'linux-gnu'
|
||||
endif
|
||||
endif
|
||||
dep_e = dependency('enlightenment')
|
||||
release = dep_e.get_pkgconfig_variable('release')
|
||||
module_arch = '@0@-@1@-@2@'.format(host_os, host_machine.cpu_family(), release)
|
||||
dir_gadgets = join_paths([dir_lib, 'enlightenment/gadgets', module_arch])
|
||||
install_data('ephoto.desktop',
|
||||
install_dir: join_paths([dir_gadgets, 'ephoto']))
|
||||
|
|
|
@ -17,6 +17,7 @@ elm = dependency('elementary', required: true, version: efl_version)
|
|||
edje = dependency('edje', required: true, version: efl_version)
|
||||
eipc = dependency('ecore-ipc', required: true, version: efl_version)
|
||||
exif = dependency('libexif', required: false, version: '>= 0.6.0')
|
||||
depe = dependency('enlightenment', required: false)
|
||||
##### check for windows dependency
|
||||
if build_machine.system() == 'windows'
|
||||
win = dependency('evil', version: efl_version)
|
||||
|
@ -66,6 +67,9 @@ endif
|
|||
if exif.found() == true
|
||||
cfg.set ('HAVE_LIBEXIF' , 1)
|
||||
endif
|
||||
if depe.found() == true
|
||||
cfg.set ('HAVE_E' , 1)
|
||||
endif
|
||||
if get_option('nls') == true
|
||||
if cc.has_header('locale.h') == true
|
||||
if cc.has_header('libintl.h') == true
|
||||
|
|
|
@ -2,16 +2,17 @@
|
|||
|
||||
static void _ephoto_display_usage(void);
|
||||
|
||||
EAPI_MAIN int
|
||||
elm_main(int argc, char **argv)
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int r = 0;
|
||||
int gadget = 0, r = 0;
|
||||
|
||||
elm_init(argc, (char **)argv);
|
||||
eio_init();
|
||||
elm_need_efreet();
|
||||
elm_language_set("");
|
||||
elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
|
||||
elm_app_info_set(elm_main, "ephoto", "themes/ephoto.edj");
|
||||
elm_app_info_set(main, "ephoto", "themes/ephoto.edj");
|
||||
#if HAVE_GETTEXT && ENABLE_NLS
|
||||
elm_app_compile_locale_set(LOCALEDIR);
|
||||
bindtextdomain(PACKAGE, elm_app_locale_dir_get());
|
||||
|
@ -28,6 +29,9 @@ elm_main(int argc, char **argv)
|
|||
|
||||
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||
|
||||
if (getenv("E_GADGET_ID"))
|
||||
gadget = 1;
|
||||
|
||||
if (argc > 2)
|
||||
{
|
||||
printf("Too Many Arguments!\n");
|
||||
|
@ -37,7 +41,7 @@ elm_main(int argc, char **argv)
|
|||
}
|
||||
else if (argc < 2)
|
||||
{
|
||||
Evas_Object *win = ephoto_window_add(NULL);
|
||||
Evas_Object *win = ephoto_window_add(NULL, gadget);
|
||||
|
||||
if (!win)
|
||||
{
|
||||
|
@ -61,7 +65,7 @@ elm_main(int argc, char **argv)
|
|||
r = 1;
|
||||
goto end;
|
||||
}
|
||||
Evas_Object *win = ephoto_window_add(real);
|
||||
Evas_Object *win = ephoto_window_add(real, gadget);
|
||||
|
||||
free(real);
|
||||
if (!win)
|
||||
|
@ -71,12 +75,12 @@ elm_main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
|
||||
elm_run();
|
||||
|
||||
ecore_main_loop_begin();
|
||||
end:
|
||||
e_thumb_shutdown();
|
||||
efreet_mime_shutdown();
|
||||
eio_shutdown();
|
||||
elm_shutdown();
|
||||
|
||||
return r;
|
||||
}
|
||||
|
@ -89,5 +93,3 @@ _ephoto_display_usage(void)
|
|||
"ephoto filename : Specifies a file to open\n"
|
||||
"ephoto dirname : Specifies a directory to open\n");
|
||||
}
|
||||
|
||||
ELM_MAIN()
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
# include <Edje.h>
|
||||
# include <Evas.h>
|
||||
# include <Eio.h>
|
||||
#if HAVE_ENLIGHTENMENT
|
||||
# include <e_gadget_types.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_GETTEXT
|
||||
# include <locale.h>
|
||||
|
@ -45,7 +48,7 @@ typedef enum _Ephoto_Sort Ephoto_Sort;
|
|||
typedef enum _Ephoto_Ipc_Domain Ephoto_Ipc_Domain;
|
||||
|
||||
/*main window functions*/
|
||||
Evas_Object *ephoto_window_add(const char *path);
|
||||
Evas_Object *ephoto_window_add(const char *path, int gadget);
|
||||
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,
|
||||
|
@ -292,6 +295,7 @@ struct _Ephoto
|
|||
const char *destination;
|
||||
|
||||
int thumb_gen_size;
|
||||
int gadget;
|
||||
|
||||
struct
|
||||
{
|
||||
|
|
|
@ -102,6 +102,8 @@ _ephoto_slideshow_show(Ephoto *ephoto, Ephoto_Entry *entry)
|
|||
{
|
||||
_ephoto_state_set(ephoto, EPHOTO_STATE_SLIDESHOW);
|
||||
ephoto_slideshow_show_controls(ephoto);
|
||||
if (!ephoto->gadget)
|
||||
{
|
||||
if (ephoto->selentries)
|
||||
ephoto_slideshow_entries_set(ephoto->slideshow, ephoto->selentries);
|
||||
else if (ephoto->searchentries)
|
||||
|
@ -109,16 +111,22 @@ _ephoto_slideshow_show(Ephoto *ephoto, Ephoto_Entry *entry)
|
|||
else
|
||||
ephoto_slideshow_entries_set(ephoto->slideshow, ephoto->entries);
|
||||
ephoto_slideshow_entry_set(ephoto->slideshow, entry);
|
||||
}
|
||||
evas_object_show(ephoto->slideshow);
|
||||
if (!ephoto->gadget)
|
||||
{
|
||||
evas_object_hide(ephoto->single_browser);
|
||||
evas_object_hide(ephoto->thumb_browser);
|
||||
elm_object_focus_set(ephoto->slideshow, EINA_TRUE);
|
||||
elm_table_unpack(ephoto->main, ephoto->statusbar);
|
||||
evas_object_hide(ephoto->dir_browser);
|
||||
elm_box_unpack(ephoto->layout, ephoto->dir_browser);
|
||||
evas_object_hide(ephoto->statusbar);
|
||||
evas_object_freeze_events_set(ephoto->single_browser, EINA_TRUE);
|
||||
evas_object_freeze_events_set(ephoto->thumb_browser, EINA_TRUE);
|
||||
elm_table_unpack(ephoto->main, ephoto->statusbar);
|
||||
}
|
||||
if (!ephoto->gadget)
|
||||
elm_object_focus_set(ephoto->slideshow, EINA_TRUE);
|
||||
evas_object_freeze_events_set(ephoto->slideshow, EINA_FALSE);
|
||||
}
|
||||
|
||||
|
@ -241,6 +249,7 @@ _win_free(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
ecore_event_handler_del(handler);
|
||||
}
|
||||
ephoto_entries_free(ephoto);
|
||||
if (!ephoto->gadget)
|
||||
ephoto_config_save(ephoto);
|
||||
free(ephoto->config);
|
||||
free(ephoto);
|
||||
|
@ -255,6 +264,8 @@ _resize_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
|
||||
if (elm_win_fullscreen_get(ephoto->win))
|
||||
return;
|
||||
if (ephoto->gadget)
|
||||
return;
|
||||
evas_object_geometry_get(ephoto->win, 0, 0, &w, &h);
|
||||
if (w && h)
|
||||
{
|
||||
|
@ -358,7 +369,7 @@ ephoto_show_folders(Ephoto *ephoto, Eina_Bool toggle)
|
|||
}
|
||||
|
||||
Evas_Object *
|
||||
ephoto_window_add(const char *path)
|
||||
ephoto_window_add(const char *path, int gadget)
|
||||
{
|
||||
Ephoto *ephoto = calloc(1, sizeof(Ephoto));
|
||||
Evas_Object *ic, *but;
|
||||
|
@ -381,7 +392,16 @@ ephoto_window_add(const char *path)
|
|||
ephoto->thumb_browser_dirty = EINA_FALSE;
|
||||
ephoto->entries = NULL;
|
||||
ephoto->sort = EPHOTO_SORT_ALPHABETICAL_ASCENDING;
|
||||
ephoto->gadget = gadget;
|
||||
if (!ephoto->gadget)
|
||||
ephoto->win = elm_win_util_standard_add("ephoto", "Ephoto");
|
||||
else
|
||||
{
|
||||
ephoto->win = elm_win_add(NULL, "ephoto", ELM_WIN_BASIC);
|
||||
elm_win_title_set(ephoto->win, "Ephoto");
|
||||
elm_win_alpha_set(ephoto->win, 1);
|
||||
evas_object_size_hint_aspect_set(ephoto->win, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
|
||||
}
|
||||
if (!ephoto->win)
|
||||
{
|
||||
free(ephoto);
|
||||
|
@ -426,6 +446,8 @@ ephoto_window_add(const char *path)
|
|||
elm_box_pack_end(ephoto->layout, ephoto->pager);
|
||||
evas_object_show(ephoto->pager);
|
||||
|
||||
if (!ephoto->gadget)
|
||||
{
|
||||
ephoto->thumb_browser = ephoto_thumb_browser_add(ephoto, ephoto->layout);
|
||||
if (!ephoto->thumb_browser)
|
||||
{
|
||||
|
@ -451,6 +473,7 @@ ephoto_window_add(const char *path)
|
|||
_ephoto_single_browser_back, ephoto);
|
||||
evas_object_smart_callback_add(ephoto->single_browser, "slideshow",
|
||||
_ephoto_single_browser_slideshow, ephoto);
|
||||
}
|
||||
ephoto->slideshow = ephoto_slideshow_add(ephoto, ephoto->layout);
|
||||
if (!ephoto->slideshow)
|
||||
{
|
||||
|
@ -461,6 +484,8 @@ ephoto_window_add(const char *path)
|
|||
evas_object_smart_callback_add(ephoto->slideshow, "back",
|
||||
_ephoto_slideshow_back, ephoto);
|
||||
|
||||
if (!ephoto->gadget)
|
||||
{
|
||||
ephoto->dir_browser = ephoto_directory_browser_add(ephoto, ephoto->layout);
|
||||
EPHOTO_WEIGHT(ephoto->dir_browser, ephoto->config->left_size, EVAS_HINT_EXPAND);
|
||||
EPHOTO_FILL(ephoto->dir_browser);
|
||||
|
@ -568,7 +593,7 @@ ephoto_window_add(const char *path)
|
|||
elm_object_tooltip_text_set(ephoto->exit, _("Exit"));
|
||||
elm_object_tooltip_orient_set(ephoto->exit, ELM_TOOLTIP_ORIENT_TOP);
|
||||
evas_object_hide(ephoto->exit);
|
||||
|
||||
}
|
||||
if ((!path) || (!ecore_file_exists(path)))
|
||||
{
|
||||
if (ephoto->config->open)
|
||||
|
@ -594,7 +619,10 @@ ephoto_window_add(const char *path)
|
|||
char *rp = ecore_file_realpath(path);
|
||||
eina_stringshare_replace(&ephoto->config->directory, rp);
|
||||
free(rp);
|
||||
if (!ephoto->gadget)
|
||||
_ephoto_thumb_browser_show(ephoto, NULL);
|
||||
else
|
||||
_ephoto_slideshow_show(ephoto, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -604,6 +632,8 @@ ephoto_window_add(const char *path)
|
|||
eina_stringshare_replace(&ephoto->config->directory, rp);
|
||||
free(rp);
|
||||
free(dir);
|
||||
if (!ephoto->gadget)
|
||||
{
|
||||
ephoto_single_browser_path_pending_set(ephoto->single_browser, path);
|
||||
evas_object_hide(ephoto->thumb_browser);
|
||||
evas_object_hide(ephoto->slideshow);
|
||||
|
@ -611,18 +641,26 @@ ephoto_window_add(const char *path)
|
|||
ephoto_single_browser_show_controls(ephoto);
|
||||
ephoto->state = EPHOTO_STATE_SINGLE;
|
||||
}
|
||||
else
|
||||
_ephoto_slideshow_show(ephoto, NULL);
|
||||
}
|
||||
|
||||
snprintf(config, PATH_MAX, "%s/.config/ephoto", eina_environment_home_get());
|
||||
ephoto->config_path = eina_stringshare_add(config);
|
||||
snprintf(trash, PATH_MAX, "%s/trash", ephoto->config_path);
|
||||
ephoto->trash_path = eina_stringshare_add(trash);
|
||||
|
||||
if (!ephoto->gadget)
|
||||
{
|
||||
ephoto_directory_browser_top_dir_set(ephoto, ephoto->config->directory);
|
||||
ephoto_directory_browser_initialize_structure(ephoto, (char *)ephoto->config->open);
|
||||
evas_object_resize(ephoto->win, ephoto->config->window_width,
|
||||
ephoto->config->window_height);
|
||||
}
|
||||
evas_object_show(ephoto->win);
|
||||
|
||||
if (!ephoto->gadget)
|
||||
{
|
||||
if (!ephoto->config->folders)
|
||||
{
|
||||
evas_object_hide(ephoto->dir_browser);
|
||||
|
@ -646,7 +684,7 @@ ephoto_window_add(const char *path)
|
|||
_settings_icon_clicked(ephoto, NULL, NULL);
|
||||
ephoto->config->firstrun = 0;
|
||||
}
|
||||
|
||||
}
|
||||
return ephoto->win;
|
||||
}
|
||||
|
||||
|
@ -799,9 +837,18 @@ _ephoto_populate_end(void *data, Eio_File *handler EINA_UNUSED)
|
|||
|
||||
ed->ephoto->ls = NULL;
|
||||
|
||||
if (!ed->ephoto->gadget)
|
||||
{
|
||||
if (eina_list_count(ed->ephoto->entries))
|
||||
ephoto_single_browser_entries_set(ed->ephoto->single_browser,
|
||||
ed->ephoto->entries);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (eina_list_count(ed->ephoto->entries))
|
||||
ephoto_slideshow_entries_set(ed->ephoto->slideshow,
|
||||
ed->ephoto->entries);
|
||||
}
|
||||
ecore_event_add(EPHOTO_EVENT_POPULATE_END, NULL, NULL, NULL);
|
||||
free(ed);
|
||||
}
|
||||
|
@ -963,6 +1010,13 @@ ephoto_directory_set(Ephoto *ephoto, const char *path, Evas_Object *expanded,
|
|||
if (ed->ephoto->job.change_dir)
|
||||
ecore_job_del(ed->ephoto->job.change_dir);
|
||||
ed->ephoto->job.change_dir = ecore_job_add(_ephoto_change_dir, ed);
|
||||
|
||||
if (ephoto->gadget)
|
||||
{
|
||||
free(rp);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ephoto->monitor)
|
||||
{
|
||||
eio_monitor_del(ephoto->monitor);
|
||||
|
|
|
@ -473,12 +473,15 @@ _slideshow_transition(void *data)
|
|||
|
||||
snprintf(buf, PATH_MAX, "ephoto,%s", ss->ephoto->config->slideshow_transition);
|
||||
elm_layout_signal_emit(ss->slideshow, buf, "ephoto");
|
||||
if (!ss->ephoto->gadget)
|
||||
{
|
||||
if (ss->ephoto->config->movess)
|
||||
{
|
||||
elm_layout_signal_emit(ss->current_item, _slideshow_move_start_get(ss), "ephoto");
|
||||
elm_layout_signal_emit(ss->current_item, _slideshow_move_end_get(ss), "ephoto");
|
||||
_slideshow_move_randomize(ss);
|
||||
}
|
||||
}
|
||||
if (ss->timer)
|
||||
ecore_timer_del(ss->timer);
|
||||
ss->timer = NULL;
|
||||
|
@ -502,20 +505,26 @@ _slideshow_play(Ephoto_Slideshow *ss)
|
|||
evas_object_raise(ss->current_item);
|
||||
evas_object_show(ss->current_item);
|
||||
}
|
||||
if (!ss->ephoto->gadget)
|
||||
{
|
||||
if (ss->ephoto->config->movess)
|
||||
_slideshow_move_randomize(ss);
|
||||
|
||||
}
|
||||
msg = alloca(sizeof(Edje_Message_Float_Set) + (1 * sizeof(float)));
|
||||
msg->count = 1;
|
||||
msg->val[0] = (float)ss->timeout;
|
||||
edje_object_message_send(elm_layout_edje_get(ss->current_item),
|
||||
EDJE_MESSAGE_FLOAT_SET, 1, msg);
|
||||
|
||||
if (!ss->ephoto->gadget)
|
||||
{
|
||||
if (ss->ephoto->config->movess)
|
||||
{
|
||||
elm_layout_signal_emit(ss->current_item, _slideshow_move_start_get(ss), "ephoto");
|
||||
elm_layout_signal_emit(ss->current_item, _slideshow_move_end_get(ss), "ephoto");
|
||||
_slideshow_move_randomize(ss);
|
||||
}
|
||||
}
|
||||
|
||||
if (ss->timer)
|
||||
ecore_timer_del(ss->timer);
|
||||
|
@ -560,6 +569,7 @@ _mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
evas_object_del(ss->notify);
|
||||
ss->notify_box = NULL;
|
||||
ss->notify = NULL;
|
||||
if (!ss->ephoto->gadget)
|
||||
evas_object_smart_callback_call(ss->slideshow, "back", entry);
|
||||
if (ss->old_item)
|
||||
{
|
||||
|
@ -777,6 +787,90 @@ _settings(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
ephoto_config_main(ss->ephoto);
|
||||
}
|
||||
|
||||
static void
|
||||
_gadget_settings_save(void *data, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *popup = data, *fentry, *spinner;
|
||||
Ephoto_Slideshow *ss = evas_object_data_get(popup, "slideshow");
|
||||
const char *path;
|
||||
|
||||
fentry = evas_object_data_get(popup, "fentry");
|
||||
spinner = evas_object_data_get(popup, "timeout");
|
||||
|
||||
ss->ephoto->config->slideshow_timeout = elm_spinner_value_get(spinner);
|
||||
path = elm_object_text_get(fentry);
|
||||
if (ecore_file_is_dir(path))
|
||||
ephoto_directory_set(ss->ephoto, path, NULL, EINA_FALSE, EINA_TRUE);
|
||||
|
||||
evas_object_del(popup);
|
||||
}
|
||||
|
||||
static void
|
||||
_gadget_settings(void *data, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ephoto_Slideshow *ss = data;
|
||||
Evas_Object *popup, *but, *table, *fentry, *label, *spinner;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
popup = elm_win_add(ss->ephoto->win, "win", ELM_WIN_BASIC);
|
||||
elm_win_alpha_set(popup, 1);
|
||||
evas_object_data_set(popup, "slideshow", ss);
|
||||
|
||||
table = elm_table_add(popup);
|
||||
EPHOTO_EXPAND(table);
|
||||
EPHOTO_FILL(table);
|
||||
elm_win_resize_object_add(popup, table);
|
||||
evas_object_show(table);
|
||||
|
||||
label = elm_label_add(table);
|
||||
elm_object_text_set(label, _("Directory:"));
|
||||
EPHOTO_FILL(label);
|
||||
elm_table_pack(table, label, 0, 0, 1, 1);
|
||||
evas_object_show(label);
|
||||
|
||||
fentry = elm_entry_add(table);
|
||||
elm_entry_single_line_set(fentry, EINA_TRUE);
|
||||
elm_entry_editable_set(fentry, EINA_TRUE);
|
||||
elm_entry_scrollable_set(fentry, EINA_TRUE);
|
||||
elm_object_text_set(fentry, ss->ephoto->config->directory);
|
||||
evas_object_size_hint_weight_set(fentry, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(fentry, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
evas_object_size_hint_min_set(fentry, 300, 75);
|
||||
elm_table_pack(table, fentry, 1, 0, 1, 1);
|
||||
evas_object_show(fentry);
|
||||
evas_object_data_set(popup, "fentry", fentry);
|
||||
|
||||
label = elm_label_add(table);
|
||||
memset(buf, 0, PATH_MAX);
|
||||
snprintf(buf, PATH_MAX, "%s:", _("Show Each Slide For"));
|
||||
elm_object_text_set(label, buf);
|
||||
EPHOTO_FILL(label);
|
||||
elm_table_pack(table, label, 0, 1, 1, 1);
|
||||
evas_object_show(label);
|
||||
|
||||
spinner = elm_spinner_add(table);
|
||||
elm_spinner_editable_set(spinner, EINA_TRUE);
|
||||
memset(buf, 0, PATH_MAX);
|
||||
snprintf(buf, PATH_MAX, "%%1.0f %s", _("seconds"));
|
||||
elm_spinner_label_format_set(spinner, buf);
|
||||
elm_spinner_step_set(spinner, 1);
|
||||
elm_spinner_value_set(spinner, ss->ephoto->config->slideshow_timeout);
|
||||
elm_spinner_min_max_set(spinner, 1, 60);
|
||||
elm_table_pack(table, spinner, 1, 1, 1, 1);
|
||||
evas_object_show(spinner);
|
||||
evas_object_data_set(popup, "timeout", spinner);
|
||||
|
||||
but = elm_button_add(table);
|
||||
elm_object_text_set(but, _("Okay"));
|
||||
elm_table_pack(table, but, 0, 2, 2, 1);
|
||||
evas_object_smart_callback_add(but, "clicked", _gadget_settings_save, popup);
|
||||
evas_object_show(but);
|
||||
|
||||
evas_object_show(popup);
|
||||
}
|
||||
|
||||
static void
|
||||
_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info)
|
||||
|
@ -790,6 +884,7 @@ _key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
|
||||
if (!strcmp(k, "Escape") || !strcmp(k, "F5"))
|
||||
{
|
||||
if (!ss->ephoto->gadget)
|
||||
_back(ss, NULL, NULL);
|
||||
}
|
||||
else if (!strcmp(k, "F1"))
|
||||
|
@ -905,6 +1000,15 @@ ephoto_slideshow_show_controls(Ephoto *ephoto)
|
|||
elm_object_content_set(ss->notify, ss->notify_box);
|
||||
evas_object_show(ss->notify_box);
|
||||
|
||||
if (ephoto->gadget)
|
||||
{
|
||||
but = _add_icon(ss->notify_box, "preferences-other", _("Settings"), NULL);
|
||||
evas_object_smart_callback_add(but, "clicked", _gadget_settings, ss);
|
||||
elm_notify_align_set(ss->notify, 0.5, 0.5);
|
||||
elm_notify_timeout_set(ss->notify, 3.0);
|
||||
evas_object_show(ss->notify);
|
||||
return;
|
||||
}
|
||||
but = _add_icon(ss->notify_box, "edit-undo", _("Back"), NULL);
|
||||
evas_object_smart_callback_add(but, "clicked", _back, ss);
|
||||
but = _add_icon(ss->notify_box, "go-first", _("First"), NULL);
|
||||
|
@ -963,6 +1067,7 @@ ephoto_slideshow_add(Ephoto *ephoto, Evas_Object *parent)
|
|||
"ephoto,slideshow,base");
|
||||
evas_object_event_callback_add(slideshow, EVAS_CALLBACK_DEL, _slideshow_del,
|
||||
ss);
|
||||
if (!ephoto->gadget)
|
||||
evas_object_event_callback_add(slideshow, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_mouse_down, ss);
|
||||
evas_object_data_set(slideshow, "slideshow", ss);
|
||||
|
@ -990,6 +1095,8 @@ ephoto_slideshow_entries_set(Evas_Object *obj, Eina_List *entries)
|
|||
|
||||
if (entries)
|
||||
ss->entries = entries;
|
||||
if (ss->ephoto->gadget)
|
||||
ephoto_slideshow_entry_set(ss->slideshow, eina_list_nth(ss->entries, 0));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1011,6 +1118,7 @@ ephoto_slideshow_entry_set(Evas_Object *obj, Ephoto_Entry *entry)
|
|||
|
||||
ss->timeout = ss->ephoto->config->slideshow_timeout;
|
||||
_slideshow_play(ss);
|
||||
ss->playing = 1;
|
||||
|
||||
if (ss->pause)
|
||||
{
|
||||
|
@ -1050,6 +1158,8 @@ ephoto_slideshow_entry_set(Evas_Object *obj, Ephoto_Entry *entry)
|
|||
evas_object_del(ss->event);
|
||||
ss->event = NULL;
|
||||
}
|
||||
if (!ss->ephoto->gadget)
|
||||
{
|
||||
ss->event = evas_object_rectangle_add(ss->ephoto->win);
|
||||
evas_object_smart_member_add(ss->event, ss->ephoto->win);
|
||||
evas_object_color_set(ss->event, 0, 0, 0, 0);
|
||||
|
@ -1059,5 +1169,6 @@ ephoto_slideshow_entry_set(Evas_Object *obj, Ephoto_Entry *entry)
|
|||
ss);
|
||||
evas_object_raise(ss->event);
|
||||
elm_object_focus_set(ss->event, EINA_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ deps = [
|
|||
elm,
|
||||
edje,
|
||||
eipc,
|
||||
exif
|
||||
exif,
|
||||
depe
|
||||
]
|
||||
executable('ephoto', [
|
||||
'ephoto.c',
|
||||
|
|
Loading…
Reference in New Issue