Add exif data and other improvements :
* controls do not disappear when mouse is over them (thanks to Al Poole) * hamburger menu open a ctxpopup to open settings or exif
This commit is contained in:
parent
082401e79f
commit
011b83ceb8
1
AUTHORS
1
AUTHORS
|
@ -1,2 +1,3 @@
|
|||
Vincent Torri <vincent dot torri at gmail dot com>
|
||||
Carsten Heiztler (rasterman)
|
||||
Al Poole <netstar at gmail dot com>
|
||||
|
|
|
@ -59,7 +59,8 @@ Original size | Ctrl-0
|
|||
Best fit | f
|
||||
Zoom in | +
|
||||
Zoom out | -
|
||||
Open Settings | s
|
||||
Manage Settings | s
|
||||
Show EXIF data | e
|
||||
Copy file name in clipboard | Ctrl-c
|
||||
Exit Settings | Esc
|
||||
|
||||
|
|
|
@ -3,6 +3,36 @@
|
|||
// padding between icon controls and window border
|
||||
#define GB_PAD 10
|
||||
|
||||
#define STOP_FADE(icon) \
|
||||
part \
|
||||
{ \
|
||||
name: "fade"icon; \
|
||||
type: RECT; \
|
||||
mouse_events: 1; \
|
||||
repeat_events: 1; \
|
||||
description \
|
||||
{ \
|
||||
state: "default" 0.0; \
|
||||
color: 255 255 255 0; \
|
||||
rel.to: "entice."icon; \
|
||||
rel1.offset: -2 -2; \
|
||||
rel2.offset: 2 2; \
|
||||
visible: 1; \
|
||||
} \
|
||||
} \
|
||||
program \
|
||||
{ \
|
||||
signal: "mouse,in"; \
|
||||
source: "fade"icon; \
|
||||
action: SIGNAL_EMIT "image,stopfade,"icon "entice"; \
|
||||
} \
|
||||
program \
|
||||
{ \
|
||||
signal: "mouse,out"; \
|
||||
source: "fade"icon; \
|
||||
action: SIGNAL_EMIT "image,startfade,"icon "entice"; \
|
||||
}
|
||||
|
||||
collections
|
||||
{
|
||||
group { name: "entice/core";
|
||||
|
@ -73,6 +103,57 @@ collections
|
|||
target: "entice.settings.panel";
|
||||
}
|
||||
|
||||
// EXIF
|
||||
|
||||
// exif bg
|
||||
part { name: "entice.exifbg"; type: RECT;
|
||||
mouse_events: 1;
|
||||
repeat_events: 1;
|
||||
description { state: "default" 0.0;
|
||||
color: 64 64 64 255;
|
||||
rel.to: "entice.exif.panel";
|
||||
rel1.offset: 0 0;
|
||||
rel2.offset: -1 -1;
|
||||
visible: 0;
|
||||
}
|
||||
description { state: "shown" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
program { signal: "state,exifbg,show"; source: "entice";
|
||||
action: STATE_SET "shown" 0.0;
|
||||
target: "entice.exifbg";
|
||||
}
|
||||
program { signal: "state,exifbg,hide"; source: "entice";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "entice.exifbg";
|
||||
}
|
||||
|
||||
part { name: "entice.exif.panel"; type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
fixed: 1 1;
|
||||
visible: 0;
|
||||
rel1.relative: 0.3 0.1;
|
||||
rel2.relative: 0.7 0.9;
|
||||
rel1.offset: 32 32;
|
||||
rel2.offset: -33 -33;
|
||||
offscale;
|
||||
}
|
||||
description { state: "shown" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
program { signal: "state,exif,show"; source: "entice";
|
||||
action: STATE_SET "shown" 0.0;
|
||||
target: "entice.exif.panel";
|
||||
}
|
||||
program { signal: "state,exif,hide"; source: "entice";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "entice.exif.panel";
|
||||
}
|
||||
|
||||
// CONTROLS
|
||||
|
||||
// Zoom best fit checkbox
|
||||
|
@ -133,6 +214,8 @@ collections
|
|||
action: SIGNAL_EMIT "image,action,zoomfit" "entice";
|
||||
}
|
||||
|
||||
STOP_FADE("zoomfit")
|
||||
|
||||
// Zoom original icon
|
||||
part
|
||||
{
|
||||
|
@ -162,6 +245,8 @@ collections
|
|||
action: SIGNAL_EMIT "image,action,zoomorig" "entice";
|
||||
}
|
||||
|
||||
STOP_FADE("zoomorig")
|
||||
|
||||
// Zoom out icon
|
||||
part
|
||||
{
|
||||
|
@ -191,6 +276,8 @@ collections
|
|||
action: SIGNAL_EMIT "image,action,zoomout" "entice";
|
||||
}
|
||||
|
||||
STOP_FADE("zoomout")
|
||||
|
||||
// entry bg
|
||||
part
|
||||
{
|
||||
|
@ -245,6 +332,8 @@ collections
|
|||
action: SIGNAL_EMIT "image,action,zoomval" "entice";
|
||||
}
|
||||
|
||||
STOP_FADE("zoomval")
|
||||
|
||||
// Zoom in icon
|
||||
part
|
||||
{
|
||||
|
@ -274,6 +363,8 @@ collections
|
|||
action: SIGNAL_EMIT "image,action,zoomin" "entice";
|
||||
}
|
||||
|
||||
STOP_FADE("zoomin")
|
||||
|
||||
// Rotate left icon
|
||||
part
|
||||
{
|
||||
|
@ -303,6 +394,8 @@ collections
|
|||
action: SIGNAL_EMIT "image,action,rotleft" "entice";
|
||||
}
|
||||
|
||||
STOP_FADE("rotleft")
|
||||
|
||||
// Rotate right icon
|
||||
part
|
||||
{
|
||||
|
@ -332,6 +425,8 @@ collections
|
|||
action: SIGNAL_EMIT "image,action,rotright" "entice";
|
||||
}
|
||||
|
||||
STOP_FADE("rotright")
|
||||
|
||||
// Prev icon
|
||||
part
|
||||
{
|
||||
|
@ -361,6 +456,8 @@ collections
|
|||
action: SIGNAL_EMIT "image,action,prev" "entice";
|
||||
}
|
||||
|
||||
STOP_FADE("prev")
|
||||
|
||||
// Next icon
|
||||
part
|
||||
{
|
||||
|
@ -389,35 +486,12 @@ collections
|
|||
action: SIGNAL_EMIT "image,action,next" "entice";
|
||||
}
|
||||
|
||||
// event RECT to forbid fade away
|
||||
part { name: "fadenext"; type: RECT;
|
||||
mouse_events: 1;
|
||||
repeat_events: 1;
|
||||
description { state: "default" 0.0;
|
||||
color: 255 255 255 0;
|
||||
rel.to: "entice.next";
|
||||
rel1.offset: -2 -2;
|
||||
rel2.offset: 2 2;
|
||||
visible: 1;
|
||||
}
|
||||
}
|
||||
program
|
||||
{
|
||||
signal: "mouse,in";
|
||||
source: "fadenext";
|
||||
action: SIGNAL_EMIT "image,stopfade,next" "entice";
|
||||
}
|
||||
program
|
||||
{
|
||||
signal: "mouse,out";
|
||||
source: "fadenext";
|
||||
action: SIGNAL_EMIT "image,startfade,next" "entice";
|
||||
}
|
||||
STOP_FADE("next")
|
||||
|
||||
// Settings icon
|
||||
// Menu icon
|
||||
part
|
||||
{
|
||||
name: "entice.settings";
|
||||
name: "entice.menu";
|
||||
type: SWALLOW;
|
||||
clip_to: fader;
|
||||
scale: 1;
|
||||
|
@ -439,10 +513,12 @@ collections
|
|||
visible: 0;
|
||||
}
|
||||
}
|
||||
program { signal: "mouse,clicked,1"; source: "entice.settings";
|
||||
action: SIGNAL_EMIT "image,action,settings" "entice";
|
||||
program { signal: "mouse,clicked,1"; source: "entice.menu";
|
||||
action: SIGNAL_EMIT "image,action,menu" "entice";
|
||||
}
|
||||
|
||||
STOP_FADE("menu")
|
||||
|
||||
// Fullscreen icon
|
||||
part
|
||||
{
|
||||
|
@ -472,6 +548,8 @@ collections
|
|||
action: SIGNAL_EMIT "image,action,fullscreen" "entice";
|
||||
}
|
||||
|
||||
STOP_FADE("fullscreen")
|
||||
|
||||
|
||||
// Close icon
|
||||
part
|
||||
|
@ -501,6 +579,8 @@ collections
|
|||
action: SIGNAL_EMIT "image,action,close" "entice";
|
||||
}
|
||||
|
||||
STOP_FADE("close")
|
||||
|
||||
// Fader rectangle
|
||||
part { name: "fader"; type: RECT;
|
||||
mouse_events: 0;
|
||||
|
|
|
@ -29,7 +29,10 @@ sys_windows = win32.contains(host_os)
|
|||
# binaries
|
||||
cc = meson.get_compiler('c')
|
||||
efl_req = '>= 1.25'
|
||||
entice_deps = [ dependency('elementary', version : efl_req) ]
|
||||
entice_deps = [
|
||||
dependency('elementary', version : efl_req),
|
||||
dependency('libexif'),
|
||||
]
|
||||
edje = dependency('edje', version: efl_req)
|
||||
|
||||
# edje_cc tool - allow ti as an option for cross-compile
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "entice_config.h"
|
||||
#include "entice_image.h"
|
||||
#include "entice_settings.h"
|
||||
#include "entice_exif.h"
|
||||
#include "entice_win.h"
|
||||
#include "entice_controls.h"
|
||||
|
||||
|
@ -38,22 +39,30 @@
|
|||
* Local *
|
||||
*============================================================================*/
|
||||
|
||||
#define CONTROLS(_icon, _action) \
|
||||
o = elm_icon_add(win); \
|
||||
elm_icon_standard_set(o, _icon); \
|
||||
evas_object_show(o); \
|
||||
entice->_action = o; \
|
||||
\
|
||||
o = elm_button_add(win); \
|
||||
elm_object_content_set(o, entice->_action); \
|
||||
elm_object_focus_allow_set(o, EINA_FALSE); \
|
||||
elm_object_style_set(o, "overlay"); \
|
||||
evas_object_show(o); \
|
||||
elm_object_part_content_set(entice->layout, "entice." #_action, o); \
|
||||
\
|
||||
elm_layout_signal_callback_add(entice->layout, \
|
||||
"image,action," #_action, "entice", \
|
||||
_cb_image_##_action, win)
|
||||
#define CONTROLS(_icon, _action) \
|
||||
o = elm_icon_add(win); \
|
||||
elm_icon_standard_set(o, _icon); \
|
||||
evas_object_show(o); \
|
||||
entice->_action = o; \
|
||||
\
|
||||
o = elm_button_add(win); \
|
||||
elm_object_content_set(o, entice->_action); \
|
||||
elm_object_focus_allow_set(o, EINA_FALSE); \
|
||||
elm_object_style_set(o, "overlay"); \
|
||||
evas_object_show(o); \
|
||||
elm_object_part_content_set(entice->layout, "entice." #_action, o); \
|
||||
\
|
||||
elm_layout_signal_callback_add(entice->layout, \
|
||||
"image,action," #_action, "entice", \
|
||||
_cb_image_##_action, win); \
|
||||
\
|
||||
elm_layout_signal_callback_add(entice->layout, \
|
||||
"image,startfade," #_action, "entice", \
|
||||
_cb_image_startfade, win); \
|
||||
\
|
||||
elm_layout_signal_callback_add(entice->layout, \
|
||||
"image,stopfade," #_action, "entice", \
|
||||
_cb_image_stopfade, win)
|
||||
|
||||
static void
|
||||
_cb_image_prev(void *win, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||
|
@ -241,22 +250,82 @@ _cb_image_fullscreen(void *win, Evas_Object *obj EINA_UNUSED, const char *emissi
|
|||
}
|
||||
|
||||
static void
|
||||
_cb_image_settings(void *win, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||
_cb_image_ctxpopup_dismissed(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
evas_object_del(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_image_ctxpopup_settings_cb(void *win, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Entice *entice;
|
||||
|
||||
entice = evas_object_data_get(win, "entice");
|
||||
|
||||
entice_settings_init(win);
|
||||
|
||||
if (entice->exif_shown)
|
||||
{
|
||||
elm_object_signal_emit(entice->layout, "state,exif,hide", "entice");
|
||||
elm_object_signal_emit(entice->layout, "state,exifbg,hide", "entice");
|
||||
entice->exif_shown = EINA_FALSE;
|
||||
}
|
||||
|
||||
if (!entice->settings_shown)
|
||||
{
|
||||
elm_object_signal_emit(entice->layout, "state,settings,show", "entice");
|
||||
entice->settings_shown = EINA_TRUE;
|
||||
}
|
||||
else
|
||||
|
||||
evas_object_del(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_image_ctxpopup_exif_cb(void *win, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Entice *entice;
|
||||
|
||||
entice = evas_object_data_get(win, "entice");
|
||||
|
||||
entice_exif_fill(win);
|
||||
|
||||
if (entice->settings_shown)
|
||||
{
|
||||
elm_object_signal_emit(entice->layout, "state,settings,hide", "entice");
|
||||
entice->settings_shown = EINA_FALSE;
|
||||
}
|
||||
|
||||
if (!entice->exif_shown)
|
||||
{
|
||||
elm_object_signal_emit(entice->layout, "state,exif,show", "entice");
|
||||
elm_object_signal_emit(entice->layout, "state,exifbg,show", "entice");
|
||||
entice->exif_shown = EINA_TRUE;
|
||||
}
|
||||
|
||||
evas_object_del(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_image_menu(void *win, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *ctxpopup;
|
||||
Evas_Coord x,y;
|
||||
|
||||
ctxpopup = elm_ctxpopup_add(win);
|
||||
elm_ctxpopup_direction_priority_set(ctxpopup,
|
||||
ELM_CTXPOPUP_DIRECTION_DOWN,
|
||||
ELM_CTXPOPUP_DIRECTION_LEFT,
|
||||
ELM_CTXPOPUP_DIRECTION_RIGHT,
|
||||
ELM_CTXPOPUP_DIRECTION_UP);
|
||||
|
||||
elm_ctxpopup_item_append(ctxpopup, "settings", NULL,
|
||||
_cb_image_ctxpopup_settings_cb, win);
|
||||
elm_ctxpopup_item_append(ctxpopup, "exif", NULL,
|
||||
_cb_image_ctxpopup_exif_cb, win);
|
||||
evas_pointer_canvas_xy_get(evas_object_evas_get(win), &x, &y);
|
||||
evas_object_move(ctxpopup, x, y);
|
||||
evas_object_show(ctxpopup);
|
||||
evas_object_smart_callback_add(ctxpopup, "dismissed", _cb_image_ctxpopup_dismissed, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -265,6 +334,7 @@ _cb_image_stopfade(void *win, Evas_Object *obj EINA_UNUSED, const char *emission
|
|||
Entice *entice;
|
||||
|
||||
entice = evas_object_data_get(win, "entice");
|
||||
entice->controls_over = EINA_TRUE;
|
||||
printf("mouse in\n");
|
||||
fflush(stdout);
|
||||
|
||||
|
@ -278,7 +348,11 @@ _cb_image_stopfade(void *win, Evas_Object *obj EINA_UNUSED, const char *emission
|
|||
static void
|
||||
_cb_image_startfade(void *win, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
||||
{
|
||||
entice_controls_timer_start(win);
|
||||
Entice *entice;
|
||||
|
||||
entice = evas_object_data_get(win, "entice");
|
||||
entice->controls_over = EINA_FALSE;
|
||||
//entice_controls_timer_start(win);
|
||||
printf("mouse out\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
@ -323,14 +397,6 @@ entice_controls_init(Evas_Object *win)
|
|||
CONTROLS("go-previous", prev);
|
||||
CONTROLS("go-next", next);
|
||||
|
||||
elm_layout_signal_callback_add(entice->layout,
|
||||
"image,stopfade,next", "entice",
|
||||
_cb_image_stopfade, win);
|
||||
|
||||
elm_layout_signal_callback_add(entice->layout,
|
||||
"image,startfade,next", "entice",
|
||||
_cb_image_startfade, win);
|
||||
|
||||
/* best fit checkbox */
|
||||
o = elm_check_add(win);
|
||||
elm_object_style_set(o, "default");
|
||||
|
@ -353,7 +419,7 @@ entice_controls_init(Evas_Object *win)
|
|||
|
||||
elm_object_part_content_set(entice->layout, "entice.zoomval", entice->zoomval);
|
||||
|
||||
CONTROLS("menu", settings);
|
||||
CONTROLS("menu", menu);
|
||||
CONTROLS("view-fullscreen", fullscreen);
|
||||
CONTROLS("window-close", close);
|
||||
}
|
||||
|
@ -382,9 +448,20 @@ entice_controls_timer_start(Evas_Object *win)
|
|||
entice = evas_object_data_get(win, "entice");
|
||||
|
||||
if (entice->controls_timer)
|
||||
ecore_timer_del(entice->controls_timer);
|
||||
{
|
||||
ecore_timer_reset(entice->controls_timer);
|
||||
return;
|
||||
}
|
||||
|
||||
entice->controls_timer = ecore_timer_add(entice->config->duration_controls,
|
||||
if ((entice->controls_timer) && (entice->controls_over))
|
||||
{
|
||||
ecore_timer_del(entice->controls_timer);
|
||||
entice->controls_timer = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((!entice->controls_timer) && (!entice->controls_over))
|
||||
entice->controls_timer = ecore_timer_add(entice->config->duration_controls,
|
||||
_cb_controls_hide, win);
|
||||
|
||||
/* display controls */
|
||||
|
|
|
@ -0,0 +1,296 @@
|
|||
/* Entice - small and simple image viewer using the EFL
|
||||
* Copyright (C) 2021 Vincent Torri
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <libexif/exif-data.h>
|
||||
|
||||
#include <Elementary.h>
|
||||
|
||||
#include "entice_private.h"
|
||||
#include "entice_config.h"
|
||||
#include "entice_win.h"
|
||||
|
||||
/*============================================================================*
|
||||
* Local *
|
||||
*============================================================================*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Evas_Object *button;
|
||||
const char *name;
|
||||
const char *tag;
|
||||
} Entice_Exif_Entry;
|
||||
|
||||
static Entice_Exif_Entry entice_exif_entries[] =
|
||||
{
|
||||
{ NULL, "Width:", "PixelXDimension" },
|
||||
{ NULL, "Height:", "PixelYDimension" },
|
||||
{ NULL, "Exposure time:", "ExposureTime" },
|
||||
{ NULL, "Date time:", "DateTimeOriginal" },
|
||||
{ NULL, "Focal length::", "FocalLength" },
|
||||
{ NULL, "Exposure time", "ColorSpace" },
|
||||
};
|
||||
|
||||
static Entice_Exif_Entry entice_exif_gps_entries[] =
|
||||
{
|
||||
{ NULL, "Latitude Ref:", "GPSLatitudeRef" },
|
||||
{ NULL, "Latitude:", "GPSLatitude" },
|
||||
{ NULL, "Longiture Ref:", "GPSLongitudeRef" },
|
||||
{ NULL, "Longiture:", "GPSLongitude" },
|
||||
{ NULL, "Altitude Ref:", "GPSAltitudeRef" },
|
||||
{ NULL, "Timestamp:", "GPSTimeStamp" },
|
||||
{ NULL, "Satellites:", "GPSSatellites" },
|
||||
{ NULL, "ImgDirectionRef:", "GPSImgDirectionRef" },
|
||||
{ NULL, "Map Datum:", "GPSMapDatum" },
|
||||
{ NULL, "DateStamp:", "GPSDateStamp" },
|
||||
};
|
||||
|
||||
/*============================================================================*
|
||||
* Global *
|
||||
*============================================================================*/
|
||||
|
||||
void
|
||||
entice_exif_init(Evas_Object *win)
|
||||
{
|
||||
Entice *entice;
|
||||
Evas_Object *o;
|
||||
Evas_Object *scroller;
|
||||
Evas_Object *vbox;
|
||||
Evas_Object *frame;
|
||||
Evas_Object *table;
|
||||
size_t i;
|
||||
|
||||
Evas_Object *box;
|
||||
Evas_Object *hbox;
|
||||
Evas_Object *icon;
|
||||
|
||||
entice = evas_object_data_get(win, "entice");
|
||||
if (entice->exif_created)
|
||||
return;
|
||||
|
||||
{
|
||||
o = elm_box_add(win);
|
||||
evas_object_size_hint_weight_set(o, 0.0, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(o, 0.0, EVAS_HINT_FILL);
|
||||
evas_object_show(o);
|
||||
box = o;
|
||||
|
||||
o = elm_box_add(box);
|
||||
evas_object_size_hint_weight_set(o, 0.0, 0.0);
|
||||
evas_object_size_hint_align_set(o, 1.0, 0.0);
|
||||
elm_box_horizontal_set(o, EINA_TRUE);
|
||||
elm_box_pack_end(box, o);
|
||||
evas_object_show(o);
|
||||
hbox = o;
|
||||
|
||||
o = elm_icon_add(win);
|
||||
evas_object_size_hint_align_set(o, 1.0, 0.0);
|
||||
elm_icon_standard_set(o, "window-close");
|
||||
evas_object_show(o);
|
||||
icon = o;
|
||||
|
||||
o = elm_button_add(box);
|
||||
elm_object_content_set(o, icon);
|
||||
//evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(o, 1.0, 0.0);
|
||||
elm_box_pack_end(hbox, o);
|
||||
evas_object_show(o);
|
||||
}
|
||||
|
||||
o = elm_scroller_add(win);
|
||||
elm_scroller_content_min_limit(o, EINA_TRUE, EINA_FALSE);
|
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
// add :
|
||||
elm_box_pack_end(box, o);
|
||||
evas_object_show(o);
|
||||
scroller = o;
|
||||
|
||||
o = elm_box_add(scroller);
|
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.0);
|
||||
elm_object_content_set(scroller, o);
|
||||
evas_object_show(o);
|
||||
vbox = o;
|
||||
|
||||
/* EXIF informations */
|
||||
|
||||
o = elm_frame_add(vbox);
|
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_focus_allow_set(o, EINA_FALSE);
|
||||
elm_object_text_set(o, "EXIF");
|
||||
elm_box_pack_end(vbox, o);
|
||||
evas_object_show(o);
|
||||
frame = o;
|
||||
|
||||
o = elm_table_add(frame);
|
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_content_set(frame, o);
|
||||
evas_object_show(o);
|
||||
table = o;
|
||||
|
||||
for (i = 0; i < sizeof(entice_exif_entries) / sizeof(Entice_Exif_Entry); i++)
|
||||
{
|
||||
o = elm_label_add(table);
|
||||
elm_object_text_set(o, entice_exif_entries[i].name);
|
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(o, 1.0, 0.5);
|
||||
elm_table_pack(table, o, 0, i, 1, 1);
|
||||
evas_object_show(o);
|
||||
|
||||
o = elm_entry_add(table);
|
||||
elm_entry_single_line_set(o, EINA_TRUE);
|
||||
elm_entry_scrollable_set(o, EINA_TRUE);
|
||||
elm_object_part_text_set(o, "text", "Unknown");
|
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
|
||||
elm_table_pack(table, o, 1, i, 1, 1);
|
||||
evas_object_show(o);
|
||||
entice_exif_entries[i].button = o;
|
||||
}
|
||||
|
||||
/* GPS informations */
|
||||
|
||||
o = elm_frame_add(vbox);
|
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_focus_allow_set(o, EINA_FALSE);
|
||||
elm_object_text_set(o, "GPS");
|
||||
elm_box_pack_end(vbox, o);
|
||||
evas_object_show(o);
|
||||
frame = o;
|
||||
|
||||
o = elm_table_add(frame);
|
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_object_content_set(frame, o);
|
||||
evas_object_show(o);
|
||||
table = o;
|
||||
|
||||
for (i = 0; i < sizeof(entice_exif_gps_entries) / sizeof(Entice_Exif_Entry); i++)
|
||||
{
|
||||
o = elm_label_add(table);
|
||||
elm_object_text_set(o, entice_exif_gps_entries[i].name);
|
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(o, 1.0, 0.5);
|
||||
elm_table_pack(table, o, 0, i, 1, 1);
|
||||
evas_object_show(o);
|
||||
|
||||
o = elm_entry_add(table);
|
||||
elm_entry_single_line_set(o, EINA_TRUE);
|
||||
elm_entry_scrollable_set(o, EINA_TRUE);
|
||||
elm_object_part_text_set(o, "text", "Unknown");
|
||||
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
|
||||
elm_table_pack(table, o, 1, i, 1, 1);
|
||||
evas_object_show(o);
|
||||
entice_exif_gps_entries[i].button = o;
|
||||
}
|
||||
|
||||
// add
|
||||
elm_object_part_content_set(entice->layout, "entice.exif.panel", box);
|
||||
|
||||
entice->exif_created = EINA_TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
entice_exif_fill(Evas_Object *win)
|
||||
{
|
||||
char value[1024];
|
||||
Entice *entice;
|
||||
ExifData *ed;
|
||||
ExifContent *ec;
|
||||
ExifEntry *ee;
|
||||
unsigned int i;
|
||||
|
||||
entice = evas_object_data_get(win, "entice");
|
||||
|
||||
ed = exif_data_new_from_file(eina_list_data_get(entice->image_current));
|
||||
if (!ed)
|
||||
{
|
||||
printf("can not get exif data from %s\n",
|
||||
(char *)eina_list_data_get(entice->image_current));
|
||||
return;
|
||||
}
|
||||
|
||||
ec = ed->ifd[EXIF_IFD_EXIF];
|
||||
if (ec && ec->count)
|
||||
{
|
||||
printf("IFD '%s'\n", exif_ifd_get_name(EXIF_IFD_EXIF));
|
||||
for (i = 0; i < ec->count; i++)
|
||||
{
|
||||
const char *tag_name;
|
||||
size_t j;
|
||||
|
||||
ee = ec->entries[i];
|
||||
tag_name = exif_tag_get_name_in_ifd(ee->tag,
|
||||
exif_entry_get_ifd(ee));
|
||||
printf(" tag name : %s\n", tag_name);
|
||||
|
||||
for (j = 0; j < sizeof(entice_exif_entries) / sizeof(Entice_Exif_Entry); j++)
|
||||
{
|
||||
printf(" tag entice : %s\n",entice_exif_entries[j].tag);
|
||||
fflush(stdout);
|
||||
if (strcmp(entice_exif_entries[j].tag, tag_name) == 0)
|
||||
{
|
||||
elm_object_text_set(entice_exif_entries[j].button,
|
||||
exif_entry_get_value(ee, value, sizeof(value)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ec = ed->ifd[EXIF_IFD_GPS];
|
||||
if (ec && ec->count)
|
||||
{
|
||||
printf("IFD '%s'\n", exif_ifd_get_name(EXIF_IFD_GPS));
|
||||
for (i = 0; i < ec->count; i++)
|
||||
{
|
||||
const char *tag_name;
|
||||
size_t j;
|
||||
|
||||
ee = ec->entries[i];
|
||||
tag_name = exif_tag_get_name_in_ifd(ee->tag,
|
||||
exif_entry_get_ifd(ee));
|
||||
printf(" tag name : %s\n", tag_name);
|
||||
|
||||
for (j = 0; j < sizeof(entice_exif_gps_entries) / sizeof(Entice_Exif_Entry); j++)
|
||||
{
|
||||
printf(" tag entice : %s\n",entice_exif_gps_entries[j].tag);
|
||||
fflush(stdout);
|
||||
if (strcmp(entice_exif_gps_entries[j].tag, tag_name) == 0)
|
||||
{
|
||||
elm_object_text_set(entice_exif_gps_entries[j].button,
|
||||
exif_entry_get_value(ee, value, sizeof(value)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/* Entice - small and simple image viewer using the EFL
|
||||
* Copyright (C) 2021 Vincent Torri
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef ENTICE_EXIF_H
|
||||
#define ENTICE_EXIF_H
|
||||
|
||||
void entice_exif_init(Evas_Object *win);
|
||||
|
||||
void entice_exif_fill(Evas_Object *win);
|
||||
|
||||
#endif /* ENTICE_EXIF_H */
|
|
@ -31,6 +31,7 @@
|
|||
#include "entice_config.h"
|
||||
#include "entice_image.h"
|
||||
#include "entice_settings.h"
|
||||
#include "entice_exif.h"
|
||||
#include "entice_win.h"
|
||||
#include "entice_key.h"
|
||||
|
||||
|
@ -115,6 +116,16 @@ void entice_key_handle(Evas_Object *win, Evas_Event_Key_Down *ev)
|
|||
entice->settings_shown = EINA_TRUE;
|
||||
}
|
||||
}
|
||||
else if (!strcmp(ev->keyname, "e"))
|
||||
{
|
||||
entice_exif_fill(win);
|
||||
if (!entice->exif_shown)
|
||||
{
|
||||
elm_object_signal_emit(entice->layout, "state,exif,show", "entice");
|
||||
elm_object_signal_emit(entice->layout, "state,exifbg,show", "entice");
|
||||
entice->exif_shown = EINA_TRUE;
|
||||
}
|
||||
}
|
||||
else if (!strcmp(ev->key, "Escape"))
|
||||
{
|
||||
fprintf(stderr, "Esc !!!!\n");
|
||||
|
@ -124,6 +135,12 @@ void entice_key_handle(Evas_Object *win, Evas_Event_Key_Down *ev)
|
|||
elm_object_signal_emit(entice->layout, "state,settings,hide", "entice");
|
||||
entice->settings_shown = EINA_FALSE;
|
||||
}
|
||||
if (entice->exif_shown)
|
||||
{
|
||||
elm_object_signal_emit(entice->layout, "state,exif,hide", "entice");
|
||||
elm_object_signal_emit(entice->layout, "state,exifbg,hide", "entice");
|
||||
entice->exif_shown = EINA_FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "entice_theme.h"
|
||||
#include "entice_image.h"
|
||||
#include "entice_settings.h"
|
||||
#include "entice_exif.h"
|
||||
#include "entice_key.h"
|
||||
#include "entice_win.h"
|
||||
|
||||
|
@ -143,8 +144,6 @@ _cb_unfocused(void *data EINA_UNUSED, Evas_Object *win, void *event EINA_UNUSED)
|
|||
static void
|
||||
_cb_mouse_move(void *win, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
printf("mouse move\n");
|
||||
fflush(stdout);
|
||||
entice_controls_timer_start(win);
|
||||
}
|
||||
|
||||
|
@ -306,6 +305,7 @@ entice_win_add(void)
|
|||
elm_object_part_content_set(entice->layout, "entice.image",
|
||||
entice->scroller);
|
||||
entice_controls_init(win);
|
||||
entice_exif_init(win);
|
||||
|
||||
/* dummy button to catch mouse events */
|
||||
o = elm_button_add(win);
|
||||
|
|
|
@ -55,7 +55,7 @@ struct Entice
|
|||
Evas_Object *zoomorig; /* zoom 1:1 */
|
||||
Evas_Object *zoomfit; /* zoom best fit */
|
||||
Evas_Object *zoomcheck; /* checkbox for zoom best fit */
|
||||
Evas_Object *settings; /* settings icon */
|
||||
Evas_Object *menu; /* menu icon */
|
||||
Evas_Object *fullscreen;/* fullscreen icon */
|
||||
Evas_Object *close; /* close icon */
|
||||
Ecore_Timer *controls_timer;
|
||||
|
@ -63,6 +63,9 @@ struct Entice
|
|||
Eina_Bool settings_created;
|
||||
Eina_Bool settings_shown;
|
||||
Eina_Bool controls_shown;
|
||||
Eina_Bool controls_over;
|
||||
Eina_Bool exif_created;
|
||||
Eina_Bool exif_shown;
|
||||
|
||||
/* theme */
|
||||
Entice_Config *config;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
entice_bin_src = [
|
||||
'entice_config.c',
|
||||
'entice_controls.c',
|
||||
'entice_exif.c',
|
||||
'entice_image.c',
|
||||
'entice_key.c',
|
||||
'entice_main.c',
|
||||
|
|
Loading…
Reference in New Issue