diff options
| author | Paul Buetow <paul@buetow.org> | 2026-07-13 21:05:24 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-07-13 21:05:24 +0300 |
| commit | 25ee19ce91dcb204d93e6d8cceb7cd64d5f057f9 (patch) | |
| tree | 2e01bf17f2a6e1e9e9051b115cdd764060f740fb /src/info.h | |
| parent | 0795d3cf926d0d937f25fcc699f5f674bf618c72 (diff) | |
fullscreen: info/EXIF, fullscreen, slideshow, Esc back (ot0)
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.
Diffstat (limited to 'src/info.h')
| -rw-r--r-- | src/info.h | 45 |
1 files changed, 45 insertions, 0 deletions
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 <gio/gio.h> +#include <glib.h> + +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 |
