summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-07-12 17:51:22 +0300
committerPaul Buetow <paul@buetow.org>2026-07-12 17:51:22 +0300
commit6b0f2de39c2d8b9e8d346abd8548024da4ae8185 (patch)
tree29e67e6a75488b4fdd34756be3944c4262e0b85a /meson.build
parent51b47a0130005bd19039422d027da23ff46dd6b8 (diff)
showimage: loader, detect, viewer widget, EXIF orientation, tests (gt0)
M1 (task gt0): show one image with zoom/pan. - src/loader/detect.{c,h}: magic-byte format sniffing (JPEG/PNG/GIF/WebP/ TIFF/ICO/JXL/AVIF/HEIF) -> GgazeFormat; pure, no I/O, unit-testable. - src/loader/loader.{c,h}: loader_load() sniffs the header and dispatches to the first registered backend; GgazeLoaderBackend struct; pixbuf is the fallback (last, accepts UNKNOWN). M1 ships only the pixbuf backend. - src/loader/backends/pixbuf.c: GdkPixbufLoader decode + gdk_pixbuf_apply_embedded_orientation (decision #26) -> GdkTexture via gdk_memory_texture_new (avoids the deprecated gdk_texture_new_for_pixbuf). - src/viewer.{c,h}: GgazeViewer : GtkWidget custom widget (decision #31) — fit/100%/in/out zoom, cursor-centered zoom, drag-to-pan with clamping, dark background, GtkSnapshot render nodes. - src/window.c: open -> loader_load -> viewer_set_texture -> stack 'large'. - tests: unit test_detect (13 cases) + test_loader_pixbuf (plain/rotated-EXIF 8x4 orient6->4x8/png/rgba/missing/unsupported jxl-avif-heif/corrupt), integration test_open_and_show (fixture + rotated + ./sample-images skip-if-absent). 6/6 green; detect 97% / loader 91% / pixbuf 87% coverage. - fixtures: gen.py produces plain.jpg, rot6.jpg, small.png, rgba.png. - AGENTS.md: documents the ./sample-images optional test corpus convention. Sub-agent review fixes: use-after-free of c_name in ggaze_window_open (BLOCKER), gtk_stack_get_pages leak in test_window (BLOCKER), coverage gap, dead branch, viewer measure, _prefix/_cb naming, include order, extern in header, pan clamp, stale comments — all addressed.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build22
1 files changed, 15 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index e21b70c..b496e25 100644
--- a/meson.build
+++ b/meson.build
@@ -17,10 +17,11 @@ project('ggaze', 'c',
)
# --- Always-required dependencies (the core viewer needs all of these) ---
-gtk4_dep = dependency('gtk4')
-glib_dep = dependency('glib-2.0')
-gio_dep = dependency('gio-2.0')
-adwaita_dep = dependency('libadwaita-1')
+gtk4_dep = dependency('gtk4')
+glib_dep = dependency('glib-2.0')
+gio_dep = dependency('gio-2.0')
+adwaita_dep = dependency('libadwaita-1')
+gdkpixbuf_dep = dependency('gdk-pixbuf-2.0') # pixbuf loader backend
# --- Optional backends (feature: auto/disabled/enabled). See meson_options.txt.
gegl_dep = dependency('gegl-0.4', required : get_option('gegl'))
@@ -52,13 +53,20 @@ src_inc = include_directories('src')
# duplicating sources). Plain-C modules will join this library as they
# land (navigator, trash, mover, ...).
ggaze_lib = static_library('ggaze',
- files('src/app.c', 'src/window.c'),
+ files(
+ 'src/app.c',
+ 'src/window.c',
+ 'src/viewer.c',
+ 'src/loader/loader.c',
+ 'src/loader/detect.c',
+ 'src/loader/backends/pixbuf.c',
+ ),
include_directories : [inc, src_inc],
- dependencies : [gtk4_dep, glib_dep, gio_dep, adwaita_dep],
+ dependencies : [gtk4_dep, glib_dep, gio_dep, adwaita_dep, gdkpixbuf_dep],
install : false,
)
-ggaze_deps = [gtk4_dep, glib_dep, gio_dep, adwaita_dep]
+ggaze_deps = [gtk4_dep, glib_dep, gio_dep, adwaita_dep, gdkpixbuf_dep]
subdir('src')
subdir('data')