From 25ee19ce91dcb204d93e6d8cceb7cd64d5f057f9 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 13 Jul 2026 21:05:24 +0300 Subject: fullscreen: info/EXIF, fullscreen, slideshow, Esc back (ot0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit M4 (task ot0): fullscreen + slideshow + info overlay. - src/info.{c,h}: plain-C EXIF gather via libexif (camera, lens, focal, aperture, shutter, ISO, datetime, orientation) + file info (dims, format, size). info_format() produces the overlay text. Unit-tested. - src/window.c: fullscreen toggle (f), slideshow (S, 3s auto-advance), info overlay (i, GtkLabel in GtkOverlay, auto-hide 5s), Esc contextual back (fullscreen→unfullscreen→large→grid→quit). Stack wrapped in GtkOverlay. ggaze_window_get_stack() accessor for tests. - src/shortcuts.c: f, S, i, Escape bindings. - meson.build: libexif dep added. - tests: unit test_info (EXIF extraction + orientation tag). 14/14 green, ASan clean. --- src/info.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/info.h (limited to 'src/info.h') diff --git a/src/info.h b/src/info.h new file mode 100644 index 0000000..7680b72 --- /dev/null +++ b/src/info.h @@ -0,0 +1,45 @@ +#ifndef GGAZE_INFO_H +#define GGAZE_INFO_H + +/*:* + * ggaze — image info / EXIF gather + * + * Gathers file info (dimensions, format, size) + EXIF (camera, lens, focal, + * aperture, shutter, ISO, datetime, orientation) into a GgazeInfo struct. + * Plain-C, no GtkWidget; uses GdkPixbuf (dims) + libexif (EXIF). Unit-testable. + * + * Copyright (c) 2026 ggaze contributors + * SPDX-License-Identifier: GPL-3.0-or-later + *:*/ + +#include +#include + +G_BEGIN_DECLS + +typedef struct { + int i_width; + int i_height; + char *c_format; /* content type (owned) */ + gint64 i_size; /* file size in bytes */ + char *c_camera; /* Make + Model (owned) */ + char *c_lens; /* Lens model (owned, or NULL) */ + char *c_focal; /* FocalLength (owned) */ + char *c_aperture; /* FNumber (owned) */ + char *c_shutter; /* ExposureTime (owned) */ + char *c_iso; /* ISOSpeedRatings (owned) */ + char *c_datetime; /* DateTimeOriginal (owned) */ + int i_orientation; /* EXIF Orientation (1-8, 0 if none) */ +} GgazeInfo; + +/* Gather info for p_file (synchronous). Returns a new GgazeInfo (caller owns, + * free with info_delete) or NULL on failure. */ +GgazeInfo *info_new(GFile *p_file); +void info_delete(GgazeInfo *p_info); + +/* Format the info as a multi-line string (caller frees). */ +char *info_format(const GgazeInfo *p_info); + +G_END_DECLS + +#endif /* GGAZE_INFO_H */ \ No newline at end of file -- cgit v1.2.3