Now that lib/ is on @INC at compile time, the 30 unconditional
`require Shutter::...` calls become `use X ()` (empty import list, same
semantics). The in-place require+import pairs left by the extraction
commits move up into the module block as `use X qw(...)`, importing the
same names.
perl -c bin/shutter now compiles every module, so a broken module or a
bad import fails the compile gate instead of surfacing at runtime.
Shutter::Draw::DrawingTool stays a runtime require: it is only loaded
when GooCanvas is available.
Startup warnings are identical before and after (diffed under
t/bin/with-x11).
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>
Restore symlinks and executable bits lost in snapshot upload
hf upload dereferences symlinks, skips symlinked directories
(drawing_tool_dark/cursor, drawing_tool_dark/objects) and drops the
executable bit on bin/shutter and po2mo.sh.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Import Shutter source from upstream shutter-project/shutter@cb78390f