Replaces threading a Locale::gettext object ($d) through every sub:
modules import __()/__n() and call them directly. Used by 47 subs in
bin/shutter today; they can move over one at a time.
- One gettext domain per process. Shutter::App::Common's gettext_object
(the legacy $d) now delegates to Shutter::I18N::init, so old and new
code always share the same object, domain and locale dir.
- First module on the new baseline: use v5.36 (strict, warnings,
signatures).
- t/Shutter/I18N.t (Test2::V0): untranslated fallback, plural forms,
shared object, and a real lookup from a catalog compiled with msgfmt
(LANGUAGE=de under en_US.UTF-8).
- t/syntax.t: teach Test::Strict that use v5.36+ enables warnings.
Checked against the real share/po catalogs: $d->get and __() both
return 'Einstellungen' for 'Preferences' with LANGUAGE=de.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move modules from share/shutter/resources/modules to lib/
Standard Perl layout, and bin/shutter now adds the module path at
compile time (BEGIN + use lib) instead of at runtime, so modules can
be loaded with plain `use` and perl -c can see them.
- bin/shutter finds lib/ (source checkout) or share/shutter/lib
(installed) and exports SHUTTER_LIB for plugins, which run as
separate processes.
- Bundled plugins prefer SHUTTER_LIB and fall back to the old path.
- Compat for third-party plugins that hard-code
$SHUTTER_ROOT/share/shutter/resources/modules: that path is now a
symlink to lib/ in the source tree and to ../lib when installed.
- Drop redundant runtime `import lib` in Screenshot::{Error,Main,Web};
the path is already on @INC.
- make lint: only files *added* since the fork point. Legacy modules
now show up as renames and stay out of the ratchet.
Pure renames for all module files (git log --follow works).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extract context menu builders into Shutter::App::ContextMenus
Move fct_ret_{workspace,window,tray,program,web,profile}_menu out of
bin/shutter. One-line wrappers with the original names pass the former
file-scoped globals explicitly; globals the menus assign to
($current_monitor_active, $is_hidden, $current_profile_indx) are passed
as scalar refs. Callbacks still dispatch to Shutter::App::evt_*/fct_*.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extract plugin discovery into Shutter::App::PluginRegistry
Move fct_check_installed_plugins, fct_plugin_get_info,
fct_check_installed_upload_plugins and fct_upload_plugin_get_info into a
new module. bin/shutter keeps one-line wrappers that pass $sc, $d, $lp,
$shf, $window, $shutter_root, $pathclass, \%plugins / \%accounts and
\&fct_update_gui explicitly. Adds t/Shutter/App/13_plugins.t.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extract filename helpers into Shutter::App::Filename
Move fct_validate_filename, fct_parse_filename_wildcards and
fct_get_next_filename into a functional module (EXPORT_OK). The original
names remain as one-line wrappers in bin/shutter that pass the globals
explicitly ($d; $sc, $combobox_settings_profiles; $sc, $d, $sd, $shf).
Adds t/Shutter/App/12_filename.t covering $w/$h/$profile/$name/$nb_name,
%N numbering, $R hashes and the reserved-character key handler.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extract session lookups into Shutter::App::Session
Move fct_is_uri_in_session, fct_screenshot_exists, fct_get_key_by_*,
fct_get_file_by_index, fct_get_total_size_of_session, fct_get_current_file
and fct_get_latest_tab_key into an OO Shutter::App::Session class. A
file-scoped $session holds a reference to %session_screens (so subs still
using the hash directly see the same data) plus getter coderefs for
$notebook and $d; the original fct_* names remain as one-line wrappers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extract environment helpers into Shutter::App::Environment
Move fct_control_wm_settings, fct_init_unsaved_files and
fct_init_debug_output into the new module as control_wm_settings,
init_unsaved_files and init_debug_output. bin/shutter keeps one-line
wrappers that pass $sc, a callback to fct_get_key_by_filename, and
SHUTTER_VERSION/SHUTTER_REV explicitly. Adds t/Shutter/App/18_environment.t.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extract upload error and profile name dialogs into Shutter::App::Dialogs
Move dlg_upload_error_message_gnome_vfs, dlg_upload_error_message and
dlg_profile_name into plain functions in Shutter::App::Dialogs. bin/shutter
keeps one-line wrappers with the original names that pass $d, $shf, $sd,
$window and the unescape_string/fct_validate_filename helpers (as coderefs)
explicitly. Shutter::App::Dialogs is used instead of UploadDialogs because
dlg_profile_name is not upload-related.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extract view menu actions into Shutter::App::View
Move fct_zoom_in/out/100/best, fct_fullscreen and fct_navigation_toolbar
into a functional module. bin/shutter keeps one-line wrappers with the
original names that pass \%session_screens + \&fct_get_current_file,
$window or $nav_toolbar explicitly. Adds t/Shutter/App/14_view.t.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extract VFS escape helpers into Shutter::App::Escape
Moved escape_string, unescape_string, unescape_string_for_display and
escape_path_string verbatim into an Exporter module. They use no globals,
so no wrappers: bin/shutter requires the module after Shutter::Upload::FTP
(the lib path is unknown at their old spot) and imports all four names.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extract mime type helpers into Shutter::App::Mime
Move fct_get_mime_type and fct_check_valid_mime_type verbatim into a new
functional module. Neither reads file-scoped globals, so no wrappers are
needed: bin/shutter requires the module in place of the old bodies and
imports both names into Shutter::App at runtime, so call sites are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
with-x11: let the X server pick the display via -displayfd
Scanning /tmp/.X11-unix for a free number races when several sessions
start at once (parallel agents each running make test): two can pick
the same display. Xvfb/Xephyr -displayfd allocates atomically.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add quality gates: make lint/test/boot/check and headless smoke test
- t/bin/with-x11: runs a command in a private X11 session (own Xvfb,
or Xephyr with VISIBLE=1, plus its own D-Bus session) with the host
Wayland environment stripped. Without this, Gtk opens windows on the
host desktop and Shutter routes captures via xdg-desktop-portal.
- make test: full suite in that session. SHUTTER_SMOKE_REQUIRED makes a
missing window manager fail loudly instead of skipping.
- t/smoke/01_full_capture.t: launches the real bin/shutter in an
isolated HOME under openbox, takes a full-screen capture with -f -e -o
and checks a PNG of the screen's size is written. Exercises STARTUP,
settings, session setup, capture and save end to end.
- make boot: 15s startup, fails on Perl runtime errors (undefined subs,
missing modules) that perl -c cannot see.
- make lint: perltidy (.perltidyrc) + perlcritic severity 4, applied
only to files added since the fork point. Legacy code (231 critic
violations, 26/35 files untidy) is not blocked; new code is.
Co-Authored…
Import Shutter source from upstream shutter-project/shutter@cb78390f (part 2)