pax_global_header00006660000000000000000000000064147610222360014515gustar00rootroot0000000000000052 comment=07d1fb1133b1621a231a3dfbafe09e17a7b365b5 shutter-0.99.6/000077500000000000000000000000001476102223600133205ustar00rootroot00000000000000shutter-0.99.6/.github/000077500000000000000000000000001476102223600146605ustar00rootroot00000000000000shutter-0.99.6/.github/FUNDING.yml000066400000000000000000000001411476102223600164710ustar00rootroot00000000000000github: [DarthGandalf] custom: ["https://www.paypal.com/donate/?hosted_button_id=U83NMZ68BFFN4"] shutter-0.99.6/.github/ISSUE_TEMPLATE/000077500000000000000000000000001476102223600170435ustar00rootroot00000000000000shutter-0.99.6/.github/ISSUE_TEMPLATE/bug_report.md000066400000000000000000000005331476102223600215360ustar00rootroot00000000000000--- name: Bug report about: Create a report describing a bug in Shutter title: '' labels: bug assignees: '' --- #### Brief summary of issue #### Steps to reproduce the issue 1. 2. 3. #### Error output #### Extra information, such as Shutter version, display server in use (Xorg or Wayland), operating system and ideas for how to solve: shutter-0.99.6/.github/ISSUE_TEMPLATE/code_of_conduct.md000066400000000000000000000126011476102223600225020ustar00rootroot00000000000000 # Contributor Covenant Code of Conduct ## Our Pledge We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. ## Our Standards Examples of behavior that contributes to a positive environment for our community include: * Demonstrating empathy and kindness toward other people * Being respectful of differing opinions, viewpoints, and experiences * Giving and gracefully accepting constructive feedback * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience * Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: * The use of sexualized language or imagery, and sexual attention or advances of any kind * Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or email address, without their explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. ## Scope This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement as en email to Vadim Peretokin (vperetokin@hey.com). All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. ## Enforcement Guidelines Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. ### 2. Warning **Community Impact**: A violation through a single incident or series of actions. **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary Ban **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within the community. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. [homepage]: https://www.contributor-covenant.org [v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html [Mozilla CoC]: https://github.com/mozilla/diversity [FAQ]: https://www.contributor-covenant.org/faq [translations]: https://www.contributor-covenant.org/translations shutter-0.99.6/.github/ISSUE_TEMPLATE/feature_request.md000066400000000000000000000004351476102223600225720ustar00rootroot00000000000000--- name: Feature request about: Suggest an idea for Shutter title: '' labels: enhancement assignees: '' --- #### Description of requested feature: #### Reasons for adding feature: #### Extra information, such as Shutter version, operating system and ideas for how to implement: shutter-0.99.6/.github/ISSUE_TEMPLATE/question.md000066400000000000000000000002101476102223600212250ustar00rootroot00000000000000--- name: Question about: Ask a question about installing, configuring or using Shutter title: '' labels: question assignees: '' --- shutter-0.99.6/.github/workflows/000077500000000000000000000000001476102223600167155ustar00rootroot00000000000000shutter-0.99.6/.github/workflows/run-tests.yml000066400000000000000000000030561476102223600214100ustar00rootroot00000000000000name: CI on: push: branches: [ master ] pull_request: branches: [ master ] workflow_dispatch: jobs: run-tests: runs-on: ubuntu-latest # Steps represent a sequence of tasks that will be executed as part of the job steps: - uses: actions/checkout@v4 - name: Install deps run: | sudo apt update sudo apt install cpanminus gir1.2-ayatanaappindicator3-0.1 gir1.2-wnck-3.0 imagemagick \ libcarp-always-perl libfile-basedir-perl libfile-copy-recursive-perl libfile-which-perl \ libglib-object-introspection-perl libglib-perl libgoocanvas2-perl libgoocanvas-2.0-dev \ libgtk3-perl libimage-exiftool-perl libimage-magick-perl \ libjson-maybexs-perl libjson-perl liblocale-gettext-perl liblwp-protocol-https-perl \ libnet-dbus-perl libnet-dbus-glib-perl libnet-oauth-perl libnumber-bytes-human-perl \ libpango-perl libpath-class-perl libproc-processtable-perl libproc-simple-perl \ libreadonly-perl librsvg2-common libsort-naturally-perl libwww-mechanize-perl libwww-perl \ libx11-protocol-other-perl libx11-protocol-perl libxml-simple-perl procps xdg-utils sudo cpanm --installdeps --notest . sudo cpanm --sudo --notest Gtk3::ImageView sudo cpanm --sudo --notest GooCanvas2::CairoTypes - name: Run tests env: TEST_APP_SHUTTER_PATH: ${{ env.GITHUB_WORKSPACE }} run: xvfb-run --auto-servernum prove -I share/shutter/resources/modules/ -I t/lib t -r shutter-0.99.6/.gitignore000066400000000000000000000000101476102223600152770ustar00rootroot00000000000000.vscode shutter-0.99.6/.perltidyrc000066400000000000000000000003511476102223600155010ustar00rootroot00000000000000-it=2 # use tabs -et=4 -ci=4 # else on the same line -ce # no extra spaces inside () -bt=2 -pt=2 -sbt=2 # don't break comments -nolc # start/end blocks on single line -sot -sct # allow more reasonably long lines than 80 -l=200 shutter-0.99.6/CHANGES000066400000000000000000001333641476102223600143250ustar00rootroot00000000000000shutter (0.99.6) Bug fixes: * Fixed sporadic crash on startup due to wrong usage of libwnck. The ability to take screenshot of a window is currently broken, but that's better than not starting at all. * Fixed Pixelate tool in Draw to decrease leaking of data from under pixelation * Fixed quality setting of PNG images New features: * Added AVIF format support New optional dependency for AVIF support: Gdk Pixbuf loader from libavif (https://github.com/AOMediaCodec/libavif), e.g. libavif-gdk-pixbuf (https://packages.debian.org/sid/libavif-gdk-pixbuf) in Debian, or as part of `libavif` package in some other distros. shutter (0.99.5) Bug fixes: * Fixed loading and saving profiles * Fixed the editor being unavailable under some circumstances * Fixed crash when selection has zero width or height * Check to prevent user setting a filename pattern without wildcards, which lead to crashes * Fixed crash on Wayland under some circumstances * Fixed crash when the autostart .desktop file is not writable * Fixed handling images pasted from clipboard: they are now handled the same as screenshots made by Shutter itself, rather than being put into /tmp * Fixed error when using the -s option with a zero coordinate for the selection origin New features: * Added WebP support * In Selection mode added an option to take screenshot on releasing the mouse button without confirmation New optional dependency for WebP support: webp-pixbuf-loader (https://github.com/aruiz/webp-pixbuf-loader) shutter (0.99.4) Two further bugs have been fixed after the recent 0.99.3 release: * Fix not appearing tray icon on system startup under rare circumstances * Fix crash on launch for new installs shutter (0.99.3) After a long time there is another bugfix release: * Improved code quality a bit, added a few unit tests (thanks to Alexander Ruzhnikov!) * Fixed font size in the editor * Fixed loading of profiles * Fixed crash when taking too small screenshots * Fixed appearance of the web capture button * Fixed XML schema of AppData * Allow more valid character in filenames * Removed dysfunctional upload plugins * Added a visible warning about limited functionality on Wayland New dependency: Moo (https://metacpan.org/pod/Moo) Dropped dependencies: libwww-mechanize-perl, libwww-perl, libnet-oauth-perl shutter (0.99.2) Fix for previous version. Removal of debug code which was accidentally left, resulting in wayland-specific code to be executed for X11 system. shutter (0.99.1) A small fix-mostly release. The fix is the compatibility with GLib 2.70. GLib strictened the way how GApplication is initialized, and Shutter apparently was doing it incorrectly before, resulting in inability to run Shutter again to bring up the main window, or to take screenshots from command line. The fix works with older GLib as well. The new feature is a rudimentary Wayland support. Don't get too excited about it yet. All it does is it asks the compositor to let user take the screenshot, and user will be presented with some implementation-defined UI to select the window or area, which we cannot control at all. Maybe the limitations will be lifted in future, but no promises. Also there are multiple cases where it doesn't work, e.g.: * The compositor doesn't even support XDG Desktop Portal API (https://flatpak.github.io/xdg-desktop-portal/portal-docs.html#gdbus-org.freedesktop.portal.Screenshot) * The backend for the XDG Desktop Portal API doesn't match the compositor running, e.g. Gnome's portal backend cannot take screenshot on KDE, and instead it silently does nothing We can't even meaningfully handle these cases, other than adding a huge timeout to the call, because perhaps the user is just taking time interacting the UI shown by the portal backend. Finally, dependency on Gtk3::ImageView is bumped to v10: the improved selection tool added in Shutter 0.98 got moved upstream. shutter (0.99) * Fixed several more regressions of the Gtk3 switch: * Fixed File->Open dialog * Fixed Autoscroll option of the Draw tool * Added support for `gir1.2-ayatanaappindicator3`, because some distros don't have `gir1.2-appindicator3` anymore. If neither of AppIndicator3 nor AyatanaAppIndicator3 is available, on some DEs you will miss the tray icon, so it's recommended to have at least one of these 2 libraries installed. * Fixed schema of the appdata XML, use https in URLs in it * Added search keywords to the shutter.desktop file * Icons cleanup * Dropped a copy of the whole Tango icon set, which was usable from the Draw Tool. Any icon can still be imported from the the local disk, including even Tango ones if they are installed * Fixed shutter icon size * Removed duplication of the same icons * Removed logo images for dropped image hosters shutter (0.98) Fixes: * show main window when launching Shutter and an instance is already running * in selection mode allow to move the selection * in selection mode allow to trigger the screenshot with doubleclick * fix the Print button * when uploading a screenshot via FTP, copying the URL to clipboard is now functional * fix the "Torn paper" and "Watermark" plugins shutter (0.97) Crash fixes: * when doing screenshot if "include cursor" is set * when using text annotation tools in the editor * when launching on Wayland. Note that the screenshot functionality is still not available on Wayland yet * when using a DE without a dedicated Pictures/ directory Additionally: * the tray icon wasn't shown on Gnome, making it impossible to interact with the app after the main window is closed/hidden * if both libappindicator is not available and the legacy tray icon doesn't work (it's not supported by gnome), closing the window will now terminate the application rather than hiding it to the non-existing tray * copy to clipboard didn't work * capturing full screen on multiple screens didn't work shutter (0.96) Drops dependency on Gtk2, and starts depending on Gtk3 instead. More specifically, these perl dependencies are gone: * Gtk2 * Gtk2::ImageView * Gtk2::Unique * Gtk2::AppIndicator * Gnome2::Wnck * Goo::Canvas These dependencies are new: * [Carp:::Always](https://metacpan.org/pod/Carp::Always) * [Gtk3](https://metacpan.org/pod/Gtk3) * [Gtk3::ImageView](https://metacpan.org/pod/Gtk3::ImageView) >= 9 * [GooCanvas2](https://metacpan.org/pod/GooCanvas2) (unlike old Goo::Canvas, this one is not optional anymore) * [GooCanvas2::CairoTypes](https://metacpan.org/pod/GooCanvas2::CairoTypes) * [Pango](https://metacpan.org/pod/Pango) * [libwnck-3](https://gitlab.gnome.org/GNOME/libwnck), used via Glib Object Introspection The feature of taking a section of window is removed (or, rather, commented out), because it didn't work with the way how modern Qt and Gtk were drawing their windows anyway. Possible issues: * Multiple screens might or might not be broken * HiDPI screens might do screenshot of a nested menu in a wrong place shutter (0.95) * almost fully dropped the dependency on the outdated Perl Gnome2 library * updated translations * removed dependencies: -- Arch: gnome-perl, gnome-vfs-perl -- Debian: libgnome2-perl, libgnome2-vfs-perl * new dependencies: -- Arch: perl-number-bytes-human, perl-glib-object-introspection -- Debian: libnumber-bytes-human-perl, libglib-object-introspection-perl shutter (0.94.3) This is another bugfix release which ensures functionality with Perl 5.30. Bugs fixed: -- LP: #1831155 New File::Glob does not export glob, shutter does not start -- LP: #1782646 shutter asks to "Authorize with Imgur" for each upload to account Imgur OAuth shutter (0.94.2) A quick fix for the Gyazo upload plugin. shutter (0.94.1) This is another bugfix release implementing further patches. Some upload plugins have been removed because the upload services have shut down (ITmages, Minus, TwitPic). Following changes in dependencies are there: perl-json-xs has been superseded by perl-json-maybexs; perl-webservice-gyazo-b is a new optional dependency for upload to Gyazo. Following update plugins are known to be still broken: Dropbox, vgy.me. Following bugs are fixed: -- LP: #1354563 Right click > "show in folder" results in "There was an error executing xdg-open -- LP: #1565017 [Patch] Convert all JSON modules to JSON::MaybeXS instead of discouraged JSON modules -- LP: #1593781 [PATCH] [enhancement] Add support for Gyazo Uploads -- LP: #1652600 Insecure use of perl exec() -- LP: #1734202 Error when switching profiles -- LP: #1739971 [PATCH] Use reverse-DNS style AppStream ID -- Michael Kogan Sun, 09 Sep 2018 18:45:00 +0100 shutter (0.94) This is a bugfix release implementing some of the patches available for quite some time. Following bugs are fixed: -- LP: #731874 Launching a second instance of Shutter if one instance is already open causes a crash -- LP: #1369330 [patch] i18n for desktop file -- LP: #1396368 Shutter screenshots uploaded to Dropbox expires -- LP: #1406324 Imgur uploaded links dialog shows links in random order on every upload -- LP: #1469840 Send by e-mail generates error (ctrl-shft-E) -- LP: #1495163 Insecure use of system() allows arbitrary code execution via "Show in Folder" -- LP: #1556021 'Window' does not show non-latin characters -- LP: #1565048 imgur upload plugin no longer works due to now unsupported API 1 and 2 -- LP: #1624795 Linux software store metadata -- Michael Kogan Wed, 16 Aug 2017 20:53:00 +0100 shutter (0.93.1) * updated Dropbox.pm and XFIXES.pm * fixed deprecated code * updated translations -- Mario Kemper Wed, 24 Dec 2014 00:01:10 +0100 shutter (0.93) * Fixed bugs / minor improvements -- LP: #1163251 [Dropbox plugin doesn't work since it uses an old version of the API] -- LP: #1250536 [Error Dropbox authentication and upload] -- LP: #1298878 [vgy.me support] -- LP: #1349512 [Dropbox upload plugin uses Public folder and does not create proper share link] * updated translations -- Mario Kemper Sun, 17 Aug 2014 19:11:28 +0200 shutter (0.92) * Fixed bugs / minor improvements -- LP: #731874 [Launching a second instance causes a crash - ArchLinux] -- LP: #1034768 [Segmentation fault (core dumped) when trying to edit an image] -- LP: #1285287 [Crashes after clicking "edit" while using certain icon themes] -- LP: #1334869 [Shutter: ImageBanana no loger active....] -- LP: #1351015 [Remove Ubuntu One] * updated translations -- Mario Kemper Sat, 09 Aug 2014 15:42:04 +0200 shutter (0.91) * Fixed bugs / minor improvements -- LP: #1243649 [Add new icon] -- LP: #1308485 [immio has been closed] -- LP: #1314893 [Session tab no longer shows thumbnails after fresh install Kubuntu 14.04] * updated translations -- Mario Kemper Mon, 09 Jun 2014 19:08:59 +0200 shutter (0.90.1) * Fixed bugs / minor improvements -- LP: #1092522 [Shutter doesn't recognize the command-line option "-d"] -- LP: #1191521 [--delay=0 doesn't work from command-line] -- LP: #1216619 [Drawing Tool: encoding problems when using chinese fonts] * updated translations -- Mario Kemper Sun, 25 Aug 2013 21:45:08 +0200 shutter (0.90) * Fixed bugs / minor improvements -- LP: #1035259 [No way to activate the main window when using the appindicator] -- LP: #1081917 [Quicklist no more working] -- LP: #1083033 [Needs a high contrast app icon] -- LP: #1083586 [Remove keybinding code] -- LP: #1083588 [Remove Simple Selection Tool] -- LP: #1087367 [File extension .png] -- LP: #1092054 [desktop-file-validate complains again] * updated translations -- Mario Kemper Wed, 19 Dec 2012 12:21:39 +0100 shutter (0.89.1) * Fixed bugs / minor improvements -- LP: #1007712 [imageshack plug in fails] -- LP: #1020600 [bug on save output image in cyrillic keybord layout] -- LP: #1021158 [Imgur plugin doesn't work] -- LP: #1033931 [libgtk2-appindicator-perl not available for lucid (Ubuntu 10.04)] -- LP: #1035332 [desktop-file-validate complains] * updated translations -- Mario Kemper Mon, 13 Aug 2012 22:52:36 +0200 shutter (0.89) * Fixed bugs / minor improvements -- LP: #664292 [Feature Request: Please make use of appindicators] -- LP: #1012235 [Advanced Selection Capture entries do not work] -- LP: #1018791 [Change fsf-address] * updated translations -- Mario Kemper Wed, 01 Aug 2012 22:46:10 +0200 shutter (0.88.3) * Fixed bugs / minor improvements -- LP: #965589 [Dropbox upload should urlencode the resuting link] -- LP: #966159 [Wrong image format in save dialogue] -- LP: #975247 [Editor: icon tool fails to add image] -- LP: #976316 [Add include/exclude cursor option for command-line] -- LP: #976322 [Add --delay command line option] * updated translations -- Mario Kemper Mon, 23 Apr 2012 01:10:03 +0200 shutter (0.88.2) * Fixed bugs / minor improvements -- LP: #625291 [Edit menu items should be shown in right-click popup for object] -- LP: #812182 [save image to jpg extension] -- LP: #903305 [Add no_session parameter] -- LP: #909195 ['Updating plugins' dialogue appears on every startup] -- LP: #917158 [FTP upload plugin recently stopped working] * updated translations -- Mario Kemper Thu, 23 Feb 2012 11:56:50 +0100 shutter (0.88.1) * Fixed bugs / minor improvements -- LP: #894416 [Some upload plugins fail with unicode characters in filename] -- LP: #894577 [Minus service doesn't work] * updated translations -- Mario Kemper Thu, 01 Dec 2011 22:01:50 +0100 shutter (0.88) * New Features -- Refactored the uploading code (added support for plugins) -- Added new upload plugins -- Public links are now saved when a screenshot was uploaded -- New command line option: specify filename * New Upload Plugins -- Dropbox -- ImageBanana -- ImageShack -- Imgur -- ImmIO -- ITmages -- Minus -- Omploader -- ToileLibre -- TwitPic -- UbuntuPics * Fixed bugs / minor improvements -- LP: #342622 [Remember upload links] -- LP: #841328 [black corners if window is selected from the window list] -- LP: #888441 [dialog not clickable when renaming a file] -- LP: #889031 [Package should'nt provide own perl libraries] -- LP: #892703 [After unlinking from Dropbox there is no way to relink it again] -- LP: #650701 [retrieve Public URL if screenshot is already uploaded] -- LP: #675911 [Url not selected when i do single click] -- LP: #793462 [Short URL in imageshack.us] -- LP: #870556 [specify file name on command line] -- LP: #374024 [http://omploader.org/ as new image hoster] -- LP: #486490 [Feature Request: Upload to imgur] -- LP: #489598 [Wish: Add Twitpic support] -- LP: #598818 [feature request: extensible imagehost/upload tools] -- LP: #602209 [Add integration with Dropbox] -- LP: #619748 [Add ubuntuusers.de thumbnail code to any of the hosting plugins] -- LP: #651029 [Feature Request: Upload to ITmages] -- LP: #703299 [Add upload to http://pix.toile-libre.org/] -- LP: #785032 [min.us uploading support] -- LP: #793463 [More image services to upload] * improved support for Gnome-Shell * several smaller bugfixes * updated translations -- Mario Kemper Mon, 21 Nov 2011 15:54:45 +0100 shutter (0.87.3) * New Features -- Show "real" cursor (instead of standard cursor) -- Locate on disk * Fixed bugs / minor improvements -- LP: #695629 [locate on disk feature] -- LP: #781235 [shutter.1.gz isn't gzipped] -- LP: #769902 [shutter --man displays source code] -- LP: #752846 [Application doesn't work on windows with certain titles] -- LP: #749442 [UI improvements to the timeout menu] -- LP: #779252 [Support gnome-web-photo >= 0.10] -- LP: #744397 [It doesn't save the selected profile between sessions] -- LP: #388475 [Showing standard cursor (left-ptr) instead of current cursor] * updated translations -- Mario Kemper Sun, 03 Jul 2011 15:35:08 +0200 shutter (0.87.2) * Fixed bugs / minor improvements -- LP: #737428 ['Open with' does not work when filename contains german umlauts] -- LP: #738710 [Needs quicklists for Natty] * updated translations -- Mario Kemper Fri, 25 Mar 2011 11:59:51 +0100 shutter (0.87.1) * Fixed bugs / minor improvements -- LP: #657585 [Shutter ignores typed-in save location] -- LP: #695295 [Section: Encoding problems in non-english version of Shutter] -- LP: #697483 [Initial image in DrawingTool shouldn't be locked by default] -- LP: #705094 [Enter and Escape keys don't work any more] -- LP: #705315 [Shutter failed to take screenshot on seamless mode of virtualbox] -- LP: #708753 [Tab closing crashes in some circumstances] -- LP: #723075 [Error while opening image 'sel_window_list.svg'] -- LP: #730883 [Profiles doesn't save some information] -- LP: #731495 [Uploading to ImageShack broken] * updated translations -- Mario Kemper Thu, 10 Mar 2011 01:20:30 +0100 shutter (0.87) * New Features -- Capture active window -- Uniqueness via libunique (single instance) -- Support for rounded window corners when using Compiz -- Automatically resize windows before capture -- New option: don't save screenshot to disk -- Advanced startup-options -- EXIF orientation flag is now supported -- Compatible with global menu (unity) -- Export to PostScript -- Faster application startup (load session in background task) * Fixed Bugs / Improvements -- LP: #336132 [Load last session in a background task] -- LP: #348161 [Option not to save screenshots to disk by default] -- LP: #371555 [Add advanced startup-options to the settings dialog] -- LP: #388478 [multiple instances running] -- LP: #419137 [keyboard shortcuts and hidden main window] -- LP: #429677 [Add option to capture last active window] -- LP: #481096 [hotkeys and Compiz' flat-file backend] -- LP: #486659 [Pressing Enter in the image editor doesn't save image] -- LP: #517267 [shortcut keys with abbreviations can reset compiz shortcut keys] -- LP: #577040 [Add a --version command line argument] -- LP: #632042 [Disable re-save file warnings] -- LP: #638588 [Image name overlapping error with $nb_name format] -- LP: #643675 [Editor window opens too large] -- LP: #643683 [Can't capture cursor anymore] -- LP: #644084 [Moving files to trash doesn't work with KDE] -- LP: #644168 [Rotation in Shotwell is incomp. with some other applications] -- LP: #644847 [Shutter does not respect the EXIF orientation flag] -- LP: #654185 [Crop tool - Offset when zooming] -- LP: #658740 ['Open with' does not work with global menu (unity)] -- LP: #658745 [Unreadable (built-in) notifications: Text is highlighted] -- LP: #661424 [Plugins fails if ' in filename] -- LP: #657585 [Shutter ignores typed-in save location] -- LP: #666854 [Auto-resize windows] -- LP: #666858 [Opaque window corners when using compiz] -- LP: #671749 [Feature Request: Redo hotkey] -- LP: #671914 [Zoom window does not update when modifying selection] -- LP: #671917 [Use filename for notebook pages (instead of [no] - [date])] -- LP: #671918 [autoincrement does not work (in rare cases)] -- LP: #677745 [non-HIG complient menu tooltip] -- LP: #681008 [Add feature 'Export to PostScript'] -- LP: #685235 [Double click doesn't work when selecting a selection] * updated translations -- Mario Kemper Tue, 08 Feb 2011 07:15:28 +0100 shutter (0.86.4) * New Features -- Automatically add a border -- Capture all workspaces as one image * New Plugins -- Hard Shadow -- Autocrop * Fixed Bugs / Minor Improvements -- LP: #342628 [Make selection capture 'rounded grey box' less intrusive] -- LP: #497050 [Direction/Color on Shadow Plugin] -- LP: #535481 [Need an autocrop tool] -- LP: #583988 [JPEG export: file size too big] -- LP: #588188 [Add DrawingTool to Preferences>Actions>Open with] -- LP: #590348 [Need "border" feature] -- LP: #608683 [capture ALL desktops as one image] -- LP: #611832 [Advanced selection tool - Enable numpad enter] -- LP: #618008 [Non-latin filenames] -- LP: #620136 [Keyboard should be able to be used for fine grain movements] -- LP: #620397 [Adv. Selection Tool: no update when using the keyboard] -- LP: #622638 [shutter launches ubuntuone also, at startup] * updated translations -- Mario Kemper Wed, 01 Sep 2010 22:36:16 +0200 shutter (0.86.3) * New features -- Publish via Ubuntu One -- New humanity icons (ubuntu-mono-dark and ubuntu-mono-light) * Fixed bugs / minor improvements -- LP: #361971 [Rename Redo to Retry in upload failure dialog] -- LP: #506181 [Would like integration with Ubuntu One] -- LP: #552842 [function to hash the file name] -- LP: #577040 [Add a --version command line argument] -- LP: #582134 [Cannot export photos to imageshack] -- LP: #610042 [Ubuntu-pics.de is dead] -- LP: #610784 [Cannot export photos to imagebanana] * updated translations -- Mario Kemper Thu, 29 Jul 2010 17:47:59 +0200 shutter (0.86.2) * Fixed bugs / minor improvements -- LP: #470403 [Drag & drop the image after taking screenshot] -- LP: #543446 [Transparent parts... show as ] -- LP: #561097 [Profiles are broken] -- LP: #566597 [imageshack.us direct link is messed up] -- LP: #568961 [Desktop may crash when canceling web-capture] * updated translations -- Mario Kemper Wed, 28 Apr 2010 11:34:02 +0200 shutter (0.86.1) * Fixed bugs / minor improvements -- LP: #541751 [Add support for Thunderbird when sending via email] -- LP: #543058 [No error reporting on 'Send by mail'] -- LP: #549732 [print gives blank page] * updated translations -- Mario Kemper Wed, 31 Mar 2010 23:39:34 +0200 shutter (0.86) * New features -- Repeat last screenshots easily -- DrawingTool: New Pixelize tool -- DrawingTool: PDF + SVG Export -- DrawingTool: new shapes (e.g. callouts) -- Improved PDF export -- Copy URL to clipboard (FTP) -- Built-in notification windows -- Option to ask for a name and directory before saving -- Many usability improvements * Screenshot Tools -- LP: #344754 [Keep selection for screenshots] -- LP: #507465 [implement a workaround if some window doesn't deliver the correct type hint] -- #515944 [Can't take window screenshots when using fluxbox and styles that use the XShape extension] * Upload / Export -- LP: #339920 [Copy URL to clipboard after uploading to a FTP Server] -- LP: #341810 [Remember last used 'Upload' tab] -- LP: #513778 [ImageShack direct link incorrect] * Drawing Tool -- LP: #349048 [Add a callout editing tool for quick annotations] -- LP: #482791 [Text Tool should allow me to edit the text immediately] -- LP: #486680 [Shapes can't be moved with keyboard] -- LP: #493308 [Should be able to move around the original image] -- LP: #511919 [Add an svg export to DrawingTool] -- LP: #519869 [Line width not changes, in Shutter editor, if I use "draw arrow" tool after "censor" tool] * Fixed bugs / minor improvements -- LP: #264623 [Add pdf export to File Menu] -- LP: #340762 [Send by email] -- LP: #412917 [Remember the path to last opened folder in "Save as" dialog] -- LP: #500352 [Shutter closes down completely when attempting web capture] -- LP: #501969 [Ctrl N does nothing, even though it is listed in the File menu] -- LP: #509546 [Option to ask for a name and location before saving the screenshots to disk] -- LP: #510404 [Keybindings do not work correctly when optional command line parameters are used] -- LP: #511942 [Default directory for saved screenshots is /home instead of /home/login] -- LP: #512130 [Shutter doesn't start if $icontheme->load_icon fails] -- LP: #513616 [File mask %T non compatible and $name] -- LP: #522508 [Several problems with comma as decimal separator] -- LP: #533764 [I'd like an option "Copy nothing to clipboard"] -- LP: #543052 [Close buttons are right-aligned instead of left on tabs] -- LP: #543063 [Layout overlap on bottom] * updated translations -- Mario Kemper Fri, 26 Mar 2010 00:21:52 +0100 shutter (0.85.1) * Fixed bugs -- LP: #471895 [Unable to set Shutter as default screenshot tool when using compiz] -- LP: #488845 [check gtk version before calling gtk-image-menu-...] -- LP: #488895 [capture menu / tooltip doesn't work with gtk2-perl 1.161] -- LP: #488897 [duplicate file after capturing a webpage and using $name in th...] -- LP: #486322 [copy filename / copy screenshot to clipboard should be xor] -- LP: #486659 [Pressing Enter in the image editor doesn't save image] -- LP: #486691 [copy and copy filename do not work in session tab] -- LP: #488702 [can't shot localhost web] * updated translations -- Mario Kemper Tue, 01 Dec 2009 20:26:49 +0100 shutter (0.85) * New features -- Undo/Redo functionality -- Drag and drop pics into Shutter -- Functionality to capture menus -- Functionality to capture tooltips -- Improved Advanced Selection Tool -- Improved Window Selection -- Improved right-click menu in preview tab -- Many UI improvements -- Change backgound color in Drawing Tool -- New multi-purpose wildcard $name -- Import images from clipboard -- Use system's notification system -- Send screenshots via email or instant messenger -- Autocopy filename to clipboard -- Shutter registers itself as an app to open images with * Screenshot Tools -- LP: #371550 [Advanced selection tool: Specify pixel values of selection area] -- LP: #392002 [Add gnome-web-photo's --width parameter to the webphoto settings] -- LP: #412466 [gnome-web-photo "Unknown option -q"] -- LP: #454266 [Cursor does not display] -- LP: #457218 [Combine the advanced and the simple selection tool into one tool] * Drawing Tool -- LP: #311582 [Make the properties dialog function as "instant apply"] -- LP: #394367 [change and mark hot spot of mouse pointer icons] -- LP: #396431 [Properties of the marker tool aren't updated instantly] -- LP: #403469 [DrawingTool: Add an option to change the background color when...] -- LP: #466067 [no icos in the 'Screenshot-Edit-Insert image' menu] * User Interface -- LP: #279271 [Allow easy profile switching] -- LP: #338800 [Drag and drop pics into shutter] -- LP: #342643 [Provide easier access to actions in the preview tab] -- LP: #344828 [Remove MIME type info from general window] -- LP: #365373 [screenshot info should be summarized] * Fixed bugs / minor improvements -- LP: #328663 [Give the screenshot title of window when capturing window only] -- LP: #338796 [Shutter should register itself as an app to open pictures with] -- LP: #339728 [Need an 'undo' for image editing and plugin operations] -- LP: #339924 [Rename strings] -- LP: #340762 [Send by email] -- LP: #345382 [add indicator for running countdown] -- LP: #350660 [Add an option to keep the shutter window hidden after a capture] -- LP: #415917 [Capture menus more easily] -- LP: #421832 [Import image from clipboard] -- LP: #426348 [JPG is a default format] -- LP: #428661 [X crashes if no instance of Shutter is running while capture s...] -- LP: #436504 [Screenshot looks fuzzy after printing] -- LP: #440526 [Files remain in folder even if put in trash] -- LP: #453210 [Shutter signals in Multi User Env] -- LP: #457209 [Add a 'delete-on-tab-close' option to the preferences] -- LP: #457211 [Add an option for a delete prompt to preferences] * updated translations -- Mario Kemper Sat, 21 Nov 2009 15:01:45 +0100 shutter (0.80.1) * Fixed bugs -- LP: #363708 [small lines at the edge of small screenshots] -- LP: #388532 [Respect stacking order of windows when selecting] -- LP: #396795 [Jigsaw plugins are broken] -- LP: #396797 [gnome-web-photo errors not properly handled in all cases] -- LP: #397873 [check permissions when saving to directory] -- LP: #397875 [Don't install anything to /usr/share/app-install] -- LP: #404860 [Paths with whitespaces in them aren't properly treated] -- LP: #406017 [settings could not be restored] * DrawingTool: new cursors * DrawingTool: improved 'insert image' functionality * updated translations -- Mario Kemper Thu, 06 Aug 2009 22:43:41 +0200 shutter (0.80) * New features -- Undo/Redo functionality in Drawing Tool -- Added arrow shape to Drawing Tool -- Added highlighter/marker to Drawing Tool -- Added numbered tags to Drawing Tool -- Added crop tool to Drawing Tool -- Functionality to resize the canvas -- Zoomable image preview -- New 'Copy filename' action -- Added access to 'Recent files' -- New watermark plugin -- New reflection plugin -- New distortion plugin -- New 3D rotate plugin * Drawing Tool -- LP: #310704 [object property changes should take immediate effect] -- LP: #311578 [resize canvas] -- LP: #312405 [added numbered tags] -- LP: #312965 [Drawing tool should have an Undo feature] -- LP: #318452 [save and restore last used tool] -- LP: #322811 [Add crop tool to drawing tool] -- LP: #338809 [keep tool focus after one usage] -- LP: #360254 [added highlighter/marker] -- LP: #364815 [added arrow shape] -- LP: #380790 [Fullscreen mode] * User Interface -- Show screenshot menu on right-button click in each tab -- Show default application in separate menu item -- Show progress dialog when updating plugin information -- LP: #338528 [use icon theme and toolbar style wherever it is possible] * Plugins -- LP: #264622 [new watermark plugin] -- LP: #342034 [new reflection plugin] -- LP: #374192 [new distortion plugin] -- LP: #375069 [new 3D rotate plugin] * Fixed bugs / minor improvements -- Use File::HomeDir instead of $ENV{ 'HOME' } -- Use xdg-open instead of gnome-open -- LP: #312221 [Item is drawn in bottom-right point of the cursor] -- LP: #336122 [Ctrl+resize in editor moves the shape] -- LP: #338812 [Better timeout options] -- LP: #340503 [Show item properties on double-click] -- LP: #341458 [Allow zooming in editor via ctrl+scrollwheel] -- LP: #348595 [keybindings don't work in ubuntu jaunty when using compiz] -- LP: #353819 [check window border option when calculating shape] -- LP: #353824 [fix advanced selection tool when using compiz] -- LP: #353830 [do not capture the zoom window when using the simple selection] -- LP: #356324 [Stutter doesn't remember preference for screenshot location] -- LP: #362508 [File - Open with gets broken sometimes] -- LP: #363708 [lines of selected area get captured sometimes] -- LP: #340635 [Preview in plugin dialogs takes too long] -- LP: #364165 [dialogs should set the window title] -- LP: #365365 [polaroid plugin text doesn't allow apostrophes] -- LP: #366695 [control advanced selection tool with arrow keys] -- LP: #367513 [desktop entry contains deprecated encoding key] -- LP: #370359 [Watermark plugin doesn't say the allowed syntax] -- LP: #370367 [DrawingTool -> View has multiple same options] -- LP: #384352 [Save settings to file when closing preferences dialog] -- LP: #386304 [Rename Edit -> Quick select to Quick profile select] -- LP: #386316 ['Delete objects' and 'Delete all objects' are too similar] -- LP: #386318 [New highlighter icon] -- LP: #386766 [Text of '3D rotate' plugin is malformated] -- LP: #386769 [quick profile selector is even sensitive when empty] -- LP: #389837 [Invalid chars in japanese translation] -- LP: #390853 [Workaround for upstream bug http://trac.bjourne.webfactional.com/ticket/21] -- LP: #394283 [query new libgoocanvas properties and methods] * code cleanup * updated translations -- Mario Kemper Sun, 05 Jul 2009 14:39:53 +0200 shutter (0.70.2) * fixed bugs -- LP: #339139 [Shutter selects incorrect target window] -- LP: #340855 + LP: #340864 [fixed save-as function] -- LP: #340856 [main window is partly visible on screenshots] -- LP: #340990 [Shutter crashes when xserver grab fails] -- LP: #341459 [Ctrl+ + doesn't zoom in drawing area] -- LP: #347821 [decode filesize properly] * updated translations -- Mario Kemper Tue, 24 Mar 2009 21:41:37 +0100 shutter (0.70.1) * fixed bugs -- LP: #260771 [Detect 'window-manager-changed' event] -- LP: #328654 [Weird paths after uploading] -- LP: #338829 [Uploading to imageshack is broken] -- LP: #338990 [Open with dialog freezes shutter and desktop] -- LP: #340253 [Capture Website creates two files] -- LP: #340459 [Use fallback icons if icon does not exist] * updated translations -- Mario Kemper Tue, 10 Mar 2009 23:06:25 +0100 shutter (0.701) * General changes -- Rebranding from GScrot to Shutter -- Exports to and opens all file formats supported by gdk-pixbuf -- Added native printing support (instead of gtklp) -- Watch opened files via GnomeVFS File Monitor to monitor changes -- Integration of GNOME Virtual File System and GNOME authentication manager (LP: #310780) -- Respect non-rectangular windows (XSHAPE) when using metacity (LP: #260771) -- Use themeable icons wherever its is possible -- Use systemwide MIME Information instead of config file -- Move screenshots to trash instead of deleting them (LP: #313003) -- Faster thumbail creation and caching (improves gui startup when a lot of files are in last session) -- Improved Dialogs (e.g. Settings Dialog) -- Show context menu for each file in session tab (right click) * Gui improvements Show current profile in statusbar (LP: #279271) Second toolbar removed (LP: #311626) Progress bars (LP: #310299) -- LP: #311627 -- LP: #312966 -- LP: #313346 -- LP: #326758 * Drawing Tool Scale uniformly (LP: #310708) Added standard actions (copy, cut, paste, delete) (LP: #313343) Added censor tool to hide private data (LP: #317659) -- LP: #310717 -- LP: #310721 -- LP: #311574 -- LP: #311576 -- LP: #311577 -- LP: #311580 * Miscellaneous Shutter shows up in GNOME add/remove (LP: #322388) Repository is not signed (thanks to the LP Team) (LP: #312681) * Plugins New hard shadow plugin (thanks to Tualatrix) (LP: #331914) * Fixed bugs -- LP: #303090 -- LP: #313761 -- LP: #316917 -- LP: #336120 -- LP: #336126 -- LP: #336121 -- LP: #336118 -- LP: #336133 -- LP: #336124 * updated translations -- Mario Kemper Thu, 05 Mar 2009 12:23:51 +0100 gscrot (0.642) * fixed bugs -- LP: #313351 -- LP: #318226 -- LP: #318227 -- LP: #313351 * updated translations -- Mario Kemper Sun, 18 Jan 2009 15:10:27 +0100 gscrot (0.640) * fixed bugs -- LP: #312866 -- LP: #313005 * updated translations -- Mario Kemper Fri, 02 Jan 2009 14:33:27 +0100 gscrot (0.64) * new goo-canvas based drawing tool (LP: #264617, LP: #278999, LP: #279001) * added ftp-upload (LP: #291286) * improved startup time (LP: #296341) * improved advanced selection tool (LP: #311185) * improved plugin interface and error handling (LP: #296091) * fixed bugs/smaller feature requests -- LP: #306420 -- LP: #264616 -- LP: #277040 -- LP: #279271 -- LP: #280161 -- LP: #291284 -- LP: #310871 * new plugin: torned-paper (Edwood Ocasio) * updated translations * massive code cleanup -- Mario Kemper Tue, 30 Dec 2008 09:48:36 +0100 gscrot (0.63) * added new "advanced" selection-tool (see LP: #273763, depends on Gtk2::ImageView) * added new keybinding-mode option * ported to Gtk2::StatusIcon (Gtk2::TrayIcon supported for older Gtk2 Versions) * faster plugin checks * minor changes (human interface guidelines) * fixed (LP: #286632, LP: #293091, LP: #291753, LP: #293616) * updated translations * code cleanup -- Mario Kemper Thu, 06 Nov 2008 13:45:57 +0100 gscrot (0.62) * display session information on startup (see LP: #277121) * minor changes related to upload dialog (see LP: #280154 and LP: #280165) * new file->save as and file->close menu entries (see LP: #280155 and LP: #280886) * new command line parameters (see LP: #280868 and LP: #281793) * deleted hard dependencies of gnome-web-photo and gtklp in source code for more flexibility (e.g. packaging) * updated translations -- Mario Kemper Wed, 22 Oct 2008 15:10:33 +0200 gscrot (0.61) * added new feature "include cursor" (default cursor) * added imageshack.us as hosting-partner * save and restore session automatically (restore tabs/screenshots) * improved plugin-dialog and upload-dialog * redesigned polaroid plugin * fixed wrong utf8-encoding in profile names * fixed wrong utf8-encoding in about dialog * improved auto incrementing of filenames (see LP: #275352) * improved thumbs (session tab) * updated translations -- Mario Kemper Mon, 06 Oct 2008 22:47:58 +0200 gscrot (0.60) * added new feature "grab window-section" * added settings-profiles * added new plugin interface * added new plugins -- pdf-export -- negate -- sepia (perl) -- resize * gui redesign -- scaling of main window -- auto-scaling of preview -- new toolbar -- new menu entries -- settings moved to menu * updated translations -- Mario Kemper Wed, 24 Sep 2008 22:00:18 +0200 gscrot (0.51.1) * minor changes * added/updated translations * fixed bugs -- 264637 -- Mario Kemper Fri, 05 Sep 2008 18:29:35 +0200 gscrot (0.51) * new features -- capture window by name -- select specific workspace to capture * minor changes -- several performance improvements -- some options added * added/updated translations -- Danish -- Dutch -- French -- German -- Italian -- Korean -- Norwegian Bokmal -- Polish -- Russian -- Serbian -- Simplified Chinese -- Spanish -- Swedish -- Traditional Chinese -- Ukrainian * fixed bugs -- 262165 -- 262206 -- 262207 -- 262263 -- Mario Kemper Mon, 01 Sep 2008 03:25:16 +0200 gscrot (0.50.1) * minor changes -- partly rewritten window-selection -- changed .po/.mo naming of plugins -- added new svg icon * added/updated translations -- Brazilian Portuguese -- Catalan -- Spanish -- Italian -- Polish -- Russian -- Swedish -- Traditional Chinese -- Ukrainian * fixed bugs -- 260146 -- 260142 -- 260736 -- Mario Kemper Tue, 26 Aug 2008 00:13:09 +0200 gscrot (0.50) * implemented new backend (gscrot does not depend on scrot anymore) * zoom for free-hand screenshot * gui changes -- added a detachable toolbar (buttons are replaced) * added translations -- spanish -- catalan -- Mario Kemper Tue, 19 Aug 2008 22:00:58 +0200 gscrot (0.405) * fixed bug https://bugs.launchpad.net/gscrot/+bug/252549 -- Mario Kemper Mon, 28 Jul 2008 16:42:19 +0200 gscrot (0.404) * gui changes (added expanders) * session collection -- added file infos -- added thumbnails * save settings automatically when exiting * added url-column to accounts treeview * included gscrot-plugins-bash in base-package -- Mario Kemper Fri, 25 Jul 2008 21:07:44 +0200 gscrot (0.39) * drawing-tool -- it's a canvas now ;-) -- zoom-factor and width of brush configurable -- fixed drawing glitches due to fast mouse movement * added new wildcard (%NN = counter) * added keybindings (using gconf, configurable via gui) * added libgnome2-perl and libgnome2-gconf-perl to dependencies -- Mario Kemper Fri, 11 Jul 2008 00:57:11 +0200 gscrot (0.385) * added simple drawing tool * added plugin-interface and gui structure * added support for image-hoster imagebanana.com * added support for upload-accounts (ubuntu-pics.de && imagebanana.com) -- gui structure and accounts.xml * internal changes -- upload-functionality swapped out to perl-modules -- changed settings-format to xml -- Mario Kemper Thu, 03 Jul 2008 19:39:35 +0200 gscrot (0.370) * added functionality to capture websites using gnome-web-photo * added upload functionality to ubuntu-pics.de --upload a file and automatically retrieve all links generated by ubuntu-pics.de * moved configuration to /home//.gscrot/settings.conf * modified program-selector --switched simple entry to combobox with tree-model --predefined or custom programs/scripts --overwrite settings individually by setting up /home//.gscrot/programs.conf * added custom icon-set * smaller changes --solved deprecation warning in about-dialog --fixed wrong time format in debian/changelog --added all new dependencies to debian/control * added russian translation files -- Mario Kemper Mon, 19 May 2008 12:49:27 +0200 gscrot (0.36.2) * unset "reduce colors" by default -- Mario Kemper Thu, 08 May 2008 22:43:38 +0200 gscrot (0.36) * added functionalities to "session collection" --remove screenshots from session (but do not delete them) --reopen screenshot with specified program --rename screenshot * new arrangement of settings area * new feature -- reduce colors -- * added dependency perlmagick -- Mario Kemper Wed, 07 May 2008 19:55:10 +0200 gscrot (0.35) * added feature "session collection" --keep track of all screenshots during session --copy screeners to clipboard --print screenshots --delete screenshots * added command line args --min_at_startup - starts gscrot minimized to tray --beeper_off - turns audible feedback off --debug - prints a lot of debugging information to STDOUT --help - displays this help * start of localization using gettext --english is now default language --german translation added * fixed typo in info_message * changed hbox/vbox arrangement -- Mario Kemper Thu, 17 Apr 2008 13:17:37 +0200 gscrot (0.34) * new features * added keybindings in menubar * added save and revert settings * reimplemented message dialogs * added support for grabbing window border when not using compiz or beryl * added debian folder to source directory * load settings automatically at startup * added statusbar to main window -- Mario Kemper Thu, 10 Apr 2008 21:00:10 +0200 gscrot (0.33) * added homepage to about box -- Mario Kemper Wed, 09 Apr 2008 13:19:30 +0200 gscrot (0.33) * initial release -- Mario Kemper Wed, 09 Apr 2008 12:50:28 +0200 shutter-0.99.6/COPYING000066400000000000000000001043741476102223600143640ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . shutter-0.99.6/Makefile000066400000000000000000000026351476102223600147660ustar00rootroot00000000000000prefix = /usr/local all: ./po2mo.sh clean: if [ -d $(srcdir)share/locale ]; then \ rm -r $(srcdir)share/locale; \ fi install: all install -Dm644 $(srcdir)COPYING $(prefix)/share/doc/shutter/COPYING install -Dm644 $(srcdir)README $(prefix)/share/doc/shutter/README install -Dm755 $(srcdir)bin/shutter $(prefix)/bin/shutter cp -r $(srcdir)share/ $(prefix)/ uninstall: rm $(prefix)/bin/shutter rm $(prefix)/share/metainfo/shutter.metainfo.xml rm $(prefix)/share/applications/shutter.desktop rm -r $(prefix)/share/doc/shutter/ rm $(prefix)/share/man/man1/shutter.1 rm $(prefix)/share/pixmaps/shutter.png rm -r $(prefix)/share/shutter/ rm $(prefix)/share/icons/HighContrast/scalable/apps/shutter.svg rm $(prefix)/share/icons/HighContrast/scalable/apps/shutter-panel.svg for size in 128x128 16x16 192x192 22x22 24x24 256x256 32x32 36x36 48x48 64x64 72x72 96x96; do \ rm $(prefix)/share/icons/hicolor/$$size/apps/shutter.png; \ done for size in 16x16 22x22 24x24; do \ rm $(prefix)/share/icons/hicolor/$$size/apps/shutter-panel.png; \ done rm $(prefix)/share/icons/hicolor/scalable/apps/shutter-panel.svg rm $(prefix)/share/icons/hicolor/scalable/apps/shutter.svg for locale in $(prefix)/share/locale/*; do \ for mofile in shutter.mo shutter-plugins.mo shutter-upload-plugins.mo; do \ if [ -f $$locale/LC_MESSAGES/$$mofile ]; then \ rm $$locale/LC_MESSAGES/$$mofile; \ fi \ done \ done shutter-0.99.6/README000066400000000000000000000076541476102223600142140ustar00rootroot00000000000000Shutter Copyright (C) 2008-2013 Mario Kemper Copyright (C) 2020-2021 Google LLC, contributed by Alexey Sokolov --------------------- https://shutter-project.org/ Installation ------------ https://shutter-project.org/downloads/ Contact ------------ Via E-Mail : https://shutter-project.org/contact/ Via GitHub : https://github.com/shutter-project/shutter/issues/new/choose Via IRC : ircs://irc.libera.chat:6697/#shutter Found a bug? ------------ https://github.com/shutter-project/shutter/issues/new?labels=bug&template=bug_report.md Shutter Licence ------------ Licence: GPL 3 or (at your option) any later version. Shutter is free software; you can redistribute it and/or modify it under the terms of the GNU General Public Licence as published by the Free Software Foundation; either version 3 of the Licence, or (at your option) any later version. Shutter is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Cursors License ------------ Licence: GPL2 or (at your option) any later version. Some cursors (share/shutter/resources/icons/drawing_tool/cursor) are based on/taken from the inkscape project http://inkscape.sourceforge.net/ Gnome Icons ------------ Licence: GPL2 or (at your option) any later version. Tango Icons ------------ In the preparation of the 0.8.90 release Novell took care of tracking down all the contributors to get them to relicense their artwork into Public Domain. The COPYING file of the tarball states the following: | The icons in this repository are herefore released into the Public Domain. Additionally the copyright status of the files was tracked in the CVS and the rdf properties of the SVGs adjusted for all files that were put into Public Domain (see rdf:about and rdf:resource). Both fields contain a link to the Creative Commons Public Domain Dediciation[0] as reproduced below: | Public Domain Dedication | | Copyright-Only Dedication (based on United States law) or Public Domain | Certification | | The person or persons who have associated work with this document (the | "Dedicator" or "Certifier") hereby either (a) certifies that, to the best | of his knowledge, the work of authorship identified is in the public | domain of the country from which the work is published, or (b) | hereby dedicates whatever copyright the dedicators holds in the work | of authorship identified below (the "Work") to the public domain. A | certifier, moreover, dedicates any copyright interest he may have in | the associated work, and for these purposes, is described as a | "dedicator" below. | | A certifier has taken reasonable steps to verify the copyright | status of this work. Certifier recognizes that his good faith efforts | may not shield him from liability if in fact the work certified is not | in the public domain. | | Dedicator makes this dedication for the benefit of the public at | large and to the detriment of the Dedicator's heirs and successors. | Dedicator intends this dedication to be an overt act of relinquishment | in perpetuity of all present and future rights under copyright law, | whether vested or contingent, in the Work. Dedicator understands that | such relinquishment of all rights includes the relinquishment of all | rights to enforce (by lawsuit or otherwise) those copyrights in the | Work. | | Dedicator recognizes that, once placed in the public domain, the Work | may be freely reproduced, distributed, transmitted, used, modified, | built upon, or otherwise exploited by anyone for any purpose, commercial | or non-commercial, and in any way, including by methods that have not | yet been invented or conceived. [0] http://creativecommons.org/licenses/publicdomain/ shutter-0.99.6/TODO-GTK3.md000066400000000000000000000002361476102223600151160ustar00rootroot00000000000000drawing: rulers ssh -X is broken selection: cursor XY stickiness to edges hidpi: fix possible issues with: multiple screens, subwindow captures, menu capture shutter-0.99.6/bin/000077500000000000000000000000001476102223600140705ustar00rootroot00000000000000shutter-0.99.6/bin/shutter000077500000000000000000013205231476102223600155220ustar00rootroot00000000000000#! /usr/bin/perl ################################################### # # Copyright (C) 2008-2013 Mario Kemper # Copyright (C) 2020-2021 Google LLC, contributed by Alexey Sokolov # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### # See "Migrating from GnomeVFS to GIO": # https://developer.gnome.org/gio/stable/ch33.html #perl -x -S perltidy -l=0 -b "%f" #modules #-------------------------------------- use utf8; use strict; use warnings; use diagnostics; use 5.10.1; use Carp::Always; BEGIN { use Glib::Object::Introspection; Glib::Object::Introspection->setup( basename => 'Gio', version => '2.0', package => 'Glib::IO', ); Glib::Object::Introspection->setup( basename => 'Wnck', version => '3.0', package => 'Wnck', ); Glib::Object::Introspection->setup( basename => 'GdkX11', version => '3.0', package => 'Gtk3::GdkX11', ); } package Shutter::App; #Deal with encoding problem binmode(STDOUT, "encoding(UTF-8)"); use Encode; use File::stat; use Number::Bytes::Human; #Glib use Pango; use Glib qw/TRUE FALSE/; use Gtk3 '-init'; use Glib::Object::Subclass qw/Gtk3::Application/; use Gtk3::ImageView 10; #filename parsing use POSIX qw/ strftime /; #File operations use File::Copy qw/ cp mv /; use File::Glob qw/ bsd_glob /; use File::Basename qw/ fileparse dirname basename /; use File::Temp qw/ tempfile tempdir /; use File::Spec; use File::Which; use File::Copy::Recursive; use IO::File(); #A selection of general-utility list subroutines use List::Util qw/ max min /; #load and save settings use XML::Simple; #DBus message system use Net::DBus; #HTTP Status code processing use HTTP::Status; #timing issues use Time::HiRes qw/ time usleep /; #Locate directory of original perl script use FindBin '$Bin'; #stringified perl data structures, suitable for both printing and eval use Data::Dumper; #md5 hash library use Digest::MD5 qw(md5_hex); #proc use Proc::Simple; #sort lexically, but sort numeral parts numerically use Sort::Naturally; use English; sub escape_string { return $_[0]; # used to be Gnome2::VFS->escape_string. my $ret = Gnome2::VFS->escape_string($_[0]); say "VFS escape_string $_[0] -> $ret"; return $ret; } sub unescape_string { return $_[0]; # used to be Gnome2::VFS->unescape_string. # at least, transform utf-8 to internal perl format for utf8 my $ret = Gnome2::VFS->unescape_string($_[0]); say "VFS unescape_string $_[0] -> $ret"; return $ret; } sub unescape_string_for_display { return $_[0]; # used to be Gnome2::VFS->unescape_string_for_display. my $ret = Gnome2::VFS->unescape_string_for_display($_[0]); say "VFS unescape_string_for_display $_[0] -> $ret"; return $ret; } sub escape_path_string { return $_[0]; # used to be Gnome2::VFS->escape_path_string. my $ret = Gnome2::VFS->escape_path_string($_[0]); say "VFS escape_path_string $_[0] -> $ret"; return $ret; } #-------------------------------------- #print UTF-8 to standard output #-------------------------------------- #binmode STDOUT, ":utf8"; #-------------------------------------- #define constants #-------------------------------------- use constant MAX_ERROR => 5; use constant SHUTTER_REV => 'Rev.1816'; use constant SHUTTER_NAME => 'Shutter'; use constant SHUTTER_VERSION => '0.99.6'; #-------------------------------------- #configure path settings #-------------------------------------- my $shutter_root = undef; if ($ENV{PAR_TEMP}) { $shutter_root = $ENV{PAR_TEMP}; } else { $Bin =~ m/(.*)\//; $shutter_root = $1; } $ENV{'SHUTTER_ROOT'} = $shutter_root; #used by some plugins #-------------------------------------- #check optional components #-------------------------------------- my $gnome_web_photo = TRUE; my $nautilus_sendto = TRUE; my $goocanvas = TRUE; my $exiftool = TRUE; my $appindicator = TRUE; fct_init_depend(); #-------------------------------------- #load shutter's modules #-------------------------------------- require lib; import lib "$shutter_root/share/shutter/resources/modules"; #app classes require Shutter::App::AboutDialog; require Shutter::App::Common; require Shutter::App::GlobalSettings; require Shutter::App::SimpleDialogs; require Shutter::App::HelperFunctions; require Shutter::App::Options; require Shutter::App::Directories; require Shutter::App::Autostart; require Shutter::App::Menu; require Shutter::App::Notification; require Shutter::App::ShutterNotification; require Shutter::App::Toolbar; require Shutter::App::Optional::Exif; #region require Shutter::Geometry::Region; #pixbuf operations require Shutter::Pixbuf::Save; require Shutter::Pixbuf::Load; require Shutter::Pixbuf::Border; #drawing classes if ($goocanvas) { require Shutter::Draw::DrawingTool; } #screenshot classes require Shutter::Screenshot::SelectorAdvanced; require Shutter::Screenshot::SelectorAuto; require Shutter::Screenshot::Wayland; require Shutter::Screenshot::Workspace; require Shutter::Screenshot::Web; require Shutter::Screenshot::Window; require Shutter::Screenshot::WindowXid; require Shutter::Screenshot::WindowName; require Shutter::Screenshot::Error; #upload classes require Shutter::Upload::FTP; #-------------------------------------- my $sc = Shutter::App::Common->new( shutter_root => $shutter_root, main_window => undef, appname => SHUTTER_NAME, version => SHUTTER_VERSION, rev => SHUTTER_REV, pid => $PID ); my $shf = Shutter::App::HelperFunctions->new($sc); my $so = Shutter::App::Options->new($sc, $shf); #set home #-------------------------------------- $ENV{'HOME'} = Shutter::App::Directories::get_home_dir(); #-------------------------------------- #load command line arguments #as well as file to open when starting my $init_files = $so->get_options; # accept either path or uri as arguments, but store only uri my @init_files = map { Glib::IO::File::new_for_commandline_arg($_)->get_uri } @$init_files; my @signal_connections; #hash of screenshots during session my %session_screens; my %session_start_screen; my $accounts_model; my $accounts_tree; my $app; my $as_confirmation_necessary; my $as_help_active; my $asel_size1; my $asel_size2; my $asel_size3; my $asel_size4; my $ask_on_delete_active; my $ask_on_fs_delete_active; my $autoshape_active; my $border_active; my $bordereffect_active; my $bordereffect_cbtn; my $bordereffect_vlabel; my $bordereffect; my $clipboard; my $close_at_close_active; my $combobox_im_colors; my $combobox_ns; my $combobox_settings_profiles; my $combobox_status_profiles_label; my $combobox_status_profiles; my $combobox_type; my $combobox_web_width; my $css_provider_alpha; my $current_monitor_active; my $current_profile_indx; my $cursor_active; my $cursor_status_active; my $d; my $delay_status_vlabel; my $delay_status; my $delay_vlabel; my $delay; my $delete_on_close_active; my $filename; my $fname_autocopy_active; my $fs_active; my $fs_min_active; my $fs_nonot_active; my $ftp_mode_combo; my $ftp_password_entry; my $ftp_remote_entry; my $ftp_username_entry; my $ftp_wurl_entry; my $hide_active; my $hide_time_vlabel; my $hide_time; my $hu; my $im_colors_active; my $image_autocopy_active; my $int_jpeg; my $int_png; my $int_bmp; my $int_webp; my $is_hidden; my $lp_ne; my $lp; my $menu_delay_vlabel; my $menu_delay; my $menu_waround_active; my $nav_toolbar; my $no_autocopy_active; my $notebook; my $notify_after_active; my $notify_ptimeout_active; my $notify_timeout_active; my $pagesetup; my $present_after_active; my $progname_active; my $progname; my $sas; my $save_ask_active; my $save_auto_active; my $save_no_active; my $saveDir_button; my $scale_label; my $scale; my $sd; my $session_asc_combo; my $session_asc; my $session_desc_combo; my $session_desc; my $settings_dialog; my $settings_xml; my $sm; my $sp; my $st; my $status; my $thumbnail_active; my $thumbnail; my $trans_backg; my $trans_check; my $trans_custom_btn; my $trans_custom; my $tray_libappindicator; my $tray_legacy; my $tray_menu; my $tray; my $visible_windows_active; my $window; my $winresize_active; my $winresize_h; my $winresize_w; my $wnck_screen; my $x11_supported; my $zoom_active; #data structures #------------------------------------------------------- my %plugins; #hash to store plugin infos my %accounts; #hash to store account infos my %settings; #hash to store settings my @supported_formats; #hash to store available supported file formats sub STARTUP { # This is called by $app->run below if another Shutter instance is not running. my ($app) = @_; $app->SUPER::STARTUP(); #main window #-------------------------------------- $window = Gtk3::ApplicationWindow->new($app); #-------------------------------------- #create app objects #-------------------------------------- $sc->set_mainwindow($window); $sas = Shutter::App::Autostart->new(); $sm = Shutter::App::Menu->new($sc); $st = Shutter::App::Toolbar->new($sc); $sd = Shutter::App::SimpleDialogs->new($window); $sp = Shutter::Pixbuf::Save->new($sc); $lp = Shutter::Pixbuf::Load->new($sc); $lp_ne = Shutter::Pixbuf::Load->new($sc, undef, TRUE); $hu = Number::Bytes::Human->new(si => 1); #-------------------------------------- #Clipboard $clipboard = Gtk3::Clipboard::get($Gtk3::Gdk::SELECTION_CLIPBOARD); #Gettext $d = $sc->get_gettext; #Page Setup $pagesetup = undef; #HELPERS $current_profile_indx = 0; #current profile index $is_hidden = TRUE; #main window hidden flag # Watch the main window and register a handler that will be called each time # that there's a new message. my $action; $action = Glib::IO::SimpleAction->new('exitac', ''); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { $sc->set_exit_after_capture(TRUE); }); $action = Glib::IO::SimpleAction->new('exfilename', 's'); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { my $arg = $_[1]->get_string; $sc->set_export_filename($arg); }); $action = Glib::IO::SimpleAction->new('delay', 's'); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { my $arg = $_[1]->get_string; $sc->set_delay($arg); }); $action = Glib::IO::SimpleAction->new('include_cursor', ''); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { $sc->set_include_cursor(TRUE); $sc->set_remove_cursor(FALSE); }); $action = Glib::IO::SimpleAction->new('remove_cursor', ''); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { $sc->set_remove_cursor(TRUE); $sc->set_include_cursor(FALSE); }); $action = Glib::IO::SimpleAction->new('nosession', ''); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { $sc->set_no_session(TRUE); }); $action = Glib::IO::SimpleAction->new('fopen', 'as'); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { my $args = $_[1]->get('as'); if (scalar @$args > 0) { fct_open_files(@$args); } fct_control_main_window('show'); }); $action = Glib::IO::SimpleAction->new('profile', 's'); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { my $arg = $_[1]->get_string; print "FIXME: switching profiles via IPC is not implemented yet\n"; }); $action = Glib::IO::SimpleAction->new('select', 's'); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { my $arg = $_[1]->get_string; evt_take_screenshot('global_keybinding', 'select', undef, $arg); }); $action = Glib::IO::SimpleAction->new('full', ''); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { evt_take_screenshot('global_keybinding', 'full'); }); $action = Glib::IO::SimpleAction->new('window', 's'); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { my $arg = $_[1]->get_string; evt_take_screenshot('global_keybinding', 'window', undef, $arg); }); $action = Glib::IO::SimpleAction->new('awindow', ''); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { evt_take_screenshot('global_keybinding', 'awindow'); }); # No sections for now: https://github.com/shutter-project/shutter/issues/25 #$action = Glib::IO::SimpleAction->new('section', ''); #$app->add_action($action); #push @signal_connections, $action->signal_connect('activate'=>sub { # evt_take_screenshot('global_keybinding', 'section'); #}); $action = Glib::IO::SimpleAction->new('menu', ''); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { evt_take_screenshot('global_keybinding', 'menu'); }); $action = Glib::IO::SimpleAction->new('tooltip', ''); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { evt_take_screenshot('global_keybinding', 'tooltip'); }); $action = Glib::IO::SimpleAction->new('web', 's'); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { my $arg = $_[1]->get_string; evt_take_screenshot('global_keybinding', 'web', undef, $arg); }); $action = Glib::IO::SimpleAction->new('redoshot', ''); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { evt_take_screenshot('global_keybinding', 'redoshot'); }); $action = Glib::IO::SimpleAction->new('showmainwindow', ''); $app->add_action($action); push @signal_connections, $action->signal_connect('activate'=>sub { fct_control_main_window('show'); }); #create needed directories etc. Shutter::App::Directories::create_hidden_home_dir_if_not_exist(); #print debug output fct_init_debug_output() if $sc->get_debug; #shutdown Shutter carefully when INT or TERM are detected # => save settings $SIG{INT} = sub { evt_delete_window('', 'quit') }; $SIG{TERM} = sub { evt_delete_window('', 'quit') }; #main window gui #-------------------------------------- Gtk3::Window::set_default_icon_name("shutter"); $window->signal_connect('delete-event' => \&evt_delete_window); $window->set_border_width(0); $window->set_resizable(TRUE); $window->set_focus_on_map(TRUE); $window->set_default_size(-1, 500); #UPDATE WINDOW LIST (signal is connected when GUI is loaded) $x11_supported = 1; if ($ENV{XDG_SESSION_TYPE} eq "wayland") { $x11_supported = 0; } if ($x11_supported) { $wnck_screen = Wnck::Screen::get_default(); $wnck_screen->force_update if $wnck_screen; } #TRAY ICON AND MENU $tray = undef; $tray_libappindicator = undef; $tray_legacy = undef; $tray_menu = fct_ret_tray_menu(); #SESSION NOTEBOOK $notebook = Gtk3::Notebook->new; $notebook = fct_create_session_notebook(); #STATUSBAR $status = Gtk3::Statusbar->new; $status->set_name('main-window-statusbar'); $combobox_status_profiles_label = Gtk3::Label->new($d->get("Profile") . ":"); $combobox_status_profiles = Gtk3::ComboBoxText->new; #arrange settings in notebook my $notebook_settings = Gtk3::Notebook->new; $notebook_settings->set_tab_pos('left'); $settings_dialog = Gtk3::Dialog->new(SHUTTER_NAME . " - " . $d->get("Preferences"), $window, [qw/modal destroy-with-parent/], 'gtk-close' => 'close'); my $vbox = Gtk3::VBox->new(FALSE, 0); $window->add($vbox); #attach signal handlers to subroutines and pack menu #-------------------------------------- $vbox->pack_start($sm->create_menu, FALSE, TRUE, 0); $sm->{_menuitem_open}->signal_connect('activate', \&dlg_open, 'menu_open'); #recent manager and menu entry $sm->{_menu_recent} = Gtk3::RecentChooserMenu->new_for_manager(Gtk3::RecentManager::get_default()); $sm->{_menu_recent}->set_sort_type('mru'); $sm->{_menu_recent}->set_local_only(TRUE); $sm->{_menu_recent}->set_show_numbers(TRUE); $sm->{_menu_recent}->set_show_not_found(FALSE); my $recentfilter = Gtk3::RecentFilter->new; $recentfilter->add_pixbuf_formats; $sm->{_menu_recent}->add_filter($recentfilter); $sm->{_menu_recent}->signal_connect( 'item-activated' => \&dlg_open, $sm->{_menu_recent}->get_current_uri ); $sm->{_menuitem_recent}->set_submenu($sm->{_menu_recent}); $sm->{_menuitem_redoshot}->signal_connect('activate', \&evt_take_screenshot, 'redoshot'); $sm->{_menuitem_selection}->signal_connect('activate', \&evt_take_screenshot, 'select'); $sm->{_menuitem_full}->signal_connect('activate', \&evt_take_screenshot, 'full'); $sm->{_menuitem_awindow}->signal_connect('activate', \&evt_take_screenshot, 'awindow'); $sm->{_menuitem_window}->signal_connect('activate', \&evt_take_screenshot, 'window'); #$sm->{_menuitem_section}->signal_connect('activate', \&evt_take_screenshot, 'section'); $sm->{_menuitem_menu}->signal_connect('activate', \&evt_take_screenshot, 'menu'); $sm->{_menuitem_tooltip}->signal_connect('activate', \&evt_take_screenshot, 'tooltip'); $sm->{_menuitem_iclipboard}->signal_connect('activate', \&fct_clipboard_import); unless ($x11_supported) { for my $name ('selection', 'awindow', 'window', 'menu', 'tooltip') { $sm->{"_menuitem_$name"}->set_sensitive(FALSE); } } #gnome web photo is optional, don't enable it when gnome-web-photo is not in PATH if ($gnome_web_photo) { $sm->{_menuitem_web}->set_sensitive(TRUE); $sm->{_menuitem_web}->signal_connect('activate', \&evt_take_screenshot, 'web'); } else { $sm->{_menuitem_web}->set_sensitive(FALSE); } #~ $sm->{_menuitem_save}->signal_connect( 'activate', \&evt_save_as, 'menu_save' ); $sm->{_menuitem_save_as}->signal_connect('activate', \&evt_save_as, 'menu_save_as'); #~ $sm->{_menuitem_export_svg}->signal_connect( 'activate', \&evt_save_as, 'menu_export_svg' ); $sm->{_menuitem_export_pdf}->signal_connect('activate', \&evt_save_as, 'menu_export_pdf'); $sm->{_menuitem_export_pscript}->signal_connect('activate', \&evt_save_as, 'menu_export_ps'); $sm->{_menuitem_print}->signal_connect('activate', \&fct_print, 'menu_print'); $sm->{_menuitem_pagesetup}->signal_connect('activate', \&evt_page_setup, 'menu_pagesetup'); $sm->{_menuitem_email}->signal_connect('activate', \&fct_email, 'menu_email'); $sm->{_menuitem_close}->signal_connect('activate', sub { fct_remove(undef, 'menu_close'); }); $sm->{_menuitem_close_all}->signal_connect('activate', sub { fct_select_all(); fct_remove(undef, 'menu_close_all'); }); $sm->{_menuitem_quit}->signal_connect('activate', \&evt_delete_window, 'quit'); $sm->{_menuitem_undo}->signal_connect('activate', \&fct_undo); $sm->{_menuitem_redo}->signal_connect('activate', \&fct_redo); $sm->{_menuitem_copy}->signal_connect('activate', \&fct_clipboard, 'image'); $sm->{_menuitem_copy_filename}->signal_connect('activate', \&fct_clipboard, 'text'); $sm->{_menuitem_trash}->signal_connect('activate', sub { fct_delete(undef); }); $sm->{_menuitem_select_all}->signal_connect('activate', \&fct_select_all); $sm->{_menuitem_settings}->signal_connect('activate', \&evt_show_settings); $sm->{_menuitem_btoolbar}->signal_connect('toggled', \&fct_navigation_toolbar); $sm->{_menuitem_zoom_in}->signal_connect('activate', \&fct_zoom_in); $sm->{_menuitem_zoom_out}->signal_connect('activate', \&fct_zoom_out); $sm->{_menuitem_zoom_100}->signal_connect('activate', \&fct_zoom_100); $sm->{_menuitem_zoom_best}->signal_connect('activate', \&fct_zoom_best); $sm->{_menuitem_fullscreen}->signal_connect('toggled', \&fct_fullscreen); #screenshot menu #~ $sm->{_menu_actions}->signal_connect( 'focus', sub { $sm->{_menuitem_reopen}->set_submenu(&fct_ret_program_menu); }); $sm->{_menuitem_reopen}->set_submenu(fct_ret_program_menu()); $sm->{_menuitem_show_in_folder}->signal_connect('activate', \&fct_show_in_folder); $sm->{_menuitem_rename}->signal_connect('activate', \&fct_rename); $sm->{_menuitem_upload}->signal_connect('activate', \&fct_upload); #nautilus-sendto is optional, don't enable it when not installed if ($nautilus_sendto) { $sm->{_menuitem_send}->signal_connect('activate', \&fct_send); } else { $sm->{_menuitem_send}->set_sensitive(FALSE); } #goocanvas is optional, don't enable it when not installed if ($goocanvas) { $sm->{_menuitem_draw}->signal_connect('activate', \&fct_draw); } else { $sm->{_menuitem_draw}->set_sensitive(FALSE); } $sm->{_menuitem_plugin}->signal_connect('activate', \&fct_plugin); $sm->{_menuitem_redoshot_this}->signal_connect('activate', \&evt_take_screenshot, 'redoshot_this'); #large screenshot menu $sm->{_menu_large_actions}->signal_connect( 'focus', sub { $sm->{_menuitem_large_reopen}->set_submenu(fct_ret_program_menu($sm->{_menuitem_large_reopen}->get_submenu)); }); $sm->{_menuitem_large_reopen}->set_submenu(fct_ret_program_menu()); $sm->{_menuitem_large_show_in_folder}->signal_connect('activate', \&fct_show_in_folder); $sm->{_menuitem_large_rename}->signal_connect('activate', \&fct_rename); $sm->{_menuitem_large_copy}->signal_connect('activate', \&fct_clipboard, 'image'); $sm->{_menuitem_large_copy_filename}->signal_connect('activate', \&fct_clipboard, 'text'); $sm->{_menuitem_large_trash}->signal_connect('activate', sub { fct_delete(undef); }); $sm->{_menuitem_large_upload}->signal_connect('activate', \&fct_upload); #nautilus-sendto is optional, don't enable it when not installed if ($nautilus_sendto) { $sm->{_menuitem_large_send}->signal_connect('activate', \&fct_send); } else { $sm->{_menuitem_large_send}->set_sensitive(FALSE); } #goocanvas is optional, don't enable it when not installed if ($goocanvas) { $sm->{_menuitem_large_draw}->signal_connect('activate', \&fct_draw); } else { $sm->{_menuitem_large_draw}->set_sensitive(FALSE); } $sm->{_menuitem_large_plugin}->signal_connect('activate', \&fct_plugin); $sm->{_menuitem_large_redoshot_this}->signal_connect('activate', \&evt_take_screenshot, 'redoshot_this'); #go to menu $sm->{_menuitem_back}->signal_connect( 'activate' => sub { $notebook->prev_page; }); $sm->{_menuitem_forward}->signal_connect( 'activate' => sub { $notebook->next_page; }); $sm->{_menuitem_first}->signal_connect( 'activate' => sub { $notebook->set_current_page(0); }); $sm->{_menuitem_last}->signal_connect( 'activate' => sub { $notebook->set_current_page($notebook->get_n_pages - 1); }); #help $sm->{_menuitem_question}->signal_connect('activate', \&evt_question); $sm->{_menuitem_translate}->signal_connect('activate', \&evt_translate); $sm->{_menuitem_bug}->signal_connect('activate', \&evt_bug); $sm->{_menuitem_about}->signal_connect('activate', \&evt_about); #-------------------------------------- #trayicon #-------------------------------------- #command line param set to disable tray icon? unless ($sc->get_disable_systray) { fct_try_init_tray(); Glib::Timeout->add(10000, sub { if (!$tray_legacy || !$tray_legacy->is_embedded) { fct_try_init_tray(); } return TRUE; }); } #-------------------------------------- #settings #-------------------------------------- my $vbox_settings = Gtk3::VBox->new(FALSE, 12); my $hbox_settings = Gtk3::HBox->new(FALSE, 12); my $vbox_basic = Gtk3::VBox->new(FALSE, 12); my $vbox_advanced = Gtk3::VBox->new(FALSE, 12); my $vbox_actions = Gtk3::VBox->new(FALSE, 12); my $vbox_imageview = Gtk3::VBox->new(FALSE, 12); my $vbox_behavior = Gtk3::VBox->new(FALSE, 12); my $vbox_keyboard = Gtk3::VBox->new(FALSE, 12); my $vbox_accounts = Gtk3::VBox->new(FALSE, 12); #profiles my $profiles_box = Gtk3::HBox->new(FALSE, 0); #main my $file_vbox = Gtk3::VBox->new(FALSE, 0); my $save_vbox = Gtk3::VBox->new(FALSE, 0); my $capture_vbox = Gtk3::VBox->new(FALSE, 0); my $scale_box = Gtk3::HBox->new(FALSE, 0); my $filetype_box = Gtk3::HBox->new(FALSE, 0); my $filename_box = Gtk3::HBox->new(FALSE, 0); my $saveDir_box = Gtk3::HBox->new(FALSE, 0); my $save_ask_box = Gtk3::HBox->new(FALSE, 0); my $save_no_box = Gtk3::HBox->new(FALSE, 0); my $save_auto_box = Gtk3::HBox->new(FALSE, 0); my $no_autocopy_box = Gtk3::HBox->new(FALSE, 0); my $image_autocopy_box = Gtk3::HBox->new(FALSE, 0); my $fname_autocopy_box = Gtk3::HBox->new(FALSE, 0); my $delay_box = Gtk3::HBox->new(FALSE, 0); my $cursor_box = Gtk3::HBox->new(FALSE, 0); #actions my $actions_vbox = Gtk3::VBox->new(FALSE, 0); my $progname_box = Gtk3::HBox->new(FALSE, 0); my $im_colors_box = Gtk3::HBox->new(FALSE, 0); my $thumbnail_box = Gtk3::HBox->new(FALSE, 0); my $bordereffect_box = Gtk3::HBox->new(FALSE, 0); #advanced my $sel_capture_vbox = Gtk3::VBox->new(FALSE, 0); my $window_capture_vbox = Gtk3::VBox->new(FALSE, 0); my $menu_capture_vbox = Gtk3::VBox->new(FALSE, 0); my $web_capture_vbox = Gtk3::VBox->new(FALSE, 0); my $zoom_box = Gtk3::HBox->new(FALSE, 0); my $as_help_box = Gtk3::HBox->new(FALSE, 0); my $as_confirmation_box = Gtk3::HBox->new(FALSE, 0); my $asel_isize_box = Gtk3::HBox->new(FALSE, 0); my $asel_isize_box2 = Gtk3::HBox->new(FALSE, 0); my $border_box = Gtk3::HBox->new(FALSE, 0); my $winresize_box = Gtk3::HBox->new(FALSE, 0); my $autoshape_box = Gtk3::HBox->new(FALSE, 0); my $visible_windows_box = Gtk3::HBox->new(FALSE, 0); my $menu_delay_box = Gtk3::HBox->new(FALSE, 0); my $menu_waround_box = Gtk3::HBox->new(FALSE, 0); my $web_width_box = Gtk3::HBox->new(FALSE, 0); #imageview my $transparent_vbox = Gtk3::VBox->new(FALSE, 0); my $imageview_hbox1 = Gtk3::HBox->new(FALSE, 0); my $imageview_hbox2 = Gtk3::HBox->new(FALSE, 0); my $imageview_hbox3 = Gtk3::HBox->new(FALSE, 0); my $session_vbox = Gtk3::VBox->new(FALSE, 0); my $session_hbox1 = Gtk3::HBox->new(FALSE, 0); my $session_hbox2 = Gtk3::HBox->new(FALSE, 0); #behavior my $first_vbox = Gtk3::VBox->new(FALSE, 0); my $window_vbox = Gtk3::VBox->new(FALSE, 0); my $notify_vbox = Gtk3::VBox->new(FALSE, 0); my $trash_vbox = Gtk3::VBox->new(FALSE, 0); my $keybinding_vbox = Gtk3::VBox->new(FALSE, 0); my $fs_active_hbox = Gtk3::HBox->new(FALSE, 0); my $fs_min_active_hbox = Gtk3::HBox->new(FALSE, 0); my $fs_nonot_active_hbox = Gtk3::HBox->new(FALSE, 0); my $hide_active_hbox = Gtk3::HBox->new(FALSE, 0); my $pafter_active_hbox = Gtk3::HBox->new(FALSE, 0); my $cac_hbox = Gtk3::HBox->new(FALSE, 0); my $hide_time_hbox = Gtk3::HBox->new(FALSE, 0); my $na_active_hbox = Gtk3::HBox->new(FALSE, 0); my $nt_active_hbox = Gtk3::HBox->new(FALSE, 0); my $npt_active_hbox = Gtk3::HBox->new(FALSE, 0); my $ns_combo_hbox = Gtk3::HBox->new(FALSE, 0); my $aod_active_hbox = Gtk3::HBox->new(FALSE, 0); my $doc_active_hbox = Gtk3::HBox->new(FALSE, 0); my $aofsd_active_hbox = Gtk3::HBox->new(FALSE, 0); #upload my $accounts_vbox = Gtk3::VBox->new(FALSE, 0); my $ftp_vbox = Gtk3::VBox->new(FALSE, 0); my $accounts_hbox = Gtk3::HBox->new(FALSE, 0); my $ftp_hbox1 = Gtk3::HBox->new(FALSE, 0); my $ftp_hbox2 = Gtk3::HBox->new(FALSE, 0); my $ftp_hbox3 = Gtk3::HBox->new(FALSE, 0); my $ftp_hbox4 = Gtk3::HBox->new(FALSE, 0); my $ftp_hbox5 = Gtk3::HBox->new(FALSE, 0); #plugins my $effects_vbox = Gtk3::VBox->new(FALSE, 0); #load settings #-------------------------------------- $settings_xml = fct_load_settings("start"); #load accounts for hosting services fct_load_accounts(); #load requested profile (argv) if (defined $sc->get_profile_to_start_with) { $settings_xml = fct_load_settings("start", $sc->get_profile_to_start_with); } else { #or load last used profile if (defined $settings_xml->{'general'}->{'last_profile'}) { if ($settings_xml->{'general'}->{'last_profile'} != -1) { $settings_xml = fct_load_settings("start", $settings_xml->{'general'}->{'last_profile_name'}); } } } #-------------------------------------- #block signals while checking plugins / opening files fct_control_signals('block'); #check plugins #-------------------------------------- #not used in a standalone environment unless ($ENV{PAR_TEMP}) { fct_check_installed_plugins(); } #check upload plugins #-------------------------------------- #not used in a standalone environment unless ($ENV{PAR_TEMP}) { fct_check_installed_upload_plugins(); } unless ($x11_supported) { my $wayland_warning = Gtk3::Label->new; $wayland_warning->set_line_wrap(TRUE); $wayland_warning->set_markup($d->get("Wayland support is limited, for more advanced screenshots please switch back to Xorg. Click here for details.")); $vbox->pack_start($wayland_warning, FALSE, TRUE, 0); } $vbox->pack_start($st->create_toolbar, FALSE, TRUE, 0); $st->{_redoshot}->signal_connect('clicked' => \&evt_take_screenshot, 'redoshot'); $st->{_redoshot}->set_sensitive(FALSE); $st->{_select}->signal_connect('clicked' => \&evt_take_screenshot, 'select'); $current_monitor_active = undef; $st->{_full}->signal_connect('clicked' => \&evt_take_screenshot, 'full'); #init menus if ($x11_supported){ $st->{_full}->set_menu(fct_ret_workspace_menu(TRUE)); } $st->{_window}->set_menu(fct_ret_window_menu()); #and attach signal handlers $st->{_full}->signal_connect('show-menu' => sub { $st->{_full}->set_menu(fct_ret_workspace_menu(FALSE)) }); $st->{_window}->signal_connect('clicked' => \&evt_take_screenshot, 'window'); $st->{_window}->signal_connect('show-menu' => sub { $st->{_window}->set_menu(fct_ret_window_menu()) }); #$st->{_section}->signal_connect('clicked' => \&evt_take_screenshot, 'section'); $st->{_menu}->signal_connect('clicked' => \&evt_take_screenshot, 'menu'); $st->{_tooltip}->signal_connect('clicked' => \&evt_take_screenshot, 'tooltip'); #gnome-web-photo is optional, don't enable it when gnome-web-photo is not in PATH if ($gnome_web_photo) { $st->{_web}->set_sensitive(TRUE); $st->{_web}->signal_connect('clicked' => \&evt_take_screenshot, 'web'); $st->{_web}->set_menu(fct_ret_web_menu()); $st->{_web}->signal_connect('show-menu' => \&fct_ret_web_menu); } else { $st->{_web}->set_tooltip_text($d->get("gnome-web-photo needs to be installed for this feature")); $st->{_web}->set_arrow_tooltip_text($d->get("gnome-web-photo needs to be installed for this feature")); $st->{_web}->set_sensitive(FALSE); } #goocanvas is optional, don't enable it when not installed if ($goocanvas) { $st->{_edit}->signal_connect('clicked' => \&fct_draw); } else { $st->{_edit}->set_tooltip_text($d->get("Goo::Canvas/libgoo-canvas-perl needs to be installed for this feature")); } $st->{_edit}->set_sensitive(FALSE); $st->{_upload}->signal_connect('clicked' => \&fct_upload); $st->{_upload}->set_sensitive(FALSE); unless ($x11_supported) { my $tooltip = $d->get("Can't take screenshots without X11 server"); for my $name ('_select', '_window', '_menu', '_tooltip') { $st->{$name}->set_sensitive(FALSE); $st->{$name}->set_tooltip_text($tooltip); } for my $name ('_full', '_window') { $st->{$name}->set_arrow_tooltip_text($tooltip); } } #-------------------------------------- #handle profiles #-------------------------------------- $combobox_settings_profiles = Gtk3::ComboBoxText->new; my @current_profiles; my $current_index = 0; foreach my $pfile (sort +bsd_glob("$ENV{'HOME'}/.shutter/profiles/*.xml")) { utf8::decode $pfile; next if $pfile =~ /\_accounts.xml/; #accounts file - we are looking for "real" profiles $pfile =~ /.*\/(.*)\.xml/; #get profiles name my $last_profile_name = $1; $combobox_settings_profiles->append_text($last_profile_name); #set active profile if (exists $settings_xml->{'general'}->{'last_profile_name'}) { if ($settings_xml->{'general'}->{'last_profile_name'} eq $last_profile_name) { $combobox_settings_profiles->set_active($current_index); $current_profile_indx = $current_index; } } push(@current_profiles, $last_profile_name); $current_index++; } $combobox_settings_profiles->set_tooltip_text($d->get("Choose a profile")); #set 0 if nothing is selected yet if (!$combobox_settings_profiles->get_active_text) { $combobox_settings_profiles->set_active(0); $current_profile_indx = 0; } my $button_profile_save = Gtk3::Button->new; $button_profile_save->signal_connect( 'clicked' => sub { my $widget = shift; evt_save_profile($widget, $combobox_settings_profiles, \@current_profiles); }); $button_profile_save->set_image(Gtk3::Image->new_from_stock('gtk-save', 'button')); $button_profile_save->set_tooltip_text($d->get("Save configuration as profile")); my $button_profile_delete = Gtk3::Button->new; $button_profile_delete->signal_connect( 'clicked' => sub { my $widget = shift; evt_delete_profile($widget, $combobox_settings_profiles, \@current_profiles); }); $button_profile_delete->set_image(Gtk3::Image->new_from_stock('gtk-delete', 'button')); $button_profile_delete->set_tooltip_text($d->get("Delete profile")); my $button_profile_apply = Gtk3::Button->new; $button_profile_apply->signal_connect( 'clicked' => sub { my $widget = shift; evt_apply_profile($widget, $combobox_settings_profiles, \@current_profiles); }); $button_profile_apply->set_image(Gtk3::Image->new_from_stock('gtk-apply', 'button')); $button_profile_apply->set_tooltip_text($d->get("Load the selected profile's configuration")); #-------------------------------------- #frames and label for settings dialog #-------------------------------------- my $file_frame_label = Gtk3::Label->new; $file_frame_label->set_markup("" . $d->get("Image format") . ""); my $file_frame = Gtk3::Frame->new(); $file_frame->set_label_widget($file_frame_label); $file_frame->set_shadow_type('none'); my $save_frame_label = Gtk3::Label->new; $save_frame_label->set_markup("" . $d->get("Save") . ""); my $save_frame = Gtk3::Frame->new(); $save_frame->set_label_widget($save_frame_label); $save_frame->set_shadow_type('none'); my $firstlaunch_frame_label = Gtk3::Label->new; $firstlaunch_frame_label->set_markup("" . $d->get("First-launch Behavior") . ""); my $firstlaunch_frame = Gtk3::Frame->new(); $firstlaunch_frame->set_label_widget($firstlaunch_frame_label); $firstlaunch_frame->set_shadow_type('none'); my $window_frame_label = Gtk3::Label->new; $window_frame_label->set_markup("" . $d->get("Window Preferences") . ""); my $window_frame = Gtk3::Frame->new(); $window_frame->set_label_widget($window_frame_label); $window_frame->set_shadow_type('none'); my $notify_frame_label = Gtk3::Label->new; $notify_frame_label->set_markup("" . $d->get("Notifications") . ""); my $notify_frame = Gtk3::Frame->new(); $notify_frame->set_label_widget($notify_frame_label); $notify_frame->set_shadow_type('none'); my $trash_frame_label = Gtk3::Label->new; $trash_frame_label->set_markup("" . $d->get("Trash") . ""); my $trash_frame = Gtk3::Frame->new(); $trash_frame->set_label_widget($trash_frame_label); $trash_frame->set_shadow_type('none'); my $keybinding_frame_label = Gtk3::Label->new; $keybinding_frame_label->set_markup("" . $d->get("Gnome-Keybinding") . ""); my $keybinding_frame = Gtk3::Frame->new(); $keybinding_frame->set_label_widget($keybinding_frame_label); $keybinding_frame->set_shadow_type('none'); my $actions_frame_label = Gtk3::Label->new; $actions_frame_label->set_markup("" . $d->get("Actions") . ""); my $actions_frame = Gtk3::Frame->new(); $actions_frame->set_label_widget($actions_frame_label); $actions_frame->set_shadow_type('none'); my $capture_frame_label = Gtk3::Label->new; $capture_frame_label->set_markup("" . $d->get("Capture") . ""); my $capture_frame = Gtk3::Frame->new(); $capture_frame->set_label_widget($capture_frame_label); $capture_frame->set_shadow_type('none'); my $sel_capture_frame_label = Gtk3::Label->new; $sel_capture_frame_label->set_markup("" . $d->get("Selection Capture") . ""); my $sel_capture_frame = Gtk3::Frame->new(); $sel_capture_frame->set_label_widget($sel_capture_frame_label); $sel_capture_frame->set_shadow_type('none'); my $window_capture_frame_label = Gtk3::Label->new; $window_capture_frame_label->set_markup("" . $d->get("Window Capture") . ""); my $window_capture_frame = Gtk3::Frame->new(); $window_capture_frame->set_label_widget($window_capture_frame_label); $window_capture_frame->set_shadow_type('none'); my $menu_capture_frame_label = Gtk3::Label->new; $menu_capture_frame_label->set_markup("" . $d->get("Menu/Tooltip Capture") . ""); my $menu_capture_frame = Gtk3::Frame->new(); $menu_capture_frame->set_label_widget($menu_capture_frame_label); $menu_capture_frame->set_shadow_type('none'); my $web_capture_frame_label = Gtk3::Label->new; $web_capture_frame_label->set_markup("" . $d->get("Website Capture") . ""); my $web_capture_frame = Gtk3::Frame->new(); $web_capture_frame->set_label_widget($web_capture_frame_label); $web_capture_frame->set_shadow_type('none'); my $accounts_frame_label = Gtk3::Label->new; $accounts_frame_label->set_markup("" . $d->get("Accounts") . ""); my $accounts_frame = Gtk3::Frame->new(); $accounts_frame->set_label_widget($accounts_frame_label); $accounts_frame->set_shadow_type('none'); my $ftp_frame_label = Gtk3::Label->new; $ftp_frame_label->set_markup("" . $d->get("File Transfer Protocol (FTP)") . ""); my $ftp_frame = Gtk3::Frame->new(); $ftp_frame->set_label_widget($ftp_frame_label); $ftp_frame->set_shadow_type('none'); my $transparent_frame_label = Gtk3::Label->new; $transparent_frame_label->set_markup("" . $d->get("Transparent Parts") . ""); my $transparent_frame = Gtk3::Frame->new(); $transparent_frame->set_label_widget($transparent_frame_label); $transparent_frame->set_shadow_type('none'); my $session_frame_label = Gtk3::Label->new; $session_frame_label->set_markup("" . $d->get("Session View") . ""); my $session_frame = Gtk3::Frame->new(); $session_frame->set_label_widget($session_frame_label); $session_frame->set_shadow_type('none'); #filename #-------------------------------------- my $filename_label = Gtk3::Label->new($d->get("Filename") . ":"); $filename = Gtk3::Entry->new; if (defined $settings_xml->{'general'}->{'filename'}) { $filename->set_text($settings_xml->{'general'}->{'filename'}); } else { $filename->set_text("\$name_\%NNN"); } my $filename_hint = Gtk3::Label->new; $filename_hint->set_no_show_all(TRUE); fct_validate_filename($filename, $filename_hint); my $filename_tooltip_string = $d->get("There are several wildcards available, like\n") . $d->get("%Y = year\n") . $d->get("%m = month\n") . $d->get("%d = day\n") . $d->get("%T = time\n") . $d->get("\$w = width\n") . $d->get("\$h = height\n") . $d->get("\$name = multi-purpose (e.g. window title)\n") . $d->get("\$nb_name = like \$name but without blanks in resulting strings\n") . $d->get("\$profile = name of current profile\n") . $d->get("\$R = random char (e.g. \$RRRR = ag4r)\n") . $d->get("%NN = counter"); $filename->set_tooltip_text($filename_tooltip_string); $filename_label->set_tooltip_text($filename_tooltip_string); $filename_box->pack_start($filename_label, FALSE, TRUE, 12); $filename_box->pack_start($filename, TRUE, TRUE, 0); #end - filename #-------------------------------------- #filetype and scale #-------------------------------------- $scale = Gtk3::HScale->new_with_range(0, 9, 1); $scale_label = Gtk3::Label->new($d->get("Compression") . ":"); $scale->set_value_pos('right'); $scale->set_value(1); #we don't need a default here because it will be set through signal handling (filetype) if (defined $settings_xml->{'general'}->{'quality'}) { $scale->set_value($settings_xml->{'general'}->{'quality'}); } $scale->set_tooltip_text($d->get("Adjust quality/compression value")); $scale_label->set_tooltip_text($d->get("Adjust quality/compression value")); $scale_box->pack_start($scale_label, FALSE, TRUE, 12); $scale_box->pack_start($scale, TRUE, TRUE, 0); #add compatile, writeable file types $combobox_type = Gtk3::ComboBoxText->new; foreach my $format (Gtk3::Gdk::Pixbuf::get_formats()) { my $format_name = $format->get_name; if ( $format_name eq "jpeg" || $format_name eq "png" || $format_name eq "bmp" || $format_name eq "webp" || $format_name eq "avif") { #we want jpg not jpeg if ($format_name eq "jpeg" || $format_name eq "jpg") { $format_name = "jpg"; } $combobox_type->append_text($format_name . " - " . $format->get_description); push(@supported_formats, $format_name); } } $combobox_type->signal_connect( 'changed' => \&evt_value_changed, 'type_changed' ); $scale->signal_connect( 'value-changed' => \&evt_value_changed, 'qvalue_changed' ); if (defined $settings_xml->{'general'}->{'filetype'}) { $combobox_type->set_active($settings_xml->{'general'}->{'filetype'}); #set saved quality/compression value if there is one if (defined $settings_xml->{'general'}->{'quality'}) { $scale->set_value($settings_xml->{'general'}->{'quality'}); } } else { #we will try to set a default value in this order foreach my $i (0 .. $#supported_formats) { $combobox_type->set_active($i); last; } } my $filetype_label = Gtk3::Label->new($d->get("Image format") . ":"); $combobox_type->set_tooltip_text($d->get("Select a file format")); $filetype_label->set_tooltip_text($d->get("Select a file format")); $filetype_box->pack_start($filetype_label, FALSE, TRUE, 12); $filetype_box->pack_start($combobox_type, TRUE, TRUE, 0); #end - filetype and scale #-------------------------------------- #saveDir #-------------------------------------- my $saveDir_label = Gtk3::Label->new($d->get("Directory") . ":"); $saveDir_button = Gtk3::FileChooserButton->new("Shutter - " . $d->get("Choose folder"), 'select-folder'); for my $saveDir_dir ($settings_xml->{'general'}->{'folder'}, Glib::get_user_special_dir('pictures'), Glib::get_home_dir()) { if (defined $saveDir_dir) { $saveDir_button->set_current_folder($saveDir_dir); last; } } $saveDir_button->set_tooltip_text($d->get("Your screenshots will be saved to this directory")); $saveDir_label->set_tooltip_text($d->get("Your screenshots will be saved to this directory")); $saveDir_box->pack_start($saveDir_label, FALSE, TRUE, 12); $saveDir_box->pack_start($saveDir_button, TRUE, TRUE, 0); #end - saveDir #-------------------------------------- #save options #-------------------------------------- $save_ask_active = Gtk3::RadioButton->new_with_label(undef, $d->get("Browse for save folder every time")); $save_ask_box->pack_start($save_ask_active, FALSE, TRUE, 12); $save_ask_active->set_tooltip_text($d->get("Browse for save folder every time")); $save_no_active = Gtk3::RadioButton->new_with_label($save_ask_active, $d->get("Do not save file automatically")); $save_no_box->pack_start($save_no_active, FALSE, TRUE, 12); $save_no_active->set_tooltip_text($d->get("Do not save file automatically")); $save_auto_active = Gtk3::RadioButton->new_with_label($save_ask_active, $d->get("Automatically save file")); $save_auto_box->pack_start($save_auto_active, FALSE, TRUE, 12); $save_auto_active->set_tooltip_text($d->get("Automatically save file")); #default state $save_ask_active->set_active(FALSE); $save_no_active->set_active(FALSE); $save_auto_active->set_active(TRUE); if (defined $settings_xml->{'general'}->{'save_auto'}) { $save_auto_active->set_active($settings_xml->{'general'}->{'save_auto'}); } if (defined $settings_xml->{'general'}->{'save_ask'}) { $save_ask_active->set_active($settings_xml->{'general'}->{'save_ask'}); } if (defined $settings_xml->{'general'}->{'save_no'}) { $save_no_active->set_active($settings_xml->{'general'}->{'save_no'}); } #end - save options #-------------------------------------- #image_autocopy #-------------------------------------- $image_autocopy_active = Gtk3::RadioButton->new_with_label(undef, $d->get("Automatically copy screenshot to clipboard")); $image_autocopy_box->pack_start($image_autocopy_active, FALSE, TRUE, 12); if (defined $settings_xml->{'general'}->{'image_autocopy'}) { $image_autocopy_active->set_active($settings_xml->{'general'}->{'image_autocopy'}); } else { $image_autocopy_active->set_active(TRUE); } $image_autocopy_active->set_tooltip_text($d->get("Automatically copy screenshot to clipboard")); #end - image_autocopy #-------------------------------------- #fname_autocopy #-------------------------------------- $fname_autocopy_active = Gtk3::RadioButton->new_with_label($image_autocopy_active, $d->get("Automatically copy filename to clipboard")); $fname_autocopy_box->pack_start($fname_autocopy_active, FALSE, TRUE, 12); if (defined $settings_xml->{'general'}->{'fname_autocopy'}) { $fname_autocopy_active->set_active($settings_xml->{'general'}->{'fname_autocopy'}); } else { $fname_autocopy_active->set_active(FALSE); } $fname_autocopy_active->set_tooltip_text($d->get("Automatically copy filename to clipboard")); #end - fname_autocopy #-------------------------------------- #no_autocopy #-------------------------------------- $no_autocopy_active = Gtk3::RadioButton->new_with_label($image_autocopy_active, $d->get("Do not copy anything to clipboard")); $no_autocopy_box->pack_start($no_autocopy_active, FALSE, TRUE, 12); if (defined $settings_xml->{'general'}->{'no_autocopy'}) { $no_autocopy_active->set_active($settings_xml->{'general'}->{'no_autocopy'}); } else { $no_autocopy_active->set_active(FALSE); } $no_autocopy_active->set_tooltip_text($d->get("Do not copy anything to clipboard")); #end - no_autocopy #-------------------------------------- #delay #-------------------------------------- #delay statusbar my $delay_status_label = Gtk3::Label->new($d->get("Delay") . ":"); $delay_status = Gtk3::SpinButton->new_with_range(0, 99, 1); $delay_status_vlabel = Gtk3::Label->new($d->nget("second", "seconds", $delay_status->get_value)); $delay_status->signal_connect( 'value-changed' => \&evt_value_changed, 'delay_status_changed' ); #delay settings dialog my $delay_label = Gtk3::Label->new($d->get("Capture after a delay of")); $delay = Gtk3::SpinButton->new_with_range(0, 99, 1); $delay_vlabel = Gtk3::Label->new($d->nget("second", "seconds", $delay->get_value)); $delay->signal_connect( 'value-changed' => \&evt_value_changed, 'delay_changed' ); if (defined $settings_xml->{'general'}->{'delay'}) { $delay->set_value($settings_xml->{'general'}->{'delay'}); } else { $delay->set_value(0); } $delay->set_tooltip_text($d->get("Wait n seconds before taking a screenshot")); $delay_label->set_tooltip_text($d->get("Wait n seconds before taking a screenshot")); $delay_vlabel->set_tooltip_text($d->get("Wait n seconds before taking a screenshot")); $delay_status->set_tooltip_text($d->get("Wait n seconds before taking a screenshot")); $delay_status_label->set_tooltip_text($d->get("Wait n seconds before taking a screenshot")); $delay_status_vlabel->set_tooltip_text($d->get("Wait n seconds before taking a screenshot")); $delay_box->pack_start($delay_label, FALSE, FALSE, 12); $delay_box->pack_start($delay, FALSE, FALSE, 0); $delay_box->pack_start($delay_vlabel, FALSE, FALSE, 2); #end - delay #-------------------------------------- #cursor #-------------------------------------- $cursor_status_active = Gtk3::CheckButton->new_with_label($d->get("Include Cursor")); $cursor_status_active->set_tooltip_text($d->get("Include cursor when taking a screenshot")); $cursor_status_active->signal_connect( 'toggled' => \&evt_value_changed, 'cursor_status_toggled' ); $cursor_active = Gtk3::CheckButton->new_with_label($d->get("Include cursor when taking a screenshot")); $cursor_active->set_tooltip_text($d->get("Include cursor when taking a screenshot")); $cursor_active->signal_connect( 'toggled' => \&evt_value_changed, 'cursor_toggled' ); $cursor_box->pack_start($cursor_active, FALSE, TRUE, 12); if (defined $settings_xml->{'general'}->{'cursor'}) { $cursor_active->set_active($settings_xml->{'general'}->{'cursor'}); } else { $cursor_active->set_active(FALSE); } #end - cursor #-------------------------------------- #program #-------------------------------------- my $model = fct_get_program_model(); $progname = Gtk3::ComboBox->new_with_model($model); #add pixbuf renderer for icon my $renderer_pix = Gtk3::CellRendererPixbuf->new; $progname->pack_start($renderer_pix, FALSE); $progname->add_attribute($renderer_pix, pixbuf => 0); #add text renderer for app name my $renderer_text = Gtk3::CellRendererText->new; $progname->pack_start($renderer_text, FALSE); $progname->add_attribute($renderer_text, text => 1); #try to set the saved value if (defined $settings_xml->{'general'}->{'prog'}) { $model->foreach(\&fct_iter_programs, $settings_xml->{'general'}->{'prog'}); } else { $progname->set_active(0); } #nothing has been set if ($progname->get_active == -1) { $progname->set_active(0); } $progname_active = Gtk3::CheckButton->new; $progname_active->set_active(TRUE); $progname_active->signal_connect( 'toggled' => \&evt_value_changed, 'progname_toggled' ); if (defined $settings_xml->{'general'}->{'prog_active'}) { $progname_active->set_active($settings_xml->{'general'}->{'prog_active'}); } else { $progname_active->set_active(FALSE); } my $progname_label = Gtk3::Label->new($d->get("Open with") . ":"); $progname->set_tooltip_text($d->get("Open your screenshot with this program after capturing")); $progname_active->set_tooltip_text($d->get("Open your screenshot with this program after capturing")); $progname_label->set_tooltip_text($d->get("Open your screenshot with this program after capturing")); $progname_box->pack_start($progname_label, FALSE, TRUE, 12); $progname_box->pack_start($progname_active, FALSE, TRUE, 0); $progname_box->pack_start($progname, TRUE, TRUE, 0); #end - program #-------------------------------------- #im_colors #-------------------------------------- $combobox_im_colors = Gtk3::ComboBoxText->new; $combobox_im_colors->insert_text(0, $d->get("16 colors - (4bit) ")); $combobox_im_colors->insert_text(1, $d->get("64 colors - (6bit) ")); $combobox_im_colors->insert_text(2, $d->get("256 colors - (8bit) ")); $combobox_im_colors->signal_connect( 'changed' => \&evt_value_changed, 'im_colors_changed' ); if (defined $settings_xml->{'general'}->{'im_colors'}) { $combobox_im_colors->set_active($settings_xml->{'general'}->{'im_colors'}); } else { $combobox_im_colors->set_active(2); } $im_colors_active = Gtk3::CheckButton->new; $im_colors_active->set_active(TRUE); $im_colors_active->signal_connect( 'toggled' => \&evt_value_changed, 'im_colors_toggled' ); if (defined $settings_xml->{'general'}->{'im_colors_active'}) { $im_colors_active->set_active($settings_xml->{'general'}->{'im_colors_active'}); } else { $im_colors_active->set_active(FALSE); } my $im_colors_label = Gtk3::Label->new($d->get("Reduce colors") . ":"); $combobox_im_colors->set_tooltip_text($d->get("Automatically reduce colors after taking a screenshot")); $im_colors_active->set_tooltip_text($d->get("Automatically reduce colors after taking a screenshot")); $im_colors_label->set_tooltip_text($d->get("Automatically reduce colors after taking a screenshot")); $im_colors_box->pack_start($im_colors_label, FALSE, TRUE, 12); $im_colors_box->pack_start($im_colors_active, FALSE, TRUE, 0); $im_colors_box->pack_start($combobox_im_colors, TRUE, TRUE, 0); #end - colors #-------------------------------------- #thumbnail #-------------------------------------- my $thumbnail_label = Gtk3::Label->new($d->get("Thumbnail") . ":"); $thumbnail = Gtk3::HScale->new_with_range(1, 100, 1); $thumbnail->signal_connect( 'value-changed' => \&evt_value_changed, 'thumbnail_changed' ); $thumbnail->set_value_pos('right'); if (defined $settings_xml->{'general'}->{'thumbnail'}) { $thumbnail->set_value($settings_xml->{'general'}->{'thumbnail'}); } else { $thumbnail->set_value(50); } $thumbnail_active = Gtk3::CheckButton->new; $thumbnail_active->set_active(TRUE); $thumbnail_active->signal_connect( 'toggled' => \&evt_value_changed, 'thumbnail_toggled' ); if (defined $settings_xml->{'general'}->{'thumbnail_active'}) { $thumbnail_active->set_active($settings_xml->{'general'}->{'thumbnail_active'}); } else { $thumbnail_active->set_active(FALSE); } $thumbnail->set_tooltip_text($d->get("Generate thumbnail too.\nselect the percentage of the original size for the thumbnail to be")); $thumbnail_active->set_tooltip_text($d->get("Generate thumbnail too.\nselect the percentage of the original size for the thumbnail to be")); $thumbnail_label->set_tooltip_text($d->get("Generate thumbnail too.\nselect the percentage of the original size for the thumbnail to be")); $thumbnail_box->pack_start($thumbnail_label, FALSE, TRUE, 12); $thumbnail_box->pack_start($thumbnail_active, FALSE, FALSE, 0); $thumbnail_box->pack_start($thumbnail, TRUE, TRUE, 0); #end - thumbnail #-------------------------------------- #bordereffect #-------------------------------------- $bordereffect_active = Gtk3::CheckButton->new; $bordereffect_active->set_active(TRUE); my $bordereffect_label = Gtk3::Label->new($d->get("Border") . ":"); $bordereffect = Gtk3::SpinButton->new_with_range(1, 100, 1); $bordereffect_vlabel = Gtk3::Label->new($d->get("pixels")); my $bordereffect_clabel = Gtk3::Label->new($d->get("Color") . ":"); $bordereffect_cbtn = Gtk3::ColorButton->new(); $bordereffect_cbtn->set_use_alpha(FALSE); $bordereffect_cbtn->set_title($d->get("Choose border color")); $bordereffect_active->set_tooltip_text($d->get("Adds a border effect to the screenshot")); $bordereffect->set_tooltip_text($d->get("Adds a border effect to the screenshot")); $bordereffect_label->set_tooltip_text($d->get("Adds a border effect to the screenshot")); $bordereffect_clabel->set_tooltip_text($d->get("Choose border color")); $bordereffect_cbtn->set_tooltip_text($d->get("Choose border color")); $bordereffect_box->pack_start($bordereffect_label, FALSE, TRUE, 12); $bordereffect_box->pack_start($bordereffect_active, FALSE, FALSE, 0); $bordereffect_box->pack_start($bordereffect, TRUE, TRUE, 2); $bordereffect_box->pack_start($bordereffect_vlabel, FALSE, FALSE, 2); $bordereffect_box->pack_start($bordereffect_clabel, FALSE, FALSE, 12); $bordereffect_box->pack_start($bordereffect_cbtn, FALSE, FALSE, 0); $bordereffect_active->signal_connect( 'toggled' => \&evt_value_changed, 'bordereffect_toggled' ); $bordereffect->signal_connect( 'value-changed' => \&evt_value_changed, 'bordereffect_changed' ); if (defined $settings_xml->{'general'}->{'bordereffect_active'}) { $bordereffect_active->set_active($settings_xml->{'general'}->{'bordereffect_active'}); } else { $bordereffect_active->set_active(FALSE); } if (defined $settings_xml->{'general'}->{'bordereffect'}) { $bordereffect->set_value($settings_xml->{'general'}->{'bordereffect'}); } else { $bordereffect->set_value(2); } if (defined $settings_xml->{'general'}->{'bordereffect_col'}) { $bordereffect_cbtn->set_rgba(Gtk3::Gdk::RGBA::parse($settings_xml->{'general'}->{'bordereffect_col'})); } else { $bordereffect_cbtn->set_rgba(Gtk3::Gdk::RGBA::parse('black')); } #end - bordereffect #-------------------------------------- #zoom window #-------------------------------------- $zoom_active = Gtk3::CheckButton->new_with_label($d->get("Enable zoom window")); if (defined $settings_xml->{'general'}->{'zoom_active'}) { $zoom_active->set_active($settings_xml->{'general'}->{'zoom_active'}); } else { $zoom_active->set_active(TRUE); } $zoom_active->set_tooltip_text($d->get("Enable zoom window")); $zoom_box->pack_start($zoom_active, FALSE, TRUE, 12); #end - zoom window #-------------------------------------- #initial size for selection tool #-------------------------------------- my $asel_size_label1 = Gtk3::Label->new($d->get("Start with selection size of")); my $asel_size_label2 = Gtk3::Label->new("x"); my $asel_size_label3 = Gtk3::Label->new($d->get("at")); my $asel_size_label4 = Gtk3::Label->new(","); $asel_size1 = Gtk3::SpinButton->new_with_range(0, 10000, 1); $asel_size2 = Gtk3::SpinButton->new_with_range(0, 10000, 1); $asel_size3 = Gtk3::SpinButton->new_with_range(0, 10000, 1); $asel_size4 = Gtk3::SpinButton->new_with_range(0, 10000, 1); my $asel_size_vlabel1 = Gtk3::Label->new($d->get("pixels")); my $asel_size_vlabel2 = Gtk3::Label->new($d->get("pixels")); if (defined $settings_xml->{'general'}->{'asel_x'}) { $asel_size3->set_value($settings_xml->{'general'}->{'asel_x'}); } else { $asel_size3->set_value(0); } if (defined $settings_xml->{'general'}->{'asel_y'}) { $asel_size4->set_value($settings_xml->{'general'}->{'asel_y'}); } else { $asel_size4->set_value(0); } if (defined $settings_xml->{'general'}->{'asel_w'}) { $asel_size1->set_value($settings_xml->{'general'}->{'asel_w'}); } else { $asel_size1->set_value(0); } if (defined $settings_xml->{'general'}->{'asel_h'}) { $asel_size2->set_value($settings_xml->{'general'}->{'asel_h'}); } else { $asel_size2->set_value(0); } $asel_size_label1->set_tooltip_text($d->get("Start Selection Tool with a customized selection size")); $asel_size_label2->set_tooltip_text($d->get("Start Selection Tool with a customized selection size")); $asel_size_label3->set_tooltip_text($d->get("Start Selection Tool with a customized selection size")); $asel_size_label4->set_tooltip_text($d->get("Start Selection Tool with a customized selection size")); $asel_size1->set_tooltip_text($d->get("Start Selection Tool with a customized selection size")); $asel_size2->set_tooltip_text($d->get("Start Selection Tool with a customized selection size")); $asel_size3->set_tooltip_text($d->get("Start Selection Tool with a customized selection size")); $asel_size4->set_tooltip_text($d->get("Start Selection Tool with a customized selection size")); $asel_size_vlabel1->set_tooltip_text($d->get("Start Selection Tool with a customized selection size")); $asel_size_vlabel2->set_tooltip_text($d->get("Start Selection Tool with a customized selection size")); $asel_isize_box->pack_start($asel_size_label1, FALSE, FALSE, 12); $asel_isize_box->pack_start($asel_size1, FALSE, FALSE, 0); $asel_isize_box->pack_start($asel_size_label2, FALSE, FALSE, 0); $asel_isize_box->pack_start($asel_size2, FALSE, FALSE, 0); $asel_isize_box->pack_start($asel_size_vlabel1, FALSE, FALSE, 2); $asel_isize_box2->pack_start($asel_size_label3, FALSE, FALSE, 12); $asel_isize_box2->pack_start($asel_size3, FALSE, FALSE, 0); $asel_isize_box2->pack_start($asel_size_label4, FALSE, FALSE, 0); $asel_isize_box2->pack_start($asel_size4, FALSE, FALSE, 0); $asel_isize_box2->pack_start($asel_size_vlabel2, FALSE, FALSE, 2); #end - initial size for advanced selection tool #-------------------------------------- #show help text when using advanced selection tool #-------------------------------------- $as_help_active = Gtk3::CheckButton->new_with_label($d->get("Show help text")); if (defined $settings_xml->{'general'}->{'as_help_active'}) { $as_help_active->set_active($settings_xml->{'general'}->{'as_help_active'}); } else { $as_help_active->set_active(TRUE); } $as_help_active->set_tooltip_text($d->get("Enables the help text")); $as_help_box->pack_start($as_help_active, FALSE, TRUE, 12); #end - show help text when using advanced selection tool #-------------------------------------- #confirmation is necessary in selection tool #-------------------------------------- $as_confirmation_necessary = Gtk3::CheckButton->new_with_label($d->get("Confirmation necessary")); if (defined $settings_xml->{'general'}->{'as_confirmation_necessary'}) { $as_confirmation_necessary->set_active($settings_xml->{'general'}->{'as_confirmation_necessary'}); } else { $as_confirmation_necessary->set_active(TRUE); } $as_confirmation_necessary->set_tooltip_text($d->get("Pressing the enter key or doubleclicking is necessary to take the screenshot")); $as_confirmation_box->pack_start($as_confirmation_necessary, FALSE, TRUE, 12); #end - confirmation is necessary in selection tool #-------------------------------------- #border #-------------------------------------- $border_active = Gtk3::CheckButton->new_with_label($d->get("Include window decoration when capturing a window")); $border_active->set_tooltip_text($d->get("Include window decoration when capturing a window")); $border_box->pack_start($border_active, FALSE, TRUE, 12); if (defined $settings_xml->{'general'}->{'border'}) { $border_active->set_active($settings_xml->{'general'}->{'border'}); } else { $border_active->set_active(TRUE); } #end - border #-------------------------------------- #window resize #-------------------------------------- my ($x, $y, $w, $h) = Gtk3::Gdk::get_default_root_window->get_geometry; $winresize_active = Gtk3::CheckButton->new_with_label($d->get("Automatically resize window to")); my $winresize_label = Gtk3::Label->new("x"); $winresize_w = Gtk3::SpinButton->new_with_range(0, $w, 1); $winresize_h = Gtk3::SpinButton->new_with_range(0, $h, 1); my $winresize_vlabel = Gtk3::Label->new($d->get("pixels")); if (defined $settings_xml->{'general'}->{'winresize_active'}) { $winresize_active->set_active($settings_xml->{'general'}->{'winresize_active'}); } else { $winresize_active->set_active(FALSE); } if (defined $settings_xml->{'general'}->{'winresize_w'}) { $winresize_w->set_value($settings_xml->{'general'}->{'winresize_w'}); } else { $winresize_w->set_value(500); } if (defined $settings_xml->{'general'}->{'winresize_h'}) { $winresize_h->set_value($settings_xml->{'general'}->{'winresize_h'}); } else { $winresize_h->set_value(500); } $winresize_active->set_tooltip_text($d->get( "This resizes the window automatically to the specified width and height. This method asks the window manager to resize the window. However, the window manager may not allow the resize.") ); $winresize_w->set_tooltip_text($d->get( "This resizes the window automatically to the specified width and height. This method asks the window manager to resize the window. However, the window manager may not allow the resize.") ); $winresize_label->set_tooltip_text($d->get( "This resizes the window automatically to the specified width and height. This method asks the window manager to resize the window. However, the window manager may not allow the resize.") ); $winresize_h->set_tooltip_text($d->get( "This resizes the window automatically to the specified width and height. This method asks the window manager to resize the window. However, the window manager may not allow the resize.") ); $winresize_vlabel->set_tooltip_text($d->get( "This resizes the window automatically to the specified width and height. This method asks the window manager to resize the window. However, the window manager may not allow the resize.") ); $winresize_box->pack_start($winresize_active, FALSE, FALSE, 12); $winresize_box->pack_start($winresize_w, FALSE, FALSE, 0); $winresize_box->pack_start($winresize_label, FALSE, FALSE, 0); $winresize_box->pack_start($winresize_h, FALSE, FALSE, 0); $winresize_box->pack_start($winresize_vlabel, FALSE, FALSE, 2); #end - window resize #-------------------------------------- #window autoshape #-------------------------------------- $autoshape_active = Gtk3::CheckButton->new_with_label($d->get("Force rounded window corners")); if (defined $settings_xml->{'general'}->{'autoshape_active'}) { $autoshape_active->set_active($settings_xml->{'general'}->{'autoshape_active'}); } else { $autoshape_active->set_active(FALSE); } $autoshape_active->set_tooltip_text( sprintf( $d->get( "Shutter uses the XShape extension to determine the window's shape, " . "but this does not work under some circumstances, e.g. when running compiz.\n\n" . "When this option is activated Shutter uses fixed parameters to round the window corners. " . "You can overwrite the default parameters by creating a file named ~/.shutter/shape.conf and put custom values in it. " . "The default values are stored in %s." ), "$shutter_root/share/shutter/resources/conf/shape.conf" )); $autoshape_box->pack_start($autoshape_active, FALSE, FALSE, 12); #end - window autoshape #-------------------------------------- #visible windows only #-------------------------------------- $visible_windows_active = Gtk3::CheckButton->new_with_label($d->get("Select only visible windows")); $visible_windows_active->set_tooltip_text($d->get("Select only visible windows")); $visible_windows_box->pack_start($visible_windows_active, FALSE, TRUE, 12); if (defined $settings_xml->{'general'}->{'visible_windows'}) { $visible_windows_active->set_active($settings_xml->{'general'}->{'visible_windows'}); } else { $visible_windows_active->set_active(FALSE); } #end - visible windows only #-------------------------------------- #menu capture delay #-------------------------------------- #delay settings dialog my $menu_delay_label = Gtk3::Label->new($d->get("Pre-Capture Delay") . ":"); $menu_delay = Gtk3::SpinButton->new_with_range(1, 99, 1); $menu_delay_vlabel = Gtk3::Label->new($d->nget("second", "seconds", $delay->get_value)); $menu_delay->signal_connect( 'value-changed' => \&evt_value_changed, 'menu_delay_changed' ); if (defined $settings_xml->{'general'}->{'menu_delay'}) { $menu_delay->set_value($settings_xml->{'general'}->{'menu_delay'}); } else { $menu_delay->set_value(10); } $menu_delay->set_tooltip_text($d->get("Capture menu/tooltip after a delay of n seconds")); $menu_delay_label->set_tooltip_text($d->get("Capture menu/tooltip after a delay of n seconds")); $menu_delay_vlabel->set_tooltip_text($d->get("Capture menu/tooltip after a delay of n seconds")); $menu_delay_box->pack_start($menu_delay_label, FALSE, TRUE, 12); $menu_delay_box->pack_start($menu_delay, FALSE, TRUE, 0); $menu_delay_box->pack_start($menu_delay_vlabel, FALSE, TRUE, 2); #end - menu capture delay #-------------------------------------- #menu/tooltip workaround #-------------------------------------- $menu_waround_active = Gtk3::CheckButton->new_with_label($d->get("Ignore possibly wrong type hints")); $menu_waround_active->set_tooltip_text($d->get( "The type hint constants specify hints for the window manager that indicate what type of function the window has. Sometimes these type hints are not correctly set. By enabling this option Shutter will not insist on the requested type hint." )); $menu_waround_box->pack_start($menu_waround_active, FALSE, TRUE, 12); if (defined $settings_xml->{'general'}->{'menu_waround'}) { $menu_waround_active->set_active($settings_xml->{'general'}->{'menu_waround'}); } else { $menu_waround_active->set_active(TRUE); } #end - menu/tooltip workaround #-------------------------------------- #web width #-------------------------------------- my $web_width_label = Gtk3::Label->new($d->get("Virtual browser width") . ":"); $combobox_web_width = Gtk3::ComboBoxText->new; $combobox_web_width->insert_text(0, "640"); $combobox_web_width->insert_text(1, "800"); $combobox_web_width->insert_text(2, "1024"); $combobox_web_width->insert_text(3, "1152"); $combobox_web_width->insert_text(4, "1280"); $combobox_web_width->insert_text(5, "1366"); $combobox_web_width->insert_text(6, "1440"); $combobox_web_width->insert_text(7, "1600"); $combobox_web_width->insert_text(8, "1680"); $combobox_web_width->insert_text(9, "1920"); $combobox_web_width->insert_text(10, "2048"); my $web_width_vlabel = Gtk3::Label->new($d->get("pixels")); if (defined $settings_xml->{'general'}->{'web_width'}) { $combobox_web_width->set_active($settings_xml->{'general'}->{'web_width'}); } else { $combobox_web_width->set_active(2); } $web_width_label->set_tooltip_text($d->get("Virtual browser width when taking a website screenshot")); $combobox_web_width->set_tooltip_text($d->get("Virtual browser width when taking a website screenshot")); $web_width_vlabel->set_tooltip_text($d->get("Virtual browser width when taking a website screenshot")); $web_width_box->pack_start($web_width_label, FALSE, TRUE, 12); $web_width_box->pack_start($combobox_web_width, FALSE, TRUE, 0); $web_width_box->pack_start($web_width_vlabel, FALSE, TRUE, 2); #end - web width #-------------------------------------- #imageview #-------------------------------------- $css_provider_alpha = Gtk3::CssProvider->new; $trans_check = Gtk3::RadioButton->new_with_label(undef, $d->get("Show as check pattern")); $trans_custom = Gtk3::RadioButton->new_with_label($trans_check, $d->get("Show as custom color:")); $trans_custom_btn = Gtk3::ColorButton->new(); $trans_custom_btn->set_use_alpha(FALSE); $trans_custom_btn->set_title($d->get("Choose fill color")); $trans_backg = Gtk3::RadioButton->new_with_label($trans_custom, $d->get("Show as background")); $imageview_hbox1->pack_start($trans_check, FALSE, TRUE, 12); $imageview_hbox2->pack_start($trans_custom, FALSE, TRUE, 12); $imageview_hbox2->pack_start($trans_custom_btn, FALSE, TRUE, 0); $imageview_hbox3->pack_start($trans_backg, FALSE, TRUE, 12); if (defined $settings_xml->{'general'}->{'trans_custom_col'}) { $trans_custom_btn->set_rgba(Gtk3::Gdk::RGBA::parse($settings_xml->{'general'}->{'trans_custom_col'})); } else { $trans_custom_btn->set_rgba(Gtk3::Gdk::RGBA::parse('black')); } if ( defined $settings_xml->{'general'}->{'trans_check'} && defined $settings_xml->{'general'}->{'trans_custom'} && defined $settings_xml->{'general'}->{'trans_backg'}) { $trans_check->set_active($settings_xml->{'general'}->{'trans_check'}); $trans_custom->set_active($settings_xml->{'general'}->{'trans_custom'}); $trans_backg->set_active($settings_xml->{'general'}->{'trans_backg'}); } else { $trans_check->set_active(TRUE); } # initialize css evt_value_changed(undef, 'transp_toggled'); $trans_check->set_tooltip_text($d->get("Displays any transparent parts of the image in a check pattern")); $trans_custom->set_tooltip_text($d->get("Displays any transparent parts of the image in a solid color that you specify")); $trans_backg->set_tooltip_text($d->get("Displays any transparent parts of the image in the background color of the application")); #connect signals after restoring the saved state $trans_check->signal_connect( 'toggled' => \&evt_value_changed, 'transp_toggled' ); $trans_custom->signal_connect( 'toggled' => \&evt_value_changed, 'transp_toggled' ); $trans_custom_btn->signal_connect( 'color-set' => \&evt_value_changed, 'transp_toggled' ); $trans_backg->signal_connect( 'toggled' => \&evt_value_changed, 'transp_toggled' ); #session view $session_asc = Gtk3::RadioButton->new_with_label(undef, $d->get("Sort ascending by")); $session_asc_combo = Gtk3::ComboBoxText->new; $session_asc_combo->insert_text(0, $d->get("Filename")); $session_asc_combo->insert_text(1, $d->get("Key/Time Created")); $session_desc = Gtk3::RadioButton->new_with_label($session_asc, $d->get("Sort descending by")); $session_desc_combo = Gtk3::ComboBoxText->new; $session_desc_combo->insert_text(0, $d->get("Filename")); $session_desc_combo->insert_text(1, $d->get("Key/Time Created")); $session_hbox1->pack_start($session_asc, FALSE, TRUE, 12); $session_hbox1->pack_start($session_asc_combo, FALSE, TRUE, 0); $session_hbox2->pack_start($session_desc, FALSE, TRUE, 12); $session_hbox2->pack_start($session_desc_combo, FALSE, TRUE, 0); if ( defined $settings_xml->{'general'}->{'session_asc'} && defined $settings_xml->{'general'}->{'session_desc'}) { $session_asc->set_active($settings_xml->{'general'}->{'session_asc'}); $session_desc->set_active($settings_xml->{'general'}->{'session_desc'}); } else { $session_desc->set_active(TRUE); } if (defined $settings_xml->{'general'}->{'session_asc_combo'}) { $session_asc_combo->set_active($settings_xml->{'general'}->{'session_asc_combo'}); } else { $session_asc_combo->set_active(1); } if (defined $settings_xml->{'general'}->{'session_desc_combo'}) { $session_desc_combo->set_active($settings_xml->{'general'}->{'session_desc_combo'}); } else { $session_desc_combo->set_active(1); } $session_asc->signal_connect( 'toggled', sub { $st->{_sorta}->set_active($session_asc->get_active); }); $session_desc->signal_connect( 'toggled', sub { $st->{_sortd}->set_active($session_desc->get_active); }); $session_asc_combo->signal_connect( 'changed', sub { $st->{_sorta}->signal_emit('toggled') if $session_asc->get_active; }); $session_desc_combo->signal_connect( 'changed', sub { $st->{_sortd}->signal_emit('toggled') if $session_desc->get_active; }); $session_asc->set_tooltip_text($d->get("Configure sort criteria")); $session_asc_combo->set_tooltip_text($d->get("Configure sort criteria")); $session_desc->set_tooltip_text($d->get("Configure sort criteria")); $session_desc_combo->set_tooltip_text($d->get("Configure sort criteria")); #end - imageview #-------------------------------------- #behavior #-------------------------------------- $fs_active = Gtk3::CheckButton->new_with_label($d->get("Start Shutter at login")); $fs_min_active = Gtk3::CheckButton->new_with_label($d->get("Hide window on first launch")); $fs_nonot_active = Gtk3::CheckButton->new_with_label($d->get("Hide notification icon")); $hide_active = Gtk3::CheckButton->new_with_label($d->get("Autohide main window when taking a screenshot")); my $hide_time_label = Gtk3::Label->new($d->get("Redraw Delay") . ":"); $hide_time_vlabel = Gtk3::Label->new; $hide_time = Gtk3::SpinButton->new_with_range(100, 1000, 50); $hide_time_vlabel->set_text($d->nget("millisecond", "milliseconds", $hide_time->get_value)); $hide_time->signal_connect( 'value-changed' => \&evt_value_changed, 'hide_time_changed' ); $present_after_active = Gtk3::CheckButton->new_with_label($d->get("Present main window after taking a screenshot")); $close_at_close_active = Gtk3::CheckButton->new_with_label($d->get("Minimize to tray when closing main window")); $notify_after_active = Gtk3::CheckButton->new_with_label($d->get("Display pop-up notification after taking a screenshot")); $notify_timeout_active = Gtk3::CheckButton->new_with_label($d->get("Display pop-up notification when using a delay")); $notify_ptimeout_active = Gtk3::CheckButton->new_with_label($d->get("Display pop-up notification when using a pre-capture delay")); my $ns_label = Gtk3::Label->new($d->get("Notification agent") . ":"); $combobox_ns = Gtk3::ComboBoxText->new; $combobox_ns->append_text($d->get("Desktop Notifications")); $combobox_ns->append_text($d->get("Built-In Notifications")); $combobox_ns->signal_connect( 'changed' => \&evt_value_changed, 'ns_changed' ); $ask_on_delete_active = Gtk3::CheckButton->new_with_label($d->get("Ask before moving files to trash")); $delete_on_close_active = Gtk3::CheckButton->new_with_label($d->get("Move file to trash when closing tab")); $ask_on_fs_delete_active = Gtk3::CheckButton->new_with_label($d->get("Notify when file was deleted from filesystem")); $fs_active_hbox->pack_start($fs_active, FALSE, TRUE, 12); $fs_min_active_hbox->pack_start($fs_min_active, FALSE, TRUE, 12); $fs_nonot_active_hbox->pack_start($fs_nonot_active, FALSE, TRUE, 12); $hide_active_hbox->pack_start($hide_active, FALSE, TRUE, 12); $pafter_active_hbox->pack_start($present_after_active, FALSE, TRUE, 12); $cac_hbox->pack_start($close_at_close_active, FALSE, TRUE, 12); $hide_time_hbox->pack_start($hide_time_label, FALSE, TRUE, 12); $hide_time_hbox->pack_start($hide_time, FALSE, TRUE, 6); $hide_time_hbox->pack_start($hide_time_vlabel, FALSE, TRUE, 0); $na_active_hbox->pack_start($notify_after_active, FALSE, TRUE, 12); $nt_active_hbox->pack_start($notify_timeout_active, FALSE, TRUE, 12); $npt_active_hbox->pack_start($notify_ptimeout_active, FALSE, TRUE, 12); $ns_combo_hbox->pack_start($ns_label, FALSE, TRUE, 12); $ns_combo_hbox->pack_start($combobox_ns, FALSE, TRUE, 0); $aod_active_hbox->pack_start($ask_on_delete_active, FALSE, TRUE, 12); $doc_active_hbox->pack_start($delete_on_close_active, FALSE, TRUE, 12); $aofsd_active_hbox->pack_start($ask_on_fs_delete_active, FALSE, TRUE, 12); if (defined $settings_xml->{'general'}->{'autofs'}) { $fs_active->set_active($settings_xml->{'general'}->{'autofs'}); } else { $fs_active->set_active(FALSE); } $fs_active->set_tooltip_text($d->get("Start Shutter at login")); if (defined $settings_xml->{'general'}->{'autofs_min'}) { $fs_min_active->set_active($settings_xml->{'general'}->{'autofs_min'}); } else { $fs_min_active->set_active(FALSE); } $fs_min_active->set_tooltip_text($d->get("Hide window on first launch")); if (defined $settings_xml->{'general'}->{'autofs_not'}) { $fs_nonot_active->set_active($settings_xml->{'general'}->{'autofs_not'}); } else { $fs_nonot_active->set_active(FALSE); } $fs_nonot_active->set_tooltip_text($d->get("Hide notification icon")); if (defined $settings_xml->{'general'}->{'autohide'}) { $hide_active->set_active($settings_xml->{'general'}->{'autohide'}); } else { $hide_active->set_active(TRUE); } $hide_active->set_tooltip_text($d->get("Autohide main window when taking a screenshot")); if (defined $settings_xml->{'general'}->{'autohide_time'}) { $hide_time->set_value($settings_xml->{'general'}->{'autohide_time'}); } else { $hide_time->set_value(400); } $hide_time_label->set_tooltip_text($d->get("Configure a short timeout to give the Xserver a chance to redraw areas that were obscured by Shutter's windows before taking a screenshot.")); $hide_time->set_tooltip_text($d->get("Configure a short timeout to give the Xserver a chance to redraw areas that were obscured by Shutter's windows before taking a screenshot.")); $hide_time_vlabel->set_tooltip_text($d->get("Configure a short timeout to give the Xserver a chance to redraw areas that were obscured by Shutter's windows before taking a screenshot.")); #If get_exit_after_capture is TRUE, overwrite any saved setting #because presenting the window does not make sense here if ($sc->get_exit_after_capture) { $present_after_active->set_active(FALSE); } else { if (defined $settings_xml->{'general'}->{'present_after'}) { $present_after_active->set_active($settings_xml->{'general'}->{'present_after'}); } else { $present_after_active->set_active(TRUE); } } $present_after_active->set_tooltip_text($d->get("Present main window after taking a screenshot")); if (defined $settings_xml->{'general'}->{'notify_after'}) { $notify_after_active->set_active($settings_xml->{'general'}->{'notify_after'}); } else { $notify_after_active->set_active(TRUE); } $notify_after_active->set_tooltip_text($d->get("Display pop-up notification after taking a screenshot")); if (defined $settings_xml->{'general'}->{'notify_timeout'}) { $notify_timeout_active->set_active($settings_xml->{'general'}->{'notify_timeout'}); } else { $notify_timeout_active->set_active(TRUE); } $notify_timeout_active->set_tooltip_text($d->get("Display pop-up notification when using a delay")); if (defined $settings_xml->{'general'}->{'notify_ptimeout'}) { $notify_ptimeout_active->set_active($settings_xml->{'general'}->{'notify_ptimeout'}); } else { $notify_ptimeout_active->set_active(TRUE); } $notify_timeout_active->set_tooltip_text($d->get("Display pop-up notification when using a delay")); if (defined $settings_xml->{'general'}->{'notify_agent'}) { $combobox_ns->set_active($settings_xml->{'general'}->{'notify_agent'}); } else { $combobox_ns->set_active(TRUE); } $ns_label->set_tooltip_text($d->get("You can either choose the system-wide desktop notifications (e.g. Ubuntu's Notify-OSD) or Shutter's built-in notification system")); $combobox_ns->set_tooltip_text($d->get("You can either choose the system-wide desktop notifications (e.g. Ubuntu's Notify-OSD) or Shutter's built-in notification system")); if (defined $settings_xml->{'general'}->{'close_at_close'}) { $close_at_close_active->set_active($settings_xml->{'general'}->{'close_at_close'}); } else { $close_at_close_active->set_active(TRUE); } $close_at_close_active->set_tooltip_text($d->get("Minimize to tray when closing main window")); if (defined $settings_xml->{'general'}->{'ask_on_delete'}) { $ask_on_delete_active->set_active($settings_xml->{'general'}->{'ask_on_delete'}); } else { $ask_on_delete_active->set_active(FALSE); } $ask_on_delete_active->set_tooltip_text($d->get("Ask before moving files to trash")); if (defined $settings_xml->{'general'}->{'delete_on_close'}) { $delete_on_close_active->set_active($settings_xml->{'general'}->{'delete_on_close'}); } else { $delete_on_close_active->set_active(FALSE); } $delete_on_close_active->set_tooltip_text($d->get("Move file to trash when closing tab")); if (defined $settings_xml->{'general'}->{'ask_on_fs_delete'}) { $ask_on_fs_delete_active->set_active($settings_xml->{'general'}->{'ask_on_fs_delete'}); } else { $ask_on_fs_delete_active->set_active(FALSE); } $ask_on_fs_delete_active->set_tooltip_text($d->get("Notify when file was deleted from filesystem")); #end - behavior #-------------------------------------- #accounts #-------------------------------------- $accounts_model = undef; fct_load_accounts_tree(); $accounts_tree = Gtk3::TreeView->new_with_model($accounts_model); $accounts_tree->signal_connect( 'row-activated' => \&evt_accounts, 'row_activated' ); fct_set_model_accounts($accounts_tree); #some notes related to uploading my $pub_hint_pref = Gtk3::Label->new(); $pub_hint_pref->set_line_wrap(TRUE); $pub_hint_pref->set_line_wrap_mode('word-char'); $pub_hint_pref->set_markup( "" . $d->get( "Please note: If a plugin allows authorized uploading you can enter your credentials above. Plugins with OAuth support are configured automatically the first time you use them.") . "" ); #ftp uri my $ftp_entry_label = Gtk3::Label->new($d->get("URI") . ":"); $ftp_remote_entry = Gtk3::Entry->new; if (defined $settings_xml->{'general'}->{'ftp_uri'}) { $ftp_remote_entry->set_text($settings_xml->{'general'}->{'ftp_uri'}); } else { $ftp_remote_entry->set_text("ftp://host:port/path"); } $ftp_entry_label->set_tooltip_text($d->get("URI\nExample: ftp://host:port/path")); $ftp_remote_entry->set_tooltip_text($d->get("URI\nExample: ftp://host:port/path")); $ftp_hbox1->pack_start($ftp_entry_label, FALSE, TRUE, 12); $ftp_hbox1->pack_start($ftp_remote_entry, TRUE, TRUE, 0); #connection mode my $ftp_mode_label = Gtk3::Label->new($d->get("Connection mode") . ":"); $ftp_mode_combo = Gtk3::ComboBoxText->new; $ftp_mode_combo->insert_text(0, $d->get("Active mode")); $ftp_mode_combo->insert_text(1, $d->get("Passive mode")); if (defined $settings_xml->{'general'}->{'ftp_mode'}) { $ftp_mode_combo->set_active($settings_xml->{'general'}->{'ftp_mode'}); } else { $ftp_mode_combo->set_active(0); } $ftp_mode_label->set_tooltip_text($d->get("Connection mode")); $ftp_mode_combo->set_tooltip_text($d->get("Connection mode")); $ftp_hbox2->pack_start($ftp_mode_label, FALSE, TRUE, 12); $ftp_hbox2->pack_start($ftp_mode_combo, TRUE, TRUE, 0); #username my $ftp_username_label = Gtk3::Label->new($d->get("Username") . ":"); $ftp_username_entry = Gtk3::Entry->new; if (defined $settings_xml->{'general'}->{'ftp_username'}) { $ftp_username_entry->set_text($settings_xml->{'general'}->{'ftp_username'}); } else { $ftp_username_entry->set_text(""); } $ftp_username_label->set_tooltip_text($d->get("Username")); $ftp_username_entry->set_tooltip_text($d->get("Username")); $ftp_hbox3->pack_start($ftp_username_label, FALSE, TRUE, 12); $ftp_hbox3->pack_start($ftp_username_entry, TRUE, TRUE, 0); #password my $ftp_password_label = Gtk3::Label->new($d->get("Password") . ":"); $ftp_password_entry = Gtk3::Entry->new; $ftp_password_entry->set_invisible_char("*"); $ftp_password_entry->set_visibility(FALSE); if (defined $settings_xml->{'general'}->{'ftp_password'}) { $ftp_password_entry->set_text($settings_xml->{'general'}->{'ftp_password'}); } else { $ftp_password_entry->set_text(""); } $ftp_password_label->set_tooltip_text($d->get("Password")); $ftp_password_entry->set_tooltip_text($d->get("Password")); $ftp_hbox4->pack_start($ftp_password_label, FALSE, TRUE, 12); $ftp_hbox4->pack_start($ftp_password_entry, TRUE, TRUE, 0); #website url my $ftp_wurl_label = Gtk3::Label->new($d->get("Website URL") . ":"); $ftp_wurl_entry = Gtk3::Entry->new; if (defined $settings_xml->{'general'}->{'ftp_wurl'}) { $ftp_wurl_entry->set_text($settings_xml->{'general'}->{'ftp_wurl'}); } else { $ftp_wurl_entry->set_text("http://example.com/screenshots"); } $ftp_wurl_label->set_tooltip_text($d->get("Website URL")); $ftp_wurl_entry->set_tooltip_text($d->get("Website URL")); $ftp_hbox5->pack_start($ftp_wurl_label, FALSE, TRUE, 12); $ftp_hbox5->pack_start($ftp_wurl_entry, TRUE, TRUE, 0); #-------------------------------------- #packing #-------------------------------------- #settings main tab my $label_basic = Gtk3::Label->new; $label_basic->set_markup($d->get("Main")); $file_vbox->pack_start($scale_box, TRUE, TRUE, 3); $file_vbox->pack_start($filetype_box, FALSE, TRUE, 3); $file_frame->add($file_vbox); $save_vbox->pack_start($save_ask_box, TRUE, TRUE, 3); $save_vbox->pack_start($save_no_box, TRUE, TRUE, 3); $save_vbox->pack_start($save_auto_box, TRUE, TRUE, 3); $save_vbox->pack_start($filename_box, TRUE, TRUE, 3); $save_vbox->pack_start($saveDir_box, FALSE, TRUE, 3); $save_vbox->pack_start($filename_hint, TRUE, TRUE, 3); $save_vbox->pack_start($fname_autocopy_box, TRUE, TRUE, 3); $save_vbox->pack_start($image_autocopy_box, TRUE, TRUE, 3); $save_vbox->pack_start($no_autocopy_box, TRUE, TRUE, 3); $save_frame->add($save_vbox); $capture_vbox->pack_start($cursor_box, FALSE, TRUE, 3); $capture_vbox->pack_start($delay_box, TRUE, TRUE, 3); $capture_frame->add($capture_vbox); #all labels = one size $scale_label->set_alignment(0, 0.5); $filetype_label->set_alignment(0, 0.5); $filename_label->set_alignment(0, 0.5); $saveDir_label->set_alignment(0, 0.5); my $sg_main = Gtk3::SizeGroup->new('horizontal'); $sg_main->add_widget($scale_label); $sg_main->add_widget($filetype_label); $sg_main->add_widget($filename_label); $sg_main->add_widget($saveDir_label); $vbox_basic->pack_start($file_frame, FALSE, TRUE, 3); $vbox_basic->pack_start($save_frame, FALSE, TRUE, 3); $vbox_basic->pack_start($capture_frame, FALSE, TRUE, 3); $vbox_basic->set_border_width(5); #settings actions tab my $label_actions = Gtk3::Label->new; $label_actions->set_markup($d->get("Actions")); $actions_vbox->pack_start($progname_box, FALSE, TRUE, 3); $actions_vbox->pack_start($im_colors_box, FALSE, TRUE, 3); $actions_vbox->pack_start($thumbnail_box, FALSE, TRUE, 3); $actions_vbox->pack_start($bordereffect_box, FALSE, TRUE, 3); $actions_frame->add($actions_vbox); #all labels = one size $progname_label->set_alignment(0, 0.5); $im_colors_label->set_alignment(0, 0.5); $thumbnail_label->set_alignment(0, 0.5); $bordereffect_label->set_alignment(0, 0.5); my $sg_actions = Gtk3::SizeGroup->new('horizontal'); $sg_actions->add_widget($progname_label); $sg_actions->add_widget($im_colors_label); $sg_actions->add_widget($thumbnail_label); $sg_actions->add_widget($bordereffect_label); $vbox_actions->pack_start($actions_frame, FALSE, TRUE, 3); $vbox_actions->set_border_width(5); #settings advanced tab my $label_advanced = Gtk3::Label->new; $label_advanced->set_markup($d->get("Advanced")); #all labels = one size $asel_size_label3->set_alignment(1, 0.5); my $sg_asel = Gtk3::SizeGroup->new('horizontal'); $sg_asel->add_widget($asel_size_label1); $sg_asel->add_widget($asel_size_label3); my $sg_asel2 = Gtk3::SizeGroup->new('horizontal'); $sg_asel2->add_widget($asel_size_label2); $sg_asel2->add_widget($asel_size_label4); $sel_capture_vbox->pack_start($zoom_box, FALSE, TRUE, 3); $sel_capture_vbox->pack_start($as_help_box, FALSE, TRUE, 3); $sel_capture_vbox->pack_start($as_confirmation_box, FALSE, TRUE, 3); $sel_capture_vbox->pack_start($asel_isize_box, FALSE, TRUE, 3); $sel_capture_vbox->pack_start($asel_isize_box2, FALSE, TRUE, 3); $sel_capture_frame->add($sel_capture_vbox); $window_capture_vbox->pack_start($border_box, FALSE, TRUE, 3); $window_capture_vbox->pack_start($winresize_box, FALSE, TRUE, 3); $window_capture_vbox->pack_start($autoshape_box, FALSE, TRUE, 3); $window_capture_vbox->pack_start($visible_windows_box, FALSE, TRUE, 3); $window_capture_frame->add($window_capture_vbox); $menu_capture_vbox->pack_start($menu_delay_box, TRUE, TRUE, 3); $menu_capture_vbox->pack_start($menu_waround_box, TRUE, TRUE, 3); $menu_capture_frame->add($menu_capture_vbox); $web_capture_vbox->pack_start($web_width_box, FALSE, TRUE, 3); $web_capture_frame->add($web_capture_vbox); #all labels = one size $menu_delay_label->set_alignment(0, 0.5); $web_width_label->set_alignment(0, 0.5); my $sg_adv = Gtk3::SizeGroup->new('horizontal'); $sg_adv->add_widget($menu_delay_label); $sg_adv->add_widget($web_width_label); $vbox_advanced->pack_start($sel_capture_frame, FALSE, TRUE, 3); $vbox_advanced->pack_start($window_capture_frame, FALSE, TRUE, 3); $vbox_advanced->pack_start($menu_capture_frame, FALSE, TRUE, 3); $vbox_advanced->pack_start($web_capture_frame, FALSE, TRUE, 3); $vbox_advanced->set_border_width(5); #settings image view tab my $label_imageview = Gtk3::Label->new; $label_imageview->set_markup($d->get("Image View")); $transparent_vbox->pack_start($imageview_hbox1, TRUE, TRUE, 3); $transparent_vbox->pack_start($imageview_hbox2, TRUE, TRUE, 3); $transparent_vbox->pack_start($imageview_hbox3, TRUE, TRUE, 3); $transparent_frame->add($transparent_vbox); my $sg_session = Gtk3::SizeGroup->new('horizontal'); $sg_session->add_widget($session_asc); $sg_session->add_widget($session_desc); $session_vbox->pack_start($session_hbox1, TRUE, TRUE, 3); $session_vbox->pack_start($session_hbox2, TRUE, TRUE, 3); $session_frame->add($session_vbox); $vbox_imageview->pack_start($transparent_frame, FALSE, TRUE, 3); $vbox_imageview->pack_start($session_frame, FALSE, TRUE, 3); $vbox_imageview->set_border_width(5); #settings behavior tab my $label_behavior = Gtk3::Label->new; $label_behavior->set_markup($d->get("Behavior")); $first_vbox->pack_start($fs_active_hbox, TRUE, TRUE, 3); $first_vbox->pack_start($fs_min_active_hbox, TRUE, TRUE, 3); $first_vbox->pack_start($fs_nonot_active_hbox, TRUE, TRUE, 3); $firstlaunch_frame->add($first_vbox); $window_vbox->pack_start($hide_active_hbox, TRUE, TRUE, 3); $window_vbox->pack_start($pafter_active_hbox, TRUE, TRUE, 3); $window_vbox->pack_start($cac_hbox, TRUE, TRUE, 3); $window_vbox->pack_start($hide_time_hbox, TRUE, TRUE, 3); $window_frame->add($window_vbox); $notify_vbox->pack_start($na_active_hbox, TRUE, TRUE, 3); $notify_vbox->pack_start($nt_active_hbox, TRUE, TRUE, 3); $notify_vbox->pack_start($npt_active_hbox, TRUE, TRUE, 3); $notify_vbox->pack_start($ns_combo_hbox, TRUE, TRUE, 3); $notify_frame->add($notify_vbox); $trash_vbox->pack_start($aod_active_hbox, TRUE, TRUE, 3); $trash_vbox->pack_start($doc_active_hbox, TRUE, TRUE, 3); $trash_vbox->pack_start($aofsd_active_hbox, TRUE, TRUE, 3); $trash_frame->add($trash_vbox); #all labels = one size $hide_time_label->set_alignment(0, 0.5); my $sg_behav = Gtk3::SizeGroup->new('horizontal'); $sg_behav->add_widget($hide_time_label); $vbox_behavior->pack_start($firstlaunch_frame, FALSE, TRUE, 3); $vbox_behavior->pack_start($window_frame, FALSE, TRUE, 3); $vbox_behavior->pack_start($notify_frame, FALSE, TRUE, 3); $vbox_behavior->pack_start($trash_frame, FALSE, TRUE, 3); $vbox_behavior->set_border_width(5); #settings upload tab my $label_accounts = Gtk3::Label->new; $label_accounts->set_markup($d->get("Upload")); #align the hint $pub_hint_pref->set_alignment(0, 0.5); my $scrolled_accounts_window = Gtk3::ScrolledWindow->new; $scrolled_accounts_window->set_policy('automatic', 'automatic'); $scrolled_accounts_window->set_shadow_type('in'); $scrolled_accounts_window->add($accounts_tree); $accounts_hbox->pack_start($scrolled_accounts_window, TRUE, TRUE, 3); $accounts_vbox->pack_start($accounts_hbox, TRUE, TRUE, 3); $accounts_vbox->pack_start($pub_hint_pref, FALSE, FALSE, 3); $accounts_frame->add($accounts_vbox); $ftp_vbox->pack_start($ftp_hbox1, FALSE, TRUE, 3); $ftp_vbox->pack_start($ftp_hbox2, FALSE, TRUE, 3); $ftp_vbox->pack_start($ftp_hbox3, FALSE, TRUE, 3); $ftp_vbox->pack_start($ftp_hbox4, FALSE, TRUE, 3); $ftp_vbox->pack_start($ftp_hbox5, FALSE, TRUE, 3); $ftp_frame->add($ftp_vbox); #all labels = one size $ftp_entry_label->set_alignment(0, 0.5); $ftp_mode_label->set_alignment(0, 0.5); $ftp_username_label->set_alignment(0, 0.5); $ftp_password_label->set_alignment(0, 0.5); $ftp_wurl_label->set_alignment(0, 0.5); my $sg_acc = Gtk3::SizeGroup->new('horizontal'); $sg_acc->add_widget($ftp_entry_label); $sg_acc->add_widget($ftp_mode_label); $sg_acc->add_widget($ftp_username_label); $sg_acc->add_widget($ftp_password_label); $sg_acc->add_widget($ftp_wurl_label); $vbox_accounts->pack_start($accounts_frame, TRUE, TRUE, 3); $vbox_accounts->pack_start($ftp_frame, FALSE, TRUE, 3); $vbox_accounts->set_border_width(5); #append pages to notebook $notebook_settings->append_page($vbox_basic, $label_basic); $notebook_settings->append_page($vbox_advanced, $label_advanced); $notebook_settings->append_page($vbox_actions, $label_actions); $notebook_settings->append_page($vbox_imageview, $label_imageview); $notebook_settings->append_page($vbox_behavior, $label_behavior); $notebook_settings->append_page($vbox_accounts, $label_accounts); #plugins #not used in a standalone environment if (keys(%plugins) > 0 && !$ENV{PAR_TEMP}) { my $effects_tree = Gtk3::TreeView->new_with_model(fct_load_plugin_tree()); fct_set_model_plugins($effects_tree); my $scrolled_plugins_window = Gtk3::ScrolledWindow->new; $scrolled_plugins_window->set_policy('automatic', 'automatic'); $scrolled_plugins_window->set_shadow_type('in'); $scrolled_plugins_window->add($effects_tree); my $label_plugins = Gtk3::Label->new; $label_plugins->set_markup($d->get("Plugins")); my $label_treeview = Gtk3::Label->new($d->get("The following plugins are installed")); $label_treeview->set_alignment(0, 0.5); $effects_vbox->pack_start($label_treeview, FALSE, TRUE, 1); $effects_vbox->pack_start($scrolled_plugins_window, TRUE, TRUE, 1); my $vbox_plugins = Gtk3::VBox->new(FALSE, 12); $vbox_plugins->set_border_width(5); $vbox_plugins->pack_start($effects_vbox, TRUE, TRUE, 1); $notebook_settings->append_page($vbox_plugins, $label_plugins); } #profiles $profiles_box->pack_start(Gtk3::Label->new($d->get("Profile") . ":"), FALSE, TRUE, 1); $profiles_box->pack_start($combobox_settings_profiles, TRUE, TRUE, 6); $profiles_box->pack_start($button_profile_save, FALSE, TRUE, 1); $profiles_box->pack_start($button_profile_delete, FALSE, TRUE, 1); $profiles_box->pack_start($button_profile_apply, FALSE, TRUE, 1); $vbox_settings->pack_start($profiles_box, FALSE, TRUE, 1); $vbox_settings->pack_start($notebook_settings, TRUE, TRUE, 1); #settings $hbox_settings->pack_start($vbox_settings, TRUE, TRUE, 6); $settings_dialog->get_child->add($hbox_settings); $settings_dialog->set_default_response('apply'); #~ #iconview #~ my $iconview = Gtk3::IconView->new_with_model($session_start_screen{'first_page'}->{'model'}); #~ $iconview->set_item_width (150); #~ $iconview->set_pixbuf_column(0); #~ $iconview->set_text_column(1); #~ $iconview->set_selection_mode('multiple'); #~ $iconview->signal_connect( 'selection-changed', \&evt_iconview_sel_changed ); #~ $iconview->signal_connect( 'item-activated', \&evt_iconview_item_activated ); #~ #~ my $scrolled_window_view = Gtk3::ScrolledWindow->new; #~ $scrolled_window_view->set_policy( 'automatic', 'automatic' ); #~ $scrolled_window_view->set_shadow_type('in'); #~ $scrolled_window_view->add($iconview); #~ #~ #add an event box to show a context menu on right-click #~ my $view_event = Gtk3::EventBox->new; #~ $view_event->add($scrolled_window_view); #~ $view_event->signal_connect( 'button-press-event', \&evt_iconview_button_press, $iconview ); #~ #~ #~ #pack notebook and iconview into vpaned# #~ my $vpaned = Gtk3::VPaned->new; #~ $vpaned->add1($notebook); #~ $vpaned->add2($view_event); #~ #~ #vpaned into vbox #~ $vbox->pack_start( $vpaned, TRUE, TRUE, 0 ); #notebook $vbox->pack_start($notebook, TRUE, TRUE, 0); #bottom toolbar $nav_toolbar = $st->create_btoolbar; $vbox->pack_start($nav_toolbar, FALSE, FALSE, 0); #signal handler $st->{_back}->signal_connect( 'clicked' => sub { $notebook->prev_page; }); $st->{_forw}->signal_connect( 'clicked' => sub { $notebook->next_page; }); $st->{_home}->signal_connect( 'clicked' => sub { $notebook->set_current_page(0); }); #signal handler for sort buttons $st->{_sorta}->signal_connect( 'toggled' => sub { my $this_button = shift; if ($this_button->get_active) { $session_start_screen{'first_page'}->{'model'}->set_sort_func( 2, sub { #The comparison callback should return # -1 if the iter1 row should come before the iter2 row, # 0 if the rows are equal, or # 1 if the iter1 row should come after the iter2 row. my ($liststore, $a, $b) = @_; my $ka = $liststore->get_value($a, $session_asc_combo->get_active + 1); my $kb = $liststore->get_value($b, $session_asc_combo->get_active + 1); if (defined $ka && defined $kb) { #negate result in this case return Sort::Naturally::ncmp($ka, $kb) * -1; } return -1; }); $session_asc->set_active(TRUE); $st->{_sortd}->set_active(FALSE); } else { $st->{_sortd}->set_active(TRUE); } }); $st->{_sortd}->signal_connect( 'toggled' => sub { my $this_button = shift; if ($this_button->get_active) { $session_start_screen{'first_page'}->{'model'}->set_sort_func( 2, sub { #see above my ($liststore, $a, $b) = @_; my $ka = $liststore->get_value($a, $session_desc_combo->get_active + 1); my $kb = $liststore->get_value($b, $session_desc_combo->get_active + 1); if (defined $ka && defined $kb) { return Sort::Naturally::ncmp($ka, $kb); } return -1; }); $session_desc->set_active(TRUE); $st->{_sorta}->set_active(FALSE); } else { $st->{_sorta}->set_active(TRUE); } }); #set saved value if ($session_asc->get_active) { $st->{_sorta}->set_active(TRUE); } else { $st->{_sortd}->set_active(TRUE); } #pack statusbar $status->pack_start($cursor_status_active, FALSE, FALSE, 0); $status->pack_start(Gtk3::HSeparator->new, FALSE, FALSE, 3); $status->pack_start($delay_status_label, FALSE, FALSE, 0); $status->pack_start($delay_status, FALSE, FALSE, 0); $status->pack_start(Gtk3::HSeparator->new, FALSE, FALSE, 6); $vbox->pack_start($status, FALSE, FALSE, 0); #-------------------------------------- #populate quick selector (profiles) #-------------------------------------- fct_update_profile_selectors($combobox_settings_profiles, \@current_profiles); #restore session #clean 'unsaved' files directory #save settings directly when cache was cleared (see Bug #909195) #-------------------------------------- Glib::Idle->add( sub { fct_load_session(); fct_init_unsaved_files(); if ($sc->get_clear_cache) { fct_post_settings(); } return FALSE; }); #open init files (cmd arguments) #-------------------------------------- if (scalar @init_files > 0) { fct_open_files(@init_files); } #unblock controls fct_control_signals('unblock'); #start minimized? #-------------------------------------- unless ($sc->get_min) { fct_control_main_window('show'); } else { fct_control_main_window('hide'); } #restore menu/toolbar settings #-------------------------------------- if (defined $settings_xml->{'gui'}->{'btoolbar_active'}) { $sm->{_menuitem_btoolbar}->set_active($settings_xml->{'gui'}->{'btoolbar_active'}); } else { $sm->{_menuitem_btoolbar}->set_active(FALSE); } #-------------------------------------- #FIXME #this is an ugly fix when 'tranparent parts' is set to background #we don't get the corret background color until the main window is shown #so we change it now if ($trans_backg->get_active) { evt_value_changed(undef, 'transp_toggled'); } #update the first tab on startup fct_update_info_and_tray(); #load saved settings #-------------------------------------- my $folder_to_save = $settings_xml->{'general'}->{'folder'} || $ENV{'HOME'}; my ($cmdname, $extra) = $sc->get_start_with; if ($cmdname && $folder_to_save) { evt_take_screenshot('global_keybinding', $cmdname, $folder_to_save, $extra); } #keep list of windows up-to-date (tray) Glib::Idle->add( sub { $wnck_screen->signal_connect('window-stacking-changed' => sub { fct_update_tray_menu(@_); }); return FALSE; }) if $wnck_screen; } #events #-------------------------------------- sub evt_value_changed { my ($widget, $data) = @_; # a small workaround when the widget is undef $widget ||= "undef"; print "\n$data was emitted by widget $widget\n" if $sc->get_debug; return FALSE unless $data; #checkbox for "open with" -> entry active/inactive if ($data eq "progname_toggled") { if ($progname_active->get_active) { $progname->set_sensitive(TRUE); } else { $progname->set_sensitive(FALSE); } } #checkbox for "color depth" -> entry active/inactive if ($data eq "im_colors_toggled") { if ($im_colors_active->get_active) { $combobox_im_colors->set_sensitive(TRUE); } else { $combobox_im_colors->set_sensitive(FALSE); } } #radiobuttons for "transparent parts" if ($data eq "transp_toggled") { #Sets how the view should draw transparent parts of images with an alpha channel if ($trans_check->get_active) { $css_provider_alpha->load_from_data(" .imageview.transparent { background-image: url('$shutter_root/share/shutter/resources/gui/checkers.svg'); } "); } elsif ($trans_custom->get_active) { my $color_string = $trans_custom_btn->get_rgba->to_string; $css_provider_alpha->load_from_data(" .imageview.transparent { background-color: $color_string; } "); } elsif ($trans_backg->get_active) { $css_provider_alpha->load_from_data(" "); } $window->queue_draw; } #"cursor_status" toggled if ($data eq "cursor_status_toggled") { $cursor_active->set_active($cursor_status_active->get_active); } #"cursor" toggled if ($data eq "cursor_toggled") { $cursor_status_active->set_active($cursor_active->get_active); } #value for "delay" -> update text if ($data eq "delay_changed") { $delay_status->set_value($delay->get_value); $delay_vlabel->set_text($d->nget("second", "seconds", $delay->get_value)); } #value for "delay" -> update text if ($data eq "delay_status_changed") { $delay->set_value($delay_status->get_value); $delay_status_vlabel->set_text($d->nget("second", "seconds", $delay_status->get_value)); } #value for "menu_delay" -> update text if ($data eq "menu_delay_changed") { $menu_delay_vlabel->set_text($d->nget("second", "seconds", $menu_delay->get_value)); } #value for "hide_time" -> update text if ($data eq "hide_time_changed") { $hide_time_vlabel->set_text($d->nget("millisecond", "milliseconds", $hide_time->get_value)); } #checkbox for "thumbnail" -> HScale active/inactive if ($data eq "thumbnail_toggled") { if ($thumbnail_active->get_active) { $thumbnail->set_sensitive(TRUE); } else { $thumbnail->set_sensitive(FALSE); } } #quality value changed if ($data eq "qvalue_changed") { my $settings = undef; if (defined $sc->get_globalsettings_object) { $settings = $sc->get_globalsettings_object; } else { $settings = Shutter::App::GlobalSettings->new(); $sc->set_globalsettings_object($settings); } if ($combobox_type->get_active_text =~ /jpeg/) { $settings->set_image_quality("jpg", $scale->get_value); } elsif ($combobox_type->get_active_text =~ /jpg/) { $settings->set_image_quality("jpg", $scale->get_value); } elsif ($combobox_type->get_active_text =~ /png/) { $settings->set_image_quality("png", $scale->get_value); } elsif ($combobox_type->get_active_text =~ /webp/) { $settings->set_image_quality("webp", $scale->get_value); } elsif ($combobox_type->get_active_text =~ /avif/) { $settings->set_image_quality("avif", $scale->get_value); } else { $settings->clear_quality_settings(); } } #checkbox for "bordereffect" -> HScale active/inactive if ($data eq "bordereffect_toggled") { if ($bordereffect_active->get_active) { $bordereffect->set_sensitive(TRUE); } else { $bordereffect->set_sensitive(FALSE); } } #value for "bordereffect" -> update text if ($data eq "bordereffect_changed") { $bordereffect_vlabel->set_text($d->nget("pixel", "pixels", $bordereffect->get_value)); } #filetype changed if ($data eq "type_changed") { $scale->set_sensitive(TRUE); $scale_label->set_sensitive(TRUE); $scale_label->set_text($d->get("Quality") . ":"); if ($combobox_type->get_active_text =~ /jpeg/) { $scale->set_range(1, 100); $scale->set_value(90); } elsif ($combobox_type->get_active_text =~ /jpg/) { $scale->set_range(1, 100); $scale->set_value(90); } elsif ($combobox_type->get_active_text =~ /png/) { $scale->set_range(0, 9); $scale->set_value(9); $scale_label->set_text($d->get("Compression") . ":"); } elsif ($combobox_type->get_active_text =~ /webp/) { $scale->set_range(0, 100); $scale->set_value(98); } elsif ($combobox_type->get_active_text =~ /avif/) { $scale->set_range(0, 100); $scale->set_value(68); } else { $scale->set_sensitive(FALSE); $scale_label->set_sensitive(FALSE); } } #notify agent changed if ($data eq "ns_changed") { if ($combobox_ns->get_active == 0) { $sc->set_notification_object(Shutter::App::Notification->new); } else { $sc->set_notification_object(Shutter::App::ShutterNotification->new($sc)); } } return TRUE; } sub evt_take_screenshot { my ($widget, $data, $folder_from_config, $extra) = @_; #get xid if any window was selected from the submenu... my $selfcapture = FALSE; if ($data =~ /^shutter_window_direct(.*)/) { my $xid = $1; $selfcapture = TRUE if $xid == $window->get_window->get_xid; } #hide mainwindow if ( $hide_active->get_active && $data ne "web" && $data ne "tray_web" && !$is_hidden && !$selfcapture) { fct_control_main_window('hide'); } else { #save current position of main window ($window->{x}, $window->{y}) = $window->get_position; } #close last message displayed my $notify = $sc->get_notification_object; $notify->close; #disable signal-handler fct_control_signals('block'); if ($data eq "web" || $data eq "tray_web") { fct_take_screenshot($widget, $data, $folder_from_config, $extra); #unblock signal handler fct_control_signals('unblock'); return TRUE; } elsif (!$x11_supported && $data ne "full" && $data ne "tray_full") { my $sd = Shutter::App::SimpleDialogs->new; $sd->dlg_error_message($d->get("Can't take screenshots without X11 server"), $d->get("Failed")); fct_control_signals('unblock'); fct_control_main_window('show'); return TRUE; } if ($data eq "menu" || $data eq "tray_menu" || $data eq "tooltip" || $data eq "tray_tooltip") { my $scd_text; if ($data eq "menu" || $data eq "tray_menu") { $scd_text = $d->get("Please activate the menu you want to capture"); if ($ENV{GDK_SCALE} > 1) { my $sd = Shutter::App::SimpleDialogs->new; $sd->dlg_info_message("Capturing a cascading menu is known to be broken with HiDPI.\nPlease unset GDK_SCALE variable and restart Shutter.\nPlease follow https://github.com/shutter-project/shutter/issues/326 and send us the patch\nWill attempt capturing it anyway...", undef, 'gtk-ok'); } } elsif ($data eq "tooltip" || $data eq "tray_tooltip") { $scd_text = $d->get("Please activate the tooltip you want to capture"); } #show notification messages displaying the countdown if ($notify_ptimeout_active->get_active) { my $notify = $sc->get_notification_object; my $ttw = $menu_delay->get_value; #first notification immediately $notify->show(sprintf($d->nget("Screenshot will be taken in %s second", "Screenshot will be taken in %s seconds", $ttw), $ttw), $scd_text); $ttw--; #delay is only 1 second #do not show any further messages if ($ttw >= 1) { #then controlled via timeout Glib::Timeout->add( 1000, sub { $notify->show(sprintf($d->nget("Screenshot will be taken in %s second", "Screenshot will be taken in %s seconds", $ttw), $ttw), $scd_text); $ttw--; if ($ttw == 0) { #close last message with a short delay (less than a second) Glib::Timeout->add( 500, sub { $notify->close; return FALSE; }); return FALSE; } else { return TRUE; } }); } else { #close last message with a short delay (less than a second) Glib::Timeout->add( 500, sub { $notify->close; return FALSE; }); } } #notify not activated #capture with delay Glib::Timeout->add( $menu_delay->get_value * 1000, sub { fct_take_screenshot($widget, $data, $folder_from_config, $extra); #unblock signal handler fct_control_signals('unblock'); return FALSE; }); } else { if (($data eq "section" || $data eq "tray_section") && $ENV{GDK_SCALE} > 1) { my $sd = Shutter::App::SimpleDialogs->new; $sd->dlg_info_message("Capturing a window section is known to be broken with HiDPI.\nPlease unset GDK_SCALE variable and restart Shutter.\nPlease follow https://github.com/shutter-project/shutter/issues/326 and send us the patch\nWill attempt capturing it anyway...", undef, 'gtk-ok'); } #A short timeout to give the server a chance to #redraw the area that was obscured by our dialog. Glib::Timeout->add( $hide_time->get_value, sub { fct_take_screenshot($widget, $data, $folder_from_config, $extra); #unblock signal handler fct_control_signals('unblock'); return FALSE; }); } return TRUE; } sub evt_notebook_switch { my ($widget, $pointer, $int) = @_; my $key = fct_get_file_by_index($int); if ($key) { Glib::Idle->add( sub { #is key still current page? if (defined $key) { return FALSE unless exists $session_screens{$key}; return FALSE unless $session_screens{$key}->{'tab_child'} == $notebook->get_nth_page($notebook->get_current_page); #~ print "update tab for $key\n"; } foreach my $ckey (keys %session_screens) { #set pixbuf for current item if ($ckey eq $key) { if ($session_screens{$key}->{'long'}) { #update window title fct_update_info_and_tray($key); #do nothing if the view does already show a pixbuf if (exists $session_screens{$ckey} && defined $session_screens{$ckey}->{'image'}) { unless ($session_screens{$ckey}->{'image'}->get_pixbuf) { $session_screens{$ckey}->{'image'}->set_pixbuf($lp->load($session_screens{$key}->{'long'}, undef, undef, undef, TRUE), TRUE); } } } next; } #unset imageview for all other items if (exists $session_screens{$ckey} && defined $session_screens{$ckey}->{'image'}) { if ($session_screens{$ckey}->{'image'}->get_pixbuf) { $session_screens{$ckey}->{'image'}->set_pixbuf(undef); } } } return FALSE; }); } else { Glib::Idle->add( sub { fct_update_info_and_tray("session"); return FALSE; }); } #unselect all items in session tab #when we move away if ($int == 0) { $session_start_screen{'first_page'}->{'view'}->unselect_all; } #enable/disable menu entry when we switch tabs fct_update_actions($int, $key); return TRUE; } sub evt_delete_window { my ($widget, $data, $scounter) = @_; print "\n$data was emitted by widget $widget\n" if $sc->get_debug; if ( $data ne "quit" && $close_at_close_active->get_active && $tray) { $window->hide; $is_hidden = TRUE; return TRUE; } Glib::Idle->add( sub { #hide window and block sontrols $window->hide; fct_control_signals('block'); #wait if there are still files that need to be loaded #they would not be saved in session unless (defined $scounter) { $scounter = 0; } while (defined $session_start_screen{'first_page'}->{'num_session_files'} && $scounter <= 15) { $scounter++; #try again in a second Glib::Timeout->add( 1000, sub { evt_delete_window('', 'quit', $scounter); return FALSE; }); return FALSE; } #save settings fct_save_settings(undef); fct_save_settings($combobox_settings_profiles->get_active_text) if $combobox_settings_profiles->get_active != -1; #autostart $sas->create_autostart_file( Shutter::App::Directories::get_autostart_dir(), $fs_active->get_active, $fs_min_active->get_active, $fs_nonot_active->get_active ); $app->quit; return FALSE; }); return TRUE; } sub evt_bug { $shf->xdg_open(undef, "https://github.com/shutter-project/shutter/issues/new?labels=bug&template=bug_report.md", undef); } sub evt_question { $shf->xdg_open(undef, "https://github.com/shutter-project/shutter/issues/new?labels=question&template=question.md", undef); } sub evt_translate { $shf->xdg_open(undef, "https://translations.launchpad.net/shutter", undef); } sub evt_about { Shutter::App::AboutDialog->new($sc)->show; } sub evt_show_systray { my ($widget, $data) = @_; if ($sc->get_debug) { print "\n$data was emitted by widget $widget\n"; } #left button (mouse) if ($_[1]->button == 1) { if ($window->visible) { fct_control_main_window('hide'); } else { fct_control_main_window('show'); } } #right button (mouse) elsif ($_[1]->button == 3) { $tray_menu->popup( undef, # parent menu shell undef, # parent menu item undef, # menu pos func undef, # data $data->button, $data->time ); } return TRUE; } sub evt_show_systray_statusicon { my ($widget, $button, $time, $tray) = @_; if ($sc->get_debug) { print "\n$button, $time was emitted by widget $widget\n"; } $tray_menu->popup( undef, # parent menu shell undef, # parent menu item sub { return Gtk3::StatusIcon::position_menu($tray_menu, 0, 0, $tray); }, # menu pos func undef, # data $time ? $button : 0, $time ); return TRUE; } sub evt_activate_systray_statusicon { my ($widget, $data, $tray) = @_; if ($sc->get_debug) { print "\n$data was emitted by widget $widget\n"; } unless ($is_hidden) { fct_control_main_window('hide'); } else { fct_control_main_window('show'); } return TRUE; } sub evt_accounts { my ($tree, $path, $column) = @_; #open browser if register url is clicked if ($column->get_title eq $d->get("Register")) { my $model = $tree->get_model(); my $account_iter = $model->get_iter($path); my $account_value = $model->get_value($account_iter, 5); $shf->xdg_open(undef, $account_value, undef); } return TRUE; } sub evt_tab_button_press { my ($ev_box, $ev, $key) = @_; #right click if ($key && $ev->button == 3 && $ev->type eq 'button-press') { $sm->{_menu_large_actions}->popup( undef, # parent menu shell undef, # parent menu item undef, # menu pos func undef, # data $ev->button, $ev->time ); } return TRUE; } sub evt_iconview_button_press { my $ev_box = shift; my $ev = shift; my $view = shift; my $path = $view->get_path_at_pos($ev->x, $ev->y); if ($path) { #select item $view->select_path($path); $sm->{_menu_large_actions}->popup( undef, # parent menu shell undef, # parent menu item undef, # menu pos func undef, # data $ev->button, $ev->time ); } return TRUE; } sub evt_iconview_sel_changed { my ($view, $data) = @_; #we don't handle selection changes #if we are not in the session tab if (fct_get_current_file()) { return FALSE; } my $items = $view->get_selected_items; my @sel_items; @sel_items = @$items if $items; #enable/disable menu entry when we are in the session tab and selection changes if (scalar @sel_items == 1) { my $key = undef; $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); } }, undef ); fct_update_actions(scalar @sel_items, $key); } else { fct_update_actions(scalar @sel_items); } return TRUE; } sub fct_get_last_capture { #~ #determine last capture and return the relevant key #~ my $last_capture_tstamp = 0; #~ my $last_capture_key = 0; #~ foreach my $key (keys %session_screens){ #~ if(exists $session_screens{$key}->{'history'} && defined $session_screens{$key}->{'history'}){ #~ if(exists $session_screens{$key}->{'history_timestamp'} && defined $session_screens{$key}->{'history_timestamp'}){ #~ if($session_screens{$key}->{'history_timestamp'} > $last_capture_tstamp){ #~ $last_capture_tstamp = $session_screens{$key}->{'history_timestamp'}; #~ $last_capture_key = $key; #~ } #~ } #~ } #~ } #~ return $last_capture_key; if (exists $session_start_screen{'first_page'}->{'history'} && defined $session_start_screen{'first_page'}->{'history'}) { return $session_start_screen{'first_page'}->{'history'}; } return FALSE; } sub fct_ret_upload_links_menu { my $key = shift; my $menu_links = shift; my $traytheme = $sc->get_theme; if (defined $menu_links) { foreach my $child ($menu_links->get_children) { $child->destroy; } } else { $menu_links = Gtk3::Menu->new; } my $nmenu_entries = 0; if (defined $key && exists $session_screens{$key}->{'links'}) { foreach my $hoster (keys %{$session_screens{$key}->{'links'}}) { #no longer valid next unless defined $session_screens{$key}->{'links'}->{$hoster}; next unless scalar keys %{$session_screens{$key}->{'links'}->{$hoster}} > 0; next unless defined $session_screens{$key}->{'links'}->{$hoster}->{'menuentry'}; #create menu entry my $menuitem_hoster = Gtk3::ImageMenuItem->new_with_mnemonic($session_screens{$key}->{'links'}->{$hoster}->{'menuentry'}); if (defined $session_screens{$key}->{'links'}->{$hoster}->{'menuimage'}) { if ($traytheme->has_icon($session_screens{$key}->{'links'}->{$hoster}->{'menuimage'})) { $menuitem_hoster->set_image(Gtk3::Image->new_from_icon_name($session_screens{$key}->{'links'}->{$hoster}->{'menuimage'}, 'menu')); } } #create submenu with urls my $menu_urls = Gtk3::Menu->new; foreach my $url (keys %{$session_screens{$key}->{'links'}->{$hoster}}) { next if $url eq 'menuimage'; next if $url eq 'menuentry'; next if $url eq 'pubfile'; #create item my $menuitem_url = Gtk3::MenuItem->new_with_label($session_screens{$key}->{'links'}->{$hoster}->{$url}); foreach my $child ($menuitem_url->get_children) { if ($child =~ m/Gtk3::AccelLabel/) { $child->set_ellipsize('middle'); $child->set_width_chars(20); last; } } $menuitem_url->signal_connect( activate => sub { $clipboard->set_text($session_screens{$key}->{'links'}->{$hoster}->{$url}); }); #prepare identifier for tooltiup #e.g. direct_link => Direct link my $prep_url = $url; $prep_url =~ s/_/ /ig; $prep_url = ucfirst $prep_url; $menuitem_url->set_tooltip_text($prep_url); $menu_urls->append($menuitem_url); } $menuitem_hoster->set_submenu($menu_urls); $menu_links->append($menuitem_hoster); $nmenu_entries++; } } $menu_links->show_all; return ($nmenu_entries, $menu_links); } sub fct_update_actions { my $n_items = shift; my $key = shift; Glib::Idle->add( sub { #does the file still exist? if (defined $key) { return FALSE unless exists $session_screens{$key}; } #does the file still exist? if (defined $key) { return FALSE unless exists $session_screens{$key}; } #is key still current page? if (defined $key && $notebook->get_current_page != 0) { return FALSE unless exists $session_screens{$key}; return FALSE unless $session_screens{$key}->{'tab_child'} == $notebook->get_nth_page($notebook->get_current_page); #~ print "update actions for $key\n"; } #MENU #-------------------------------------- $sm->{_menuitem_reopen}->set_submenu(fct_ret_program_menu($sm->{_menuitem_reopen}->get_submenu)); #NAVIGATION BAR #-------------------------------------- if (defined $key && $notebook->get_current_page != 0) { #does the file still exist? return FALSE unless exists $session_screens{$key}; #disable sort buttons when session tab is active $st->{_sorta}->set_sensitive(FALSE); $st->{_sortd}->set_sensitive(FALSE); } else { #enable sort buttons when session tab is active $st->{_sorta}->set_sensitive(TRUE); $st->{_sortd}->set_sensitive(TRUE); } #TRAY #-------------------------------------- #last capture foreach my $child ($tray_menu->get_children) { if ($child->get_name eq 'redoshot') { $child->set_sensitive(fct_get_last_capture()); last; } } #TOOLBAR #-------------------------------------- #last capture $st->{_redoshot}->set_sensitive(fct_get_last_capture()); #goocanvas is optional, don't enable it when not installed if ($goocanvas) { $st->{_edit}->set_sensitive($n_items); } else { $st->{_edit}->set_sensitive(FALSE); } #upload links my (undef, $menu_links_tb) = fct_ret_upload_links_menu($key, $st->{_upload}->get_menu); $st->{_upload}->set_menu($menu_links_tb); $st->{_upload}->set_sensitive($n_items); #MENU #-------------------------------------- #last capture $sm->{_menuitem_redoshot}->set_sensitive($st->{_redoshot}->is_sensitive); #file #~ if(defined $key && defined $session_screens{$key}->{'is_unsaved'} && $session_screens{$key}->{'is_unsaved'}){ #~ $sm->{_menuitem_save}->set_sensitive($n_items); #~ }elsif(defined $key){ #~ $sm->{_menuitem_save}->set_sensitive(FALSE); #~ }else{ #~ $sm->{_menuitem_save}->set_sensitive($n_items); #~ } $sm->{_menuitem_save_as}->set_sensitive($n_items); #~ $sm->{_menuitem_export_svg}->set_sensitive($n_items); $sm->{_menuitem_export_pdf}->set_sensitive($n_items); $sm->{_menuitem_export_pscript}->set_sensitive($n_items); $sm->{_menuitem_pagesetup}->set_sensitive($n_items); $sm->{_menuitem_print}->set_sensitive($n_items); $sm->{_menuitem_email}->set_sensitive($n_items); $sm->{_menuitem_close}->set_sensitive($n_items); $sm->{_menuitem_close_all}->set_sensitive($n_items); #edit if ( $n_items && defined $key && defined $session_screens{$key}->{'undo'} && scalar @{$session_screens{$key}->{'undo'}} > 1) { $sm->{_menuitem_undo}->set_sensitive(TRUE); } else { $sm->{_menuitem_undo}->set_sensitive(FALSE); } if ( $n_items && defined $key && defined $session_screens{$key}->{'redo'} && scalar @{$session_screens{$key}->{'redo'}} > 0) { $sm->{_menuitem_redo}->set_sensitive(TRUE); } else { $sm->{_menuitem_redo}->set_sensitive(FALSE); } $sm->{_menuitem_trash}->set_sensitive($n_items); $sm->{_menuitem_copy}->set_sensitive($n_items); $sm->{_menuitem_copy_filename}->set_sensitive($n_items); #view $sm->{_menuitem_zoom_in}->set_sensitive($n_items); $sm->{_menuitem_zoom_out}->set_sensitive($n_items); $sm->{_menuitem_zoom_100}->set_sensitive($n_items); $sm->{_menuitem_zoom_best}->set_sensitive($n_items); #screenshot $sm->{_menuitem_reopen}->set_sensitive($n_items); $sm->{_menuitem_show_in_folder}->set_sensitive($n_items); $sm->{_menuitem_rename}->set_sensitive($n_items); #upload links #~ $sm->{_menuitem_links}->set_sensitive(fct_get_upload_links($key)); #upload links my ($nmenu_entries, $menu_links) = fct_ret_upload_links_menu($key, $sm->{_menuitem_links}->get_submenu); #~ if($nmenu_entries){ $sm->{_menuitem_links}->set_submenu($menu_links); #~ }else{ #~ $sm->{_menuitem_links}->set_submenu(undef); #~ } $sm->{_menuitem_links}->set_sensitive($nmenu_entries); #nautilus-sendto is optional, don't enable it when not installed if ($nautilus_sendto) { $sm->{_menuitem_send}->set_sensitive($n_items); } else { $sm->{_menuitem_send}->set_sensitive(FALSE); } $sm->{_menuitem_upload}->set_sensitive($n_items); #goocanvas is optional, don't enable it when not installed if ($goocanvas) { $sm->{_menuitem_draw}->set_sensitive($n_items); } else { $sm->{_menuitem_draw}->set_sensitive(FALSE); } $sm->{_menuitem_plugin}->set_sensitive($n_items); #redoshot_this if ( defined $key && exists $session_screens{$key}->{'history'} && defined $session_screens{$key}->{'history'}) { $sm->{_menuitem_redoshot_this}->set_sensitive($n_items); } else { $sm->{_menuitem_redoshot_this}->set_sensitive(FALSE); } #right-click menu $sm->{_menuitem_large_reopen}->set_sensitive($n_items); $sm->{_menuitem_large_show_in_folder}->set_sensitive($n_items); $sm->{_menuitem_large_rename}->set_sensitive($n_items); $sm->{_menuitem_large_trash}->set_sensitive($n_items); $sm->{_menuitem_large_copy}->set_sensitive($n_items); $sm->{_menuitem_large_copy_filename}->set_sensitive($n_items); #upload links my ($nmenu_entries_large, $menu_links_large) = fct_ret_upload_links_menu($key, $sm->{_menuitem_large_links}->get_submenu); #~ if($nmenu_entries_large){ $sm->{_menuitem_large_links}->set_submenu($menu_links_large); #~ }else{ #~ $sm->{_menuitem_large_links}->set_submenu(undef); #~ } $sm->{_menuitem_large_links}->set_sensitive($nmenu_entries_large); #nautilus-sendto is optional, don't enable it when not installed if ($nautilus_sendto) { $sm->{_menuitem_large_send}->set_sensitive($n_items); } else { $sm->{_menuitem_large_send}->set_sensitive(FALSE); } $sm->{_menuitem_large_upload}->set_sensitive($n_items); #goocanvas is optional, don't enable it when not installed if ($goocanvas) { $sm->{_menuitem_large_draw}->set_sensitive($n_items); } else { $sm->{_menuitem_large_draw}->set_sensitive(FALSE); } $sm->{_menuitem_large_plugin}->set_sensitive($n_items); #redoshot_this if ( defined $key && exists $session_screens{$key}->{'history'} && defined $session_screens{$key}->{'history'}) { $sm->{_menuitem_large_redoshot_this}->set_sensitive($n_items); } else { $sm->{_menuitem_large_redoshot_this}->set_sensitive(FALSE); } return FALSE; }); return TRUE; } sub evt_iconview_item_activated { my ($view, $path, $data) = @_; my $model = $view->get_model; my $iter = $model->get_iter($path); my $key = $model->get_value($iter, 2); $notebook->set_current_page($notebook->page_num($session_screens{$key}->{'tab_child'})); return TRUE; } sub evt_show_settings { fct_check_installed_programs(); $settings_dialog->show_all; my $settings_dialog_response = $settings_dialog->run; fct_post_settings($settings_dialog); if ($settings_dialog_response eq "close") { return TRUE; } else { return FALSE; } } sub fct_post_settings { my $settings_dialog = shift; #unset profile combobox when profile was not applied if ($current_profile_indx != $combobox_settings_profiles->get_active) { $combobox_settings_profiles->set_active($current_profile_indx); } if (defined $settings_dialog && $settings_dialog) { $settings_dialog->hide(); } #save directly fct_save_settings(undef); fct_save_settings($combobox_settings_profiles->get_active_text) if $combobox_settings_profiles->get_active != -1; #autostart $sas->create_autostart_file( Shutter::App::Directories::get_autostart_dir(), $fs_active->get_active, $fs_min_active->get_active, $fs_nonot_active->get_active ); #we need to update the first tab here #because the profile might have changed fct_update_info_and_tray(); return TRUE; } sub evt_page_setup { my ($widget, $data) = @_; #restore settings if prossible my $ssettings = Gtk3::PrintSettings->new; if ($shf->file_exists("$ENV{ HOME }/.shutter/printing.xml")) { eval { $ssettings = Gtk3::PrintSettings->new_from_file("$ENV{ HOME }/.shutter/printing.xml"); }; } ($pagesetup) = Glib::Object::Introspection->invoke('Gtk', undef, 'print_run_page_setup_dialog', $window, $pagesetup, $ssettings); return TRUE; } sub evt_save_as { my ($widget, $data) = @_; print "\n$data was emitted by widget $widget\n" if $sc->get_debug; my $key = fct_get_current_file(); my @save_as_files; #single file if ($key) { push @save_as_files, $key; #session tab } else { $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { my $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); push @save_as_files, $key; } }, undef ); } #determine requested filetype my $rfiletype = undef; if ($data eq 'menu_export_svg') { $rfiletype = 'svg'; } elsif ($data eq 'menu_export_ps') { $rfiletype = 'ps'; } elsif ($data eq 'menu_export_pdf') { $rfiletype = 'pdf'; } foreach my $file (@save_as_files) { dlg_save_as($file, $rfiletype); } return TRUE; } sub evt_save_profile { my ($widget, $combobox_settings_profiles, $current_profiles_ref) = @_; my $curr_profile_name = $combobox_settings_profiles->get_active_text || ""; my $new_profile_name = dlg_profile_name($curr_profile_name, $combobox_settings_profiles); if ($new_profile_name) { if ($curr_profile_name ne $new_profile_name) { $combobox_settings_profiles->prepend_text($new_profile_name); $combobox_settings_profiles->set_active(0); $current_profile_indx = 0; #unshift to array as well unshift(@{$current_profiles_ref}, $new_profile_name); fct_update_profile_selectors($combobox_settings_profiles, $current_profiles_ref); } #save settings fct_save_settings($new_profile_name); #autostart $sas->create_autostart_file( Shutter::App::Directories::get_autostart_dir(), $fs_active->get_active, $fs_min_active->get_active, $fs_nonot_active->get_active ); } return TRUE; } sub evt_delete_profile { my ($widget, $combobox_settings_profiles, $current_profiles_ref) = @_; if ($combobox_settings_profiles->get_active_text) { my $active_text = $combobox_settings_profiles->get_active_text; my $active_index = $combobox_settings_profiles->get_active; unlink("$ENV{'HOME'}/.shutter/profiles/" . $active_text . ".xml"); unlink("$ENV{'HOME'}/.shutter/profiles/" . $active_text . "_accounts.xml"); unless ($shf->file_exists("$ENV{'HOME'}/.shutter/profiles/" . $active_text . ".xml") || $shf->file_exists("$ENV{'HOME'}/.shutter/profiles/" . $active_text . "_accounts.xml")) { $combobox_settings_profiles->remove($active_index); $combobox_settings_profiles->set_active($combobox_settings_profiles->get_active + 1); $current_profile_indx = $combobox_settings_profiles->get_active; #remove from array as well splice(@{$current_profiles_ref}, $active_index, 1); fct_update_profile_selectors($combobox_settings_profiles, $current_profiles_ref); fct_show_status_message(1, $d->get("Profile deleted")); } else { $sd->dlg_error_message($d->get("Profile could not be deleted"), $d->get("Failed")); fct_show_status_message(1, $d->get("Profile could not be deleted")); } } return TRUE; } sub evt_apply_profile { my ($widget, $combobox_settings_profiles, $current_profiles_ref) = @_; if ($combobox_settings_profiles->get_active_text) { $settings_xml = fct_load_settings('profile_load', $combobox_settings_profiles->get_active_text); $current_profile_indx = $combobox_settings_profiles->get_active; my $current_profile_text = $combobox_settings_profiles->get_active_text; fct_update_profile_selectors($combobox_settings_profiles, $current_profiles_ref, $widget); fct_update_info_and_tray(); fct_show_status_message(1, sprintf($d->get("Profile %s loaded successfully"), "'" . $current_profile_text . "'")); } return TRUE; } #-------------------------------------- #functions #-------------------------------------- sub fct_try_init_tray { $tray_legacy = Gtk3::StatusIcon->new(); $tray_legacy->set_from_icon_name("shutter-panel"); $tray_legacy->set_visible(1); fct_update_gui(); if ($tray_legacy->is_embedded) { if ($tray_libappindicator) { $tray_libappindicator->set_status('passive'); $tray_libappindicator = undef; } $tray = $tray_legacy; $tray->{'hid'} = $tray->signal_connect( 'popup-menu' => sub { evt_show_systray_statusicon(@_); }, $tray ); $tray->{'hid2'} = $tray->signal_connect( 'activate' => sub { evt_activate_systray_statusicon(@_); $tray; }, $tray ); } else { $tray_legacy->set_visible(0); $tray_legacy = undef; if ($appindicator && !$tray_libappindicator) { # Fallback to AppIndicator. This one doesn't allow left-click signal, but it seems to be the only option for Gnome on Ubuntu 21.04... $tray_libappindicator = AppIndicator::Indicator->new("Shutter", "shutter-panel", 'application-status'); $tray_libappindicator->set_menu($tray_menu); $tray_libappindicator->set_status('active'); } if ($tray_libappindicator) { $tray = $tray_libappindicator; } else { $tray = undef; } } } sub fct_create_session_notebook { #~ $notebook->set( 'homogeneous' => TRUE ); $notebook->set('scrollable' => TRUE); #enable dnd for it $notebook->drag_dest_set('all', [Gtk3::TargetEntry->new('text/uri-list', [], 0)], 'link'); $notebook->signal_connect(drag_data_received => \&fct_drop_handler); $notebook->signal_connect(drag_motion => sub { my ($view, $ctx, $x, $y, $time) = @_; for my $target (@{$ctx->list_targets}) { if ($target->name eq 'text/uri-list') { Gtk3::Gdk::drag_status($ctx, 'link', $time); return TRUE; } } return FALSE; }); #packing and first page my $hbox_first_label = Gtk3::HBox->new(FALSE, 0); my $thumb_first_icon = Gtk3::Image->new_from_stock('gtk-index', 'menu'); my $tab_first_label = Gtk3::Label->new(); $tab_first_label->set_markup("" . $d->get("Session") . ""); $hbox_first_label->pack_start($thumb_first_icon, FALSE, FALSE, 1); $hbox_first_label->pack_start($tab_first_label, FALSE, FALSE, 1); $hbox_first_label->show_all; my $new_index = $notebook->append_page(fct_create_tab("", TRUE), $hbox_first_label); $session_start_screen{'first_page'}->{'tab_child'} = $notebook->get_nth_page($new_index); $notebook->signal_connect('switch-page' => \&evt_notebook_switch); return $notebook; } sub fct_integrate_screenshot_in_notebook { my ($giofile, $pixbuf, $history, $count) = @_; #check parameters return FALSE unless $giofile; unless ($giofile->query_exists) { fct_show_status_message(1, $giofile->get_path . " " . $d->get("not found")); return FALSE; } #check mime type my ($mime_type) = Glib::Object::Introspection->invoke('Gio', undef, 'content_type_guess', $giofile->get_path); $mime_type =~ s/image\/x\-apple\-ios\-png/image\/png/; #FIXME if ($mime_type =~ m/(pdf|ps|svg)/ig) { #not a supported mime type #~ my $response = $sd->dlg_error_message( #~ sprintf ( $d->get( "Error while opening image %s." ), "'" . $giofile->get_path . "'" ) , #~ $d->get( "There was an error opening the image." ), #~ undef, undef, undef, #~ undef, undef, undef, #~ $d->get( "MimeType not supported." ) #~ ); #~ fct_show_status_message( 1, $giofile->get_path . " " . $d->get("not supported") ); return FALSE; } #add to recentmanager Gtk3::RecentManager::get_default->add_item($giofile->get_path); #FIXME my $num_files = $session_start_screen{'first_page'}->{'num_session_files'}; #append a page to notebook using with label == filename my $fname = $shf->utf8_decode(unescape_string_for_display($giofile->get_basename)); my $key = 0; my $indx = 0; if (defined $num_files && $num_files > 0) { if (defined $history && $history->get_history) { $indx = $num_files + 1; #update it (e.g. when taking more than one screenshot when still loading session) $session_start_screen{'first_page'}->{'num_session_files'} = $indx; } elsif (defined $count) { $indx = $count; } else { $indx = $num_files + 1; while ($indx < fct_get_latest_tab_key()) { $indx++; } #update it (e.g. when taking more than one screenshot when still loading session) $session_start_screen{'first_page'}->{'num_session_files'} = $indx; } } else { $indx = fct_get_latest_tab_key(); } $key = "[" . $indx . "] - $fname"; #~ print $key, "-", $giofile->to_string, "\n"; #store the history object if (defined $history && $history->get_history) { $session_screens{$key}->{'history'} = $history; $session_start_screen{'first_page'}->{'history'} = $history; $session_screens{$key}->{'history_timestamp'} = time; } #setup tab label (thumb, preview etc.) my $hbox_tab_label = Gtk3::HBox->new(FALSE, 0); my $close_icon = Gtk3::Image->new_from_icon_name('window-close', 'menu'); $session_screens{$key}->{'tab_icon'} = Gtk3::Image->new; #setup tab label my $tab_close_button = Gtk3::Button->new; $tab_close_button->set_relief('none'); $tab_close_button->set_image($close_icon); $tab_close_button->set_name('tab-close-button'); my $tab_label = Gtk3::Label->new($key); $tab_label->set_ellipsize('middle'); $tab_label->set_width_chars(20); $hbox_tab_label->pack_start($session_screens{$key}->{'tab_icon'}, FALSE, FALSE, 1); $hbox_tab_label->pack_start($tab_label, TRUE, TRUE, 1); $hbox_tab_label->pack_start(Gtk3::HBox->new, TRUE, TRUE, 1); $hbox_tab_label->pack_start($tab_close_button, FALSE, FALSE, 1); $hbox_tab_label->show_all; #and append page with label == key my $new_index = 0; if (defined $num_files && $num_files > 0) { if (defined $history && $history->get_history) { $new_index = $notebook->insert_page(fct_create_tab($key, FALSE), $hbox_tab_label, $indx); } elsif (defined $count) { $new_index = $notebook->insert_page(fct_create_tab($key, FALSE), $hbox_tab_label, $count); } else { $new_index = $notebook->insert_page(fct_create_tab($key, FALSE), $hbox_tab_label, $indx); } } else { $new_index = $notebook->append_page(fct_create_tab($key, FALSE), $hbox_tab_label); } $session_screens{$key}->{'tab_indx'} = $indx; $session_screens{$key}->{'tab_label'} = $tab_label; $session_screens{$key}->{'hbox_tab_label'} = $hbox_tab_label; $session_screens{$key}->{'tab_child'} = $notebook->get_nth_page($new_index); $tab_close_button->signal_connect(clicked => sub { fct_remove($key); }); #this value is undefined when all files are loaded #in this case we switch to any new image unless (defined $session_start_screen{'first_page'}->{'num_session_files'}) { $notebook->set_current_page($new_index); } else { #if there is a history we recently took a screenshot #switch to that page #(even though the session is still loading) if (defined $history && $history->get_history) { $notebook->set_current_page($new_index); } } if (fct_update_tab($key, $pixbuf, $giofile, undef, undef, TRUE)) { #setup a filemonitor, so we get noticed if the file changed fct_add_file_monitor($key); } return $key; } sub fct_add_file_monitor { my $key = shift; $session_screens{$key}->{'changed'} = FALSE; $session_screens{$key}->{'deleted'} = FALSE; $session_screens{$key}->{'created'} = FALSE; eval { if (defined $session_screens{$key}->{'giofile'}) { my $monitor = $session_screens{$key}->{'giofile'}->monitor_file([]); $session_screens{$key}->{'monitor'} = $monitor; $monitor->signal_connect( 'changed', sub { my $handle = shift; my $file1 = shift; my $file2 = shift; my $event = shift; my $key = shift; print $event. " - $key\n" if $sc->get_debug; if ($event eq 'deleted') { $handle->cancel; if (exists $session_screens{$key}) { $session_screens{$key}->{'deleted'} = TRUE; $session_screens{$key}->{'changed'} = TRUE; fct_update_tab($key); } } elsif ($event eq 'changed') { print $session_screens{$key}->{'giofile'}->get_path . " - " . $event . "\n" if $sc->get_debug; $session_screens{$key}->{'changed'} = TRUE; fct_update_tab($key); } }, $key ); } }; if ($@) { #show error dialog when installing the file #monitor failed $sd->dlg_error_message("$@", $d->get("Error while adding the file monitor.")); return FALSE; } return TRUE; } sub fct_control_signals { my $action = shift; my $sensitive = undef; if ($action eq 'block') { $sensitive = FALSE; #block signals foreach my $connection (@signal_connections) { if ($app->signal_handler_is_connected($connection)) { $app->signal_handler_block($connection); } } #and block status icon handler if ($tray && $tray->isa('Gtk3::StatusIcon')) { if ($tray->signal_handler_is_connected($tray->{'hid'})) { $tray->signal_handler_block($tray->{'hid'}); } if ($tray->signal_handler_is_connected($tray->{'hid2'})) { $tray->signal_handler_block($tray->{'hid2'}); } } elsif ($tray && $tray->isa('AppIndicator::Indicator')) { $tray->set_status('passive'); } } elsif ($action eq 'unblock') { $sensitive = TRUE; #attach signal-handler again foreach my $connection (@signal_connections) { if ($app->signal_handler_is_connected($connection)) { $app->signal_handler_unblock($connection); } } #and unblock status icon handler if ($tray && $tray->isa('Gtk3::StatusIcon')) { if ($tray->signal_handler_is_connected($tray->{'hid'})) { $tray->signal_handler_unblock($tray->{'hid'}); } if ($tray->signal_handler_is_connected($tray->{'hid2'})) { $tray->signal_handler_unblock($tray->{'hid2'}); } } elsif ($tray && $tray->isa('AppIndicator::Indicator')) { $tray->set_status('active'); } } #enable/disable controls if ($st->{_select} && $sm->{_menuitem_selection}) { # if $x11_supported is false, we are on Wayland, and all these buttons are already disabled and should stay disabled #menu if ($x11_supported) { $sm->{_menuitem_selection}->set_sensitive($sensitive); $sm->{_menuitem_window}->set_sensitive($sensitive); #$sm->{_menuitem_section}->set_sensitive($sensitive); $sm->{_menuitem_menu}->set_sensitive($sensitive); $sm->{_menuitem_tooltip}->set_sensitive($sensitive); } $sm->{_menuitem_web}->set_sensitive($sensitive) if ($gnome_web_photo); $sm->{_menuitem_iclipboard}->set_sensitive($sensitive); #toolbar if ($x11_supported) { $st->{_select}->set_sensitive($sensitive); $st->{_window}->set_sensitive($sensitive); #$st->{_section}->set_sensitive($sensitive); $st->{_menu}->set_sensitive($sensitive); $st->{_tooltip}->set_sensitive($sensitive); } $st->{_web}->set_sensitive($sensitive) if ($gnome_web_photo); #special case: redoshot (toolbar and menu) if (fct_get_last_capture()) { $st->{_redoshot}->set_sensitive($sensitive); $sm->{_menuitem_redoshot}->set_sensitive($sensitive); } } return TRUE; } sub fct_control_main_window { my $mode = shift; #default value for present is TRUE my $present = TRUE; $present = shift if @_; #this is an unusual method for raising the window #to the top within the stacking order (z-axis) #but it works best here if ($mode eq 'show' && $present) { #move window to saved position $window->move($window->{x}, $window->{y}) if (defined $window->{x} && defined $window->{y}); #if it's shown already, but behind other windows, without hiding it doesn't show $window->hide; $window->show_all; #$window->window->focus(Gtk3->get_current_event_time) # if defined $window->window; $window->present; #set flag $is_hidden = FALSE; #toolbar->set_show_arrow is FALSE at startup #to automatically adjust the main window width #we change the setting to TRUE if it is still false, #so the window/toolbar is resizable again if ($st->{_toolbar}) { unless ($st->{_toolbar}->get_show_arrow) { $st->{_toolbar}->set_show_arrow(TRUE); #add a small margin my ($rw, $rh) = $window->get_size; $window->resize($rw + 50, $rh); } } } elsif ($mode eq 'hide') { #save current position of main window ($window->{x}, $window->{y}) = $window->get_position; $window->hide; $is_hidden = TRUE; } return TRUE; } sub fct_create_tab { my ($key, $is_all) = @_; my $vbox = Gtk3::VBox->new(FALSE, 0); my $vbox_tab = Gtk3::VBox->new(FALSE, 0); my $vbox_tab_event = Gtk3::EventBox->new; unless ($is_all) { #Gtk2::ImageView - empty at first $session_screens{$key}->{'image'} = Gtk3::ImageView->new(); #$session_screens{$key}->{'image'}->set_show_frame(FALSE); $session_screens{$key}->{'image'}->set_fitting(TRUE); $session_screens{$key}->{'image'}->get_style_context->add_provider($css_provider_alpha, 0); $session_screens{$key}->{'image'}->set('zoom-step', 1.2); #Gtk2::ImageView::ScrollWin packaged in a Gtk2::ScrolledWindow #my $scrolled_window_image = Gtk2::ImageView::ScrollWin->new($session_screens{$key}->{'image'}); my $scrolled_window_image = Gtk3::ScrolledWindow->new; $scrolled_window_image->add_with_viewport($session_screens{$key}->{'image'}); #WORKAROUND #upstream bug #http://trac.bjourne.webfactional.com/ticket/21 #left => zoom in #right => zoom out $session_screens{$key}->{'image'}->signal_connect( 'scroll-event', sub { my ($view, $ev) = @_; if ($ev->direction eq 'left') { $ev->direction('up'); } elsif ($ev->direction eq 'right') { $ev->direction('down'); } return FALSE; }); $session_screens{$key}->{'image'}->signal_connect( 'button-press-event', sub { my ($view, $ev) = @_; if ($ev->button == 1 && $ev->type eq '2button-press') { fct_zoom_best(); return TRUE; } else { return FALSE; } }); $session_screens{$key}->{'image'}->signal_connect( 'dnd-start', sub { my ($view, $x, $y, $button) = @_; my $list = Gtk3::TargetList->new; $list->add_table([Gtk3::TargetEntry->new('text/uri-list', [], 0)]); $view->drag_begin_with_coordinates( $list, ['copy'], $button, undef, $x, $y, ); return TRUE; } ); $session_screens{$key}->{'image'}->signal_connect( 'drag-data-get', sub { my ($widget, $context, $data, $info, $time) = @_; $data->set_uris([$session_screens{$key}->{'giofile'}->get_uri]); } ); $session_screens{$key}->{'image'}->signal_connect( 'zoom-changed', sub { my ($view, $zoom) = @_; if ($zoom >= 1) { $view->set_interpolation('nearest'); } else { $view->set_interpolation('bilinear'); } } ); $vbox_tab->pack_start($scrolled_window_image, TRUE, TRUE, 0); $vbox->pack_start($vbox_tab, TRUE, TRUE, 0); #pack vbox into an event box so we can listen #to various key and button events $vbox_tab_event->add($vbox); $vbox_tab_event->show_all; $vbox_tab_event->signal_connect('button-press-event', \&evt_tab_button_press, $key); return $vbox_tab_event; } else { #create iconview for session $session_start_screen{'first_page'}->{'model'} = Gtk3::ListStore->new('Gtk3::Gdk::Pixbuf', 'Glib::String', 'Glib::String'); $session_start_screen{'first_page'}->{'model'}->set_sort_column_id(2, 'descending'); $session_start_screen{'first_page'}->{'view'} = Gtk3::IconView->new_with_model($session_start_screen{'first_page'}->{'model'}); #~ $session_start_screen{'first_page'}->{'view'}->set_orientation('horizontal'); $session_start_screen{'first_page'}->{'view'}->set_item_width(100); $session_start_screen{'first_page'}->{'view'}->set_pixbuf_column(0); $session_start_screen{'first_page'}->{'view'}->set_text_column(1); $session_start_screen{'first_page'}->{'view'}->set_selection_mode('multiple'); #~ $session_start_screen{'first_page'}->{'view'}->set_columns(0); $session_start_screen{'first_page'}->{'view'}->signal_connect('selection-changed', \&evt_iconview_sel_changed, 'sel_changed'); $session_start_screen{'first_page'}->{'view'}->signal_connect('item-activated', \&evt_iconview_item_activated, 'item_activated'); #pack into scrolled window my $scrolled_window_view = Gtk3::ScrolledWindow->new; $scrolled_window_view->set_policy('automatic', 'automatic'); $scrolled_window_view->set_shadow_type('in'); $scrolled_window_view->add($session_start_screen{'first_page'}->{'view'}); #add an event box to show a context menu on right-click my $view_event = Gtk3::EventBox->new; $view_event->add($scrolled_window_view); $view_event->signal_connect('button-press-event', \&evt_iconview_button_press, $session_start_screen{'first_page'}->{'view'}); #dnd $session_start_screen{'first_page'}->{'view'}->enable_model_drag_source( 'button1-mask', [Gtk3::TargetEntry->new('text/uri-list', [], 0)], ['copy']); $session_start_screen{'first_page'}->{'view'}->signal_connect( 'drag-data-get', sub { my ($widget, $context, $data, $info, $time) = @_; my @target_list; $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { my $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); if (exists $session_screens{$key}->{'giofile'} && defined $session_screens{$key}->{'giofile'}) { push @target_list, $session_screens{$key}->{'giofile'}->get_uri; } } }); $data->set_uris(\@target_list); }); $vbox_tab->pack_start($view_event, TRUE, TRUE, 0); $vbox->pack_start($vbox_tab, TRUE, TRUE, 0); $vbox->show_all; return $vbox; } } sub fct_save_settings { my ($profilename) = @_; #settings file my $settingsfile = "$ENV{ HOME }/.shutter/settings.xml"; if (defined $profilename) { $settingsfile = "$ENV{ HOME }/.shutter/profiles/$profilename.xml" if ($profilename ne ""); } #session file my $sessionfile = "$ENV{ HOME }/.shutter/session.xml"; #accounts file my $accountsfile = "$ENV{ HOME }/.shutter/accounts.xml"; if (defined $profilename) { $accountsfile = "$ENV{ HOME }/.shutter/profiles/$profilename\_accounts.xml" if ($profilename ne ""); } #we store the version info, so we know if there was a new version installed #when starting new version we clear the cache on first startup $settings{'general'}->{'app_version'} = $sc->get_version . $sc->get_rev; $settings{'general'}->{'last_profile'} = $combobox_settings_profiles->get_active; $settings{'general'}->{'last_profile_name'} = $combobox_settings_profiles->get_active_text || ""; #menu $settings{'gui'}->{'btoolbar_active'} = $sm->{_menuitem_btoolbar}->get_active(); #recently used $settings{'recent'}->{'ruu_tab'} = $sc->get_ruu_tab; $settings{'recent'}->{'ruu_hosting'} = $sc->get_ruu_hosting; $settings{'recent'}->{'ruu_places'} = $sc->get_ruu_places; #main $settings{'general'}->{'filetype'} = $combobox_type->get_active; $settings{'general'}->{'quality'} = $scale->get_value(); if ($filename->get_text() =~ "\%NN" || $filename->get_text() =~ "\%T") { $settings{'general'}->{'filename'} = $filename->get_text(); } else { $sd->dlg_error_message($@, $d->get("Settings could not be saved! Please make sure that the filename contains a wildcard like \%NN or \%T!")); evt_show_settings(); return 1; } $settings{'general'}->{'folder'} = Glib::filename_to_unicode($saveDir_button->get_filename()); #~ print "Pfad ".$saveDir_button->get_filename()."\n"; #~ print "Pfad ".$saveDir_button->get_uri()."\n"; $settings{'general'}->{'save_auto'} = $save_auto_active->get_active(); $settings{'general'}->{'save_ask'} = $save_ask_active->get_active(); $settings{'general'}->{'save_no'} = $save_no_active->get_active(); $settings{'general'}->{'image_autocopy'} = $image_autocopy_active->get_active(); $settings{'general'}->{'fname_autocopy'} = $fname_autocopy_active->get_active(); $settings{'general'}->{'no_autocopy'} = $no_autocopy_active->get_active(); $settings{'general'}->{'cursor'} = $cursor_active->get_active(); $settings{'general'}->{'delay'} = $delay->get_value(); #wrksp -> submenu if ($x11_supported) { $settings{'general'}->{'current_monitor_active'} = $current_monitor_active->get_active; } #determining timeout if ($gnome_web_photo) { my $web_menu = $st->{_web}->get_menu; my @timeouts = $web_menu->get_children; my $timeout = undef; foreach my $to (@timeouts) { if ($to->get_active) { $timeout = $to->get_name; $timeout =~ /([0-9]+)/; $timeout = $1; } } $settings{'general'}->{'web_timeout'} = $timeout; } my $model = $progname->get_model(); my $progname_iter = $progname->get_active_iter(); if (defined $progname_iter) { my $progname_value = $model->get_value($progname_iter, 1); $settings{'general'}->{'prog'} = $progname_value; } #actions $settings{'general'}->{'prog_active'} = $progname_active->get_active(); $settings{'general'}->{'im_colors'} = $combobox_im_colors->get_active(); $settings{'general'}->{'im_colors_active'} = $im_colors_active->get_active(); $settings{'general'}->{'thumbnail'} = $thumbnail->get_value(); $settings{'general'}->{'thumbnail_active'} = $thumbnail_active->get_active(); $settings{'general'}->{'bordereffect'} = $bordereffect->get_value(); $settings{'general'}->{'bordereffect_active'} = $bordereffect_active->get_active(); my $bcolor = $bordereffect_cbtn->get_color; $settings{'general'}->{'bordereffect_col'} = sprintf("#%02x%02x%02x", $bcolor->red / 257, $bcolor->green / 257, $bcolor->blue / 257); #advanced $settings{'general'}->{'zoom_active'} = $zoom_active->get_active(); $settings{'general'}->{'as_help_active'} = $as_help_active->get_active(); $settings{'general'}->{'as_confirmation_necessary'} = $as_confirmation_necessary->get_active(); $settings{'general'}->{'asel_x'} = $asel_size3->get_value(); $settings{'general'}->{'asel_y'} = $asel_size4->get_value(); $settings{'general'}->{'asel_w'} = $asel_size1->get_value(); $settings{'general'}->{'asel_h'} = $asel_size2->get_value(); $settings{'general'}->{'border'} = $border_active->get_active(); $settings{'general'}->{'winresize_active'} = $winresize_active->get_active(); $settings{'general'}->{'winresize_w'} = $winresize_w->get_value(); $settings{'general'}->{'winresize_h'} = $winresize_h->get_value(); $settings{'general'}->{'autoshape_active'} = $autoshape_active->get_active(); $settings{'general'}->{'visible_windows'} = $visible_windows_active->get_active(); $settings{'general'}->{'menu_delay'} = $menu_delay->get_value(); $settings{'general'}->{'menu_waround'} = $menu_waround_active->get_active(); $settings{'general'}->{'web_width'} = $combobox_web_width->get_active(); #imageview $settings{'general'}->{'trans_check'} = $trans_check->get_active(); $settings{'general'}->{'trans_custom'} = $trans_custom->get_active(); my $tcolor = $trans_custom_btn->get_color; $settings{'general'}->{'trans_custom_col'} = sprintf("#%02x%02x%02x", $tcolor->red / 257, $tcolor->green / 257, $tcolor->blue / 257); $settings{'general'}->{'trans_backg'} = $trans_backg->get_active(); $settings{'general'}->{'session_asc'} = $session_asc->get_active(); $settings{'general'}->{'session_asc_combo'} = $session_asc_combo->get_active(); $settings{'general'}->{'session_desc'} = $session_desc->get_active(); $settings{'general'}->{'session_desc_combo'} = $session_desc_combo->get_active(); #behavior $settings{'general'}->{'autofs'} = $fs_active->get_active(); $settings{'general'}->{'autofs_min'} = $fs_min_active->get_active(); $settings{'general'}->{'autofs_not'} = $fs_nonot_active->get_active(); $settings{'general'}->{'autohide'} = $hide_active->get_active(); $settings{'general'}->{'autohide_time'} = $hide_time->get_value(); $settings{'general'}->{'present_after'} = $present_after_active->get_active(); $settings{'general'}->{'close_at_close'} = $close_at_close_active->get_active(); $settings{'general'}->{'notify_after'} = $notify_after_active->get_active(); $settings{'general'}->{'notify_timeout'} = $notify_timeout_active->get_active(); $settings{'general'}->{'notify_ptimeout'} = $notify_ptimeout_active->get_active(); $settings{'general'}->{'notify_agent'} = $combobox_ns->get_active(); $settings{'general'}->{'ask_on_delete'} = $ask_on_delete_active->get_active(); $settings{'general'}->{'delete_on_close'} = $delete_on_close_active->get_active(); $settings{'general'}->{'ask_on_fs_delete'} = $ask_on_fs_delete_active->get_active(); #ftp upload $settings{'general'}->{'ftp_uri'} = $ftp_remote_entry->get_text(); $settings{'general'}->{'ftp_mode'} = $ftp_mode_combo->get_active(); $settings{'general'}->{'ftp_username'} = $ftp_username_entry->get_text(); $settings{'general'}->{'ftp_password'} = $ftp_password_entry->get_text(); $settings{'general'}->{'ftp_wurl'} = $ftp_wurl_entry->get_text(); #plugins foreach my $plugin_key (sort keys %plugins) { $settings{'plugins'}->{$plugin_key}->{'name'} = $plugin_key; $settings{'plugins'}->{$plugin_key}->{'binary'} = $plugins{$plugin_key}->{'binary'}; $settings{'plugins'}->{$plugin_key}->{'name_plugin'} = $plugins{$plugin_key}->{'name'}; $settings{'plugins'}->{$plugin_key}->{'category'} = $plugins{$plugin_key}->{'category'}; #keep newlines => switch them to ]]> tags #the load routine does it the other way round my $temp_tooltip = $plugins{$plugin_key}->{'tooltip'}; $temp_tooltip =~ s/\n/\<\!\[CDATA\[\\]\]\>/g; $settings{'plugins'}->{$plugin_key}->{'tooltip'} = $temp_tooltip; $settings{'plugins'}->{$plugin_key}->{'lang'} = $plugins{$plugin_key}->{'lang'}; $settings{'plugins'}->{$plugin_key}->{'recent'} = $plugins{$plugin_key}->{'recent'} if defined $plugins{$plugin_key}->{'recent'}; } #settings eval { my ($tmpfh, $tmpfilename) = tempfile(UNLINK => 1); XMLout(\%settings, OutputFile => $tmpfilename); #and finally move the file mv($tmpfilename, $settingsfile); }; if ($@) { $sd->dlg_error_message($@, $d->get("Settings could not be saved!")); } else { fct_show_status_message(1, $d->get("Settings saved successfully!")); } #we need to clean the hashkeys, so they become parseable my %clean_files; my $counter = 0; foreach my $key (Sort::Naturally::nsort(keys %session_screens)) { next unless exists $session_screens{$key}->{'long'}; #8 leading zeros to counter $counter = sprintf("%08d", $counter); if ($shf->file_exists($session_screens{$key}->{'long'})) { $clean_files{"file" . $counter}{'filename'} = $session_screens{$key}->{'long'}; $counter++; } } #session eval { my ($tmpfh, $tmpfilename) = tempfile(UNLINK => 1); XMLout(\%clean_files, OutputFile => $tmpfilename); #and finally move the file mv($tmpfilename, $sessionfile); }; if ($@) { $sd->dlg_error_message($@, $d->get("Session could not be saved!")); } #accounts #~ print Dumper %accounts; my %clean_accounts; foreach my $ac (keys %accounts) { $clean_accounts{$ac}->{'path'} = $accounts{$ac}->{'path'}; $clean_accounts{$ac}->{'host'} = $accounts{$ac}->{'host'}; $clean_accounts{$ac}->{'password'} = $accounts{$ac}->{'password'}; $clean_accounts{$ac}->{'username'} = $accounts{$ac}->{'username'}; $clean_accounts{$ac}->{'module'} = $accounts{$ac}->{'module'}; $clean_accounts{$ac}->{'folder'} = $accounts{$ac}->{'folder'}; $clean_accounts{$ac}->{'description'} = $accounts{$ac}->{'description'}; $clean_accounts{$ac}->{'register_text'} = $accounts{$ac}->{'register_text'}; $clean_accounts{$ac}->{'register_color'} = $accounts{$ac}->{'register_color'}; $clean_accounts{$ac}->{'supports_anonymous_upload'} = $accounts{$ac}->{'supports_anonymous_upload'}; $clean_accounts{$ac}->{'supports_authorized_upload'} = $accounts{$ac}->{'supports_authorized_upload'}; $clean_accounts{$ac}->{'supports_oauth_upload'} = $accounts{$ac}->{'supports_oauth_upload'}; } eval { my ($tmpfh, $tmpfilename) = tempfile(UNLINK => 1); XMLout(\%clean_accounts, OutputFile => $tmpfilename); #and finally move the file mv($tmpfilename, $accountsfile); }; if ($@) { $sd->dlg_error_message($@, $d->get("Account-settings could not be saved!")); } return TRUE; } sub fct_load_settings { my ($data, $profilename) = @_; #settings file my $settingsfile = "$ENV{ HOME }/.shutter/settings.xml"; $settingsfile = "$ENV{ HOME }/.shutter/profiles/$profilename.xml" if (defined $profilename); my $settings_xml; if ($shf->file_exists($settingsfile)) { eval { $settings_xml = XMLin(IO::File->new($settingsfile)); if ($data eq 'profile_load') { $combobox_type->set_active($settings_xml->{'general'}->{'filetype'}); #main $scale->set_value($settings_xml->{'general'}->{'quality'}); utf8::decode $settings_xml->{'general'}->{'filename'}; $filename->set_text($settings_xml->{'general'}->{'filename'}); utf8::decode $settings_xml->{'general'}->{'folder'}; $saveDir_button->set_filename($settings_xml->{'general'}->{'folder'}); $save_auto_active->set_active($settings_xml->{'general'}->{'save_auto'}); $save_ask_active->set_active($settings_xml->{'general'}->{'save_ask'}); $save_no_active->set_active($settings_xml->{'general'}->{'save_no'}); $image_autocopy_active->set_active($settings_xml->{'general'}->{'image_autocopy'}); $fname_autocopy_active->set_active($settings_xml->{'general'}->{'fname_autocopy'}); $no_autocopy_active->set_active($settings_xml->{'general'}->{'no_autocopy'}); $cursor_active->set_active($settings_xml->{'general'}->{'cursor'}); $delay->set_value($settings_xml->{'general'}->{'delay'}); #FIXME #this is a dirty hack to force the setting to be enabled in session tab #at the moment i simply dont know why the filechooser "caches" the old value # => weird... $settings_xml->{'general'}->{'folder_force'} = TRUE; #wrksp -> submenu $current_monitor_active->set_active($settings_xml->{'general'}->{'current_monitor_active'}); #determining timeout my $web_menu = $st->{_web}->get_menu; if (defined $web_menu) { my @timeouts = $web_menu->get_children; my $timeout = undef; foreach my $to (@timeouts) { $timeout = $to->get_name; $timeout =~ /([0-9]+)/; $timeout = $1; if ($settings_xml->{'general'}->{'web_timeout'} == $timeout) { $to->set_active(TRUE); } } } #action settings my $model = $progname->get_model; utf8::decode $settings_xml->{'general'}->{'prog'}; $model->foreach(\&fct_iter_programs, $settings_xml->{'general'}->{'prog'}); $progname_active->set_active($settings_xml->{'general'}->{'prog_active'}); $im_colors_active->set_active($settings_xml->{'general'}->{'im_colors_active'}); $combobox_im_colors->set_active($settings_xml->{'general'}->{'im_colors'}); $thumbnail->set_value($settings_xml->{'general'}->{'thumbnail'}); $thumbnail_active->set_active($settings_xml->{'general'}->{'thumbnail_active'}); $bordereffect->set_value($settings_xml->{'general'}->{'bordereffect'}); $bordereffect_active->set_active($settings_xml->{'general'}->{'bordereffect_active'}); if (defined $settings_xml->{'general'}->{'bordereffect_col'}) { $bordereffect_cbtn->set_rgba(Gtk3::Gdk::RGBA::parse($settings_xml->{'general'}->{'bordereffect_col'})); } #advanced settings $zoom_active->set_active($settings_xml->{'general'}->{'zoom_active'}); $as_help_active->set_active($settings_xml->{'general'}->{'as_help_active'}); $as_confirmation_necessary->set_active($settings_xml->{'general'}->{'as_confirmation_necessary'}); $asel_size3->set_value($settings_xml->{'general'}->{'asel_x'}); $asel_size4->set_value($settings_xml->{'general'}->{'asel_y'}); $asel_size1->set_value($settings_xml->{'general'}->{'asel_w'}); $asel_size2->set_value($settings_xml->{'general'}->{'asel_h'}); $border_active->set_active($settings_xml->{'general'}->{'border'}); $winresize_active->set_active($settings_xml->{'general'}->{'winresize_active'}); $winresize_w->set_value($settings_xml->{'general'}->{'winresize_w'}); $winresize_h->set_value($settings_xml->{'general'}->{'winresize_h'}); $autoshape_active->set_active($settings_xml->{'general'}->{'autoshape_active'}); $visible_windows_active->set_active($settings_xml->{'general'}->{'visible_windows'}); $menu_waround_active->set_active($settings_xml->{'general'}->{'menu_waround'}); $menu_delay->set_value($settings_xml->{'general'}->{'menu_delay'}); $combobox_web_width->set_active($settings_xml->{'general'}->{'web_width'}); #imageview $trans_check->set_active($settings_xml->{'general'}->{'trans_check'}); $trans_custom->set_active($settings_xml->{'general'}->{'trans_custom'}); if (defined $settings_xml->{'general'}->{'trans_custom_col'}) { $trans_custom_btn->set_rgba(Gtk3::Gdk::RGBA::parse($settings_xml->{'general'}->{'trans_custom_col'})); } $trans_backg->set_active($settings_xml->{'general'}->{'trans_backg'}); $session_asc->set_active($settings_xml->{'general'}->{'session_asc'}); $session_asc_combo->set_active($settings_xml->{'general'}->{'session_asc_combo'}); $session_desc->set_active($settings_xml->{'general'}->{'session_desc'}); $session_desc_combo->set_active($settings_xml->{'general'}->{'session_desc_combo'}); #behavior $fs_active->set_active($settings_xml->{'general'}->{'autofs'}); $fs_min_active->set_active($settings_xml->{'general'}->{'autofs_min'}); $fs_nonot_active->set_active($settings_xml->{'general'}->{'autofs_not'}); $hide_active->set_active($settings_xml->{'general'}->{'autohide'}); $hide_time->set_value($settings_xml->{'general'}->{'autohide_time'}); $present_after_active->set_active($settings_xml->{'general'}->{'present_after'}); $close_at_close_active->set_active($settings_xml->{'general'}->{'close_at_close'}); $notify_after_active->set_active($settings_xml->{'general'}->{'notify_after'}); $notify_timeout_active->set_active($settings_xml->{'general'}->{'notify_timeout'}); $notify_ptimeout_active->set_active($settings_xml->{'general'}->{'notify_ptimeout'}); $combobox_ns->set_active($settings_xml->{'general'}->{'notify_agent'}); $ask_on_delete_active->set_active($settings_xml->{'general'}->{'ask_on_delete'}); $delete_on_close_active->set_active($settings_xml->{'general'}->{'delete_on_close'}); $ask_on_fs_delete_active->set_active($settings_xml->{'general'}->{'ask_on_fs_delete'}); #ftp_upload utf8::decode $settings_xml->{'general'}->{'ftp_uri'}; utf8::decode $settings_xml->{'general'}->{'ftp_mode'}; utf8::decode $settings_xml->{'general'}->{'ftp_username'}; utf8::decode $settings_xml->{'general'}->{'ftp_password'}; utf8::decode $settings_xml->{'general'}->{'ftp_wurl'}; $ftp_remote_entry->set_text($settings_xml->{'general'}->{'ftp_uri'}); $ftp_mode_combo->set_active($settings_xml->{'general'}->{'ftp_mode'}); $ftp_username_entry->set_text($settings_xml->{'general'}->{'ftp_username'}); $ftp_password_entry->set_text($settings_xml->{'general'}->{'ftp_password'}); $ftp_wurl_entry->set_text($settings_xml->{'general'}->{'ftp_wurl'}); #we store the version info, so we know if there was a new version installed #when starting new version we clear the cache on first startup if (defined $settings_xml->{'general'}->{'app_version'}) { if ($sc->get_version . $sc->get_rev ne $settings_xml->{'general'}->{'app_version'}) { $sc->set_clear_cache(TRUE); } } else { $sc->set_clear_cache(TRUE); } #load account data from profile unless param is set to ignore it fct_load_accounts($profilename); if (defined $accounts_tree) { fct_load_accounts_tree(); $accounts_tree->set_model($accounts_model); fct_set_model_accounts($accounts_tree); } #endif profile load } else { #recently used $sc->set_ruu_tab($settings_xml->{'recent'}->{'ruu_tab'}); $sc->set_ruu_hosting($settings_xml->{'recent'}->{'ruu_hosting'}); $sc->set_ruu_places($settings_xml->{'recent'}->{'ruu_places'}); #we store the version info, so we know if there was a new version installed #when starting new version we clear the cache on first startup if (defined $settings_xml->{'general'}->{'app_version'}) { if ($sc->get_version . $sc->get_rev ne $settings_xml->{'general'}->{'app_version'}) { $sc->set_clear_cache(TRUE); } } else { $sc->set_clear_cache(TRUE); } #get plugins from cache unless param is set to ignore it if (!$sc->get_clear_cache) { foreach my $plugin_key (sort keys %{$settings_xml->{'plugins'}}) { utf8::decode $settings_xml->{'plugins'}->{$plugin_key}->{'binary'}; #check if plugin still exists in filesystem if ($shf->file_exists($settings_xml->{'plugins'}->{$plugin_key}->{'binary'})) { #restore newlines ]]> tags => \n $settings_xml->{'plugins'}->{$plugin_key}->{'tooltip'} =~ s/\<\!\[CDATA\[\\]\]\>/\n/g; utf8::decode $settings_xml->{'plugins'}->{$plugin_key}->{'name_plugin'}; utf8::decode $settings_xml->{'plugins'}->{$plugin_key}->{'category'}; utf8::decode $settings_xml->{'plugins'}->{$plugin_key}->{'tooltip'}; utf8::decode $settings_xml->{'plugins'}->{$plugin_key}->{'lang'}; $plugins{$plugin_key}->{'binary'} = $settings_xml->{'plugins'}->{$plugin_key}->{'binary'}; $plugins{$plugin_key}->{'name'} = $settings_xml->{'plugins'}->{$plugin_key}->{'name_plugin'}; $plugins{$plugin_key}->{'category'} = $settings_xml->{'plugins'}->{$plugin_key}->{'category'}; $plugins{$plugin_key}->{'tooltip'} = $settings_xml->{'plugins'}->{$plugin_key}->{'tooltip'}; $plugins{$plugin_key}->{'lang'} = $settings_xml->{'plugins'}->{$plugin_key}->{'lang'} || "shell"; $plugins{$plugin_key}->{'recent'} = $settings_xml->{'plugins'}->{$plugin_key}->{'recent'}; } } #endforeach } #endif plugins from cache } }; if ($@) { $sd->dlg_error_message($@, $d->get("Settings could not be restored!")); unlink $settingsfile; } else { fct_show_status_message(1, $d->get("Settings loaded successfully")); } #endif file exists } else { warn "ERROR: settingsfile " . $settingsfile . " does not exist\n\n"; } return $settings_xml; } sub fct_get_program_model { my $model = Gtk3::ListStore->new('Gtk3::Gdk::Pixbuf', 'Glib::String', 'Glib::Scalar'); #add Shutter's built-in editor to the list if ($goocanvas) { my $icon_pixbuf = undef; my $icon = 'shutter'; if ($sc->get_theme->has_icon($icon)) { my ($iw, $ih) = $shf->icon_size('menu'); eval { $icon_pixbuf = $sc->get_theme->load_icon($icon, $ih, 'generic-fallback'); }; if ($@) { print "\nWARNING: Could not load icon $icon: $@\n"; $icon_pixbuf = undef; } } $model->set($model->append, 0, $icon_pixbuf, 1, $d->get("Built-in Editor"), 2, 'shutter-built-in'); } #get applications my $apps = Glib::IO::AppInfo::get_recommended_for_type('image/png'); # $apps is undefined if Glib::IO::AppInfo::get_recommended_for_type fails unless (defined $apps) { return $model; } #no apps determined! unless (scalar @$apps) { return $model; } #create menu items foreach my $app (@$apps) { #ignore Shutter's desktop entry next if $app->get_id eq 'shutter.desktop'; $app->{'name'} = $shf->utf8_decode($app->get_display_name); #get icon my $icon_pixbuf = undef; my $icon = $app->get_icon; if ($icon) { my ($iw, $ih) = $shf->icon_size('menu'); eval { my $icon_info = $sc->get_theme->choose_icon($icon->get_names, $ih, []); $icon_pixbuf = $icon_info->load_icon if $icon_info; }; if ($@) { print "\nWARNING: Could not load icon for ", $app->{'name'}, ": $@\n"; $icon_pixbuf = undef; } } $model->set($model->append, 0, $icon_pixbuf, 1, $app->{'name'}, 2, $app); } return $model; } sub fct_load_accounts { my ($profilename) = @_; #accounts file my $accountsfile = "$ENV{ HOME }/.shutter/accounts.xml"; $accountsfile = "$ENV{ HOME }/.shutter/profiles/$profilename\_accounts.xml" if (defined $profilename); if ($shf->file_exists($accountsfile)) { my $accounts_xml = undef; eval { $accounts_xml = XMLin(IO::File->new($accountsfile)) }; if ($@) { $sd->dlg_error_message($@, $d->get("Account-settings could not be restored!")); unlink $accountsfile; } else { foreach (keys %{$accounts_xml}) { #check if plugin still exists if ($shf->file_exists($accounts_xml->{$_}->{path})) { #clear cache if (!$sc->get_clear_cache) { $accounts{$_}->{path} = $accounts_xml->{$_}->{path}; $accounts{$_}->{module} = $accounts_xml->{$_}->{module}; $accounts{$_}->{host} = $accounts_xml->{$_}->{host}; $accounts{$_}->{folder} = $accounts_xml->{$_}->{folder}; $accounts{$_}->{description} = $accounts_xml->{$_}->{description}; $accounts{$_}->{register_color} = "blue"; $accounts{$_}->{register_text} = $accounts_xml->{$_}->{register_text}; $accounts{$_}->{supports_anonymous_upload} = $accounts_xml->{$_}->{supports_anonymous_upload}; $accounts{$_}->{supports_authorized_upload} = $accounts_xml->{$_}->{supports_authorized_upload}; $accounts{$_}->{supports_oauth_upload} = $accounts_xml->{$_}->{supports_oauth_upload}; utf8::decode $accounts{$_}->{'host'}; } $accounts{$_}->{username} = $accounts_xml->{$_}->{username}; $accounts{$_}->{password} = $accounts_xml->{$_}->{password}; utf8::decode $accounts{$_}->{'username'}; utf8::decode $accounts{$_}->{'password'}; } } } } return TRUE; } sub fct_drop_handler { my ($widget, $context, $x, $y, $selection, $info, $time) = @_; my $type = $selection->get_target->name; return unless $type eq 'text/uri-list'; my $data = $selection->get_data; $data = join('', map { chr } @$data); my @files = grep defined($_), split /[\r\n]+/, $data; my @valid_files; foreach my $file (@files) { my $giofile = Glib::IO::File::new_for_uri($file); my ($mime_type) = Glib::Object::Introspection->invoke('Gio', undef, 'content_type_guess', $giofile->get_path); $mime_type =~ s/image\/x\-apple\-ios\-png/image\/png/; #FIXME if ($mime_type && fct_check_valid_mime_type($mime_type)) { push @valid_files, $file; } } #open all valid files if (@valid_files) { fct_open_files(@valid_files); Gtk3::drag_finish($context, 1, 0, $time); return TRUE; } else { Gtk3::drag_finish($context, 0, 0, $time); return FALSE; } } sub fct_check_valid_mime_type { my $mime_type = shift; foreach my $format (Gtk3::Gdk::Pixbuf::get_formats()) { foreach my $mtype (@{$format->get_mime_types}) { return TRUE if $mtype eq $mime_type; last; } } return FALSE; } sub fct_open_files { my (@new_files) = @_; return FALSE if scalar(@new_files) < 1; my ($throbber, $sep) = fct_toggle_status_throbber($status); foreach my $file (@new_files) { my $new_giofile = Glib::IO::File::new_for_uri($shf->utf8_decode(unescape_string($file))); next if fct_is_uri_in_session($new_giofile, TRUE); #refresh gui fct_update_gui(); #do the real work if (fct_integrate_screenshot_in_notebook($new_giofile)) { fct_show_status_message(1, $shf->utf8_decode($new_giofile->get_path) . " " . $d->get("opened")); } else { fct_show_status_message(1, sprintf($d->get("Error while opening image %s."), "'" . $shf->utf8_decode($new_giofile->get_basename) . "'")); } } fct_toggle_status_throbber($status, $throbber, $sep); return TRUE; } sub fct_is_uri_in_session { my $giofile = shift; my $jump = shift; return FALSE unless $giofile; foreach my $key (keys %session_screens) { if (exists $session_screens{$key}->{'giofile'}) { if ($giofile->equal($session_screens{$key}->{'giofile'})) { if (exists $session_screens{$key}->{'tab_child'}) { if ($jump) { $notebook->set_current_page($notebook->page_num($session_screens{$key}->{'tab_child'})); } return TRUE; } } } } return FALSE; } sub fct_toggle_status_throbber { my $status = shift; my $throbber = shift; my $sep = shift; return FALSE unless $status; if (defined $throbber && defined $sep) { $throbber->destroy; $throbber = undef; $sep->destroy; $sep = undef; } else { #don't show more than one foreach my $child ($status->get_children) { if ($child->get_name eq 'throbber') { return FALSE; } } $throbber = Gtk3::Image->new_from_file("$shutter_root/share/shutter/resources/icons/throbber_16x16.gif"); $throbber->set_name('throbber'); $sep = Gtk3::HSeparator->new; $status->pack_start($sep, FALSE, FALSE, 3); $status->pack_end($throbber, FALSE, FALSE, 0); } $status->show_all; return ($throbber, $sep); } sub fct_load_session { #session file my $sessionfile = "$ENV{ HOME }/.shutter/session.xml"; eval { my $session_xml = XMLin(IO::File->new($sessionfile)) if $shf->file_exists($sessionfile); return FALSE if scalar(keys %{$session_xml}) < 1; #activate throbber my ($throbber, $sep) = fct_toggle_status_throbber($status); #how many files have to be loaded #store this value in the session hash $session_start_screen{'first_page'}->{'num_session_files'} = scalar(keys %{$session_xml}); #local counter #is passed to several subroutines to indicate the correct index my $count = 0; foreach my $key (sort keys %{$session_xml}) { #increment counter $count++; #refresh gui fct_update_gui(); #do the real work my $new_giofile = Glib::IO::File::new_for_path(${$session_xml}{$key}{'filename'}); if (fct_integrate_screenshot_in_notebook($new_giofile, undef, undef, $count)) { fct_show_status_message(1, $shf->utf8_decode($new_giofile->get_path) . " " . $d->get("opened")); } else { fct_show_status_message(1, sprintf($d->get("Error while opening image %s."), "'" . $new_giofile->get_basename . "'")); } } #clear the value after loading the files $session_start_screen{'first_page'}->{'num_session_files'} = undef; #de-activate the throbber fct_toggle_status_throbber($status, $throbber, $sep); }; if ($@) { $sd->dlg_error_message($@, $d->get("Session could not be restored!")); unlink $sessionfile; } return TRUE; } sub fct_screenshot_exists { my ($key) = @_; #check if file still exists unless ($session_screens{$key}->{'giofile'}->query_exists) { fct_show_status_message(1, $session_screens{$key}->{'long'} . " " . $d->get("not found")); return FALSE; } return TRUE; } sub fct_trash { my $key = shift; #cancel handle if (exists $session_screens{$key}->{'handle'}) { $session_screens{$key}->{'handle'}->cancel; } $session_screens{$key}->{'giofile'}->trash; } sub fct_delete { my $key = shift; my $action = shift; #close current tab (unless $key is provided or close_all) unless (defined $action && $action eq 'menu_close_all') { $key = fct_get_current_file() unless $key; } #single file if ($key) { if ($ask_on_delete_active->get_active) { my $response = $sd->dlg_question_message( "", sprintf($d->get("Are you sure you want to move %s to the trash?"), "'" . $session_screens{$key}->{'long'} . "'"), 'gtk-cancel', $d->get("Move to _Trash"), ); return FALSE unless $response == 20; } if ($session_screens{$key}->{'giofile'}->query_exists) { fct_trash($key); eval { #remove from recentmanager Gtk3::RecentManager::get_default->remove_item($session_screens{$key}->{'giofile'}->get_path); }; } $notebook->remove_page($notebook->page_num($session_screens{$key}->{'tab_child'})); #delete tab fct_show_status_message(1, $session_screens{$key}->{'long'} . " " . $d->get("deleted")) if defined($session_screens{$key}->{'long'}); if (defined $session_screens{$key}->{'iter'} && $session_start_screen{'first_page'}->{'model'}->iter_is_valid($session_screens{$key}->{'iter'})) { $session_start_screen{'first_page'}->{'model'}->remove($session_screens{$key}->{'iter'}); } #unlink undo and redo files fct_unlink_tempfiles($key); delete $session_screens{$key}; $window->show_all unless $is_hidden; #session tab } else { if ($ask_on_delete_active->get_active) { #any files selected? my $selected = FALSE; $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { $selected = TRUE; } }); if ($selected) { my $response = $sd->dlg_question_message("", $d->get("Are you sure you want to move the selected files to the trash?"), 'gtk-cancel', $d->get("Move to _Trash"),); return FALSE unless $response == 20; } else { fct_show_status_message(1, $d->get("No screenshots selected")); return FALSE; } } my @to_delete; $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { my $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); $notebook->remove_page($notebook->page_num($session_screens{$key}->{'tab_child'})); if ($session_screens{$key}->{'giofile'}->query_exists) { fct_trash($key); eval { #remove from recentmanager Gtk3::RecentManager::get_default->remove_item($session_screens{$key}->{'giofile'}->get_path); }; } #copy to array #we delete the files from hash and model #when exiting the sub push @to_delete, $key; } }, undef ); if (scalar @to_delete == 0) { fct_show_status_message(1, $d->get("No screenshots selected")); return FALSE; } #delete from hash and model foreach my $key (@to_delete) { if (defined $session_screens{$key}->{'iter'} && $session_start_screen{'first_page'}->{'model'}->iter_is_valid($session_screens{$key}->{'iter'})) { $session_start_screen{'first_page'}->{'model'}->remove($session_screens{$key}->{'iter'}); } #unlink undo and redo files fct_unlink_tempfiles($key); delete $session_screens{$key}; } fct_show_status_message(1, $d->get("Selected screenshots deleted")); $window->show_all unless $is_hidden; } fct_update_info_and_tray(); return TRUE; } sub fct_remove { my $key = shift; my $action = shift; #close current tab (unless $key is provided or close_all) unless (defined $action && $action eq 'menu_close_all') { $key = fct_get_current_file() unless $key; } #single file if ($key) { #delete instead of remove if ($delete_on_close_active->get_active) { fct_delete($key); return FALSE; } if (exists $session_screens{$key}->{'handle'}) { #cancel handle $session_screens{$key}->{'handle'}->cancel; } $notebook->remove_page($notebook->page_num($session_screens{$key}->{'tab_child'})); #delete tab fct_show_status_message(1, $session_screens{$key}->{'long'} . " " . $d->get("removed from session")) if defined($session_screens{$key}->{'long'}); if (defined $session_screens{$key}->{'iter'} && $session_start_screen{'first_page'}->{'model'}->iter_is_valid($session_screens{$key}->{'iter'})) { $session_start_screen{'first_page'}->{'model'}->remove($session_screens{$key}->{'iter'}); } #unlink undo and redo files fct_unlink_tempfiles($key); delete $session_screens{$key}; $window->show_all unless $is_hidden; } else { #delete instead of remove if ($delete_on_close_active->get_active) { fct_delete(undef, 'menu_close_all'); return FALSE; } my @to_remove; $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { my $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); $notebook->remove_page($notebook->page_num($session_screens{$key}->{'tab_child'})); if (exists $session_screens{$key}->{'handle'}) { #cancel handle $session_screens{$key}->{'handle'}->cancel; } #copy to array #we remove the files from hash and model #when exiting the sub push @to_remove, $key; } }, undef ); if (scalar @to_remove == 0) { fct_show_status_message(1, $d->get("No screenshots selected")); return FALSE; } #delete from hash and model foreach my $key (@to_remove) { if (defined $session_screens{$key}->{'iter'} && $session_start_screen{'first_page'}->{'model'}->iter_is_valid($session_screens{$key}->{'iter'})) { $session_start_screen{'first_page'}->{'model'}->remove($session_screens{$key}->{'iter'}); } #unlink undo and redo files fct_unlink_tempfiles($key); delete $session_screens{$key}; } fct_show_status_message(1, $d->get("Selected screenshots removed")); $window->show_all unless $is_hidden; } fct_update_info_and_tray(); return TRUE; } sub fct_update_gui { while (Gtk3::events_pending()) { Gtk3::main_iteration(); } Gtk3::Gdk::flush(); return TRUE; } sub fct_clipboard_import { my $image = $clipboard->wait_for_image; if (defined $image) { #folder to save my $folder = Glib::filename_to_unicode($saveDir_button->get_filename) ; if ($save_no_active->get_active) { $folder = Shutter::App::Directories::get_cache_dir(); } #determine current file type (name - description) $combobox_type->get_active_text =~ /(.*) -/; my $filetype_value = $1; unless ($filetype_value) { $sd->dlg_error_message($d->get("No valid filetype specified"), $d->get("Failed")); fct_control_main_window('show'); return FALSE; } #generate random filename my $short = "clipboard-import-" . int(rand(10000000000)); #relative to abs my $tmpfilename = $folder ."/" . $short ."." . $filetype_value; unless (File::Spec->file_name_is_absolute($tmpfilename)) { $tmpfilename = File::Spec->rel2abs($tmpfilename); } #save pixbuf to tempfile and integrate it if ($sp->save_pixbuf_to_file($image, $tmpfilename, $filetype_value)) { my $new_key = fct_integrate_screenshot_in_notebook(Glib::IO::File::new_for_path($tmpfilename), $image); $session_screens{$new_key}->{'image'}->set_fitting(TRUE); } } else { fct_show_status_message(1, $d->get("There is no image data in the clipboard to paste")); } return TRUE; } sub fct_clipboard { my ($widget, $mode) = @_; my $key = fct_get_current_file(); #create shutter region object my $sr = Shutter::Geometry::Region->new(); my @clipboard_array; #single file if ($key) { return FALSE unless fct_screenshot_exists($key); push(@clipboard_array, $key); } else { $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { my $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); push(@clipboard_array, $key); } }, undef ); } my $clipboard_string = undef; my $clipboard_region = Cairo::Region->create; my @pixbuf_array; my @rects_array; foreach my $key (@clipboard_array) { if ($mode eq 'image') { my $pixbuf = $lp->load($session_screens{$key}->{'long'}); my $rect = {x=>$sr->get_clipbox($clipboard_region)->{width}, y=>0, width=>$pixbuf->get_width, height=>$pixbuf->get_height}; $clipboard_region->union_rectangle($rect); push @pixbuf_array, $pixbuf; push @rects_array, $rect; } else { $clipboard_string .= $session_screens{$key}->{'long'} . "\n"; } } if ($clipboard_string) { chomp $clipboard_string; $clipboard->set_text($clipboard_string); fct_show_status_message(1, $d->get("Selected filenames copied to clipboard")); } if ($clipboard_region->num_rectangles) { my $clipboard_image = Gtk3::Gdk::Pixbuf->new('rgb', TRUE, 8, $sr->get_clipbox($clipboard_region)->{width}, $sr->get_clipbox($clipboard_region)->{height}); $clipboard_image->fill(0x00000000); #copy images to the blank pixbuf my $rect_counter = 0; foreach my $pixbuf (@pixbuf_array) { $pixbuf->copy_area(0, 0, $pixbuf->get_width, $pixbuf->get_height, $clipboard_image, $rects_array[$rect_counter]->{x}, 0); $rect_counter++; } $clipboard->set_image($clipboard_image); fct_show_status_message(1, $d->get("Selected images copied to clipboard")); } return TRUE; } sub fct_unlink_tempfiles { my $key = shift; foreach my $tmpf (@{$session_screens{$key}->{'undo'}}) { unlink $tmpf; } foreach my $tmpf (@{$session_screens{$key}->{'redo'}}) { unlink $tmpf; } return TRUE; } sub fct_validate_filename{ my $myfilename = shift; my $myfilename_hint = shift; my @invalid_codes = (47, 92); $myfilename->signal_connect( 'key-press-event' => sub { shift; my $event = shift; my $input = Gtk3::Gdk::keyval_to_unicode($event->keyval); #invalid input #~ print $input."\n"; if (grep($input == $_, @invalid_codes)) { my $char = chr($input); $char = 'amp();' if $char eq '&'; $myfilename_hint->set_markup("" . sprintf($d->get("Reserved character %s is not allowed to be in a filename."), "'" . $char . "'") . ""); return TRUE; } else { #clear possible message when valid char is entered $myfilename_hint->set_markup(""); return FALSE; } }); } sub fct_undo { my $key = fct_get_current_file(); #single file if ($key) { return FALSE unless fct_screenshot_exists($key); #push current version to redo #(current version is always the last element in the array) my $current_version = pop @{$session_screens{$key}->{'undo'}}; push @{$session_screens{$key}->{'redo'}}, $current_version; #and revert last version my $last_version = pop @{$session_screens{$key}->{'undo'}}; if ($last_version) { #cancel handle if (exists $session_screens{$key}->{'handle'}) { $session_screens{$key}->{'handle'}->cancel; } if (cp($last_version, $session_screens{$key}->{'long'})) { fct_update_tab($key, undef, $session_screens{$key}->{'giofile'}, TRUE, 'gui'); fct_show_status_message(1, $d->get("Last action undone")); #delete last_version from filesystem unlink $last_version; } else { my $response = $sd->dlg_error_message( sprintf($d->get("Error while copying last version (%s)."), "'" . $last_version . "'"), sprintf($d->get("There was an error performing undo on %s."), "'" . $session_screens{$key}->{'long'} . "'"), undef, undef, undef, undef, undef, undef, $@ ); fct_update_tab($key, undef, $session_screens{$key}->{'giofile'}, TRUE, 'clear'); } #setup a new filemonitor, so we get noticed if the file changed fct_add_file_monitor($key); } } return TRUE; } sub fct_redo { my $key = fct_get_current_file(); #single file if ($key) { return FALSE unless fct_screenshot_exists($key); #and revert last version my $last_version = pop @{$session_screens{$key}->{'redo'}}; #~ push @{$session_screens{$key}->{'undo'}}, $last_version; if ($last_version) { #cancel handle if (exists $session_screens{$key}->{'handle'}) { $session_screens{$key}->{'handle'}->cancel; } if (cp($last_version, $session_screens{$key}->{'long'})) { fct_update_tab($key, undef, $session_screens{$key}->{'giofile'}, TRUE, 'gui'); fct_show_status_message(1, $d->get("Last action redone")); #delete last_version from filesystem unlink $last_version; } else { my $response = $sd->dlg_error_message( sprintf($d->get("Error while copying last version (%s)."), "'" . $last_version . "'"), sprintf($d->get("There was an error performing redo on %s."), "'" . $session_screens{$key}->{'long'} . "'"), undef, undef, undef, undef, undef, undef, $@ ); fct_update_tab($key, undef, $session_screens{$key}->{'giofile'}, TRUE, 'clear'); } #setup a new filemonitor, so we get noticed if the file changed fct_add_file_monitor($key); } } return TRUE; } sub fct_select_all { $session_start_screen{'first_page'}->{'view'}->select_all; return TRUE; } sub fct_plugin { my $key = fct_get_current_file(); my @plugin_array; #single file if ($key) { return FALSE unless fct_screenshot_exists($key); unless (keys %plugins > 0) { $sd->dlg_error_message($d->get("No plugin installed"), $d->get("Failed")); } else { push(@plugin_array, $key); dlg_plugin(@plugin_array); } #session tab } else { $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { my $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); push(@plugin_array, $key); } }, undef ); dlg_plugin(@plugin_array); } return TRUE; } sub fct_show_in_folder { my $key = fct_get_current_file(); my @show_in_folder_array; #single file if ($key) { return FALSE unless fct_screenshot_exists($key); print "Showing in filebrowser started - file: " . $session_screens{$key}->{'long'} . "\n" if $sc->get_debug; push(@show_in_folder_array, $key); } else { $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { my $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); push(@show_in_folder_array, $key); } }, undef ); } #open folders in filebrowser foreach my $ckey (@show_in_folder_array) { utf8::encode(my $folder_name_utf8 = $session_screens{$ckey}->{'folder'}); $shf->xdg_open(undef, $folder_name_utf8); } return TRUE; } sub fct_rename { my $key = fct_get_current_file(); my @rename_array; #single file if ($key) { return FALSE unless fct_screenshot_exists($key); print "Renaming of file " . $session_screens{$key}->{'long'} . " started\n" if $sc->get_debug; push(@rename_array, $key); } else { $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { my $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); push(@rename_array, $key); } }, undef ); } dlg_rename(@rename_array); return TRUE; } sub fct_draw { my $key = fct_get_current_file(); my @draw_array; #single file if ($key) { return FALSE unless fct_screenshot_exists($key); push(@draw_array, $key); } else { $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { my $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); push(@draw_array, $key); } }, undef ); } #open drawing tool foreach my $key (@draw_array) { my $drawing_tool = Shutter::Draw::DrawingTool->new($sc); $drawing_tool->show( $session_screens{$key}->{'long'}, $session_screens{$key}->{'filetype'}, $session_screens{$key}->{'mime_type'}, $session_screens{$key}->{'name'}, $session_screens{$key}->{'is_unsaved'}, \%session_screens ); } #~ &fct_control_main_window ('show'); return TRUE; } sub fct_take_screenshot { my ($widget, $data, $folder_from_config, $extra) = @_; print "\n$data was emitted by widget $widget\n" if $sc->get_debug; #quality my $quality_value = $scale->get_value(); #delay my $delay_value = undef; #include_cursor my $include_cursor = undef; #filename my $filename_value = $filename->get_text(); #filetype my $filetype_value = undef; #folder to save my $folder = Glib::filename_to_unicode($saveDir_button->get_filename) || $folder_from_config; if ($save_no_active->get_active) { $folder = Shutter::App::Directories::get_cache_dir(); } #screenshot(pixbuf) and screenshot name my $screenshot = undef; my $screenshooter = undef; my $screenshot_name = undef; my $thumbnail_ending = "thumb"; #determine current file type (name - description) $combobox_type->get_active_text =~ /(.*) -/; $filetype_value = $1; unless ($filetype_value) { $sd->dlg_error_message($d->get("No valid filetype specified"), $d->get("Failed")); fct_control_main_window('show'); return FALSE; } #delay #when capturing a menu or tooltip => disable delay (there is a dedicated delay property for this) unless ($data eq "menu" || $data eq "tray_menu" || $data eq "tooltip" || $data eq "tray_tooltip") { if (defined $sc->get_delay) { $delay_value = int $sc->get_delay; } else { if ($delay->get_value) { $delay_value = int $delay->get_value; } else { $delay_value = 0; } } } else { $delay_value = 0; } #cursor if ($sc->get_include_cursor) { $include_cursor = $sc->get_include_cursor; } elsif ($sc->get_remove_cursor) { $include_cursor = FALSE; } else { if ($cursor_active->get_active) { $include_cursor = $cursor_active->get_active; } else { $include_cursor = FALSE; } } #fullscreen screenshot if ($data eq "full" || $data eq "tray_full") { if ($x11_supported) { $screenshooter = Shutter::Screenshot::Workspace->new( $sc, $include_cursor, $delay_value, $notify_timeout_active->get_active, $wnck_screen ? $wnck_screen->get_active_workspace : undef, undef, undef, $current_monitor_active->get_active ); $screenshot = $screenshooter->workspace(); } else { # TODO: support kwin directly, because it has more features than the xdg portal $screenshot = Shutter::Screenshot::Wayland::xdg_portal($screenshooter); } #window } elsif ($data eq "window" || $data eq "tray_window" || $data eq "awindow" || $data eq "tray_awindow" || $data eq "section" || $data eq "tray_section" || $data eq "menu" || $data eq "tray_menu" || $data eq "tooltip" || $data eq "tray_tooltip") { #control some wm related settings my $curr_value = fct_control_wm_settings('start'); if (defined $extra && $extra) { $screenshooter = Shutter::Screenshot::WindowName->new( $sc, $include_cursor, $delay_value, $notify_timeout_active->get_active, $border_active->get_active, $winresize_active->get_active, $winresize_w->get_value, $winresize_h->get_value, $hide_time->get_value, $data, $autoshape_active->get_active ); $screenshot = $screenshooter->window_find_by_name($extra); } else { $screenshooter = Shutter::Screenshot::Window->new( $sc, $include_cursor, $delay_value, $notify_timeout_active->get_active, $border_active->get_active, $winresize_active->get_active, $winresize_w->get_value, $winresize_h->get_value, $hide_time->get_value, $data, $autoshape_active->get_active, $is_hidden, $visible_windows_active->get_active, $menu_waround_active->get_active ); $screenshot = $screenshooter->window(); } #control some wm related settings if (defined $curr_value && $curr_value != -1) { fct_control_wm_settings('stop', $curr_value); } #selection } elsif ($data eq "select" || $data eq "tray_select") { if (defined $extra && $extra) { my @coords = split(',', $extra); $screenshooter = Shutter::Screenshot::SelectorAuto->new($sc, $include_cursor, $delay_value, $notify_timeout_active->get_active,); $screenshot = $screenshooter->select_auto($coords[0], $coords[1], $coords[2], $coords[3]); } else { $screenshooter = Shutter::Screenshot::SelectorAdvanced->new( $sc, $include_cursor, $delay_value, $notify_timeout_active->get_active, $zoom_active->get_active, $hide_time->get_value, $as_help_active->get_active, $asel_size3->get_value, $asel_size4->get_value, $asel_size1->get_value, $asel_size2->get_value, $as_confirmation_necessary->get_active, ); $screenshot = $screenshooter->select_advanced(); } #web } elsif ($data eq "web" || $data eq "tray_web") { my $website_width = 1024; if ($combobox_web_width->get_active_text =~ /(\d+)/) { $website_width = $1; } print "\nvirtual website width: $website_width\n" if $sc->get_debug; #determine timeout my $web_menu = $st->{_web}->get_menu; my @timeouts = $web_menu->get_children; my $timeout = undef; foreach my $to (@timeouts) { if ($to->get_active) { $timeout = $to->get_name; $timeout =~ /([0-9]+)/; $timeout = $1; print $timeout. "\n" if $sc->get_debug; } } $screenshooter = Shutter::Screenshot::Web->new($sc, $timeout, $website_width); $screenshot = $screenshooter->dlg_website($extra); #window by xid } elsif ($data =~ /^shutter_window_direct(.*)/) { my $xid = $1; print "Selected xid: $xid\n" if $sc->get_debug; #control some wm related settings my $curr_value = fct_control_wm_settings('start'); #change mode (imitating selecting a window by mouse) $data = "window"; $screenshooter = Shutter::Screenshot::WindowXid->new( $sc, $include_cursor, $delay_value, $notify_timeout_active->get_active, $border_active->get_active, $winresize_active->get_active, $winresize_w->get_value, $winresize_h->get_value, $hide_time->get_value, $data, $autoshape_active->get_active ); $screenshot = $screenshooter->window_by_xid($xid); #control some wm related settings if (defined $curr_value && $curr_value != -1) { fct_control_wm_settings('stop', $curr_value); } } elsif ($data =~ /^shutter_wrksp_direct/) { #we need to handle different wm, e.g. metacity, compiz here my $selected_workspace = undef; my $vpx = undef; my $vpy = undef; #compiz if ($data =~ /compiz(\d*)x(\d*)/) { $vpx = $1; $vpy = $2; print "Sel. Viewport: $vpx, $vpy\n" if $sc->get_debug; #metacity etc. } elsif ($data =~ /shutter_wrksp_direct(.*)/) { $selected_workspace = $1; print "Sel. Workspace: $selected_workspace\n" if $sc->get_debug; #all workspaces } elsif ($data =~ /shutter_wrksp_all/) { print "Capturing all workspaces\n" if $sc->get_debug; $selected_workspace = 'all'; } $screenshooter = Shutter::Screenshot::Workspace->new($sc, $include_cursor, $delay_value, $notify_timeout_active->get_active, $selected_workspace, $vpx, $vpy, $current_monitor_active->get_active); if ($selected_workspace eq 'all') { $screenshot = $screenshooter->workspaces(); } else { $screenshot = $screenshooter->workspace(); } } elsif ($data eq "redoshot") { #~ my $key = fct_get_last_capture(); #~ if(defined $key && exists $session_screens{$key}->{'history'} && defined $session_screens{$key}->{'history'}){ #~ $screenshooter = $session_screens{$key}->{'history'}; #~ $screenshot = $screenshooter->redo_capture; #~ }else{ #~ $screenshot = 3; #~ } if ($screenshooter = fct_get_last_capture()) { #we need to handle menu and tooltip in a special way if ($screenshooter->can('get_mode')) { if (my $mode = $screenshooter->get_mode) { #control some wm related settings my $curr_value = undef; if (($mode eq "window" || $mode eq "tray_window" || $mode eq "awindow" || $mode eq "tray_awindow" || $mode eq "section" || $mode eq "tray_section")) { $curr_value = fct_control_wm_settings('start'); } if ($mode eq "menu" || $mode eq "tray_menu") { $st->{_menu}->signal_emit('clicked'); return FALSE; } elsif ($mode eq "tooltip" || $mode eq "tray_tooltip") { $st->{_tooltip}->signal_emit('clicked'); return FALSE; } else { $screenshot = $screenshooter->redo_capture; } #control some wm related settings if (($mode eq "window" || $mode eq "tray_window" || $mode eq "awindow" || $mode eq "tray_awindow" || $mode eq "section" || $mode eq "tray_section")) { if (defined $curr_value && $curr_value != -1) { fct_control_wm_settings('stop', $curr_value); } } #window by xid } else { #control some wm related settings my $curr_value = fct_control_wm_settings('start'); $screenshot = $screenshooter->redo_capture; #control some wm related settings if (defined $curr_value && $curr_value != -1) { fct_control_wm_settings('stop', $curr_value); } } } else { $screenshot = $screenshooter->redo_capture; } } else { $screenshot = 3; } } elsif ($data eq "redoshot_this") { #get current screenshot (current notebook page) my $key = fct_get_current_file(); #or get the selected screenshot in the view unless (defined $key) { $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); } }, undef ); } if ( defined $key && exists $session_screens{$key}->{'history'} && defined $session_screens{$key}->{'history'}) { $screenshooter = $session_screens{$key}->{'history'}; #we need to handle menu and tooltip in a special way if ($screenshooter->can('get_mode')) { if (my $mode = $screenshooter->get_mode) { #control some wm related settings my $curr_value = undef; if (($mode eq "window" || $mode eq "tray_window" || $mode eq "awindow" || $mode eq "tray_awindow" || $mode eq "section" || $mode eq "tray_section")) { $curr_value = fct_control_wm_settings('start'); } if ($mode eq "menu" || $mode eq "tray_menu") { $st->{_menu}->signal_emit('clicked'); return FALSE; } elsif ($mode eq "tooltip" || $mode eq "tray_tooltip") { $st->{_tooltip}->signal_emit('clicked'); return FALSE; } else { $screenshot = $screenshooter->redo_capture; } #control some wm related settings if (($mode eq "window" || $mode eq "tray_window" || $mode eq "awindow" || $mode eq "tray_awindow" || $mode eq "section" || $mode eq "tray_section")) { if (defined $curr_value && $curr_value != -1) { fct_control_wm_settings('stop', $curr_value); } } #window by xid } else { #control some wm related settings my $curr_value = fct_control_wm_settings('start'); $screenshot = $screenshooter->redo_capture; #control some wm related settings if (defined $curr_value && $curr_value != -1) { fct_control_wm_settings('stop', $curr_value); } } } else { $screenshot = $screenshooter->redo_capture; } } else { $screenshot = 3; } } else { #show error dialog my $response = $sd->dlg_error_message($d->get("Triggered invalid screenshot action."), $d->get("Error while taking the screenshot.")); fct_show_status_message(1, $d->get("Error while taking the screenshot.")); fct_control_main_window('show'); return FALSE; } #screenshot was taken at this stage... #start postprocessing here #...successfully??? # $screenshot is undefined if the selection width or height is zero # Actually this should be handled by Shutter::Screenshot::Error but fails for an area with zero width or height for some reason unless ($screenshot) { my $response = $sd->dlg_error_message($d->get("Error: selection width or height is zero, please retry!"), $d->get("Failed")); fct_control_main_window('show'); return FALSE; } my $giofile = undef; my $error = Shutter::Screenshot::Error->new($sc, $screenshot, $data, $extra); if ($error->is_error) { my $detailed_error_text = ''; if (defined $screenshooter && $screenshooter) { $detailed_error_text = $screenshooter->get_error_text; } my ($response, $status_text) = $error->show_dialog($detailed_error_text); fct_show_status_message(1, $status_text); if ($error->is_aborted_by_user) { fct_control_main_window('show', $present_after_active->get_active); } else { fct_control_main_window('show'); } return FALSE; } else { #get next filename (auto increment using a wild card or manually) if ($sc->get_export_filename) { my ($short, $folder, $ext) = fileparse($shf->switch_home_in_file($shf->utf8_decode($sc->get_export_filename)), qr/\.[^.]*/); #set filetype $filetype_value = $ext; $filetype_value =~ s/\.//; #prepare filename, parse wild-cards $short = strftime $short, localtime; #..remove / and # $short =~ s/(\/|\#)/-/g; #relative to abs my $tmp_filename = $folder . $short . $ext; unless (File::Spec->file_name_is_absolute($tmp_filename)) { $tmp_filename = File::Spec->rel2abs($tmp_filename); } #..replace wildcards by values $tmp_filename = &fct_parse_filename_wildcards($tmp_filename, $screenshooter, $screenshot); #...and create an uri $giofile = Glib::IO::File::new_for_path($tmp_filename); } else { #prepare filename, parse wild-cards $filename_value = $shf->utf8_decode(strftime $filename_value , localtime); #..remove / and # $filename_value =~ s/(\/|\#)/-/g; #..replace wildcards by values $filename_value = &fct_parse_filename_wildcards($filename_value, $screenshooter, $screenshot); #...and get next filename $giofile = fct_get_next_filename($filename_value, $folder, $filetype_value); } #no valid filename was determined, exit here unless ($giofile) { my $response = $sd->dlg_error_message($d->get("There was an error determining the filename."), $d->get("Failed")); fct_control_main_window('show'); return FALSE; } #we have to use the path (e.g. /home/username/file1.png) #so we can save the screenshot_properly $screenshot_name = $shf->utf8_decode(unescape_string($giofile->get_path)); #maybe / is set as uri (get_path returns undef) #in this case nothing is returned when using get_path #we use the directory name and the short name in this case #(anyway - most users won't have permissions to write to /) $screenshot_name = "/" . $giofile->get_basename unless $screenshot_name; #update uri after parsing as well, so we can check if file exists for example $giofile = Glib::IO::File::new_for_path($screenshot_name); #maybe the uri already exists, so we have to append some digits (e.g. testfile01(0002).png) #don't check if filename is set via cmd parameter unless ($sc->get_export_filename) { if ($giofile->query_exists) { my $count = 1; my $new_filename = fileparse($shf->utf8_decode(unescape_string($giofile->get_path)), qr/\.[^.]*/); print "Checking if filename already exists: " . $new_filename . "\n" if $sc->get_debug; my $existing_filename = $new_filename; while ($giofile->query_exists) { $new_filename = $existing_filename . "(" . sprintf("%03d", $count++) . ")"; $giofile = Glib::IO::File::new_for_path($folder); $giofile = $giofile->append_string("$new_filename.$filetype_value"); print "Checking new uri after parsing: " . $giofile->get_path . "\n" if $sc->get_debug; } } } #we have to update the path again $screenshot_name = $shf->utf8_decode(unescape_string($giofile->get_path)); #no valid filename was determined, exit here unless ($screenshot_name) { my $response = $sd->dlg_error_message($d->get("There was an error determining the filename."), $d->get("Failed")); fct_control_main_window('show'); return FALSE; } print "New uri after exists check: " . $shf->utf8_decode($giofile->get_path) . "\n" if $sc->get_debug; #manipulate before saving #bordereffect if ($bordereffect_active->get_active) { print "Adding border effect to $screenshot_name\n" if $sc->get_debug; my $pbuf_border = Shutter::Pixbuf::Border->new($sc); $screenshot = $pbuf_border->create_border($screenshot, $bordereffect->get_value, $bordereffect_cbtn->get_color); } #ask for filename and folder if ($save_ask_active->get_active) { print "Asking for filename\n" if $sc->get_debug; if ($screenshot_name = dlg_save_as(undef, undef, $screenshot_name, $screenshot, $quality_value)) { if ($screenshot_name eq 'user_cancel') { fct_show_status_message(1, $d->get("Capture aborted by user")); fct_control_main_window('show', $present_after_active->get_active); return FALSE; } else { #update uri after saving, so we can check if file exists for example $giofile = Glib::IO::File::new_for_path($screenshot_name); } } else { fct_control_main_window('show'); return FALSE; } } else { print "Trying to save file to $screenshot_name\n" if $sc->get_debug; #finally save pixbuf unless ($sp->save_pixbuf_to_file($screenshot, $screenshot_name, $filetype_value, $quality_value)) { fct_control_main_window('show'); return FALSE; } } } #end screenshot successfull if ($giofile->query_exists) { #quantize if ($im_colors_active->get_active) { my $colors; if ($combobox_im_colors->get_active == 0) { $colors = 16; } elsif ($combobox_im_colors->get_active == 1) { $colors = 64; } elsif ($combobox_im_colors->get_active == 2) { $colors = 256; } $screenshot = fct_imagemagick_perform('reduce_colors', $screenshot_name, $colors); } #generate the thumbnail my $screenshot_thumbnail = undef; my $screenshot_thumbnail_name = undef; if ($thumbnail_active->get_active) { #calculate size my $twidth = int($screenshot->get_width * ($thumbnail->get_value / 100)); my $theight = int($screenshot->get_height * ($thumbnail->get_value / 100)); #create thumbail $screenshot_thumbnail = $lp->load($screenshot_name, $twidth, $theight, TRUE); #save path of thumbnail my ($name, $folder, $ext) = fileparse($screenshot_name, qr/\.[^.]*/); $screenshot_thumbnail_name = $folder . "/$name-$thumbnail_ending.$filetype_value"; #parse wild cards $screenshot_thumbnail_name =~ s/\$w/$twidth/g; $screenshot_thumbnail_name =~ s/\$h/$theight/g; print "Trying to save file to $screenshot_thumbnail_name\n" if $sc->get_debug; #finally save pixbuf unless ($sp->save_pixbuf_to_file($screenshot_thumbnail, $screenshot_thumbnail_name, $filetype_value, $quality_value)) { fct_control_main_window('show'); return FALSE; } } my $new_key_screenshot = undef; my $new_key_screenshot_thumbnail = undef; #Dont add it to session if no_session-parameter is set unless ($sc->get_no_session) { #Dont add it to session if it already exists unless (fct_is_uri_in_session($giofile, TRUE)) { #integrate it into the notebook $new_key_screenshot = fct_integrate_screenshot_in_notebook($giofile, $screenshot, $screenshooter); #thumbnail as well if present $new_key_screenshot_thumbnail = fct_integrate_screenshot_in_notebook(Glib::IO::File::new_for_path($screenshot_thumbnail_name), $screenshot_thumbnail) if $thumbnail_active->get_active; $session_screens{$new_key_screenshot}->{'image'}->set_fitting(TRUE); } } #in some cases it is not possible to add it to the session #e.g. when saving to pdf if ($new_key_screenshot) { #copy to clipboard if (!$no_autocopy_active->get_active()) { #image_autocopy to clipboard if configured if ($image_autocopy_active->get_active()) { $clipboard->set_image($screenshot); } #filename autocopy to clipboard if configured if ($fname_autocopy_active->get_active()) { $clipboard->set_text($screenshot_name); } } #open screenshot with configured program if ($progname_active->get_active) { my $model = $progname->get_model(); my $progname_iter = $progname->get_active_iter(); if ($progname_iter) { my $progname_value = $model->get_value($progname_iter, 2); my $appname_value = $model->get_value($progname_iter, 1); fct_open_with_program($progname_value, $appname_value); } } print "screenshot successfully saved to $screenshot_name!\n" if $sc->get_debug; fct_show_status_message(1, sprintf($d->get("%s saved"), $session_screens{$new_key_screenshot}->{'short'})); #show pop-up notification if ($notify_after_active->get_active) { my $notify = $sc->get_notification_object; if (defined $session_screens{$new_key_screenshot}->{'is_unsaved'} && $session_screens{$new_key_screenshot}->{'is_unsaved'}) { $notify->show($d->get("Screenshot saved"), "*" . $session_screens{$new_key_screenshot}->{'name'}); } else { $notify->show($d->get("Screenshot saved"), $session_screens{$new_key_screenshot}->{'long'}); } } } else { #endif - adding to session worked print "screenshot successfully saved to $screenshot_name, but unable to add the file to session!\n" if $sc->get_debug; fct_show_status_message(1, sprintf($d->get("%s saved"), $screenshot_name)); #show pop-up notification if ($notify_after_active->get_active) { my $notify = $sc->get_notification_object; $notify->show($d->get("Screenshot saved"), $screenshot_name); } } } else { #show error dialog my $response = $sd->dlg_error_message(sprintf($d->get("The filename %s could not be verified. Maybe it contains unsupported characters."), "'" . $screenshot_name . "'"), $d->get("Error while taking the screenshot.")); fct_show_status_message(1, $d->get("Error while taking the screenshot.")); fct_control_main_window('show'); return FALSE; } fct_control_main_window('show', $present_after_active->get_active); #Exit Shutter after the first capture has been made. #This is useful when using Shutter in scripts. if ($sc->get_exit_after_capture) { evt_delete_window('', 'quit'); } return TRUE; } sub fct_update_tray_menu { my $screen = shift; if ($sc->get_debug) { print "\nfct_update_tray_menu was called by $screen\n"; } #update window list foreach my $child ($tray_menu->get_children) { if ($child->get_name eq 'windowlist') { $child->set_submenu(fct_ret_window_menu()); last; } } } sub fct_upload { my $key = fct_get_current_file(); my @upload_array; #single file if ($key) { return FALSE unless fct_screenshot_exists($key); push(@upload_array, $key); dlg_upload(@upload_array); #session tab } else { $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { my $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); return FALSE unless fct_screenshot_exists($key); push(@upload_array, $key); } }, undef ); dlg_upload(@upload_array); } #update actions #new public links might be available foreach my $key (@upload_array) { fct_update_actions(1, $key); } return TRUE; } sub fct_send { my $key = fct_get_current_file(); my @files_to_send; unless ($key) { $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { my $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); push(@files_to_send, $session_screens{$key}->{'long'}); } }); } else { push(@files_to_send, $session_screens{$key}->{'long'}); } my $sendto_string = undef; foreach my $sendto_filename (@files_to_send) { $sendto_string .= "'$sendto_filename' "; } $shf->nautilus_sendto($sendto_string); return TRUE; } sub fct_email { my $key = fct_get_current_file(); my @files_to_email; unless ($key) { $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { my $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); push(@files_to_email, $session_screens{$key}->{'long'}); } }); } else { push(@files_to_email, $session_screens{$key}->{'long'}); } my @mail_args = map { ('--attach' => $_) } @files_to_email; $shf->xdg_open_mail(undef, undef, @mail_args); return TRUE; } sub fct_print { my $key = fct_get_current_file(); my @pages; unless ($key) { $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { my $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); push(@pages, $session_screens{$key}->{'long'}); } }); } else { push(@pages, $session_screens{$key}->{'long'}); } my $op = Gtk3::PrintOperation->new; $op->set_job_name(SHUTTER_NAME . " - " . SHUTTER_VERSION . " - " . localtime); $op->set_n_pages(scalar @pages); $op->set_unit('none'); # aka pixel $op->set_show_progress(TRUE); $op->set_default_page_setup($pagesetup); #restore settings if prossible if ($shf->file_exists("$ENV{ HOME }/.shutter/printing.xml")) { eval { my $ssettings = Gtk3::PrintSettings->new_from_file("$ENV{ HOME }/.shutter/printing.xml"); $op->set_print_settings($ssettings); }; } $op->signal_connect( 'status-changed' => sub { my $op = shift; fct_show_status_message(1, $op->get_status_string); }); $op->signal_connect( 'draw-page' => sub { my $op = shift; my $pc = shift; my $int = shift; #cairo context my $cr = $pc->get_cairo_context; #load pixbuf from file if (my $pixbuf = $lp->load($pages[$int])) { #scale if image doesn't fit on page my $scale_x = $pc->get_width / $pixbuf->get_width; my $scale_y = $pc->get_height / $pixbuf->get_height; if (min($scale_x, $scale_y) < 1) { $cr->scale(min($scale_x, $scale_y), min($scale_x, $scale_y)); } Gtk3::Gdk::cairo_set_source_pixbuf($cr, $pixbuf, 0, 0); } $cr->paint; }); $op->run('print-dialog', $window); #save settings my $settings = $op->get_print_settings; eval { $settings->to_file("$ENV{ HOME }/.shutter/printing.xml"); }; return TRUE; } sub fct_open_with_program { my $app = shift; #no program set - exit return FALSE unless $app; my $key = fct_get_current_file(); #single file if ($key) { return FALSE unless fct_screenshot_exists($key); #built-in-editor if ($app =~ /shutter/i) { fct_draw(); fct_show_status_message(1, sprintf($d->get("%s opened with %s"), $session_screens{$key}->{'short'}, $d->get("Built-in Editor"))); } else { #everything is fine -> open it if ($app->supports_uris) { $app->launch_uris([$session_screens{$key}->{'giofile'}->get_uri]); } else { $app->launch([$session_screens{$key}->{'giofile'}]); } fct_show_status_message(1, sprintf($d->get("%s opened with %s"), $session_screens{$key}->{'short'}, $app->{'name'})); } #session tab } else { my @open_files; $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { my $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); if ($app->supports_uris) { push @open_files, $session_screens{$key}->{'giofile'}->get_uri; } else { push @open_files, $session_screens{$key}->{'giofile'}; } } }, undef ); if (@open_files > 0) { if ($app->supports_uris) { $app->launch_uris(\@open_files); } else { $app->launch(\@open_files); } fct_show_status_message(1, $d->get("Opened all files with") . " " . $app->{'name'}); } } return TRUE; } sub fct_execute_plugin { my $arrayref = $_[1]; my ($plugin_value, $plugin_name, $plugin_lang, $key, $plugin_dialog, $plugin_progress) = @$arrayref; unless ($shf->file_exists($session_screens{$key}->{'long'})) { return FALSE; } #if it is a native perl plugin, use a plug to integrate it properly if ($plugin_lang eq "perl") { #hide plugin dialog $plugin_dialog->hide if defined $plugin_dialog; #dialog to show the plugin my $sdialog = Gtk3::Dialog->new($plugin_name, $window, [qw/modal destroy-with-parent/]); $sdialog->set_resizable(FALSE); # Ensure that the dialog box is destroyed when the user responds. $sdialog->signal_connect(response => sub { $_[0]->destroy }); #initiate the socket to draw the contents of the plugin to our dialog my $socket = Gtk3::Socket->new; $sdialog->get_child->add($socket); $socket->signal_connect( 'plug-removed' => sub { $sdialog->destroy(); return TRUE; }); printf("\n", $socket->get_id); my $pid = fork; if ($pid < 0) { $sd->dlg_error_message(sprintf($d->get("Could not apply plugin %s"), "'" . $plugin_name . "'"), $d->get("Failed")); } elsif ($pid == 0) { #see Bug #661424 #my $qfilename = quotemeta $session_screens{$key}->{'long'}; exec($^X, $plugin_value, $socket->get_id, $session_screens{$key}->{'long'}, $session_screens{$key}->{'width'}, $session_screens{$key}->{'height'}, $session_screens{$key}->{'filetype'}); } $sdialog->show_all; $sdialog->run; waitpid($pid, 0); #check exit code if ($? == 0) { fct_show_status_message(1, sprintf($d->get("Successfully applied plugin %s"), "'" . $plugin_name . "'")); } elsif ($? / 256 == 1) { fct_show_status_message(1, sprintf($d->get("Could not apply plugin %s"), "'" . $plugin_name . "'")); } #...if not => simple execute the plugin via system (e.g. shell plugins) } else { print "$plugin_value $session_screens{$key}->{'long'} $session_screens{$key}->{'width'} $session_screens{$key}->{'height'} $session_screens{$key}->{'filetype'} submitted to plugin\n" if $sc->get_debug; #cancel handle, because file gets manipulated #multiple times if (exists $session_screens{$key}->{'handle'}) { $session_screens{$key}->{'handle'}->cancel; } #create a new process, so we are able to cancel the current operation my $plugin_process = Proc::Simple->new; #see Bug #661424 #my $qfilename = quotemeta $session_screens{$key}->{'long'}; $plugin_process->start( sub { system($plugin_value, $session_screens{$key}->{'long'}, $session_screens{$key}->{'width'}, $session_screens{$key}->{'height'}, $session_screens{$key}->{'filetype'}); POSIX::_exit(0); }); #ignore delete-event during execute $plugin_dialog->signal_connect( 'delete-event' => sub { return TRUE; }); #we are also able to show a little progress bar to give some feedback #to the user. there is no real progress because we are just executing a shell script while ($plugin_process->poll) { $plugin_progress->set_text($plugin_name . " - " . $session_screens{$key}->{'short'}); $plugin_progress->pulse; fct_update_gui(); usleep 100000; } fct_update_gui(); #finally show some status messages if ($plugin_process->exit_status() == 0) { fct_show_status_message(1, sprintf($d->get("Successfully applied plugin %s"), "'" . $plugin_name . "'")); } else { $sd->dlg_error_message(sprintf($d->get("Error while executing plugin %s."), "'" . $plugin_name . "'"), $d->get("There was an error executing the plugin."),); } #update session tab manually fct_update_tab($key, undef, $session_screens{$key}->{'giofile'}); #setup a new filemonitor, so we get noticed if the file changed fct_add_file_monitor($key); } return TRUE; } sub fct_show_status_message { my $index = shift; my $status_text = shift; $status->pop($index); if (defined $session_start_screen{'first_page'}->{'statusbar_timer'}) { if ($session_start_screen{'first_page'}->{'statusbar_timer'}) { Glib::Source->remove($session_start_screen{'first_page'}->{'statusbar_timer'}); } } $status->push($index, $status_text); #...and remove it $session_start_screen{'first_page'}->{'statusbar_timer'} = Glib::Timeout->add( 3000, sub { $status->pop($index); #show file or session info again fct_update_info_and_tray(); return FALSE; }); return TRUE; } sub fct_update_info_and_tray { my $force_key = shift; my $key = undef; if ($force_key) { if ($force_key eq "session") { $key = undef; } else { $key = $force_key; } } else { $key = fct_get_current_file(); } #STATUSBAR AND WINDOW TITLE #-------------------------------------- #update statusbar when this image is current tab if ( $key && defined $session_screens{$key}->{'long'} && defined $session_screens{$key}->{'width'}) { #change window title if (defined $session_screens{$key}->{'is_unsaved'} && $session_screens{$key}->{'is_unsaved'}) { $window->set_title("*" . $session_screens{$key}->{'name'} . " - " . SHUTTER_NAME); } else { $window->set_title($session_screens{$key}->{'long'} . " - " . SHUTTER_NAME); } $status->push(1, $session_screens{$key}->{'width'} . " x " . $session_screens{$key}->{'height'} . " " . $d->get("pixels") . " " . $shf->utf8_decode($hu->format($session_screens{$key}->{'size'}))); #session tab } else { #change window title $window->set_title($d->get("Session") . " - " . SHUTTER_NAME); $status->push(1, sprintf($d->nget("%s screenshot", "%s screenshots", scalar(keys(%session_screens))), scalar(keys(%session_screens))) . " " . $shf->utf8_decode($hu->format(fct_get_total_size_of_session()))); } #TRAY TOOLTIP #-------------------------------------- if ($combobox_settings_profiles) { if ($tray && $tray->isa('Gtk3::StatusIcon')) { if ($combobox_settings_profiles->get_active_text) { $tray->set_tooltip_text($d->get("Current profile") . ": " . $combobox_settings_profiles->get_active_text); } else { $tray->set_tooltip_text(SHUTTER_NAME . " " . SHUTTER_VERSION); } } } return TRUE; } sub fct_get_key_by_filename { my $filename = shift; return unless $filename; my $key = undef; #and loop through hash to find the corresponding key foreach my $ckey (keys %session_screens) { next unless exists $session_screens{$ckey}->{'long'}; #~ print "compare ".$session_screens{$ckey}->{'long'}." - $filename\n"; if ($session_screens{$ckey}->{'long'} eq $filename) { $key = $ckey; last; } } return $key; } sub fct_get_key_by_pubfile { my $filename = shift; return unless $filename; my $key = undef; #and loop through hash to find the corresponding key foreach my $ckey (keys %session_screens) { next unless exists $session_screens{$ckey}->{'links'}; next unless exists $session_screens{$ckey}->{'links'}->{'ubuntu-one'}; next unless exists $session_screens{$ckey}->{'links'}->{'ubuntu-one'}->{'pubfile'}; #~ print "compare ".$session_screens{$ckey}->{'links'}->{'ubuntu-one'}->{'pubfile'}." - $filename\n"; if ($session_screens{$ckey}->{'links'}->{'ubuntu-one'}->{'pubfile'} eq $filename) { $key = $ckey; last; } } return $key; } sub fct_get_file_by_index { my $index = shift; return unless $index; #get current page my $curr_page = $notebook->get_nth_page($index); my $key = undef; #and loop through hash to find the corresponding key if ($curr_page) { foreach my $ckey (keys %session_screens) { next unless exists $session_screens{$ckey}->{'tab_child'}; if ($session_screens{$ckey}->{'tab_child'} == $curr_page) { $key = $ckey; last; } } } return $key; } sub fct_get_total_size_of_session { my $total_size = 0; foreach my $ckey (keys %session_screens) { next unless $session_screens{$ckey}->{'size'}; $total_size += $session_screens{$ckey}->{'size'}; } return $total_size; } sub fct_get_current_file { #get current page my $curr_page = $notebook->get_nth_page($notebook->get_current_page); my $key = undef; #and loop through hash to find the corresponding key if ($curr_page) { foreach my $ckey (keys %session_screens) { next unless (exists $session_screens{$ckey}->{'tab_child'}); if ($session_screens{$ckey}->{'tab_child'} == $curr_page) { $key = $ckey; last; } } } return $key; } sub fct_update_profile_selectors { my ($combobox_settings_profiles, $current_profiles_ref, $recur_widget) = @_; #populate quick selector as well if (scalar @{$current_profiles_ref} > 0) { #tray menu foreach my $child ($tray_menu->get_children) { if ($child->get_name eq 'quicks') { $child->set_submenu(fct_ret_profile_menu($combobox_settings_profiles, $current_profiles_ref)); $child->set_sensitive(TRUE); last; } } #main menu $sm->{_menuitem_quicks}->set_submenu(fct_ret_profile_menu($combobox_settings_profiles, $current_profiles_ref, $sm->{_menuitem_quicks}->get_submenu)); $sm->{_menuitem_quicks}->set_sensitive(TRUE); #and statusbar #FIXME - some explanation is missing here unless ($recur_widget && $recur_widget eq $combobox_status_profiles) { if ( defined $combobox_status_profiles && defined $combobox_status_profiles_label) { $combobox_status_profiles_label->destroy; $combobox_status_profiles->destroy; } $combobox_status_profiles_label = Gtk3::Label->new($d->get("Profile") . ":"); $combobox_status_profiles = Gtk3::ComboBoxText->new; $status->pack_start($combobox_status_profiles_label, FALSE, FALSE, 0); $status->pack_start($combobox_status_profiles, FALSE, FALSE, 0); foreach my $profile (@{$current_profiles_ref}) { $combobox_status_profiles->append_text($profile); } $combobox_status_profiles->set_active($combobox_settings_profiles->get_active); $combobox_status_profiles->signal_connect( 'changed' => sub { my $widget = shift; $combobox_settings_profiles->set_active($widget->get_active); evt_apply_profile($widget, $combobox_settings_profiles, $current_profiles_ref); }); $status->show_all; } } else { #tray menu foreach my $child ($tray_menu->get_children) { if ($child->get_name eq 'quicks') { $child->set_submenu(undef); $child->set_sensitive(FALSE); last; } } #main menu $sm->{_menuitem_quicks}->set_submenu(undef); $sm->{_menuitem_quicks}->set_sensitive(FALSE); #and statusbar if ( defined $combobox_status_profiles && defined $combobox_status_profiles_label) { $combobox_status_profiles_label->destroy; $combobox_status_profiles->destroy; } } return TRUE; } sub fct_update_tab { #mandatory my $key = shift; return FALSE unless $key; #optional, e.g.used by fct_integrate... my $pixbuf = shift; my $giofile = shift; my $force_thumb = shift; my $xdo = shift; my $no_image_load = shift; $session_screens{$key}->{'giofile'} = $giofile if $giofile; $session_screens{$key}->{'mtime'} = -1 unless $session_screens{$key}->{'mtime'}; #something wrong here unless (defined $session_screens{$key}->{'giofile'}) { return FALSE; } #sometimes there are some read errors #because the CHANGED signal gets emitted by the file monitor #but the file is still in use (e.g. plugin, external app) #we try to read the fileinfos and the file itsels several times #until throwing an error my $error_counter = 0; while ($error_counter <= MAX_ERROR) { my $filestat = stat($session_screens{$key}->{'giofile'}->get_path); #does the file exist? if ($session_screens{$key}->{'giofile'}->query_exists) { #maybe we need no update if ($filestat->mtime == $session_screens{$key}->{'mtime'} && !$giofile) { print "Updating fileinfos REJECTED for key: $key (not modified)\n" if $sc->get_debug; return TRUE; } print "Updating fileinfos for key: $key\n" if $sc->get_debug; #FILEINFO #-------------------------------------- $session_screens{$key}->{'mtime'} = $filestat->mtime; $session_screens{$key}->{'size'} = $filestat->size; $session_screens{$key}->{'short'} = $shf->utf8_decode(unescape_string($session_screens{$key}->{'giofile'}->get_basename)); $session_screens{$key}->{'long'} = $shf->utf8_decode(unescape_string($session_screens{$key}->{'giofile'}->get_path)); $session_screens{$key}->{'folder'} = $shf->utf8_decode(unescape_string($session_screens{$key}->{'giofile'}->get_parent->get_path)); $session_screens{$key}->{'filetype'} = $session_screens{$key}->{'short'}; $session_screens{$key}->{'filetype'} =~ s/.*\.//ig; #just the name $session_screens{$key}->{'name'} = $session_screens{$key}->{'short'}; $session_screens{$key}->{'name'} =~ s/\.$session_screens{$key}->{'filetype'}//g; #mime type my ($mime_type) = Glib::Object::Introspection->invoke('Gio', undef, 'content_type_guess', $session_screens{$key}->{'giofile'}->get_path); $mime_type =~ s/image\/x\-apple\-ios\-png/image\/png/; #FIXME $session_screens{$key}->{'mime_type'} = $mime_type; #TAB PREVIEW IMAGE #-------------------------------------- #maybe we have a pixbuf already (e.g. after taking a screenshot) unless ($pixbuf) { unless ($no_image_load) { $pixbuf = $lp_ne->load($session_screens{$key}->{'long'}, undef, undef, undef, TRUE); unless ($pixbuf) { #increment error counter #and go to next try $error_counter++; sleep 1; #we need to reset the modification time #because the change would not be #recognized otherwise $session_screens{$key}->{'mtime'} = -1; next; } } } my $im_format = undef; my $im_width = undef; my $im_height = undef; if (defined $pixbuf) { #setting pixbuf $session_screens{$key}->{'image'}->set_pixbuf($pixbuf); $im_width = $pixbuf->get_width; $im_height = $pixbuf->get_height; } else { #If image pixbuf was not loaded, get image info without loading it into the memory ($im_format, $im_width, $im_height) = Gtk3::Gdk::Pixbuf::get_file_info($session_screens{$key}->{'long'}); unless ($im_format) { #increment error counter #and go to next try $error_counter++; sleep 1; #we need to reset the modification time #because the change would not be #recognized otherwise $session_screens{$key}->{'mtime'} = -1; next; } } #UPDATE INFOS #-------------------------------------- #get dimensions - using the pixbuf $session_screens{$key}->{'width'} = $im_width; $session_screens{$key}->{'height'} = $im_height; #generate thumbnail if file is not too large #set flag if ( $session_screens{$key}->{'width'} <= 10000 && $session_screens{$key}->{'height'} <= 10000) { $session_screens{$key}->{'no_thumbnail'} = FALSE; } else { $session_screens{$key}->{'no_thumbnail'} = TRUE; } #update is_unsaved flag if ($session_screens{$key}->{'folder'} eq Shutter::App::Directories::get_cache_dir()) { $session_screens{$key}->{'is_unsaved'} = TRUE; } else { $session_screens{$key}->{'is_unsaved'} = FALSE; } #update tab label #and tooltip if (defined $session_screens{$key}->{'is_unsaved'} && $session_screens{$key}->{'is_unsaved'}) { $session_screens{$key}->{'hbox_tab_label'}->set_tooltip_text("*" . $session_screens{$key}->{'name'}); $session_screens{$key}->{'tab_label'}->set_text("[" . $session_screens{$key}->{'tab_indx'} . "] - " . "*" . $session_screens{$key}->{'name'}); } else { $session_screens{$key}->{'hbox_tab_label'}->set_tooltip_text($session_screens{$key}->{'long'}); $session_screens{$key}->{'tab_label'}->set_text("[" . $session_screens{$key}->{'tab_indx'} . "] - " . $session_screens{$key}->{'short'}); } #create tempfile #maybe we have to restore the file later my ($tmpfh, $tmpfilename) = tempfile(UNLINK => 1); #UNDO / REDO #-------------------------------------- #blocked (e.g. renaming) if (defined $xdo && $xdo eq 'block') { unlink $tmpfilename; #clear (e.g. save_as) } elsif (defined $xdo && $xdo eq 'clear') { while (defined $session_screens{$key}->{'undo'} && scalar @{$session_screens{$key}->{'undo'}} > 0) { unlink shift @{$session_screens{$key}->{'undo'}}; } while (defined $session_screens{$key}->{'redo'} && scalar @{$session_screens{$key}->{'redo'}} > 0) { unlink shift @{$session_screens{$key}->{'redo'}}; } push @{$session_screens{$key}->{'undo'}}, $tmpfilename; cp($session_screens{$key}->{'long'}, $tmpfilename); #push to undo } else { #clear redo unless triggered from gui (undo/redo buttons) if (!defined $xdo) { while (defined $session_screens{$key}->{'redo'} && scalar @{$session_screens{$key}->{'redo'}} > 0) { unlink shift @{$session_screens{$key}->{'redo'}}; } } push @{$session_screens{$key}->{'undo'}}, $tmpfilename; cp($session_screens{$key}->{'long'}, $tmpfilename); } #thumbnail in tab my $thumb; unless ($session_screens{$key}->{'no_thumbnail'}) { #update tab icon $thumb = $lp_ne->load($shf->utf8_decode($session_screens{$key}->{'giofile'}->get_path), $shf->icon_size('small-toolbar')); $session_screens{$key}->{'tab_icon'}->set_from_pixbuf($thumb); } #UPDATE FIRST TAB - VIEW #-------------------------------------- my $thumb_view = undef; unless ($session_screens{$key}->{'no_thumbnail'}) { my $max_size = 100; #update first page tab list view thumb icon if ($im_width <= $max_size && $im_height <= $max_size) { if (defined $pixbuf) { $thumb_view = $pixbuf; } else { #If the full image is smaller than max_size in all #the dimensions, no need to resize it. $thumb_view = $lp_ne->load($shf->utf8_decode($session_screens{$key}->{'giofile'}->get_path)); } } else { $thumb_view = $lp_ne->load($shf->utf8_decode($session_screens{$key}->{'giofile'}->get_path), $max_size, $max_size); } #update dnd pixbuf $session_screens{$key}->{'image'}->drag_source_set_icon_pixbuf($thumb_view); } else { $thumb_view = Gtk3::Gdk::Pixbuf->new('rgb', TRUE, 8, 5, 5); $thumb_view->fill(0x00000000); } #create new iter if needed... unless (defined $session_screens{$key}->{'iter'} && $session_start_screen{'first_page'}->{'model'}->iter_is_valid($session_screens{$key}->{'iter'})) { $session_screens{$key}->{'iter'} = $session_start_screen{'first_page'}->{'model'}->append; } #...update it if (defined $session_screens{$key}->{'is_unsaved'} && $session_screens{$key}->{'is_unsaved'}) { $session_start_screen{'first_page'}->{'model'}->set($session_screens{$key}->{'iter'}, 0, $thumb_view, 1, "*" . $session_screens{$key}->{'name'}, 2, $key); } else { $session_start_screen{'first_page'}->{'model'}->set($session_screens{$key}->{'iter'}, 0, $thumb_view, 1, $session_screens{$key}->{'short'}, 2, $key); } #update first tab fct_update_info_and_tray(); #update menu actions my $current_key = fct_get_current_file(); if (defined $current_key && $current_key eq $key) { fct_update_actions(1, $key); } return TRUE; #file does not exist } else { #show dialog if ($ask_on_fs_delete_active->get_active) { #mark file as deleted $session_screens{$key}->{'deleted'} = TRUE; #we only handle one case here: #file was deleted in filesystem and we got informed about that... my $response = $sd->dlg_question_message( $d->get("Try to resave the file?"), sprintf($d->get("Image %s was not found on disk"), "'" . $session_screens{$key}->{'long'} . "'"), 'gtk-discard', 'gtk-save' ); #handle different responses if ($response == 10 || $response == -1) { $notebook->remove_page($notebook->page_num($session_screens{$key}->{'tab_child'})); #delete tab fct_show_status_message(1, $session_screens{$key}->{'long'} . " " . $d->get("removed from session")) if defined($session_screens{$key}->{'long'}); if (defined $session_screens{$key}->{'iter'} && $session_start_screen{'first_page'}->{'model'}->iter_is_valid($session_screens{$key}->{'iter'})) { $session_start_screen{'first_page'}->{'model'}->remove($session_screens{$key}->{'iter'}); } delete($session_screens{$key}); } elsif ($response == 20) { #try to resave the file #(current version is always the last element in the array) my $current_version = pop @{$session_screens{$key}->{'undo'}}; my $pixbuf = $lp_ne->load($current_version); #restoring the last version failed => delete the screenshot unless ($pixbuf) { $sd->dlg_error_message( sprintf($d->get("Error while saving the image %s."), "'" . $session_screens{$key}->{'short'} . "'"), sprintf($d->get("There was an error saving the image to %s."), "'" . $session_screens{$key}->{'folder'} . "'"), undef, undef, undef, undef, undef, undef, $@ ); $notebook->remove_page($notebook->page_num($session_screens{$key}->{'tab_child'})); #delete tab fct_show_status_message(1, $session_screens{$key}->{'long'} . " " . $d->get("removed from session")) if defined($session_screens{$key}->{'long'}); if (defined $session_screens{$key}->{'iter'} && $session_start_screen{'first_page'}->{'model'}->iter_is_valid($session_screens{$key}->{'iter'})) { $session_start_screen{'first_page'}->{'model'}->remove($session_screens{$key}->{'iter'}); } delete($session_screens{$key}); fct_update_info_and_tray(); return FALSE; } if ($sp->save_pixbuf_to_file($pixbuf, $session_screens{$key}->{'long'}, $session_screens{$key}->{'filetype'})) { fct_update_tab($key); #setup a new filemonitor, so we get noticed if the file changed fct_add_file_monitor($key); fct_show_status_message(1, $session_screens{$key}->{'long'} . " " . $d->get("saved")); fct_update_info_and_tray(); return TRUE; #resave failed => delete the screenshot } else { $notebook->remove_page($notebook->page_num($session_screens{$key}->{'tab_child'})); #delete tab fct_show_status_message(1, $session_screens{$key}->{'long'} . " " . $d->get("removed from session")) if defined($session_screens{$key}->{'long'}); if (defined $session_screens{$key}->{'iter'} && $session_start_screen{'first_page'}->{'model'}->iter_is_valid($session_screens{$key}->{'iter'})) { $session_start_screen{'first_page'}->{'model'}->remove($session_screens{$key}->{'iter'}); } delete($session_screens{$key}); } } #no dialog } else { #mark file as deleted $session_screens{$key}->{'deleted'} = TRUE; #try to resave the file #(current version is always the last element in the array) my $current_version = pop @{$session_screens{$key}->{'undo'}}; my $pixbuf = $lp_ne->load($current_version); #restoring the last version failed => delete the screenshot unless ($pixbuf) { $sd->dlg_error_message( sprintf($d->get("Error while saving the image %s."), "'" . $session_screens{$key}->{'short'} . "'"), sprintf($d->get("There was an error saving the image to %s."), "'" . Shutter::App::Directories::get_cache_dir() . "'"), undef, undef, undef, undef, undef, undef, $@ ); $notebook->remove_page($notebook->page_num($session_screens{$key}->{'tab_child'})); #delete tab fct_show_status_message(1, $session_screens{$key}->{'long'} . " " . $d->get("removed from session")) if defined($session_screens{$key}->{'long'}); if (defined $session_screens{$key}->{'iter'} && $session_start_screen{'first_page'}->{'model'}->iter_is_valid($session_screens{$key}->{'iter'})) { $session_start_screen{'first_page'}->{'model'}->remove($session_screens{$key}->{'iter'}); } delete($session_screens{$key}); fct_update_info_and_tray(); return FALSE; } #prepare new filename my ($short, $folder, $ext) = fileparse($session_screens{$key}->{'long'}, qr/\.[^.]*/); my $new_giofile = fct_get_next_filename($short, Shutter::App::Directories::get_cache_dir(), $ext); my $new_filename = $shf->utf8_decode(unescape_string($new_giofile->get_path)); if ($sp->save_pixbuf_to_file($pixbuf, $new_filename, $session_screens{$key}->{'filetype'})) { if (fct_update_tab($key, undef, Glib::IO::File::new_for_path($new_filename), FALSE, 'clear')) { #setup a new filemonitor, so we get noticed if the file changed fct_add_file_monitor($key); } fct_show_status_message(1, sprintf($d->get("Image %s was deleted from filesystem"), $new_filename)); fct_update_info_and_tray(); return TRUE; #resave failed => delete the screenshot } else { $notebook->remove_page($notebook->page_num($session_screens{$key}->{'tab_child'})); #delete tab fct_show_status_message(1, $session_screens{$key}->{'long'} . " " . $d->get("removed from session")) if defined($session_screens{$key}->{'long'}); if (defined $session_screens{$key}->{'iter'} && $session_start_screen{'first_page'}->{'model'}->iter_is_valid($session_screens{$key}->{'iter'})) { $session_start_screen{'first_page'}->{'model'}->remove($session_screens{$key}->{'iter'}); } delete($session_screens{$key}); } } fct_update_info_and_tray(); return FALSE; } #end if exists } #end while($error_counter <= MAX_ERROR){ #could not load the file => show an error message my $response = $sd->dlg_error_message( sprintf($d->get("Error while opening image %s."), "'" . $session_screens{$key}->{'long'} . "'"), $d->get("There was an error opening the image."), undef, undef, undef, undef, undef, undef, $@ ); $notebook->remove_page($notebook->page_num($session_screens{$key}->{'tab_child'})); #delete tab fct_show_status_message(1, $session_screens{$key}->{'long'} . " " . $d->get("removed from session")) if defined($session_screens{$key}->{'long'}); if (defined $session_screens{$key}->{'iter'} && $session_start_screen{'first_page'}->{'model'}->iter_is_valid($session_screens{$key}->{'iter'})) { $session_start_screen{'first_page'}->{'model'}->remove($session_screens{$key}->{'iter'}); } delete($session_screens{$key}); fct_update_info_and_tray(); return FALSE; } sub fct_get_latest_tab_key { my $max_key = 0; foreach my $key (keys %session_screens) { $key =~ /\[(\d+)\]/; $max_key = $1 if ($1 > $max_key); } return $max_key + 1; } sub fct_imagemagick_perform { my ($function, $file, $data) = @_; my $pixbuf = undef; my $result = undef; $file = $shf->switch_home_in_file($file); if ($function eq "reduce_colors") { $result = `convert '$file' -colors $data '$file'`; $pixbuf = $lp->load($file); } return $pixbuf; } sub fct_check_installed_programs { #update list of available programs in settings dialog as well if ($progname) { my $model = $progname->get_model(); my $progname_iter = $progname->get_active_iter(); #get last prog my $progname_value; if (defined $progname_iter) { $progname_value = $model->get_value($progname_iter, 1); } #rebuild model with new hash of installed programs... $model = fct_get_program_model(); $progname->set_model($model); #...and try to set last value if ($progname_value) { $model->foreach(\&fct_iter_programs, $progname_value); } else { $progname->set_active(0); } #nothing has been set if ($progname->get_active == -1) { $progname->set_active(0); } } return TRUE; } sub fct_parse_filename_wildcards { my ($filename_value, $screenshooter, $screenshot) = @_; my $screenshot_name = $filename_value; print "Parsing wildcards for $screenshot_name\n" if $sc->get_debug; #parse width and height my $swidth = $screenshot->get_width; my $sheight = $screenshot->get_height; $screenshot_name =~ s/\$w/$swidth/g; $screenshot_name =~ s/\$h/$sheight/g; print "Parsed \$width and \$height: $screenshot_name\n" if $sc->get_debug; #parse profile name my $current_pname = $combobox_settings_profiles->get_active_text; $screenshot_name =~ s/\$profile/$current_pname/g; print "Parsed \$profile: $screenshot_name\n" if $sc->get_debug; #set name #e.g. window or workspace name if ($x11_supported) { if (my $action_name = $screenshooter->get_action_name) { utf8::decode $action_name; $action_name =~ s/(\/|\#|\>|\<|\%|\*)/-/g; $screenshot_name =~ s/\$name/$action_name/g; #no blanks (special wildcard) $action_name =~ s/\ //g; $screenshot_name =~ s/\$nb_name/$action_name/g; } else { $screenshot_name =~ s/(\$name|\$nb_name)/unknown/g; } } else { $screenshot_name =~ s/(\$name|\$nb_name)/unknown/g; } print "Parsed \$name: $screenshot_name\n" if $sc->get_debug; return $screenshot_name; } sub fct_get_next_filename { my ($filename_value, $folder, $filetype_value) = @_; #remove possible dots $filetype_value =~ s/\.//; $filename_value =~ s/\\//g; #random number - should be earlier than %N reading, as $R is actually a part of date if ($filename_value =~ /\$R{1,}/) { #how many Rs are used? (important for formatting) my $pos_proc = index($filename_value, "\$R", 0); my $r_counter = 0; my $last_pos = $pos_proc; $pos_proc++; while ($pos_proc <= length($filename_value)) { $last_pos = index($filename_value, "R", $pos_proc); if ($last_pos != -1 && ($last_pos - $pos_proc <= 1)) { $r_counter++; $pos_proc++; } else { last; } } #prepare filename print "---$r_counter Rs used in wild-card\n" if $sc->get_debug; my $marks = ""; my $i = 0; # Md5 will contain a salt (shutter) and a seconds since 1970 my $md5_data = "shutter" . time; my $md5_hash = md5_hex($md5_data); # TODO: set random offset? I guess, current implementation is sufficient $marks = substr($md5_hash, 0, $r_counter); #switch $Rs to a part of the hash $filename_value =~ s/\$R{1,}/$marks/g; } #auto increment (%NNN is the pattern for the increment placeholder) if ($filename_value =~ /\%(N{1,})/) { #how many Ns are used? (important for formatting) my $n_counter = length($1); #prepare filename print "$n_counter Ns used in wild-card\n" if $sc->get_debug; my $filename_template = quotemeta $filename_value; #replace %NNN by a \d+ regex to search for digits #also take into account conflicted filenames Ex.: "_014(002)" $filename_template =~ s/\\\%N+/(\\d+)(?:\\(\\d+\\))?/g; #store regex to string my $search_pattern = qr/$filename_template\.$filetype_value/; print "Searching for files with pattern: $search_pattern\n" if $sc->get_debug; #get_all files from directory #we handle the listing with GnomeVFS to read remote dirs as well my $dir = Glib::IO::File::new_for_path($folder); my $next_count = 0; eval { my $enumerator = $dir->enumerate_children('standard::*', []); while (my $fileinfo = $enumerator->next_file) { my $fname = $shf->utf8_decode($fileinfo->get_name); #not a regular file? -> skip next unless $fileinfo->get_file_type eq 'regular'; #does the current file match the pattern? # print "Comparing $fname\n" if $sc->get_debug; if ($fname =~ $search_pattern) { my $curr_value = $1; if ($curr_value && $curr_value > $next_count) { $next_count = $curr_value; print "$next_count is currently greatest value...\n" if $sc->get_debug; } } } $enumerator->close; }; if ($@) { my $response = $sd->dlg_error_message( sprintf($d->get("Error while opening directory %s."), "'" . $folder . "'"), $d->get("There was an error determining the filename."), undef, undef, undef, undef, undef, undef, $@ ); return FALSE; } $next_count = 0 unless $next_count =~ /^(\d+\.?\d*|\.\d+)$/; $next_count = sprintf("%0" . $n_counter . "d", $next_count + 1); #switch placeholder to $next_count $filename_value =~ s/\%N+/$next_count/g; } #create new uri my $new_giofile = Glib::IO::File::new_for_path("$folder/$filename_value.$filetype_value"); if ($new_giofile->query_exists) { my $count = 1; my $existing_filename = $filename_value; while ($new_giofile->query_exists) { $filename_value = $existing_filename . "(" . sprintf("%03d", $count++) . ")"; $new_giofile = Glib::IO::File::new_for_path($folder); $new_giofile = $new_giofile->append_string("$filename_value.$filetype_value"); print "Checking new uri: " . $new_giofile->to_string . "\n" if $sc->get_debug; } } return $new_giofile; } sub fct_check_installed_plugins { my $plugin_dialog = Gtk3::MessageDialog->new($window, [qw/modal destroy-with-parent/], 'info', 'close', $d->get("Updating plugin information")); $plugin_dialog->{destroyed} = FALSE; $plugin_dialog->set_title("Shutter"); $plugin_dialog->set('secondary-text' => $d->get("Please wait while Shutter updates the plugin information") . "."); $plugin_dialog->signal_connect(response => sub { $plugin_dialog->{destroyed} = TRUE; $_[0]->destroy; }); $plugin_dialog->set_resizable(TRUE); my $plugin_progress = Gtk3::ProgressBar->new; $plugin_progress->set_no_show_all(TRUE); $plugin_progress->set_ellipsize('middle'); $plugin_progress->set_orientation('horizontal'); $plugin_progress->set_fraction(0); $plugin_dialog->get_child->add($plugin_progress); my $current_plugin = Gtk3::Label->new(""); $current_plugin->set_line_wrap(TRUE); $plugin_dialog->get_child->add($current_plugin); my @plugin_paths = ("$shutter_root/share/shutter/resources/system/plugins/*/*", "$ENV{'HOME'}/.shutter/plugins/*/*"); #fallback icon # maybe the plugin # does not provide a custom icon my $fb_pixbuf_path = "$shutter_root/share/shutter/resources/icons/executable.svg"; my $fb_pixbuf = $lp->load($fb_pixbuf_path, $shf->icon_size('menu')); foreach my $plugin_path (@plugin_paths) { my @plugins = bsd_glob($plugin_path); foreach my $pkey (@plugins) { if (-d $pkey) { my $dir_name = $pkey; #parse filename my ($name, $folder, $type) = fileparse($dir_name, qr/\.[^.]*/); #file exists if ($shf->file_exists("$dir_name/$name")) { #file is executable if ($shf->file_executable("$dir_name/$name")) { #new plugin information? unless ($plugins{$pkey}->{'binary'} && $plugins{$pkey}->{'name'} && $plugins{$pkey}->{'category'} && $plugins{$pkey}->{'tooltip'} && $plugins{$pkey}->{'lang'}) { #show dialog and progress bar if ( !$plugin_dialog->get_window && !$plugin_dialog->{destroyed}) { $plugin_progress->show; $plugin_dialog->show_all; } print "\nINFO: new plugin information detected - $dir_name/$name\n"; #path to executable $plugins{$pkey}->{'binary'} = "$dir_name/$name"; #name $plugins{$pkey}->{'name'} = fct_plugin_get_info($plugins{$pkey}->{'binary'}, 'name'); #category $plugins{$pkey}->{'category'} = fct_plugin_get_info($plugins{$pkey}->{'binary'}, 'sort'); #tooltip $plugins{$pkey}->{'tooltip'} = fct_plugin_get_info($plugins{$pkey}->{'binary'}, 'tip'); #language (shell, perl etc.) #=> directory name my $folder_name = dirname($dir_name); $folder_name =~ /.*\/(.*)/; $plugins{$pkey}->{'lang'} = $1; #refresh the progressbar $plugin_progress->pulse; $current_plugin->set_text($plugins{$pkey}->{'binary'}); #refresh gui fct_update_gui(); } $plugins{$pkey}->{'lang'} = "shell" if $plugins{$pkey}->{'lang'} eq ""; chomp($plugins{$pkey}->{'name'}); chomp($plugins{$pkey}->{'category'}); chomp($plugins{$pkey}->{'tooltip'}); chomp($plugins{$pkey}->{'lang'}); #pixbuf $plugins{$pkey}->{'pixbuf'} = $plugins{$pkey}->{'binary'} . ".png" if ($shf->file_exists($plugins{$pkey}->{'binary'} . ".png")); $plugins{$pkey}->{'pixbuf'} = $plugins{$pkey}->{'binary'} . ".svg" if ($shf->file_exists($plugins{$pkey}->{'binary'} . ".svg")); if ($shf->file_exists($plugins{$pkey}->{'pixbuf'})) { $plugins{$pkey}->{'pixbuf_object'} = $lp->load($plugins{$pkey}->{'pixbuf'}, $shf->icon_size('menu')); } else { $plugins{$pkey}->{'pixbuf'} = $fb_pixbuf_path; $plugins{$pkey}->{'pixbuf_object'} = $fb_pixbuf; } if ($sc->get_debug) { print "$plugins{$pkey}->{'name'} - $plugins{$pkey}->{'binary'}\n"; } } else { my $changed = chmod(0755, "$dir_name/$name"); unless ($changed) { print "\nERROR: plugin exists but is not executable - $dir_name/$name\n"; delete $plugins{$pkey}; } } #endif plugin is executable } else { delete $plugins{$pkey}; } #endif plugin exists } } } #destroys the plugin dialog $plugin_dialog->response('ok'); return TRUE; } sub fct_plugin_get_info { my ($plugin, $info) = @_; my $plugin_info = `$plugin $info`; utf8::decode $plugin_info; return $plugin_info; } sub fct_check_installed_upload_plugins { my $upload_plugin_dialog = Gtk3::MessageDialog->new($window, [qw/modal destroy-with-parent/], 'info', 'close', $d->get("Updating upload plugin information")); $upload_plugin_dialog->{destroyed} = FALSE; $upload_plugin_dialog->set_title("Shutter"); $upload_plugin_dialog->set('secondary-text' => $d->get("Please wait while Shutter updates the upload plugin information") . "."); $upload_plugin_dialog->signal_connect(response => sub { $upload_plugin_dialog->{destroyed} = TRUE; $_[0]->destroy; }); $upload_plugin_dialog->set_resizable(TRUE); my $upload_plugin_progress = Gtk3::ProgressBar->new; $upload_plugin_progress->set_no_show_all(TRUE); $upload_plugin_progress->set_ellipsize('middle'); $upload_plugin_progress->set_orientation('horizontal'); $upload_plugin_progress->set_fraction(0); $upload_plugin_dialog->get_child->add($upload_plugin_progress); my $current_plugin = Gtk3::Label->new(""); $current_plugin->set_line_wrap(TRUE); $upload_plugin_dialog->get_child->add($current_plugin); #plugins in user-home not supported yet FIXME my @upload_plugin_paths = ("$shutter_root/share/shutter/resources/system/upload_plugins/upload/*"); foreach my $upload_plugin_path (@upload_plugin_paths) { my @upload_plugins = bsd_glob($upload_plugin_path); foreach my $ukey (@upload_plugins) { #Checking if file exists if ($shf->file_exists("$ukey")) { #file is executable if ($shf->file_executable("$ukey")) { #parse filename my ($name, $folder, $type) = fileparse($ukey, qr/\.[^.]*/); #~ print $name, $folder, $type, "\n"; if ( !exists $accounts{$name} || !exists $accounts{$name}->{module} || $accounts{$name}->{supports_anonymous_upload} ne fct_upload_plugin_get_info($ukey, 'supports_anonymous_upload') || $accounts{$name}->{supports_authorized_upload} ne fct_upload_plugin_get_info($ukey, 'supports_authorized_upload') || $accounts{$name}->{supports_oauth_upload} ne fct_upload_plugin_get_info($ukey, 'supports_oauth_upload')) { #show dialog and progress bar if ( !$upload_plugin_dialog->get_window && !$upload_plugin_dialog->{destroyed}) { $upload_plugin_progress->show; $upload_plugin_dialog->show_all; } print "\nINFO: new upload-plugin information detected - $folder$name\n"; if (fct_upload_plugin_get_info($ukey, 'module')) { # Path $accounts{$name}->{path} = $ukey; # Module Name $accounts{$name}->{module} = fct_upload_plugin_get_info($ukey, 'module'); # URL $accounts{$name}->{host} = fct_upload_plugin_get_info($ukey, 'url'); # Folder $accounts{$name}->{folder} = $folder; # Description $accounts{$name}->{description} = fct_plugin_get_info($ukey, 'description'); # Username $accounts{$name}->{username} = "" unless defined $accounts{$name}->{username}; # Password $accounts{$name}->{password} = "" unless defined $accounts{$name}->{password}; # Register Color $accounts{$name}->{register_color} = "blue"; # Register Text $accounts{$name}->{register_text} = fct_upload_plugin_get_info($ukey, 'registration'); # Upload Features $accounts{$name}->{supports_anonymous_upload} = fct_upload_plugin_get_info($ukey, 'supports_anonymous_upload'); $accounts{$name}->{supports_authorized_upload} = fct_upload_plugin_get_info($ukey, 'supports_authorized_upload'); $accounts{$name}->{supports_oauth_upload} = fct_upload_plugin_get_info($ukey, 'supports_oauth_upload'); #refresh the progressbar $upload_plugin_progress->pulse; $current_plugin->set_text($accounts{$name}->{path}); } else { print "\nERROR: upload-plugin exists but does not work properly - $folder$name\n"; delete $accounts{$name}; } #refresh gui fct_update_gui(); } } else { my $changed = chmod(0755, "$ukey"); unless ($changed) { #parse filename my ($name, $folder, $type) = fileparse($ukey, qr/\.[^.]*/); print "\nERROR: upload-plugin exists but is not executable - $ukey\n"; delete $accounts{$name}; } #endif plugin is executable } } } } #destroys the upload_plugin dialog $upload_plugin_dialog->response('ok'); return TRUE; } sub fct_upload_plugin_get_info { my ($upload_plugin, $info) = @_; my $upload_plugin_info = `$upload_plugin $info`; utf8::decode $upload_plugin_info; return $upload_plugin_info; } sub fct_iter_programs { my ($model, $path, $iter, $search_for) = @_; my $progname_value = $model->get_value($iter, 1); return FALSE if $search_for ne $progname_value; $progname->set_active_iter($iter); return TRUE; } sub fct_ret_workspace_menu { my $init = shift; my $menu_wrksp = Gtk3::Menu->new; unless ($x11_supported) { return $menu_wrksp; } my $wnck_screen = Wnck::Screen::get_default(); unless ($wnck_screen) { $current_monitor_active = Gtk3::CheckMenuItem->new_with_label($d->get("Limit to current monitor")); return $menu_wrksp; } $wnck_screen->force_update(); #we determine the wm name but on older #version of libwnck (or the bindings) #the needed method is not available #in this case we use gdk to do it # #this leads to a known problem when switching #the wm => wm_name will still remain the old one #but it doesn't work on gtk3 my $wm_name; if ($wnck_screen->can('get_window_manager_name')) { $wm_name = $wnck_screen->get_window_manager_name; } my $active_workspace = $wnck_screen->get_active_workspace; #we need to handle different window managers here because there are some different models related #to workspaces and viewports # compiz uses "multiple workspaces" - "multiple viewports" model for example # default gnome wm metacity simply uses multiple workspaces #we will try to handle them by name my @workspaces = (); for (my $wcount = 0 ; $wcount < $wnck_screen->get_workspace_count ; $wcount++) { push(@workspaces, $wnck_screen->get_workspace($wcount)); } foreach my $space (@workspaces) { next unless defined $space; #compiz print "Current window manager: ", $wm_name, "\n" if $sc->get_debug; if ($wm_name =~ /compiz/i) { #calculate viewports with size of workspace my $vpx = $space->get_viewport_x; my $vpy = $space->get_viewport_y; my $n_viewports_column = int($space->get_width / $wnck_screen->get_width); my $n_viewports_rows = int($space->get_height / $wnck_screen->get_height); #rows for (my $j = 0 ; $j < $n_viewports_rows ; $j++) { #columns for (my $i = 0 ; $i < $n_viewports_column ; $i++) { my @vp = ($i * $wnck_screen->get_width, $j * $wnck_screen->get_height); my $vp_name = "$wm_name x: $i y: $j"; print "shutter_wrksp_direct_compiz" . $vp[0] . "x" . $vp[1] . "\n" if $sc->get_debug; my $vp_item = Gtk3::MenuItem->new_with_label(ucfirst $vp_name); $vp_item->signal_connect( 'activate' => \&evt_take_screenshot, "shutter_wrksp_direct_compiz" . $vp[0] . "x" . $vp[1]); $menu_wrksp->append($vp_item); #do not offer current viewport if ($vp[0] == $vpx && $vp[1] == $vpy) { $vp_item->set_sensitive(FALSE); } } #columns } #rows #all other wm manager like metacity etc. #we could add more of them here if needed } else { my $wrkspace_item = Gtk3::MenuItem->new_with_label($space->get_name); $wrkspace_item->signal_connect( 'activate' => \&evt_take_screenshot, "shutter_wrksp_direct" . $space->get_number ); $menu_wrksp->append($wrkspace_item); if ( $active_workspace && $active_workspace->get_number == $space->get_number) { $wrkspace_item->set_sensitive(FALSE); } } } #entry for capturing all workspaces $menu_wrksp->append(Gtk3::SeparatorMenuItem->new); my $allwspaces_item = Gtk3::MenuItem->new_with_label($d->get("Capture All Workspaces")); $allwspaces_item->signal_connect( 'activate' => \&evt_take_screenshot, "shutter_wrksp_direct" . 'all' ); $menu_wrksp->append($allwspaces_item); #monitor flag my $n_mons = Gtk3::Gdk::Screen::get_default->get_n_monitors; #use only current monitor $menu_wrksp->append(Gtk3::SeparatorMenuItem->new); if ($init) { $current_monitor_active = Gtk3::CheckMenuItem->new_with_label($d->get("Limit to current monitor")); if (defined $settings_xml->{'general'}->{'current_monitor_active'}) { $current_monitor_active->set_active($settings_xml->{'general'}->{'current_monitor_active'}); } else { $current_monitor_active->set_active(FALSE); } $menu_wrksp->append($current_monitor_active); } else { $current_monitor_active->reparent($menu_wrksp); } $current_monitor_active->set_tooltip_text( sprintf( $d->nget( "This option is only useful when you are running a multi-monitor system (%d monitor detected).\nEnable it to capture only the current monitor.", "This option is only useful when you are running a multi-monitor system (%d monitors detected).\nEnable it to capture only the current monitor.", $n_mons ), $n_mons )); if ($n_mons > 1) { $current_monitor_active->set_sensitive(TRUE); } else { $current_monitor_active->set_active(FALSE); $current_monitor_active->set_sensitive(FALSE); } $menu_wrksp->show_all(); return $menu_wrksp; } sub fct_ret_window_menu { my $menu_windows = Gtk3::Menu->new; return $menu_windows unless $wnck_screen; my $active_workspace = $wnck_screen->get_active_workspace; my $icontheme = $sc->get_theme; #add item for active window my $active_window_item_image; if ($icontheme->has_icon('preferences-system-windows')) { $active_window_item_image = Gtk3::Image->new_from_icon_name('preferences-system-windows', 'menu'); } else { $active_window_item_image = Gtk3::Image->new_from_pixbuf($lp->load("$shutter_root/share/shutter/resources/icons/sel_window_active.svg", $shf->icon_size('menu'))); } my $active_window_item = Gtk3::ImageMenuItem->new_with_label($d->get("Active Window")); $active_window_item->set_image($active_window_item_image); $active_window_item->set('always_show_image' => TRUE); $active_window_item->set_tooltip_text($d->get("Capture the last active window")); $active_window_item->signal_connect( 'activate' => \&evt_take_screenshot, 'awindow' ); $menu_windows->append($active_window_item); $menu_windows->append(Gtk3::SeparatorMenuItem->new); # Check if we can retrieve the list of stacked windows first, otherwise we will run into a crash, see issue 659 unless ($wnck_screen->get_windows_stacked) { print "ERROR: The window list could not be retrieved and has been disabled, see https://github.com/shutter-project/shutter/issues/659"; return $menu_windows; } #add all windows to menu to capture it directly foreach my $win (@{$wnck_screen->get_windows_stacked}) { if ($active_workspace && $win->is_on_workspace($active_workspace)) { my $win_name = $win->get_name; Encode::_utf8_on($win_name); my $window_item = Gtk3::ImageMenuItem->new_with_label($win_name); foreach my $child ($window_item->get_children) { if ($child =~ /Gtk3::AccelLabel/) { $child->set_width_chars(50); $child->set_ellipsize('middle'); last; } } $window_item->set_image(Gtk3::Image->new_from_pixbuf($win->get_mini_icon)); $window_item->set('always_show_image' => TRUE); $window_item->signal_connect( 'activate' => \&evt_take_screenshot, "shutter_window_direct" . $win->get_xid ); $menu_windows->append($window_item); } } $menu_windows->show_all; return $menu_windows; } sub fct_ret_tray_menu { my $traytheme = $sc->get_theme; my $menu_tray = Gtk3::Menu->new(); #selection my $menuitem_select = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Selection')); $menuitem_select->set_sensitive($x11_supported); eval { my $ccursor_pb = Gtk3::Gdk::Cursor::new('left_ptr')->get_image->scale_simple($shf->icon_size('menu'), 'bilinear'); $menuitem_select->set_image(Gtk3::Image->new_from_pixbuf($ccursor_pb)); }; if ($@) { if ($traytheme->has_icon('applications-accessories')) { $menuitem_select->set_image(Gtk3::Image->new_from_icon_name('applications-accessories', 'menu')); } else { $menuitem_select->set_image(Gtk3::Image->new_from_pixbuf($lp->load("$shutter_root/share/shutter/resources/icons/selection.svg", $shf->icon_size('menu')))); } } $menuitem_select->signal_connect( activate => \&evt_take_screenshot, 'tray_select' ); #full screen my $menuitem_full = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Desktop')); if ($traytheme->has_icon('user-desktop')) { $menuitem_full->set_image(Gtk3::Image->new_from_icon_name('user-desktop', 'menu')); } elsif ($traytheme->has_icon('desktop')) { $menuitem_full->set_image(Gtk3::Image->new_from_icon_name('desktop', 'menu')); } else { $menuitem_full->set_image(Gtk3::Image->new_from_pixbuf($lp->load("$shutter_root/share/shutter/resources/icons/desktop.svg", $shf->icon_size('menu')))); } $menuitem_full->signal_connect( activate => \&evt_take_screenshot, 'tray_full' ); #~ #awindow #~ my $menuitem_awindow = Gtk3::ImageMenuItem->new_with_mnemonic( $d->get('_Active Window') ); #~ if($traytheme->has_icon('preferences-system-windows')){ #~ $menuitem_awindow->set_image( Gtk3::Image->new_from_icon_name( 'preferences-system-windows', 'menu' ) ); #~ }else{ #~ $menuitem_awindow->set_image( #~ Gtk3::Image->new_from_pixbuf( #~ $lp->load( "$shutter_root/share/shutter/resources/icons/sel_window_active.svg", $shf->icon_size('menu') ) #~ ) #~ ); #~ } #~ $menuitem_awindow->signal_connect( #~ activate => \&evt_take_screenshot, #~ 'tray_awindow' #~ ); #window my $menuitem_window = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Window _under Cursor')); $menuitem_window->set_sensitive($x11_supported); if ($traytheme->has_icon('preferences-system-windows')) { $menuitem_window->set_image(Gtk3::Image->new_from_icon_name('preferences-system-windows', 'menu')); } else { $menuitem_window->set_image(Gtk3::Image->new_from_pixbuf($lp->load("$shutter_root/share/shutter/resources/icons/sel_window.svg", $shf->icon_size('menu')))); } $menuitem_window->signal_connect( activate => \&evt_take_screenshot, 'tray_window' ); #window list my $menuitem_window_list = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Select W_indow')); $menuitem_window_list->set_sensitive($x11_supported); if ($traytheme->has_icon('preferences-system-windows')) { $menuitem_window_list->set_image(Gtk3::Image->new_from_icon_name('preferences-system-windows', 'menu')); } else { $menuitem_window_list->set_image(Gtk3::Image->new_from_pixbuf($lp->load("$shutter_root/share/shutter/resources/icons/sel_window.svg", $shf->icon_size('menu')))); } $menuitem_window_list->set_name('windowlist'); $menuitem_window_list->set_submenu(fct_ret_window_menu()); #section # No sections for now: https://github.com/shutter-project/shutter/issues/25 #my $menuitem_window_sect = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Se_ction')); #if ($traytheme->has_icon('gdm-xnest')) { # $menuitem_window_sect->set_image(Gtk3::Image->new_from_icon_name('gdm-xnest', 'menu')); #} else { # $menuitem_window_sect->set_image(Gtk3::Image->new_from_pixbuf($lp->load("$shutter_root/share/shutter/resources/icons/sel_window_section.svg", $shf->icon_size('menu')))); #} #$menuitem_window_sect->signal_connect( # activate => \&evt_take_screenshot, # 'tray_section' #); #menu my $menuitem_window_menu = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Menu')); $menuitem_window_menu->set_sensitive($x11_supported); if ($traytheme->has_icon('alacarte')) { $menuitem_window_menu->set_image(Gtk3::Image->new_from_icon_name('alacarte', 'menu')); } else { $menuitem_window_menu->set_image(Gtk3::Image->new_from_pixbuf($lp->load("$shutter_root/share/shutter/resources/icons/sel_window_menu.svg", $shf->icon_size('menu')))); } $menuitem_window_menu->signal_connect( activate => \&evt_take_screenshot, 'tray_menu' ); #tooltip my $menuitem_window_tooltip = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Tooltip')); $menuitem_window_tooltip->set_sensitive($x11_supported); if ($traytheme->has_icon('help-faq')) { $menuitem_window_tooltip->set_image(Gtk3::Image->new_from_icon_name('help-faq', 'menu')); } else { $menuitem_window_tooltip->set_image(Gtk3::Image->new_from_pixbuf($lp->load("$shutter_root/share/shutter/resources/icons/sel_window_tooltip.svg", $shf->icon_size('menu')))); } $menuitem_window_tooltip->signal_connect( activate => \&evt_take_screenshot, 'tray_tooltip' ); #web my $menuitem_web = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Web')); $menuitem_web->set_sensitive($gnome_web_photo); if ($traytheme->has_icon('web-browser')) { $menuitem_web->set_image(Gtk3::Image->new_from_icon_name('web-browser', 'menu')); } else { $menuitem_web->set_image(Gtk3::Image->new_from_pixbuf($lp->load("$shutter_root/share/shutter/resources/icons/web_image.svg", $shf->icon_size('menu')))); } $menuitem_web->signal_connect( activate => \&evt_take_screenshot, 'tray_web' ); #show main window my $menuitem_show_window = Gtk3::MenuItem->new_with_mnemonic($d->get('S_how main window')); $menuitem_show_window->signal_connect('activate', sub { $is_hidden = TRUE; fct_control_main_window('show'); }); $menuitem_show_window->set_name('show_window'); $menuitem_show_window->set_sensitive(TRUE); #redo last screenshot my $menuitem_redoshot = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Redo last screenshot')); $menuitem_redoshot->set_image(Gtk3::Image->new_from_stock('gtk-refresh', 'menu')); $menuitem_redoshot->signal_connect('activate', \&evt_take_screenshot, 'redoshot'); $menuitem_redoshot->set_name('redoshot'); $menuitem_redoshot->set_sensitive(FALSE); #preferences my $menuitem_settings = Gtk3::ImageMenuItem->new_from_stock('gtk-preferences'); $menuitem_settings->signal_connect("activate", \&evt_show_settings); #quick profile selector my $menuitem_quicks = Gtk3::MenuItem->new_with_mnemonic($d->get('_Quick profile select')); #set name to identify the item later - we use this in really rare cases $menuitem_quicks->set_name('quicks'); $menuitem_quicks->set_sensitive(FALSE); #info my $menuitem_info = Gtk3::ImageMenuItem->new_from_stock('gtk-about'); $menuitem_info->signal_connect("activate", \&evt_about); #quit my $menuitem_quit = Gtk3::ImageMenuItem->new_from_stock('gtk-quit'); $menuitem_quit->signal_connect("activate", \&evt_delete_window, 'quit'); $menu_tray->append($menuitem_show_window); $menu_tray->append(Gtk3::SeparatorMenuItem->new); $menu_tray->append($menuitem_redoshot); $menu_tray->append(Gtk3::SeparatorMenuItem->new); $menu_tray->append($menuitem_select); #~ $menu_tray->append( Gtk3::SeparatorMenuItem->new ); $menu_tray->append($menuitem_full); #~ $menu_tray->append( Gtk3::SeparatorMenuItem->new ); #~ $menu_tray->append($menuitem_awindow); $menu_tray->append($menuitem_window); $menu_tray->append($menuitem_window_list); # No sections for now: https://github.com/shutter-project/shutter/issues/25 #$menu_tray->append($menuitem_window_sect); $menu_tray->append($menuitem_window_menu); $menu_tray->append($menuitem_window_tooltip); #~ $menu_tray->append( Gtk3::SeparatorMenuItem->new ); $menu_tray->append($menuitem_web); $menu_tray->append(Gtk3::SeparatorMenuItem->new); $menu_tray->append($menuitem_settings); $menu_tray->append($menuitem_quicks); $menu_tray->append(Gtk3::SeparatorMenuItem->new); $menu_tray->append($menuitem_info); $menu_tray->append($menuitem_quit); $menu_tray->show_all; return $menu_tray; } sub fct_ret_program_menu { my $menu_programs = shift; $menu_programs = Gtk3::Menu->new unless defined $menu_programs; foreach my $child ($menu_programs->get_children) { $child->destroy; } #take $key (mime) directly my $key = fct_get_current_file(); #FIXME - different mime types #have different apps registered #we should restrict the offeres apps #by comparing the selected # #currently we just take the last selected file into account # #search selected files for mime... unless ($key) { $session_start_screen{'first_page'}->{'view'}->selected_foreach( sub { my ($view, $path) = @_; my $iter = $session_start_screen{'first_page'}->{'model'}->get_iter($path); if (defined $iter) { $key = $session_start_screen{'first_page'}->{'model'}->get_value($iter, 2); } }); } #still no key? => leave sub unless ($key) { $sm->{_menuitem_reopen}->set_sensitive(FALSE); $sm->{_menuitem_large_reopen}->set_sensitive(FALSE); return $menu_programs; } #no valid hash entry? unless (exists $session_screens{$key}->{'mime_type'}) { $sm->{_menuitem_reopen}->set_sensitive(FALSE); $sm->{_menuitem_large_reopen}->set_sensitive(FALSE); return $menu_programs; } #get applications my $mime_type = $session_screens{$key}->{'mime_type'}; # apps is a list of GAppInfo # https://developer.gnome.org/gio/stable/GAppInfo.html my $apps = Glib::IO::AppInfo::get_recommended_for_type($mime_type); # $apps is undefined if Glib::IO::AppInfo::get_recommended_for_type fails unless (defined $apps) { $sm->{_menuitem_reopen}->set_sensitive(FALSE); $sm->{_menuitem_large_reopen}->set_sensitive(FALSE); return $menu_programs; } #no apps determined! unless (scalar @$apps) { $sm->{_menuitem_reopen}->set_sensitive(FALSE); $sm->{_menuitem_large_reopen}->set_sensitive(FALSE); return $menu_programs; } #create menu items foreach my $app (@$apps) { #ignore Shutter's desktop entry next if $app->get_display_name =~ /shutter/i; # $app->{'name'} = $shf->utf8_decode( $app->{'name'} ); #FIXME #we simply cut the kde* / kde4* substring here #is it possible to get the wrong app if there #is the kde3 and the kde4 version of an app installed? # #I think so ;-) # $app->{'id'} =~ s/^(kde4|kde)-//g; my $program_item = Gtk3::ImageMenuItem->new_with_label($app->get_display_name); $program_item->set('always_show_image' => TRUE); $menu_programs->append($program_item); my $icon = $app->get_icon; if ($icon && $program_item) { my $icon_pixbuf = undef; my ($iw, $ih) = $shf->icon_size('menu'); eval { my $icon_info = $sc->get_theme->choose_icon($icon->get_names, $ih, []); $icon_pixbuf = $icon_info->load_icon if $icon_info; }; if ($@) { print "\nWARNING: Could not load icon for ", $app->get_display_name, ": $@\n"; $icon_pixbuf = undef; } if ($icon_pixbuf) { $program_item->set_image(Gtk3::Image->new_from_pixbuf($icon_pixbuf)); } } #connect to signal if ($program_item) { $program_item->signal_connect( 'activate' => sub { fct_open_with_program($app, $app->get_display_name); }); } } #menu does not contain any item unless ($menu_programs->get_children) { $sm->{_menuitem_reopen}->set_sensitive(FALSE); $sm->{_menuitem_large_reopen}->set_sensitive(FALSE); } $menu_programs->show_all; return $menu_programs; } sub fct_ret_web_menu { my $menu_web = Gtk3::Menu->new; my $timeout0 = Gtk3::RadioMenuItem->new_with_label(undef, $d->get("Wait indefinitely")); my $timeout1 = Gtk3::RadioMenuItem->new_with_label($timeout0, sprintf($d->nget("Wait max %d second", "Wait max %d seconds", 10), 10)); my $timeout2 = Gtk3::RadioMenuItem->new_with_label($timeout0, sprintf($d->nget("Wait max %d second", "Wait max %d seconds", 10), 30)); my $timeout3 = Gtk3::RadioMenuItem->new_with_label($timeout0, sprintf($d->nget("Wait max %d minute", "Wait max %d minutes", 1), 1)); my $timeout4 = Gtk3::RadioMenuItem->new_with_label($timeout0, sprintf($d->nget("Wait max %d minute", "Wait max %d minutes", 2), 2)); $timeout0->set_name("timeout0"); $timeout1->set_name("timeout10"); $timeout2->set_name("timeout30"); $timeout3->set_name("timeout60"); $timeout4->set_name("timeout120"); $timeout0->set_tooltip_text($d->get("Shutter will wait indefinitely for the screenshot to capture")); $timeout1->set_tooltip_text( sprintf( $d->nget( "Shutter will wait up to %d second for the screenshot to capture before aborting the process if it's taking too long", "Shutter will wait up to %d seconds for the screenshot to capture before aborting the process if it's taking too long", 10 ), 10 )); $timeout2->set_tooltip_text( sprintf( $d->nget( "Shutter will wait up to %d second for the screenshot to capture before aborting the process if it's taking too long", "Shutter will wait up to %d seconds for the screenshot to capture before aborting the process if it's taking too long", 30 ), 30 )); $timeout3->set_tooltip_text( sprintf( $d->nget( "Shutter will wait up to %d minute for the screenshot to capture before aborting the process if it's taking too long", "Shutter will wait up to %d minutes for the screenshot to capture before aborting the process if it's taking too long", 1 ), 1 )); $timeout4->set_tooltip_text( sprintf( $d->nget( "Shutter will wait up to %d minute for the screenshot to capture before aborting the process if it's taking too long", "Shutter will wait up to %d minutes for the screenshot to capture before aborting the process if it's taking too long", 2 ), 2 )); $timeout2->set_active(TRUE); $menu_web->append($timeout0); $menu_web->append($timeout1); $menu_web->append($timeout2); $menu_web->append($timeout3); $menu_web->append($timeout4); if (defined $settings_xml->{'general'}->{'web_timeout'}) { #determining timeout my @timeouts = $menu_web->get_children; my $timeout = undef; foreach my $to (@timeouts) { $timeout = $to->get_name; $timeout =~ /([0-9]+)/; $timeout = $1; if ($settings_xml->{'general'}->{'web_timeout'} == $timeout) { $to->set_active(TRUE); } } } $menu_web->show_all; return $menu_web; } sub fct_ret_profile_menu { my $combobox_settings_profiles = shift; my $current_profiles_ref = shift; my $menu_profile = shift; $menu_profile = Gtk3::Menu->new unless defined $menu_profile; foreach my $child ($menu_profile->get_children) { $child->destroy; } my $group = undef; my $counter = 0; foreach my $profile (@{$current_profiles_ref}) { my $profile_item = Gtk3::RadioMenuItem->new_with_label($group, $profile); $profile_item->set_active(TRUE) if $profile eq $combobox_settings_profiles->get_active_text; $profile_item->signal_connect( 'toggled' => sub { my $widget = shift; return TRUE unless $widget->get_active; for (my $i = 0 ; $i < scalar @{$current_profiles_ref} ; $i++) { $combobox_settings_profiles->set_active($i); $current_profile_indx = $i; if ($profile eq $combobox_settings_profiles->get_active_text) { evt_apply_profile($widget, $combobox_settings_profiles, $current_profiles_ref); last; } } }); $group = $profile_item unless $group; $menu_profile->append($profile_item); $counter++; } $menu_profile->show_all; return $menu_profile; } sub fct_load_accounts_tree { $accounts_model = Gtk3::ListStore->new( 'Glib::String', 'Glib::String', 'Glib::String', 'Glib::String', 'Glib::String', 'Glib::String', 'Glib::String', 'Glib::String', 'Glib::String', 'Glib::String', 'Glib::Boolean', 'Glib::Boolean', 'Glib::Boolean' ); foreach (keys %accounts) { my $hidden_text = ""; for (my $i = 1 ; $i <= length($accounts{$_}->{'password'}) ; $i++) { $hidden_text .= '*'; } $accounts_model->set( $accounts_model->append, 0, $accounts{$_}->{'host'}, 1, $accounts{$_}->{'username'}, 2, $hidden_text, 3, $accounts{$_}->{'not_used_yet'}, 4, $accounts{$_}->{'register_color'}, 5, $accounts{$_}->{'register_text'}, 6, $accounts{$_}->{'module'}, 7, $accounts{$_}->{'path'}, 8, $accounts{$_}->{'folder'}, 9, $accounts{$_}->{'description'}, 10, $accounts{$_}->{'supports_anonymous_upload'}, 11, $accounts{$_}->{'supports_authorized_upload'}, 12, $accounts{$_}->{'supports_oauth_upload'}, ); } return TRUE; } sub fct_load_plugin_tree { my $effects_model = Gtk3::ListStore->new('Gtk3::Gdk::Pixbuf', 'Glib::String', 'Glib::String', 'Glib::String', 'Glib::String', 'Glib::String', 'Glib::String',); foreach my $pkey (sort keys %plugins) { if ($plugins{$pkey}->{'binary'}) { #we need to update the pixbuf of the plugins again in some cases # #pixbufs are not cached and therefore not checked at startup if #the cached plugin is not in the plugin path #(maybe changed the installation dir) unless ($plugins{$pkey}->{'pixbuf'} || $plugins{$pkey}->{'pixbuf_object'}) { $plugins{$pkey}->{'pixbuf'} = $plugins{$pkey}->{'binary'} . ".png" if ($shf->file_exists($plugins{$pkey}->{'binary'} . ".png")); $plugins{$pkey}->{'pixbuf'} = $plugins{$pkey}->{'binary'} . ".svg" if ($shf->file_exists($plugins{$pkey}->{'binary'} . ".svg")); if ($shf->file_exists($plugins{$pkey}->{'pixbuf'})) { $plugins{$pkey}->{'pixbuf_object'} = $lp->load($plugins{$pkey}->{'pixbuf'}, $shf->icon_size('menu')); } else { $plugins{$pkey}->{'pixbuf'} = "$shutter_root/share/shutter/resources/icons/executable.svg"; $plugins{$pkey}->{'pixbuf_object'} = $lp->load($plugins{$pkey}->{'pixbuf'}, $shf->icon_size('menu')); } } $effects_model->set( $effects_model->append, 0, $plugins{$pkey}->{'pixbuf_object'}, 1, $plugins{$pkey}->{'name'}, 2, $plugins{$pkey}->{'category'}, 3, $plugins{$pkey}->{'tooltip'}, 4, $plugins{$pkey}->{'lang'}, 5, $plugins{$pkey}->{'binary'}, 6, $pkey, ); } else { print "\nWARNING: Plugin $pkey is not configured properly, ignoring\n"; delete $plugins{$pkey}; } } return $effects_model; } sub fct_set_model_accounts { my $accounts_tree = $_[0]; my @columns = $accounts_tree->get_columns; foreach my $col (@columns) { $accounts_tree->remove_column($col); } $accounts_tree->set_tooltip_column(9); #name my $tv_clmn_name_text = Gtk3::TreeViewColumn->new; $tv_clmn_name_text->set_title($d->get("Host")); my $renderer_name_accounts = Gtk3::CellRendererText->new; $tv_clmn_name_text->pack_start($renderer_name_accounts, FALSE); $tv_clmn_name_text->set_attributes($renderer_name_accounts, text => 6); $accounts_tree->append_column($tv_clmn_name_text); #username my $tv_clmn_username_text = Gtk3::TreeViewColumn->new; $tv_clmn_username_text->set_max_width(100); $tv_clmn_username_text->set_title($d->get("Username")); my $renderer_username_accounts = Gtk3::CellRendererText->new; $tv_clmn_username_text->pack_start($renderer_username_accounts, FALSE); $tv_clmn_username_text->set_attributes( $renderer_username_accounts, text => 1, editable => 11, sensitive => 11 ); $renderer_username_accounts->signal_connect( 'edited' => sub { my ($cell, $text_path, $new_text, $model) = @_; my $path = Gtk3::TreePath->new_from_string($text_path); my $iter = $model->get_iter($path); #save entered username to the hash $accounts{$model->get_value($iter, 6)}->{'username'} = $new_text; $model->set($iter, 1, $new_text); }, $accounts_model ); $accounts_tree->append_column($tv_clmn_username_text); #password my $tv_clmn_password_text = Gtk3::TreeViewColumn->new; $tv_clmn_password_text->set_max_width(100); $tv_clmn_password_text->set_title($d->get("Password")); my $renderer_password_accounts = Gtk3::CellRendererText->new; $tv_clmn_password_text->pack_start($renderer_password_accounts, FALSE); $tv_clmn_password_text->set_attributes( $renderer_password_accounts, text => 2, editable => 11, sensitive => 11 ); $renderer_password_accounts->signal_connect( 'edited' => sub { my ($cell, $text_path, $new_text, $model) = @_; my $path = Gtk3::TreePath->new_from_string($text_path); my $iter = $model->get_iter($path); my $hidden_text = ""; for (my $i = 1 ; $i <= length($new_text) ; $i++) { $hidden_text .= '*'; } $accounts{$model->get_value($iter, 6)}->{'password'} = $new_text; #save entered password to the hash $model->set($iter, 2, $hidden_text); }, $accounts_model ); $accounts_tree->append_column($tv_clmn_password_text); #upload features my $tv_clmn_f1_toggle = Gtk3::TreeViewColumn->new; $tv_clmn_f1_toggle->set_title($d->get("Anonymous Upload")); my $f1_toggle = Gtk3::CellRendererToggle->new(); $tv_clmn_f1_toggle->pack_start($f1_toggle, FALSE); $tv_clmn_f1_toggle->set_attributes($f1_toggle, active => 10); $accounts_tree->append_column($tv_clmn_f1_toggle); my $tv_clmn_f2_toggle = Gtk3::TreeViewColumn->new; $tv_clmn_f2_toggle->set_title($d->get("Authorized Upload")); my $f2_toggle = Gtk3::CellRendererToggle->new(); $tv_clmn_f2_toggle->pack_start($f2_toggle, FALSE); $tv_clmn_f2_toggle->set_attributes($f2_toggle, active => 11); $accounts_tree->append_column($tv_clmn_f2_toggle); my $tv_clmn_f3_toggle = Gtk3::TreeViewColumn->new; $tv_clmn_f3_toggle->set_title($d->get("OAuth Upload")); my $f3_toggle = Gtk3::CellRendererToggle->new(); $tv_clmn_f3_toggle->pack_start($f3_toggle, FALSE); $tv_clmn_f3_toggle->set_attributes($f3_toggle, active => 12); $accounts_tree->append_column($tv_clmn_f3_toggle); #description #tooltip column (show as columns when needed) my $tv_clmn_descr_text = Gtk3::TreeViewColumn->new; $tv_clmn_descr_text->set_resizable(TRUE); $tv_clmn_descr_text->set_title($d->get("Description")); my $renderer_descr_effects = Gtk3::CellRendererText->new; $tv_clmn_descr_text->pack_start($renderer_descr_effects, FALSE); $tv_clmn_descr_text->set_attributes($renderer_descr_effects, text => 9); $accounts_tree->append_column($tv_clmn_descr_text); #register my $tv_clmn_pix_text = Gtk3::TreeViewColumn->new; $tv_clmn_pix_text->set_title($d->get("Register")); my $ren_text = Gtk3::CellRendererText->new(); $tv_clmn_pix_text->pack_start($ren_text, FALSE); $tv_clmn_pix_text->set_attributes($ren_text, 'text', 5, 'foreground', 4); $accounts_tree->append_column($tv_clmn_pix_text); return TRUE; } sub fct_set_model_plugins { my $effects_tree = $_[0]; #~ my @columns = $effects_tree->get_columns; #~ foreach (@columns) { #~ $effects_tree->remove_column($_); #~ } #tooltip $effects_tree->set_tooltip_column(3); my $tv_clmn_pix_text = Gtk3::TreeViewColumn->new; $tv_clmn_pix_text->set_resizable(TRUE); $tv_clmn_pix_text->set_title($d->get("Icon")); my $renderer_pix_effects = Gtk3::CellRendererPixbuf->new; $tv_clmn_pix_text->pack_start($renderer_pix_effects, FALSE); $tv_clmn_pix_text->set_attributes($renderer_pix_effects, pixbuf => 0); $effects_tree->append_column($tv_clmn_pix_text); #name my $tv_clmn_text_text = Gtk3::TreeViewColumn->new; $tv_clmn_text_text->set_resizable(TRUE); $tv_clmn_text_text->set_title($d->get("Name")); my $renderer_text_effects = Gtk3::CellRendererText->new; $tv_clmn_text_text->pack_start($renderer_text_effects, FALSE); $tv_clmn_text_text->set_attributes($renderer_text_effects, text => 1); $effects_tree->append_column($tv_clmn_text_text); #category my $tv_clmn_category_text = Gtk3::TreeViewColumn->new; $tv_clmn_category_text->set_resizable(TRUE); $tv_clmn_category_text->set_title($d->get("Category")); my $renderer_category_effects = Gtk3::CellRendererText->new; $tv_clmn_category_text->pack_start($renderer_category_effects, FALSE); $tv_clmn_category_text->set_attributes($renderer_category_effects, text => 2); $effects_tree->append_column($tv_clmn_category_text); my $tv_clmn_descr_text = Gtk3::TreeViewColumn->new; $tv_clmn_descr_text->set_resizable(TRUE); $tv_clmn_descr_text->set_title($d->get("Description")); my $renderer_descr_effects = Gtk3::CellRendererText->new; $tv_clmn_descr_text->pack_start($renderer_descr_effects, FALSE); $tv_clmn_descr_text->set_attributes($renderer_descr_effects, text => 3); $effects_tree->append_column($tv_clmn_descr_text); #language my $tv_clmn_lang_text = Gtk3::TreeViewColumn->new; $tv_clmn_lang_text->set_resizable(TRUE); $tv_clmn_lang_text->set_title($d->get("Language")); my $renderer_lang_effects = Gtk3::CellRendererText->new; $tv_clmn_lang_text->pack_start($renderer_lang_effects, FALSE); $tv_clmn_lang_text->set_attributes($renderer_lang_effects, text => 4); $effects_tree->append_column($tv_clmn_lang_text); #path my $tv_clmn_path_text = Gtk3::TreeViewColumn->new; $tv_clmn_path_text->set_resizable(TRUE); $tv_clmn_path_text->set_title($d->get("Path")); my $renderer_path_effects = Gtk3::CellRendererText->new; $tv_clmn_path_text->pack_start($renderer_path_effects, FALSE); $tv_clmn_path_text->set_attributes($renderer_path_effects, text => 5); $effects_tree->append_column($tv_clmn_path_text); return TRUE; } sub fct_init_depend { #imagemagick/perlmagick unless (File::Which::which('convert')) { die "ERROR: imagemagick is missing --> aborting!\n\n"; } #gnome-web-photo unless (File::Which::which('gnome-web-photo')) { warn "WARNING: gnome-web-photo is missing --> screenshots of websites will be disabled!\n\n"; $gnome_web_photo = FALSE; } #nautilus-sendto unless (File::Which::which('nautilus-sendto')) { $nautilus_sendto = FALSE; } #goocanvas eval { require GooCanvas2; require GooCanvas2::CairoTypes; }; if ($@) { warn "WARNING: Goo::Canvas/libgoo-canvas-perl is missing --> drawing tool will be disabled!\n\n"; $goocanvas = FALSE; } #libimage-exiftool-perl eval { require Image::ExifTool }; if ($@) { warn "WARNING: Image::ExifTool is missing --> writing Exif information will be disabled!\n\n"; $exiftool = FALSE; } #dev-libs/libappindicator[introspection] eval { Glib::Object::Introspection->setup( basename => 'AppIndicator3', version => '0.1', package => 'AppIndicator', ); }; if ($@) { eval { Glib::Object::Introspection->setup( basename => 'AyatanaAppIndicator3', version => '0.1', package => 'AppIndicator', ); }; if ($@) { warn "WARNING: AppIndicator is missing --> there will be no icon showing up in the status bar when running Unity!\n\n"; $appindicator = FALSE; } } return TRUE; } sub fct_control_wm_settings { my $mode = shift; my $restore_value = shift; #compiz via dbus my $bus = undef; my $compiz = undef; my $fpl = undef; #disable focus_prevention my $curr_value = -1; #disable focus prevention when using compiz eval { $bus = Net::DBus->find; #Get a handle to the compiz service $compiz = $bus->get_service("org.freedesktop.compiz"); #Get the relevant object $fpl = $compiz->get_object("/org/freedesktop/compiz/core/screen0/focus_prevention_level", "org.freedesktop.compiz"); }; if ($@) { warn "INFO: DBus connection to org.freedesktop.compiz failed --> skipping compiz related tasks\n\n"; warn $@ . "\n\n"; return $curr_value; } if (defined $fpl && $fpl) { eval { if ($mode eq 'start') { #save and return current value if (defined $fpl && $fpl) { $curr_value = $fpl->get; } if (defined $fpl && $fpl && $fpl->get != 0) { $fpl->set(0); } #re-enable focus prevention -> restore value } elsif ($mode eq 'stop') { if (defined $fpl && $fpl && defined $restore_value) { $fpl->set($restore_value); } elsif (defined $fpl && $fpl) { $fpl->set(1); } } }; if ($@) { warn "ERROR: Unable to set/get focus_level_prevention --> skipping compiz related tasks\n\n"; warn $@ . "\n\n"; } } return $curr_value; } sub fct_init_unsaved_files { #delete all files in this folder #except the ones that are in the current session my @unsaved_files = bsd_glob(Shutter::App::Directories::get_cache_dir() . "/*"); foreach my $unsaved_file (@unsaved_files) { utf8::decode $unsaved_file; print $unsaved_file, " checking \n" if $sc->get_debug; unless (fct_get_key_by_filename($unsaved_file)) { print $unsaved_file, " deleted \n" if $sc->get_debug; unlink $unsaved_file; } } } sub fct_init_debug_output { print "\nINFO: gathering system information..."; print "\n"; print "\n"; print "Shutter "; print SHUTTER_VERSION; print ' '; print SHUTTER_REV; print "\n"; #kernel info if (File::Which::which('uname')) { print `uname -a`, "\n"; } #issue if (-f '/etc/issue') { if (File::Which::which('cat')) { print `cat /etc/issue`, "\n"; } } printf "Glib %s \n", $Glib::VERSION; printf "Gtk3 %s \n", $Gtk3::VERSION; print "\n"; # The version info stuff appeared in 1.040. print "Glib built for " . join(".", Glib->GET_VERSION_INFO) . ", running with " . join(".", Glib::major_version(), Glib::minor_version(), Glib::micro_version()) . "\n" if $Glib::VERSION >= 1.040; print "Gtk3 built for " . join(".", Gtk3->GET_VERSION_INFO) . ", running with " . join(".", Gtk3::major_version(), Gtk3::minor_version(), Gtk3::micro_version()) . "\n" if $Gtk3::VERSION >= 1.040; print "\n"; return TRUE; } #-------------------------------------- #dialogs #-------------------------------------- sub dlg_rename { my (@file_to_rename_keys) = @_; foreach my $key (@file_to_rename_keys) { my $input_dialog = Gtk3::MessageDialog->new($window, [qw/modal destroy-with-parent/], 'other', 'none', undef); $input_dialog->set_title($d->get("Rename")); $input_dialog->set('image' => Gtk3::Image->new_from_stock('gtk-save-as', 'dialog')); $input_dialog->set('text' => sprintf($d->get("Rename image %s"), "'$session_screens{$key}->{'short'}'")); $input_dialog->set('secondary-text' => $d->get("New filename") . ": "); #rename button my $rename_btn = Gtk3::Button->new_with_mnemonic($d->get("_Rename")); $rename_btn->set_image(Gtk3::Image->new_from_stock('gtk-save-as', 'button')); $rename_btn->set_can_default(TRUE); $input_dialog->add_button('gtk-cancel', 'reject'); $input_dialog->add_action_widget($rename_btn, 'accept'); $input_dialog->set_default_response('accept'); my $new_filename_vbox = Gtk3::VBox->new(); my $new_filename_hint = Gtk3::Label->new(); my $new_filename = Gtk3::Entry->new(); $new_filename->set_activates_default(TRUE); fct_validate_filename($new_filename, $new_filename_hint); #parse filename my ($short, $folder, $ext) = fileparse($session_screens{$key}->{'long'}, qr/\.[^.]*/); #enable/disable rename button #e.g. if no text is in entry $new_filename->signal_connect( 'changed' => sub { my $temp_filename = $new_filename->get_text; if (length($temp_filename)) { $rename_btn->set_sensitive(TRUE); #Bug #1087367 if ($temp_filename =~ /.*$ext$/) { my ($short, $folder, $ext) = fileparse($temp_filename, qr/\.[^.]*/); $new_filename->set_text($short); } } else { $rename_btn->set_sensitive(FALSE); } return TRUE; }); #show just the name of the image $new_filename->set_text($session_screens{$key}->{'name'}); if (length($new_filename->get_text)) { $rename_btn->set_sensitive(TRUE); } else { $rename_btn->set_sensitive(FALSE); } $new_filename_vbox->pack_start($new_filename, TRUE, TRUE, 0); $new_filename_vbox->pack_start($new_filename_hint, TRUE, TRUE, 0); $input_dialog->get_child->add($new_filename_vbox); $input_dialog->show_all; #run dialog my $input_response = $input_dialog->run; #handle user responses here if ($input_response eq 'accept') { my $new_name = $new_filename->get_text; $new_name = $session_screens{$key}->{'folder'} . "/" . $new_name . "." . $session_screens{$key}->{'filetype'}; #create uris for following action (e.g. update tab, move etc.) my $new_giofile = Glib::IO::File::new_for_path($new_name); my $old_giofile = $session_screens{$key}->{'giofile'}; if ($new_giofile) { #filenames eq? -> nothing to do here unless ($session_screens{$key}->{'long'} eq $new_name) { #does the "renamed" file already exists? unless ($shf->file_exists($new_name)) { #ok => rename it #cancel handle if (exists $session_screens{$key}->{'handle'}) { $session_screens{$key}->{'handle'}->cancel; } eval { $old_giofile->move($new_giofile, []); }; if ($@) { my $response = $sd->dlg_error_message( sprintf($d->get("Error while renaming the image %s."), "'" . $old_giofile->get_basename . "'"), sprintf($d->get("There was an error renaming the image to %s."), "'" . $new_giofile->get_basename . "'"), undef, undef, undef, undef, undef, undef, $@ ); } fct_update_tab($key, undef, $new_giofile, FALSE, 'block'); #setup a new filemonitor, so we get noticed if the file changed fct_add_file_monitor($key); fct_show_status_message(1, $session_screens{$key}->{'long'} . " " . $d->get("renamed")); #change window title #~ $window->set_title($session_screens{$key}->{'long'}." - ".SHUTTER_NAME); } else { #ask the user to replace the image #replace button my $replace_btn = Gtk3::Button->new_with_mnemonic($d->get("_Replace")); $replace_btn->set_image(Gtk3::Image->new_from_stock('gtk-save-as', 'button')); my $sd = Shutter::App::SimpleDialogs->new; my $response = $sd->dlg_warning_message( sprintf($d->get("The image already exists in %s. Replacing it will overwrite its contents."), "'" . $new_giofile->extract_dirname . "'"), sprintf($d->get("An image named %s already exists. Do you want to replace it?"), "'" . $new_giofile->get_basename . "'"), undef, undef, undef, $replace_btn, undef, undef ); #rename == replace_btn was hit if ($response == 40) { #ok => rename it #cancel handle if (exists $session_screens{$key}->{'handle'}) { $session_screens{$key}->{'handle'}->cancel; } eval { $old_giofile->move($new_giofile, ['overwrite']); }; if ($@) { my $response = $sd->dlg_error_message( sprintf($d->get("Error while renaming the image %s."), "'" . $old_giofile->get_basename . "'"), sprintf($d->get("There was an error renaming the image to %s."), "'" . $new_giofile->get_basename . "'"), undef, undef, undef, undef, undef, undef, $@ ); } fct_update_tab($key, undef, $new_giofile, FALSE, 'block'); #setup a new filemonitor, so we get noticed if the file changed fct_add_file_monitor($key); fct_show_status_message(1, $session_screens{$key}->{'long'} . " " . $d->get("renamed")); #change window title #~ $window->set_title($session_screens{$key}->{'long'}." - ".SHUTTER_NAME); #maybe file is in session as well, need to set the handler again ;-) foreach my $searchkey (keys %session_screens) { next if $key eq $searchkey; if ($session_screens{$searchkey}->{'long'} eq $new_name) { #cancel handle if (exists $session_screens{$searchkey}->{'handle'}) { $session_screens{$searchkey}->{'handle'}->cancel; } fct_update_tab($searchkey, undef, $new_giofile, FALSE, 'block'); #setup a new filemonitor, so we get noticed if the file changed fct_add_file_monitor($searchkey); } } $input_dialog->destroy(); next; } $input_dialog->destroy(); next; } } } else { #uri object could not be created #=> uri illegal my $response = $sd->dlg_error_message( sprintf($d->get("Error while renaming the image %s."), "'" . $old_giofile->get_basename . "'"), sprintf($d->get("There was an error renaming the image to %s."), "'" . $new_name . "'"), undef, undef, undef, undef, undef, undef, $d->get("Invalid Filename")); } } $input_dialog->destroy(); next; } } sub dlg_open { my ($widget, $data) = @_; print "\n$data was emitted by widget $widget\n" if $sc->get_debug; #do we need to open a filechooserdialog? #maybe we open a recently opened file that is #selected via menu my @new_files; unless ($widget =~ /Gtk3::RecentChooserMenu/) { my $fs = Gtk3::FileChooserDialog->new( $d->get("Choose file to open"), $window, 'open', 'gtk-cancel' => 'reject', 'gtk-open' => 'accept' ); $fs->set_select_multiple(TRUE); #preview widget my $iprev = Gtk3::Image->new; $fs->set_preview_widget($iprev); $fs->signal_connect( 'selection-changed' => sub { if (my $pfilename = $fs->get_preview_filename) { #without error dialog my $pixbuf = $lp_ne->load($pfilename, 200, 200, TRUE, TRUE); unless (defined $pixbuf) { $fs->set_preview_widget_active(FALSE); } else { $fs->get_preview_widget->set_from_pixbuf($pixbuf); $fs->set_preview_widget_active(TRUE); } } else { $fs->set_preview_widget_active(FALSE); } }); my $filter_all = Gtk3::FileFilter->new; $filter_all->set_name($d->get("All compatible image formats")); $fs->add_filter($filter_all); foreach my $format (Gtk3::Gdk::Pixbuf::get_formats()) { my $filter = Gtk3::FileFilter->new; #add all known formats to the dialog $filter->set_name($format->get_name . " - " . $format->get_description); foreach my $ext (@{$format->get_extensions}) { $filter->add_pattern("*." . uc $ext); $filter_all->add_pattern("*." . uc $ext); $filter->add_pattern("*." . $ext); $filter_all->add_pattern("*." . $ext); } $fs->add_filter($filter); } #set default filter $fs->set_filter($filter_all); #get current file my $key = fct_get_current_file(); #go to recently used folder if (defined $sc->get_ruof && $shf->folder_exists($sc->get_ruof)) { $fs->set_current_folder_uri($sc->get_ruof); } else { if ($key) { $fs->set_filename($session_screens{$key}->{'long'}); } elsif ($saveDir_button->get_filename) { $fs->set_current_folder($saveDir_button->get_filename); } else { $fs->set_current_folder($ENV{'HOME'}); } } my $fs_resp = $fs->run; if ($fs_resp eq "accept") { @new_files = @{$fs->get_uris}; #keep folder in mind if ($new_files[0]) { my ($oshort, $ofolder, $oext) = fileparse($new_files[0], qr/\.[^.]*/); $sc->set_ruof($ofolder) if defined $ofolder; } $fs->destroy(); } else { $fs->destroy(); } } else { print "Trying to open file via RecentChooserMenu ", $sm->{_menu_recent}->get_current_item->get_uri, "\n" if $sc->get_debug; push @new_files, $sm->{_menu_recent}->get_current_item->get_uri; } #call function to open files - with progress bar etc. fct_open_files(@new_files); return TRUE; } sub dlg_save_as { #mandatory my $key = shift; #optional my $rfiletype = shift; my $rfilename = shift; my $rpixbuf = shift; my $rquality = shift; $rfilename = $session_screens{$key}->{'long'} if $key; my $fs = Gtk3::FileChooserDialog->new( $d->get("Choose a location to save to"), $window, 'save', 'gtk-cancel' => 'reject', 'gtk-save' => 'accept' ); #parse filename my ($short, $folder, $ext) = fileparse($rfilename, qr/\.[^.]*/); #go to recently used folder if (defined $sc->get_rusf && $shf->folder_exists($sc->get_rusf)) { $fs->set_current_folder($sc->get_rusf); $fs->set_current_name($short . $ext); } elsif (defined $key && defined $session_screens{$key}->{'is_unsaved'} && $session_screens{$key}->{'is_unsaved'}) { $fs->set_current_folder($saveDir_button->get_current_folder); $fs->set_current_name($short . $ext); } else { $fs->set_current_folder($folder); $fs->set_current_name($short . $ext); } #preview widget my $iprev = Gtk3::Image->new; $fs->set_preview_widget($iprev); $fs->signal_connect( 'selection-changed' => sub { if (my $pfilename = $fs->get_preview_filename) { #without error dialog my $pixbuf = $lp_ne->load($pfilename, 200, 200, TRUE, TRUE); unless (defined $pixbuf) { $fs->set_preview_widget_active(FALSE); } else { $fs->get_preview_widget->set_from_pixbuf($pixbuf); $fs->set_preview_widget_active(TRUE); } } else { $fs->set_preview_widget_active(FALSE); } }); #change extension related to the requested filetype if (defined $rfiletype && defined $rfilename) { my ($short, $folder, $ext) = fileparse($rfilename, qr/\.[^.]*/); $fs->set_current_name($short . "." . $rfiletype); } my $extra_hbox = Gtk3::HBox->new; my $label_save_as_type = Gtk3::Label->new($d->get("Image format") . ":"); my $combobox_save_as_type = Gtk3::ComboBoxText->new; #add supported formats to combobox my $counter = 0; my $png_counter = undef; #add pdf support if (defined $rfiletype && $rfiletype eq 'pdf') { $combobox_save_as_type->insert_text($counter, "pdf - Portable Document Format"); $combobox_save_as_type->set_active(0); } elsif (defined $rfiletype && $rfiletype eq 'ps') { $combobox_save_as_type->insert_text($counter, "ps - PostScript"); $combobox_save_as_type->set_active(0); #images } else { foreach my $format (Gtk3::Gdk::Pixbuf::get_formats()) { #we don't want svg here - this is a dedicated action in the DrawingTool next if !defined $rfiletype && $format->get_name =~ /svg/; #we have a requested filetype - nothing else will be offered next if defined $rfiletype && $format->get_name ne $rfiletype; #we want jpg not jpeg if ($format->get_name eq "jpeg" || $format->get_name eq "jpg") { $combobox_save_as_type->insert_text($counter, "jpg" . " - " . $format->get_description); } else { $combobox_save_as_type->insert_text($counter, $format->get_name . " - " . $format->get_description); } #set active when mime_type is matching #loop because multiple mime types are registered for fome file formats foreach my $mime (@{$format->get_mime_types}) { if (defined $key) { if ($mime eq $session_screens{$key}->{'mime_type'} || defined $rfiletype) { $combobox_save_as_type->set_active($counter); } } else { #Fix Bug #966159 if (defined $rfilename) { my ($short, $folder, $ext) = fileparse($rfilename, qr/\.[^.]*/); if ($mime eq "image/jpeg" && $ext eq ".jpg" || $mime eq "image/png" && $ext eq ".png" || $mime eq "image/bmp" && $ext eq ".bmp" || $mime eq "image/webp" && $ext eq ".webp" || $mime eq "image/avif" && $ext eq ".avif") { $combobox_save_as_type->set_active($counter); } } } #save png_counter as well as fallback $png_counter = $counter if $mime eq 'image/png'; } $counter++; } } #something went wrong here #filetype was not detected automatically #set to png as default unless ($combobox_save_as_type->get_active_text) { if (defined $png_counter) { $combobox_save_as_type->set_active($png_counter); } } $combobox_save_as_type->signal_connect( 'changed' => sub { my $filename = $shf->utf8_decode($fs->get_filename); my $choosen_format = $combobox_save_as_type->get_active_text; $choosen_format =~ s/ \-.*//; #get png or jpeg (jpg) for example #~ print $choosen_format . "\n"; #parse filename my ($short, $folder, $ext) = fileparse($filename, qr/\.[^.]*/); $fs->set_current_name($short . "." . $choosen_format); }); #emit the signal once in order to invoke the sub above #~ $combobox_save_as_type->signal_emit('changed'); $extra_hbox->pack_start($label_save_as_type, FALSE, FALSE, 5); $extra_hbox->pack_start($combobox_save_as_type, FALSE, FALSE, 5); my $align_save_as_type = Gtk3::Alignment->new(1, 0, 0, 0); $align_save_as_type->add($extra_hbox); $align_save_as_type->show_all; $fs->set_extra_widget($align_save_as_type); my $fs_resp = $fs->run; if ($fs_resp eq "accept") { my $filename = $shf->utf8_decode($fs->get_filename); #parse filename my ($short, $folder, $ext) = fileparse($filename, qr/\.[^.]*/); #keep selected folder in mind $sc->set_rusf($folder); #handle file format my $choosen_format = $combobox_save_as_type->get_active_text; $choosen_format =~ s/ \-.*//; #get png or jpeg (jpg) for example $filename = $folder . $short . "." . $choosen_format; unless ($shf->file_exists($filename)) { #get pixbuf from param my $pixbuf = $rpixbuf; unless ($pixbuf) { #or load pixbuf from existing file $pixbuf = $lp_ne->load($rfilename); } #save as (pixbuf, new_filename, filetype, quality - auto here, old_filename) if ($sp->save_pixbuf_to_file($pixbuf, $filename, $choosen_format, $rquality)) { if ($key) { #do not try to update when exporting to pdf or ps unless (defined $rfiletype && ($rfiletype eq 'pdf' || $rfiletype eq 'ps')) { #cancel handle if (exists $session_screens{$key}->{'handle'}) { $session_screens{$key}->{'handle'}->cancel; } if (fct_update_tab($key, undef, Glib::IO::File::new_for_path($filename), FALSE, 'clear')) { #setup a new filemonitor, so we get noticed if the file changed fct_add_file_monitor($key); fct_show_status_message(1, "$session_screens{ $key }->{ 'long' } " . $d->get("saved")); } } else { if ($shf->file_exists($filename)) { fct_show_status_message(1, "$filename " . $d->get("saved")); } } } #successfully saved $fs->destroy(); return $filename; } else { #error while saving $fs->destroy(); return FALSE; } } else { #ask the user to replace the image #replace button my $replace_btn = Gtk3::Button->new_with_mnemonic($d->get("_Replace")); $replace_btn->set_image(Gtk3::Image->new_from_stock('gtk-save-as', 'button')); my $response = $sd->dlg_warning_message( sprintf($d->get("The image already exists in %s. Replacing it will overwrite its contents."), "'" . $folder . "'"), sprintf($d->get("An image named %s already exists. Do you want to replace it?"), "'" . $short . "." . $choosen_format . "'"), undef, undef, undef, $replace_btn, undef, undef ); if ($response == 40) { #get pixbuf from param my $pixbuf = $rpixbuf; unless ($pixbuf) { #or load pixbuf from existing file $pixbuf = $lp_ne->load($rfilename); } if ($sp->save_pixbuf_to_file($pixbuf, $filename, $choosen_format, $rquality)) { if ($key) { #do not try to update when exporting to pdf unless (defined $rfiletype && ($rfiletype eq 'pdf' || $rfiletype eq 'ps')) { #cancel handle if (exists $session_screens{$key}->{'handle'}) { $session_screens{$key}->{'handle'}->cancel; } if (fct_update_tab($key, undef, Glib::IO::File::new_for_path($filename), FALSE, 'clear')) { #setup a new filemonitor, so we get noticed if the file changed fct_add_file_monitor($key); #maybe file is in session as well, need to set the handler again ;-) foreach my $searchkey (keys %session_screens) { next if $key eq $searchkey; if ($session_screens{$searchkey}->{'long'} eq $filename) { $session_screens{$searchkey}->{'changed'} = TRUE; fct_update_tab($searchkey, undef, undef, FALSE, 'clear'); } } fct_show_status_message(1, "$session_screens{ $key }->{ 'long' } " . $d->get("saved")); } } else { if ($shf->file_exists($filename)) { fct_show_status_message(1, "$filename " . $d->get("saved")); } } } #end if $key #successfully saved $fs->destroy(); return $filename; } else { #error while saving $fs->destroy(); return FALSE; } } else { #user cancelled overwrite $fs->destroy(); return 'user_cancel'; } } } else { #user cancelled $fs->destroy(); return 'user_cancel'; } $fs->destroy(); } sub dlg_plugin { my (@file_to_plugin_keys) = @_; my $plugin_dialog = Gtk3::Dialog->new($d->get("Choose a plugin"), $window, [qw/modal destroy-with-parent/]); $plugin_dialog->set_size_request(350, -1); $plugin_dialog->set_resizable(FALSE); #rename button my $run_btn = Gtk3::Button->new_with_mnemonic($d->get("_Run")); $run_btn->set_image(Gtk3::Image->new_from_stock('gtk-execute', 'button')); $run_btn->set_can_default(TRUE); $plugin_dialog->add_button('gtk-cancel', 'reject'); $plugin_dialog->add_action_widget($run_btn, 'accept'); $plugin_dialog->set_default_response('accept'); my $model = Gtk3::ListStore->new('Gtk3::Gdk::Pixbuf', 'Glib::String', 'Glib::String', 'Glib::String', 'Glib::String', 'Glib::String'); #temp variables to restore the #recent plugin my $recent_time = 0; my $iter_lastex_plugin = undef; foreach my $pkey (sort keys %plugins) { #check if plugin allows current filetype #~ my $nfiles_ok += scalar grep($plugins{$pkey}->{'ext'} =~ /$session_screens{$_}->{'mime_type'}/, @file_to_plugin_keys); #~ next if scalar @file_to_plugin_keys > $nfiles_ok; if ($plugins{$pkey}->{'binary'} ne "") { my $new_iter = $model->append; $model->set( $new_iter, 0, $plugins{$pkey}->{'pixbuf_object'}, 1, $plugins{$pkey}->{'name'}, 2, $plugins{$pkey}->{'binary'}, 3, $plugins{$pkey}->{'lang'}, 4, $plugins{$pkey}->{'tooltip'}, 5, $pkey ); #initialize $iter_lastex_plugin #with first new iter $iter_lastex_plugin = $new_iter unless defined $iter_lastex_plugin; #restore the recent plugin #($plugins{$plugin_key}->{'recent'} is a timestamp) # #we keep the new_iter in mind if (defined $plugins{$pkey}->{'recent'} && $plugins{$pkey}->{'recent'} > $recent_time) { $iter_lastex_plugin = $new_iter; $recent_time = $plugins{$pkey}->{'recent'}; } } else { print "WARNING: Program $pkey is not configured properly, ignoring\n"; } } my $plugin_label = Gtk3::Label->new($d->get("Plugin") . ":"); my $plugin = Gtk3::ComboBox->new_with_model($model); #plugin description my $plugin_descr = Gtk3::TextBuffer->new; my $plugin_descr_view = Gtk3::TextView->new_with_buffer($plugin_descr); $plugin_descr_view->set_sensitive(FALSE); $plugin_descr_view->set_wrap_mode('word'); my $textview_hbox = Gtk3::HBox->new(FALSE, 5); $textview_hbox->set_border_width(8); $textview_hbox->pack_start($plugin_descr_view, TRUE, TRUE, 0); my $plugin_descr_label = Gtk3::Label->new(); $plugin_descr_label->set_markup("" . $d->get("Description") . ""); my $plugin_descr_frame = Gtk3::Frame->new(); $plugin_descr_frame->set_label_widget($plugin_descr_label); $plugin_descr_frame->set_shadow_type('none'); $plugin_descr_frame->add($textview_hbox); #plugin image my $plugin_image = Gtk3::Image->new; #packing my $plugin_vbox1 = Gtk3::VBox->new(FALSE, 5); my $plugin_hbox1 = Gtk3::HBox->new(FALSE, 5); my $plugin_hbox2 = Gtk3::HBox->new(FALSE, 5); $plugin_hbox2->set_border_width(10); #what plugin is selected? my $plugin_pixbuf = undef; my $plugin_name = undef; my $plugin_value = undef; my $plugin_lang = undef; my $plugin_tip = undef; my $plugin_key = undef; $plugin->signal_connect( 'changed' => sub { my $model = $plugin->get_model(); my $plugin_iter = $plugin->get_active_iter(); if ($plugin_iter) { $plugin_pixbuf = $model->get_value($plugin_iter, 0); $plugin_name = $model->get_value($plugin_iter, 1); $plugin_value = $model->get_value($plugin_iter, 2); $plugin_lang = $model->get_value($plugin_iter, 3); $plugin_tip = $model->get_value($plugin_iter, 4); $plugin_key = $model->get_value($plugin_iter, 5); $plugin_descr->set_text($plugin_tip); if ($shf->file_exists($plugins{$plugin_key}->{'pixbuf'})) { $plugin_image->set_from_pixbuf($lp->load($plugins{$plugin_key}->{'pixbuf'}, 100, 100)); } } }); my $renderer_pix = Gtk3::CellRendererPixbuf->new; $plugin->pack_start($renderer_pix, FALSE); $plugin->add_attribute($renderer_pix, pixbuf => 0); my $renderer_text = Gtk3::CellRendererText->new; $plugin->pack_start($renderer_text, FALSE); $plugin->add_attribute($renderer_text, text => 1); #we try to activate the last executed plugin if that's possible $plugin->set_active_iter($iter_lastex_plugin); $plugin_hbox1->pack_start($plugin, TRUE, TRUE, 0); $plugin_hbox2->pack_start($plugin_image, TRUE, TRUE, 0); $plugin_hbox2->pack_start($plugin_descr_frame, TRUE, TRUE, 0); $plugin_vbox1->pack_start($plugin_hbox1, FALSE, TRUE, 1); $plugin_vbox1->pack_start($plugin_hbox2, TRUE, TRUE, 1); $plugin_dialog->get_child->add($plugin_vbox1); my $plugin_progress = Gtk3::ProgressBar->new; $plugin_progress->set_no_show_all(TRUE); $plugin_progress->set_ellipsize('middle'); $plugin_progress->set_orientation('horizontal'); $plugin_dialog->get_child->add($plugin_progress); $plugin_dialog->show_all; my $plugin_response = $plugin_dialog->run; if ($plugin_response eq 'accept') { #anything wrong with the selected plugin? unless ($plugin_value =~ /[a-zA-Z0-9]+/) { $sd->dlg_error_message($d->get("No plugin specified"), $d->get("Failed")); return FALSE; } #we save the last execution time #and try to preselect it when the plugin dialog is executed again $plugins{$plugin_key}->{'recent'} = time; #disable buttons and combobox $plugin->set_sensitive(FALSE); foreach my $dialog_child ($plugin_dialog->get_child->get_children) { $dialog_child->set_sensitive(FALSE) if $dialog_child =~ /Button/; } #show the progress bar $plugin_progress->show; $plugin_progress->set_fraction(0); fct_update_gui(); my $counter = 1; #call execute_plugin for each file to be processed foreach my $key (@file_to_plugin_keys) { #update the progress bar and update gui to show changes #~ $plugin_progress->set_text($session_screens{$key}->{'long'}); #~ $plugin_progress->set_fraction($counter / scalar @file_to_plugin_keys); #~ fct_update_gui(); #store data my $data = [$plugin_value, $plugin_name, $plugin_lang, $key, $plugin_dialog, $plugin_progress]; fct_execute_plugin(undef, $data); #increase counter and update gui to show updated progress bar $counter++; } $plugin_dialog->destroy(); return TRUE; } else { $plugin_dialog->destroy(); return FALSE; } } sub dlg_upload { my (@files_to_upload) = @_; return FALSE if @files_to_upload < 1; my $dlg_header = $d->get("Upload / Export"); my $hosting_dialog = Gtk3::Dialog->new($dlg_header, $window, [qw/modal destroy-with-parent/]); $hosting_dialog->set_default_size(400, 300); my $close_button = $hosting_dialog->add_button('gtk-close', 'close'); my $upload_button = $hosting_dialog->add_button($d->get("_Upload"), 'accept'); $upload_button->set_image(Gtk3::Image->new_from_stock('gtk-go-up', 'button')); $hosting_dialog->set_default_response('accept'); my $model = Gtk3::ListStore->new('Glib::String', 'Glib::String', 'Glib::String', 'Glib::String', 'Glib::String', 'Glib::String'); foreach (keys %accounts) { #cut username so the dialog will not explode ;-) my $short_username = $accounts{$_}->{'username'}; if (defined $accounts{$_}->{'username'} && length $accounts{$_}->{'username'} > 10) { $short_username = substr($accounts{$_}->{'username'}, 0, 10) . "..."; } #Create Username/Password entry (if supported and supplied) if ($accounts{$_}->{'supports_authorized_upload'}) { if ( $accounts{$_}->{'username'} ne "" && $accounts{$_}->{'password'} ne "") { $model->set( $model->append, 0, $accounts{$_}->{'module'}, 1, $accounts{$_}->{'username'}, 2, $accounts{$_}->{'password'}, 3, $short_username, 4, $accounts{$_}->{'module'}, 5, $accounts{$_}->{'folder'}); } } #Create Anonymous entry (if supported) if ($accounts{$_}->{'supports_anonymous_upload'}) { $model->set($model->append, 0, $accounts{$_}->{'module'}, 1, $d->get("Guest"), 2, "", 3, $d->get("Guest"), 4, $accounts{$_}->{'module'}, 5, $accounts{$_}->{'folder'}); } #Create OAuth entry (if supported) if ($accounts{$_}->{'supports_oauth_upload'}) { $model->set($model->append, 0, $accounts{$_}->{'module'}, 1, $d->get("OAuth"), 2, "", 3, $d->get("OAuth"), 4, $accounts{$_}->{'module'}, 5, $accounts{$_}->{'folder'}); } } #set up account combobox my $hosting = Gtk3::ComboBox->new_with_model($model); my $renderer_host = Gtk3::CellRendererText->new; $hosting->pack_start($renderer_host, FALSE); $hosting->add_attribute($renderer_host, text => 0); my $renderer_username = Gtk3::CellRendererText->new; $hosting->pack_start($renderer_username, FALSE); $hosting->add_attribute($renderer_username, text => 3); $hosting->set_active(0); #public hosting settings my $pub_hbox1 = Gtk3::HBox->new(FALSE, 0); my $pub_hbox2 = Gtk3::HBox->new(FALSE, 0); my $pub_hbox_hint = Gtk3::HBox->new(FALSE, 0); my $pub_hbox_hint2 = Gtk3::HBox->new(FALSE, 0); my $pub_vbox1 = Gtk3::VBox->new(FALSE, 0); my $pub_hint = Gtk3::Label->new(); my $pub_hint2 = Gtk3::Label->new(); $pub_hint->set_line_wrap(TRUE); $pub_hint2->set_line_wrap(TRUE); $pub_hint->set_line_wrap_mode('word-char'); $pub_hint2->set_line_wrap_mode('word-char'); $pub_hint->set_markup( "" . $d->get( "Please choose one of the accounts above and click Upload. The upload links will still be available in the screenshot's right-click menu after closing this dialog.") . "" ); $pub_hint2->set_markup("" . $d->get("Please note: If a plugin allows only authorized uploading you need to enter your credentials in preferences first to make it appear in the list above.") . ""); $pub_hbox1->pack_start(Gtk3::Label->new($d->get("Choose account") . ":"), FALSE, FALSE, 6); $pub_hbox1->pack_start($hosting, TRUE, TRUE, 0); $pub_hbox_hint->pack_start($pub_hint, TRUE, TRUE, 6); $pub_hbox_hint2->pack_start($pub_hint2, TRUE, TRUE, 6); $pub_hint->set_alignment(0, 0.5); $pub_hint2->set_alignment(0, 0.5); $pub_vbox1->pack_start($pub_hbox1, FALSE, FALSE, 3); $pub_vbox1->pack_start($pub_hbox_hint, FALSE, FALSE, 3); $pub_vbox1->pack_start($pub_hbox_hint2, FALSE, FALSE, 3); #places settings my $pl_hbox1 = Gtk3::HBox->new(FALSE, 0); my $pl_vbox1 = Gtk3::VBox->new(FALSE, 0); my $places_fc = Gtk3::FileChooserButton->new("Shutter - " . $d->get("Choose folder"), 'select-folder'); $places_fc->set('local-only' => FALSE); $pl_hbox1->pack_start(Gtk3::Label->new($d->get("Choose folder") . ":"), FALSE, FALSE, 6); $pl_hbox1->pack_start($places_fc, TRUE, TRUE, 0); $pl_vbox1->pack_start($pl_hbox1, FALSE, FALSE, 3); #ftp settings #we are using the same widgets as in the settings and populate #them with saved values when possible my $ftp_hbox1_dlg = Gtk3::HBox->new(FALSE, 0); my $ftp_hbox2_dlg = Gtk3::HBox->new(FALSE, 0); my $ftp_hbox3_dlg = Gtk3::HBox->new(FALSE, 0); my $ftp_hbox4_dlg = Gtk3::HBox->new(FALSE, 0); my $ftp_hbox5_dlg = Gtk3::HBox->new(FALSE, 0); #uri my $ftp_entry_label_dlg = Gtk3::Label->new($d->get("URI") . ":"); $ftp_hbox1_dlg->pack_start($ftp_entry_label_dlg, FALSE, TRUE, 10); my $ftp_remote_entry_dlg = Gtk3::Entry->new; $ftp_remote_entry_dlg->set_text($ftp_remote_entry->get_text); $ftp_entry_label_dlg->set_tooltip_text($d->get("URI\nExample: ftp://host:port/path")); $ftp_remote_entry_dlg->set_tooltip_text($d->get("URI\nExample: ftp://host:port/path")); $ftp_hbox1_dlg->pack_start($ftp_remote_entry_dlg, TRUE, TRUE, 10); #connection mode my $ftp_mode_label_dlg = Gtk3::Label->new($d->get("Connection mode") . ":"); $ftp_hbox2_dlg->pack_start($ftp_mode_label_dlg, FALSE, TRUE, 10); my $ftp_mode_combo_dlg = Gtk3::ComboBoxText->new; $ftp_mode_combo_dlg->insert_text(0, $d->get("Active mode")); $ftp_mode_combo_dlg->insert_text(1, $d->get("Passive mode")); $ftp_mode_combo_dlg->set_active($ftp_mode_combo->get_active); $ftp_mode_label_dlg->set_tooltip_text($d->get("Connection mode")); $ftp_mode_combo_dlg->set_tooltip_text($d->get("Connection mode")); $ftp_hbox2_dlg->pack_start($ftp_mode_combo_dlg, TRUE, TRUE, 10); #username my $ftp_username_label_dlg = Gtk3::Label->new($d->get("Username") . ":"); $ftp_hbox3_dlg->pack_start($ftp_username_label_dlg, FALSE, TRUE, 10); my $ftp_username_entry_dlg = Gtk3::Entry->new; $ftp_username_entry_dlg->set_text($ftp_username_entry->get_text); $ftp_username_label_dlg->set_tooltip_text($d->get("Username")); $ftp_username_entry_dlg->set_tooltip_text($d->get("Username")); $ftp_hbox3_dlg->pack_start($ftp_username_entry_dlg, TRUE, TRUE, 10); #password my $ftp_password_label_dlg = Gtk3::Label->new($d->get("Password") . ":"); $ftp_hbox4_dlg->pack_start($ftp_password_label_dlg, FALSE, TRUE, 10); my $ftp_password_entry_dlg = Gtk3::Entry->new; $ftp_password_entry_dlg->set_invisible_char("*"); $ftp_password_entry_dlg->set_visibility(FALSE); $ftp_password_entry_dlg->set_text($ftp_password_entry->get_text); $ftp_password_label_dlg->set_tooltip_text($d->get("Password")); $ftp_password_entry_dlg->set_tooltip_text($d->get("Password")); $ftp_hbox4_dlg->pack_start($ftp_password_entry_dlg, TRUE, TRUE, 10); #website url my $ftp_wurl_label_dlg = Gtk3::Label->new($d->get("Website URL") . ":"); $ftp_hbox5_dlg->pack_start($ftp_wurl_label_dlg, FALSE, TRUE, 10); my $ftp_wurl_entry_dlg = Gtk3::Entry->new; $ftp_wurl_entry_dlg->set_text($ftp_wurl_entry->get_text); $ftp_wurl_label_dlg->set_tooltip_text($d->get("Website URL")); $ftp_wurl_entry_dlg->set_tooltip_text($d->get("Website URL")); $ftp_hbox5_dlg->pack_start($ftp_wurl_entry_dlg, TRUE, TRUE, 10); my $ftp_vbox_dlg = Gtk3::VBox->new(FALSE, 0); $ftp_vbox_dlg->pack_start($ftp_hbox1_dlg, FALSE, TRUE, 3); $ftp_vbox_dlg->pack_start($ftp_hbox2_dlg, FALSE, TRUE, 3); $ftp_vbox_dlg->pack_start($ftp_hbox3_dlg, FALSE, TRUE, 3); $ftp_vbox_dlg->pack_start($ftp_hbox4_dlg, FALSE, TRUE, 3); $ftp_vbox_dlg->pack_start($ftp_hbox5_dlg, FALSE, TRUE, 3); #all labels = one size $ftp_entry_label_dlg->set_alignment(0, 0.5); $ftp_mode_label_dlg->set_alignment(0, 0.5); $ftp_username_label_dlg->set_alignment(0, 0.5); $ftp_password_label_dlg->set_alignment(0, 0.5); $ftp_wurl_label_dlg->set_alignment(0, 0.5); my $sg_ftp_dlg = Gtk3::SizeGroup->new('horizontal'); $sg_ftp_dlg->add_widget($ftp_entry_label_dlg); $sg_ftp_dlg->add_widget($ftp_mode_label_dlg); $sg_ftp_dlg->add_widget($ftp_username_label_dlg); $sg_ftp_dlg->add_widget($ftp_password_label_dlg); $sg_ftp_dlg->add_widget($ftp_wurl_label_dlg); #setup notebook my $unotebook = Gtk3::Notebook->new; my $hosting_label = Gtk3::Label->new; $hosting_label->set_text($d->get("Public hosting")); $unotebook->append_page($pub_vbox1, $hosting_label); my $ftp_label = Gtk3::Label->new; $ftp_label->set_text("FTP"); $unotebook->append_page($ftp_vbox_dlg, $ftp_label); my $places_label = Gtk3::Label->new; $places_label->set_text($d->get("Places")); $unotebook->append_page($pl_vbox1, $places_label); $hosting_dialog->get_child->add($unotebook); my $hosting_progress = Gtk3::ProgressBar->new; $hosting_progress->set_no_show_all(TRUE); $hosting_progress->set_ellipsize('middle'); $hosting_progress->set_orientation('horizontal'); $hosting_dialog->get_child->add($hosting_progress); $hosting_dialog->show_all; #restore recently used upload tab if (defined $sc->get_ruu_tab && $sc->get_ruu_tab) { $unotebook->set_current_page($sc->get_ruu_tab); } #and the relevant detail (folder, uploader etc.) if (defined $sc->get_ruu_hosting && $sc->get_ruu_hosting) { $hosting->set_active($sc->get_ruu_hosting); } else { $hosting->set_active(0); } if (defined $sc->get_ruu_places && $shf->folder_exists($sc->get_ruu_places)) { $places_fc->set_current_folder($sc->get_ruu_places); } #DIALOG RUN while (my $hosting_response = $hosting_dialog->run) { #start upload if ($hosting_response eq "accept") { #running state of dialog $upload_button->set_sensitive(FALSE); $close_button->set_sensitive(FALSE); $hosting_progress->show; #public hosting #All modules must provide the following methods: # 1: init # 2: upload # 3: show # 4: show_all if ($unotebook->get_current_page == 0) { my $model = $hosting->get_model(); my $hosting_iter = $hosting->get_active_iter(); my $hosting_host = $model->get_value($hosting_iter, 0); my $hosting_username = $model->get_value($hosting_iter, 1); my $hosting_password = $model->get_value($hosting_iter, 2); my $hosting_module = $model->get_value($hosting_iter, 4); my $hosting_folder = $model->get_value($hosting_iter, 5); $hosting_progress->set_text(sprintf($d->get("Loading module %s"), $hosting_module)); fct_update_gui(); #import module eval { import lib $hosting_folder; require "$hosting_module.pm"; }; if ($@) { #dialogs (main window != parent window) my $sd = Shutter::App::SimpleDialogs->new; $sd->dlg_error_message( sprintf($d->get("Error while executing upload plugin %s."), "'" . $hosting_module . "'"), $d->get("There was an error executing the upload plugin."), undef, undef, undef, undef, undef, undef, $@ ); $hosting_dialog->destroy(); return FALSE; } my $uploader = $hosting_module->new($hosting_host, $sc->get_debug, $shutter_root, $d, $window, SHUTTER_VERSION); #init module if ($uploader->init($hosting_username)) { my $counter = 1; $hosting_progress->set_fraction(0); foreach my $key (sort @files_to_upload) { my $file = $session_screens{$key}->{'long'}; #set text for progressbar $hosting_progress->set_text("Uploading $file"); fct_update_gui(); #upload file my %upload_response = $uploader->upload($shf->switch_home_in_file($file), $hosting_username, $hosting_password); if (is_success($upload_response{'status'})) { #add to public-links menu foreach (keys %upload_response) { next if $_ eq 'status'; $session_screens{$key}->{'links'}->{$hosting_module}->{$_} = $upload_response{$_}; $session_screens{$key}->{'links'}->{$hosting_module}->{'menuentry'} = $hosting_module; } $uploader->show; fct_show_status_message(1, $file . " " . $d->get("uploaded")); } else { my $response = dlg_upload_error_message($upload_response{'status'}, $upload_response{'max_filesize'}); #10 == skip all, 20 == skip, else == cancel last if $response == 10; next if $response == 20; redo if $response == 30; next; } $hosting_progress->set_fraction($counter / @files_to_upload); #update gui fct_update_gui(); $counter++; } $uploader->show_all; } #ftp } elsif ($unotebook->get_current_page == 1) { #create upload object my $uploader = Shutter::Upload::FTP->new($sc->get_debug, $shutter_root, $d, $window, $ftp_mode_combo_dlg->get_active); my $counter = 1; my $login = FALSE; $hosting_progress->set_fraction(0); #start upload foreach my $key (sort @files_to_upload) { my $file = $session_screens{$key}->{'long'}; #need to login? my @upload_response; unless ($login) { eval { $uploader->quit; }; @upload_response = $uploader->login($ftp_remote_entry_dlg->get_text, $ftp_username_entry_dlg->get_text, $ftp_password_entry_dlg->get_text); if ($upload_response[0]) { #dialogs (main window != parent window) my $sd = Shutter::App::SimpleDialogs->new; #we already get translated error messaged back my $response = $sd->dlg_error_message($upload_response[1], $upload_response[0], undef, undef, undef, undef, undef, undef, $upload_response[2]); next; } else { $login = TRUE; } } $hosting_progress->set_text($file); #update gui fct_update_gui(); @upload_response = $uploader->upload($shf->switch_home_in_file($file)); #upload returns FALSE if there is no error unless ($upload_response[0]) { #everything is fine here fct_show_status_message(1, $file . " " . $d->get("uploaded")); #show as notification my $notify = $sc->get_notification_object; $notify->show($d->get("Successfully uploaded"), sprintf($d->get("The file %s was successfully uploaded."), $file)); #copy website url to clipboard my $uri = $ftp_wurl_entry_dlg->get_text; if ($uri) { my ($short, $folder, $ext) = fileparse($file, qr/\.[^.]*/); if ($uri !~ m|/$|) { $uri .= '/'; } $uri .= $short . $ext; $clipboard->set_text($uri); print "copied URI ", $uri, " to clipboard\n" if $sc->get_debug; } } else { #dialogs (main window != parent window) my $sd = Shutter::App::SimpleDialogs->new; #we already get translated error messaged back my $response = $sd->dlg_error_message($upload_response[1], $upload_response[0], $d->get("Skip all"), $d->get("Skip"), $d->get("Retry"), undef, undef, undef, $upload_response[2]); #10 == skip all, 20 == skip, 30 == redo, else == cancel if ($response == 10) { last; } elsif ($response == 20) { $login = FALSE; next; } elsif ($response == 30) { $login = FALSE; redo; } else { next; } } $hosting_progress->set_fraction($counter / @files_to_upload); #update gui fct_update_gui(); $counter++; } #end foreach eval { $uploader->quit; }; #xfer using Gnome-VFS } elsif ($unotebook->get_current_page == 2) { my $counter = 1; $hosting_progress->set_fraction(0); #start upload foreach my $key (sort @files_to_upload) { my $file = $session_screens{$key}->{'long'}; $hosting_progress->set_text($file); #update gui fct_update_gui(); my $source_giofile = Glib::IO::File::new_for_path($file); my $target_giofile = Glib::IO::File::new_for_uri($places_fc->get_uri); $target_giofile = $target_giofile->get_child($source_giofile->get_basename); #~ print sprintf("%s und %s \n", $target_giofile->to_string, $source_giofile->to_string); my $result; unless (unescape_string($target_giofile->get_path) eq unescape_string($source_giofile->get_path)) { unless ($target_giofile->query_exists) { eval { $source_giofile->copy($target_giofile, []); $result = 'ok'; }; if ($@) { $result = $@; } } else { $result = 'error-file-exists'; } } else { $result = 'ok'; } #everything is fine here if ($result eq 'ok') { fct_show_status_message(1, $file . " " . $d->get("exported")); #show as notification my $notify = $sc->get_notification_object; } elsif ($result eq 'error-file-exists') { #ask the user to replace the image #replace button my $replace_btn = Gtk3::Button->new_with_mnemonic($d->get("_Replace")); $replace_btn->set_image(Gtk3::Image->new_from_stock('gtk-save-as', 'button')); my $target_path = $shf->utf8_decode(unescape_string($target_giofile->get_path // $target_giofile->get_uri)); #dialogs (main window != parent window) my $sd = Shutter::App::SimpleDialogs->new; my $response = $sd->dlg_warning_message( sprintf($d->get("The image already exists in %s. Replacing it will overwrite its contents."), "'" . $target_path . "'"), sprintf($d->get("An image named %s already exists. Do you want to replace it?"), "'" . $shf->utf8_decode($target_giofile->get_basename) . "'"), $d->get("Skip all"), $d->get("Skip"), undef, $replace_btn, undef, undef ); #10 == skip all, 20 == skip, 40 == replace, else == cancel if ($response == 10) { last; } elsif ($response == 20) { next; } elsif ($response == 40) { eval { $source_giofile->copy($target_giofile, ['overwrite']); $result = 'ok'; }; if ($@) { $result = $@; } #check result again if ($result eq 'ok') { fct_show_status_message(1, $file . " " . $d->get("exported")); #show as notification my $notify = $sc->get_notification_object; $notify->show($d->get("Successfully exported"), sprintf($d->get("The file %s was successfully exported."), $file)); } else { my $response = dlg_upload_error_message_gnome_vfs($target_giofile, $result); #10 == skip all, 20 == skip, 40 == retry, else == cancel if ($response == 10) { last; } elsif ($response == 20) { next; } elsif ($response == 40) { redo; } else { next; } } } } else { my $response = dlg_upload_error_message_gnome_vfs($target_giofile, $result); #10 == skip all, 20 == skip, 40 == retry, else == cancel if ($response == 10) { last; } elsif ($response == 20) { next; } elsif ($response == 40) { redo; } else { next; } } $hosting_progress->set_fraction($counter / @files_to_upload); #update gui fct_update_gui(); $counter++; } } #save recently used upload tab $sc->set_ruu_tab($unotebook->get_current_page); #and the relevant detail (folder, uploader etc.) #hosting service $sc->set_ruu_hosting($hosting->get_active); $sc->set_ruu_places($places_fc->get_filename); #set initial state of dialog $upload_button->set_sensitive(TRUE); $close_button->set_sensitive(TRUE); $hosting_progress->hide; #response != accept } else { $hosting_dialog->destroy(); return FALSE; } } #dialog loop } sub dlg_upload_error_message_gnome_vfs { my $target_giofile = shift; my $result = shift; #dialogs (main window != parent window) my $sd = Shutter::App::SimpleDialogs->new; my $target_path = $shf->utf8_decode(unescape_string($target_giofile->get_path // $target_giofile->get_uri)); #retry button my $retry_btn = Gtk3::Button->new_with_mnemonic($d->get("_Retry")); $retry_btn->set_image(Gtk3::Image->new_from_stock('gtk-redo', 'button')); my $response = $sd->dlg_error_message( sprintf($d->get("Error while copying the image %s."), "'" . $target_giofile->get_basename . "'"), sprintf($d->get("There was an error copying the image into %s."), "'" . $target_path . "'"), $d->get("Skip all"), $d->get("Skip"), undef, $retry_btn, undef, undef, $result ); return $response; } sub dlg_upload_error_message { my ($status, $max_filesize) = @_; #dialogs (main window != parent window) my $sd = Shutter::App::SimpleDialogs->new; my $response; if ($status == 999) { $response = $sd->dlg_error_message($d->get("Please check your credentials and try again."), $d->get("Error while login")); } elsif ($status == 998) { $response = $sd->dlg_error_message( $d->get("Maximum filesize reached"), $d->get("Error while uploading"), $d->get("Skip all"), $d->get("Skip"), undef, undef, undef, undef, sprintf($d->get("Maximum filesize: %s"), $max_filesize)); } else { $response = $sd->dlg_error_message($status, $d->get("Error while connecting"), $d->get("Skip all"), $d->get("Skip"), $d->get("Retry"),); } return $response; } sub dlg_profile_name { my ($curr_profile_name, $combobox_settings_profiles) = @_; my $profile_dialog = Gtk3::MessageDialog->new($window, [qw/modal destroy-with-parent/], 'other', 'none', undef); $profile_dialog->set_title("Shutter"); $profile_dialog->set('image' => Gtk3::Image->new_from_stock('gtk-dialog-question', 'dialog')); $profile_dialog->set('text' => $d->get("Save current preferences as new profile")); $profile_dialog->set('secondary-text' => $d->get("New profile name") . ": "); $profile_dialog->add_button('gtk-cancel', 'reject'); $profile_dialog->add_button('gtk-save', 'accept'); $profile_dialog->set_default_response('accept'); my $new_profile_name_vbox = Gtk3::VBox->new(); my $new_profile_name_hint = Gtk3::Label->new(); my $new_profile_name = Gtk3::Entry->new(); $new_profile_name->set_activates_default(TRUE); fct_validate_filename($new_profile_name, $new_profile_name_hint); #show name of current profile $new_profile_name->set_text($curr_profile_name) if defined $curr_profile_name; $new_profile_name_vbox->pack_start($new_profile_name, TRUE, TRUE, 0); $new_profile_name_vbox->pack_start($new_profile_name_hint, TRUE, TRUE, 0); $profile_dialog->get_child->add($new_profile_name_vbox); $profile_dialog->show_all; #run dialog my $profile_response = $profile_dialog->run; #handle user responses here if ($profile_response eq 'accept') { my $entered_name = $new_profile_name->get_text; if ($shf->file_exists("$ENV{'HOME'}/.shutter/profiles/$entered_name.xml")) { #ask the user to replace the profile #replace button my $replace_btn = Gtk3::Button->new_with_mnemonic($d->get("_Replace")); $replace_btn->set_image(Gtk3::Image->new_from_stock('gtk-save-as', 'button')); my $response = $sd->dlg_warning_message( $d->get("Replacing it will overwrite its contents."), sprintf($d->get("A profile named %s already exists. Do you want to replace it?"), "'" . $entered_name . "'"), undef, undef, undef, $replace_btn, undef, undef ); #40 == replace_btn was hit if ($response != 40) { $profile_dialog->destroy(); return FALSE; } } $profile_dialog->destroy(); return $entered_name; } else { $profile_dialog->destroy(); return FALSE; } } sub fct_zoom_in { my $key = fct_get_current_file(); if ($key) { $session_screens{$key}->{'image'}->zoom_in; } } sub fct_zoom_out { my $key = fct_get_current_file(); if ($key) { $session_screens{$key}->{'image'}->zoom_out; } } sub fct_zoom_100 { my $key = fct_get_current_file(); if ($key) { $session_screens{$key}->{'image'}->set_zoom(1); } } sub fct_zoom_best { my $key = fct_get_current_file(); if ($key) { $session_screens{$key}->{'image'}->set_fitting(TRUE); } } sub fct_fullscreen { my ($widget) = @_; if ($widget->get_active) { $window->fullscreen; } else { $window->unfullscreen; } } sub fct_navigation_toolbar { my ($widget) = @_; if ($widget->get_active) { $nav_toolbar->show; foreach my $child ($nav_toolbar->get_children) { $child->show_all; } } else { $nav_toolbar->hide; foreach my $child ($nav_toolbar->get_children) { $child->hide_all; } } } #-------------------------------------- package main; $app = Shutter::App->new( application_id=>'org.shutter-project.Shutter', flags=>['flags-none']); $app->signal_connect('notify::is-registered'=>sub { if (!$app->get_is_registered) { return; } if (!$app->get_is_remote) { return; } #The application is already running, send it a message my ($cmdname, $extra) = $sc->get_start_with; my $profile = $sc->get_profile_to_start_with; my $exitac = $sc->get_exit_after_capture; my $exfilename = $sc->get_export_filename; my $delay = $sc->get_delay; my $include_cursor = $sc->get_include_cursor; my $remove_cursor = $sc->get_remove_cursor; my $nosession = $sc->get_no_session; #change profile in running application if (defined $profile && $profile) { $app->activate_action('profile', Glib::Variant->new_string($profile)); } #set exit flag in running application if (defined $exitac && $exitac) { $app->activate_action('exitac', Glib::Variant->new('')); } #set export_filename (parameter -o) in running application if (defined $exfilename && $exfilename) { $app->activate_action('exfilename', Glib::Variant->new_string($shf->utf8_decode($exfilename))); } #change delay in running application if (defined $delay && $delay) { $app->activate_action('delay', Glib::Variant->new_string($delay)); } #change include_cursor in running application if (defined $include_cursor && $include_cursor) { $app->activate_action('include_cursor', Glib::Variant->new('')); } #change remove_cursor in running application if (defined $remove_cursor && $remove_cursor) { $app->activate_action('remove_cursor', Glib::Variant->new('')); } #set nosession flag in running application if (defined $nosession && $nosession) { $app->activate_action('nosession', Glib::Variant->new('')); } my %screenshot_cmds = ( select => 1, full => 1, window => 1, awindow => 1, # No sections for now: https://github.com/shutter-project/shutter/issues/25 #section => 1, menu => 1, tooltip => 1, web => 1, redoshot => 1, ); if (defined $cmdname && $screenshot_cmds{$cmdname} && defined $extra) { $app->activate_action($cmdname, Glib::Variant->new_string($extra)); } elsif (defined $cmdname && $screenshot_cmds{$cmdname}) { $app->activate_action($cmdname, Glib::Variant->new('')); } elsif (@init_files) { my @variants; foreach my $uri (@init_files) { push @variants, Glib::Variant->new_string($uri); } $app->activate_action('fopen', Glib::Variant->new_array(undef, \@variants)); } else { $app->activate_action('showmainwindow', Glib::Variant->new('')); } print "\nINFO: There is already another instance of Shutter running!\n"; }); $app->run; __END__ =head1 NAME Shutter - Feature-rich Screenshot Tool =head1 SYNOPSIS shutter [options] =head1 COPYRIGHT Shutter is Copyright (C) by Mario Kemper and Shutter Team =head1 DESCRIPTION B is a feature-rich screenshot program. You can take a screenshot of a specific area, window, your whole screen, or even of a website - apply different effects to it, draw on it to highlight points, and then upload to an image hosting site, all within one window. =head1 OPTIONS =over 8 =item Example 1 shutter -a -p=myprofile --min_at_startup =item Example 2 shutter -s=100,100,300,300 -e =item Example 3 shutter --window=.*firefox.* =item Example 4 shutter --web=http://shutter-project.org/ -e =back =head2 CAPTURE MODE OPTIONS =over 8 =item B<-s, --select=[X,Y,WIDTH,HEIGHT]> Capture an area of the screen. Providing X,Y,WIDTH,HEIGHT is optional. =item B<-f, --full> Capture the entire screen. =item B<-w, --window=[NAME_PATTERN]> Select a window to capture. Providing a NAME_PATTERN (Perl-style regex) is optional. =item B<-a, --active> Capture the current active window. =item B<-m, --menu> Capture a menu. =item B<-t, --tooltip> Capture a tooltip. =item B<--web=[URL]> Capture a webpage. Providing an URL is optional. =item B<-r, --redo> Redo last screenshot. =back =head2 SETTINGS OPTIONS =over 8 =item B<-p, --profile=NAME> Load a specific profile on startup. =item B<-o, --output=FILENAME> Specify a filename to save the screenshot to (overwrites any profile-related setting). B You can save to any popular image format (e.g. jpeg, png, gif, bmp). Additionally it is possible to save to pdf, ps or svg. B There are several wildcards available, like %Y = year %m = month %d = day %T = time $w = width $h = height $name = multi-purpose (e.g. window title) $nb_name = like $name but without blanks in resulting strings $profile = name of current profile $R = random char (e.g. $RRRR = ag4r) %NN = counter The string is interpretted by strftime. See C for more examples. B shutter -f -e -o './%y-%m-%d_$w_$h.png' would create a file named '11-10-28_1280_800.png' in the current directory. =item B<-d, --delay=SECONDS> Wait n seconds before taking a screenshot. =item B<-c, --include_cursor> Include cursor when taking a screenshot. =item B<-C, --remove_cursor> Remove cursor when taking a screenshot. =back =head2 APPLICATION OPTIONS =over 8 =item B<-h, --help> Prints a brief help message and exits. =item B<-v, --version> Prints version information. =item B<--debug> Prints a lot of debugging information to STDOUT. =item B<--clear_cache> Clears cache, e.g. installed plugins, at startup. =item B<--min_at_startup> Starts Shutter minimized to tray. =item B<--disable_systray> Disables systray icon. =item B<-e, --exit_after_capture> Exit after the first capture has been made. This is useful when using Shutter in scripts. =item B<-n, --no_session> Do not add the screenshot to the session. This is useful when using Shutter in scripts. =back =head1 BUG REPORTS If you find a bug in Shutter, you should report it. But first, you should make sure that it really is a bug, and that it appears in the latest version of Shutter. The latest version is always available from: B Once you have determined that a bug actually exists, please report it at github: B =cut shutter-0.99.6/cpanfile000066400000000000000000000010011476102223600150140ustar00rootroot00000000000000requires "Gtk3"; requires "Pango"; requires "Glib"; requires "Gtk3::ImageView"; requires "Number::Bytes::Human"; requires "XML::Simple"; requires "Net::DBus"; requires "HTTP::Status"; requires "Digest::MD5"; requires "Proc::Simple"; requires "Sort::Naturally"; requires "GooCanvas2"; requires "Image::Magick"; requires "Locale::gettext"; requires "Proc::Killfam"; requires "File::Which"; requires "File::Copy::Recursive"; requires "Moo", ">= 2.0"; test_requires "Test::MockModule"; test_requires "Test::Strict"; shutter-0.99.6/po2mo.sh000077500000000000000000000010121476102223600147050ustar00rootroot00000000000000#!/bin/bash SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" POPATH=$SCRIPTPATH/share/shutter/resources/po MOPATH=$SCRIPTPATH/share/locale CREATEFOLDERS=0 if [ ! -d $MOPATH ] then CREATEFOLDERS=1 fi for POFOLDER in $POPATH/* do for POFILE in ${POFOLDER}/*.po do LOCALE=$(echo $(basename $POFILE) | cut -d"." -f1) if [ $CREATEFOLDERS -eq 1 ] then mkdir -p $MOPATH/$LOCALE/LC_MESSAGES fi MOFILE=$(basename $POFOLDER)".mo" msgfmt -o $MOPATH/$LOCALE/LC_MESSAGES/$MOFILE $POFILE done doneshutter-0.99.6/share/000077500000000000000000000000001476102223600144225ustar00rootroot00000000000000shutter-0.99.6/share/applications/000077500000000000000000000000001476102223600171105ustar00rootroot00000000000000shutter-0.99.6/share/applications/shutter.desktop000066400000000000000000000107541476102223600222100ustar00rootroot00000000000000[Desktop Entry] Version=1.0 Name=Shutter Name[de_DE]=Shutter Name[pt_BR]=Shutter GenericName=Screenshot Tool GenericName[de_DE]=Anwendung für Bildschirmfotos GenericName[pt_BR]=Captura de tela GenericName[de]=Anwendung für Bildschirmfotos GenericName[ar]=أداة لقطة شاشة GenericName[ca]=Eina de captura de pantalla GenericName[cs]=Snímkovací nástroj GenericName[da]=Værktøj til skærmbilleder GenericName[el]=ΕÏγαλείο στιγμιότυπου οθόνης GenericName[es]=Herramienta para la captura de la pantalla GenericName[fi]=Kuvaruutukaappaus GenericName[hu]=KépernyÅ‘kép-készítÅ‘ eszköz GenericName[it]=Strumento di istantanee dello schermo GenericName[ja]=スクリーンショットツール GenericName[lt]=MomentinÄ— ekrano kopija GenericName[nb]=Skjermdumpverktøy GenericName[nl]=Hulpmiddel voor schermafdruk GenericName[pl]=NarzÄ™dzie zrzutów ekranu GenericName[ro]=Utilitar pentru capturi de ecran GenericName[ru]=Утилита Ð´Ð»Ñ Ñкранных Ñнимков GenericName[zh_CN]=截图工具 GenericName[zh_TW]=螢幕抓圖工具 Comment=Capture, edit and share screenshots Comment[de_DE]=Bildschirmfotos aufnehmen, bearbeiten und mit Anderen teilen Comment[pt_BR]=Aplicativo avançado para capturar imagens da tela Comment[eu]=Egin, editatu eta partekatu pantaila-argazkiak Comment[sq]=Kap modifiko dhe shpërnda pamjet e ekranit Comment[ast]=Captura, edita y comparte captures de pantalla Comment[bn]=সà§à¦•à§à¦°à§€à¦¨à¦¶à¦Ÿ শেয়ার à¦à¦¬à¦‚ সমà§à¦ªà¦¾à¦¦à¦¨à¦¾, অধিগà§à¦°à¦¹à¦¨ করà§à¦¨ Comment[bs]=Hvatanje, ureÄ‘ivanje i dijeljenje snimaka ekrana Comment[bg]=Снимайте, редактирайте и Ñподелете Ñнимките на екрана Comment[ca]=Captureu, editeu i compartiu captures de pantalla Comment[ca@valencia]=Captureu, editeu i compartiu captures de pantalla Comment[zh_HK]=æ•æ‰ã€ç·¨è¼¯ã€åˆ†äº«èž¢å¹•截圖 Comment[zh_TW]=æ•æ‰ã€ç·¨è¼¯å’Œåˆ†äº«èž¢å¹•æ“·å–圖 Comment[crh]=Ekran görüntüleri yakalayın, düzenleyin ve paylaşın Comment[zh_CN]=获å–ã€ç¼–辑和共享截图 Comment[cs]=Zachycování, úprava a sdílení snímků obrazovky Comment[nl]=Schermafdrukken maken, bewerken en delen Comment[da]=Fang, rediger og del skærmbilleder Comment[et]=Ekraanikuvade salvestamine, redigeerimine ning jagamine Comment[fi]=Ota, muokkaa ja jaa kuvankaappauksia Comment[fr]=Faire des captures d'acran, les modifier et les partager Comment[gl]=Capture, edite e comparta capturas de pantalla Comment[de]=Bildschirmfotos aufnehmen, bearbeiten und mit Anderen teilen Comment[el]=Λήψη, επεξεÏγασία και κοινή χÏήση στιγμιότυπων οθόνης Comment[hu]=KépernyÅ‘kép készítés, szerkesztés, megosztás Comment[it]=Cattura, modifica e condivide schermate Comment[ja]=スクリーンショットã®ã‚­ãƒ£ãƒ—ãƒãƒ£/編集/共有 Comment[ky]=Скриншотторду тартуу, оңдоо жана башкалар менен бөлүшүү Comment[ms]=Tangkap, sunting dan kongsi cekupan skrin Comment[oc]=Far de capturas d'ecran, las modificar e las partejar Comment[nb]=Ta bilder, rediger og del bilder av skjermen med andre Comment[ro]=RealizaÈ›i. editaÈ›i È™i partajaÈ›i capturi de ecran Comment[pl]=Pobieranie, edycja i udostÄ™pnianie zrzutów ekranu Comment[pt]=Capture, edite e partilhe capturas de ecrã Comment[ru]=Захват, редактирование и выкладывание в общий доÑтуп Ñнимков Ñкрана Comment[sv]=FÃ¥nga, redigera och dela skärmbilder Comment[es]=Capture, edite y comparta capturas de pantallas Comment[sl]=Zajemite, uredite in souporabljajte zaslonske posnetke Comment[uk]=ЗахопленнÑ, Ñ€ÐµÐ´Ð°Ð³ÑƒÐ²Ð°Ð½Ð½Ñ Ñ‚Ð° Ð¾Ð¿Ñ€Ð¸Ð»ÑŽÐ´Ð½ÐµÐ½Ð½Ñ Ð·Ð½Ñ–Ð¼ÐºÑ–Ð² вікон Comment[tr]=Ekran görüntüleri yakalayın, düzenleyin ve paylaşın Exec=shutter %U Icon=shutter Terminal=false Type=Application Categories=Utility; MimeType=image/bmp;image/jpeg;image/gif;image/png;image/tiff;image/x-bmp;image/x-ico;image/x-png;image/x-pcx;image/x-tga;image/xpm;image/svg+xml; Actions=Redo;Select;Screen;Window;Active; Keywords=capture;print;screenshot;snapshot; [Desktop Action Redo] Name=Redo last screenshot Exec=shutter --redo [Desktop Action Select] Name=Capture an area of the screen Exec=shutter --select [Desktop Action Screen] Name=Capture the entire screen Exec=shutter --full [Desktop Action Window] Name=Select a window to capture Exec=shutter --window [Desktop Action Active] Name=Capture the current active window Exec=shutter --active shutter-0.99.6/share/icons/000077500000000000000000000000001476102223600155355ustar00rootroot00000000000000shutter-0.99.6/share/icons/HighContrast/000077500000000000000000000000001476102223600201325ustar00rootroot00000000000000shutter-0.99.6/share/icons/HighContrast/scalable/000077500000000000000000000000001476102223600217005ustar00rootroot00000000000000shutter-0.99.6/share/icons/HighContrast/scalable/apps/000077500000000000000000000000001476102223600226435ustar00rootroot00000000000000shutter-0.99.6/share/icons/HighContrast/scalable/apps/shutter-panel.svg000077700000000000000000000000001476102223600303712shutter.svgustar00rootroot00000000000000shutter-0.99.6/share/icons/HighContrast/scalable/apps/shutter.svg000066400000000000000000000433231476102223600250670ustar00rootroot00000000000000 image/svg+xml shutter-0.99.6/share/icons/hicolor/000077500000000000000000000000001476102223600171745ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/128x128/000077500000000000000000000000001476102223600201315ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/128x128/apps/000077500000000000000000000000001476102223600210745ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/128x128/apps/shutter.png000066400000000000000000000244271476102223600233110ustar00rootroot00000000000000‰PNG  IHDR€€Ã>aËsBIT|dˆ pHYsvv}Õ‚ÌtEXtSoftwarewww.inkscape.org›î< IDATxœí]y|U¶þNUw'Ý=éÈjXE–€JPp—}0Š ¢*oÜÅ1ƧŒË8£èŒ2À îã8:î¨AÆAE$,@öµ;½÷=ïêê®^@² É÷ûUêÖÒ•[÷|g»uë13zÐ}!uuzеè!@7Gº9zÐÍÑC€nŽtsô ›£‡Ý=èæè!@7Gº9zÐÍÑC€nŽtsô ›C×Õø¥‚„û‹ ß%œl!þ‰NÎJ&W]%•¦Ö{¸¨HtuÔ3 $:2îxÁ,”$Dh€A`ÀÜú/¼© àý•1¸ à2Aº²š&Û~^>ßÓ÷q$ôÀÌ»ŸËcŸn:1 CA”€ œC­ÿ<^ŠlbÀ›ldŸ´’ØTùØ•-?¿ö?Ýš9÷<ŸêõJ $¢FðKùhE},à"pè>/€¯ÁØÈà×*»rsT *º%rî|)GtÀóà7çŠÜFðZ i¾£hKæÈ³8Ìf0oaE¬Ûûâ¾?_Õx•úÙèVȽuQ<€è&úà‘ ¥¤@«ZGÂvGiópb(ç8˜x,‰[˗ή;†5º ²îzùt"i'až=L¸®å?!&Ÿ£ãÐÓ´²Ð‚Á¥:Aç|tÖîã¨MTt ä,~åA0ÝãOÞ ᇠ¾uÙG;½9äP$ 8"0ÐBë˜ë$É;¨½-Á¯º€”u÷Ú'ˆ¤‰¢;ZŒE¶tTf xŽV¯CbJ¦Ð3 Ö¤ìd°ÿ'Ê1VJ_mÛQTä˜ð«µD œÅÿx ùQ…n ü»µ{£_8òHk ug 3lEóƒå:0}"H”!}\±tÆÑ+t|øÕZ€œ;_ºƒÈ0_ÙÒyZ j(eÚØJ'Ž<#ϪÂSh á¤ï˜Ä0¶À'}Y¾ô’ï¢% í_¥ȹñO#¤„œM¤Øh§ð\_³ÝüœH[Q~ÀûÚ@À—>ˆ- ÛwÍpÿŒrÜøÕY*˜iÌtáßI–c£ Ü_•m¨€Û´G_ÿĮ̈¨ÓGûŠ~»ÿ8.Ü®øÅ€H ·a²ˆˆ2oxò>Š5VN§(7û9 ¢Zƒc + QBB| ïû¿™;ÚªwWâ„'É+W®²qãÆ…D”PPPpíçŸîˆvnÆÌ{&ë“Òo#YB@èZ¶e ‚'DÖ¡íœÀÂö¸>ó¹œk¬{¿_Û°î‘æ€Ð8!eà'ÀÝwß¼aÃÆe½zY.3M²Óé@||ü-"˜_’0mîÓ’!V"\jÍô‡›ýhŽ.øÀ.nW¥°[ÿá©9üÜ¡çÇÌ>åàÃÇt¯]…–+V¬8yúôé/§¥Y†Ë²f†Ûí¶—––º¢o=õz]BÚP…IÚOkúÃÍ~¸Éo[ãÙãòúlMz›ê^*ßð¯7øÇO­€Õ÷ëmv9N8­Y³æ¢Q£F¯LLLH‚¹±ÇãmÔëõ-(;Û”}ÉÝ“,GzD&²f Z>Ân­sÕZå(Ûý\ÝÛÝÍÌ^àÖã¾ç®Ä G€U«V]8thþ+qqf£*xfàr9›­V«/ü7)ÃÏ?M—¦~Ñ„N­ZIk­Fè>¯£¹Å]uà9ÛÎÿþ±qÿËßþ—ö¹á.Æ E€eË–Ž7þy“ÉhdVJp¹\Mƒ!Ä‘ÔëÊû®”qê¶z Ë·Ö ØŒÞ(œ6«bÿkÖÒ-4®y;3ÿ"†y N<üðã§Œ{Õd2%j¯®™‡ÃaËËËójgÌ?5Û–3-Bð– Là"„fƒ>¸ªöï°ÿ´õΚ·v}À\â^ ©¯?-ÕgϾ;âRN#y"€lf! !¼Äü|ü tº·ËŸ^Ø!rÛ'n¹å–¼óÏ?]BBBzPóÉoúÉO‚Ýn·•””„ÀtÒ„+ôIKDÞߪÐ#ÓCí9>{³§¥tûs‡·¾»„¿ÛT^W² ŽÏ8ë·—äÎä)Ö<²¾IX0˜ IXˆ³Yf@xZ²üi…$¼—¯XTÞíw<èòaá ˆ™0aâ“ÉÉ©}TMWI¾¸\®qs”ŸoÐ'¥M“ô1ŠæKJ¾€¤Ðm‰@aû˜ÎC{v5l~wöán> ”–ù»ÛnÏûÝõ_šû YmHÍülŒï#é ʵÔkJRÈ 3$º™%yoæ¼?þ={îwj]jˆˆ–-{úúœœœ‹”=0÷þ.Ô7àt:C‡šDlª.>¥IÑý~¤ùÒ'@€ð¸aûñ«w[¶}~Cöw÷‡ü‘gf' vCßsÎÒŧå)êÍ`!I,)k $E­„ÿÿøËLЃÄ\ŸNwEÆ5ÿo媻þÖžmùsÑ¥¸ùæ›G <¸H§ÓE>\.—]û{6§åêL يࣘhƒBÿ1egàÂÑÂMÛ?}¡róû7ñ¾mñw”ŸoHÍ:uV¯‚óî‰Éè3€ º"¨ÁÀÂYIŸH,·õLÒò^×<<¢z¯ë&.) qi.sæ±cÇ?Ÿ4ûhÕ!àr¹¬ÚkÄXz“MfYMÿ‚&?ZÙoò5nÂÛ\çløê½?U~¶ñ:­ðO9礌“Ï~1íÔ3W˜r tzŤûD1õ$IŠó'eØOaç©õÝ`É3|˜=«8­S> ]F€›nºåŠÌ̬EÀÑ}¾vñz½p»Ý!ÐÅGȱqQ¯v(!!8«Ëê7¯/ªnüþ.>¨<[ 1côigÏý}ò©SÞK5y†>1E"è(B%Up_ˆÖKšm’e":ÃcЕ2§¸w—]D€#F˜{÷î3?hú¼x<¸\®&íudƒ±¯¢‘Ñ¿P­×žãª9lküvCqÝ»{ŒýY?/Á’=þÙ´±g>–8pdIoð ]®D EË)LÓµD?R?I[Ï<ºw’ç'u…,º„Ó§_üÛôtËèh‚"Ýj\.Wƒz ^‚—Nÿ)øóO<µî†o7>]ÿNîSêÓ:ÓØßäöê=ôŸéã§Î5¦eÅ…¦ý!û(`ò)ÂäGf$ZÍ×Zÿñ“u>é_4³ØÐÙ²ètsss 1ÐúùhéŸÖ5x<Øl¶€ŸŽ÷ê $éô­kdÙÓÒ(ê¿.y¡n_]³òòfâԹ㓠ÿOÆøiS ñI´*|¢H ±.!‹ hö…k~x}AT˜CWÇ=t:= ?~â´ÌÌÌIGõk÷ ! íŠeá%"´W@ØÊFpŸÛç°¡áë’ÿÔîÙq3ï(q@Â9sOKʸÆ2bb_’%åÿ©Q~ Òg%“òGüá)H]8,ò—”}þºq8Q4äð—/O¹¢x€ÿë¨öG§[‹%mªÑhlSÛ#@–e˜L¦ôÀ…â↮é‘Ú/B ~ë'Ÿ;ö—^Ë;JlÖÕCã3ú®ì5úŒ¾Š¿—C}~ÓÕ¬KQ:$ dÑL}4KEÑÈ^’|yñÈÎ’G§ °°Pg6Ç Ž&`íˆt ²,#66¶Wàb¾Xµƒ Šè$h.ýî°½êà¢æ-oÖ€éÌë³ã2²_Íwæ@I¯Éá>>J à÷ïAó®Y$ r›¦Þ¿ x>ÑKàÕTXÜ)Ö¹S `µZ“­ûýÖNIÒYÔk±ÑK`¿ÑoÃ÷»k…íÀÎ6üâg2uAb\FÊëY¦ ÓÅA’ I’ýëh)_´¨>\¸R‚Ö’¢M½UW†‘I¾»:C&J€†æ™L朣7ýÁã’$A’è4Ñûb\Âçñ!Ðh‘?,|hÜñÅ6©Öq/ÐÌbƒl±ü;gÜ”Sbâ퇤|Am@ ¸š D÷é‹!$ªÖ"(g$¢% 3— êh™t*rr2 bbb¨maGO‚N§OP¯ÕP²ºÑë°;B…¯~ÊvÓ®mUΦÚE5Ÿ®²¥éù™£&SzI$û5^×x¥_×çvÂkk†«©κJ¶W°Úî>d;¸û€½ª¬ÚUWÙânª>[„Ýár^oðy ÀX‡’ZBô:ÜÙÑ2éÔ,@§“eYT}Ì«žBH-+Ðëõ)Úë±ð5ªQ?!ذ‚«©VØ—½ÕøÎŠ åÒûf&÷0%!;ÏŸk3 .kœuÕn{õá gSM­Ïé¬%Ÿ¨cx+…Ç}Øç´ò6Wd‡hôº=628¼ìb=ˤctƤä8Äšô¦ø8ÙÛK6O"c|]L\býI§O#’ýÚvàÍÁ@, ¬YC f\ž6óÞ%µk<Ôa2é¨ GƒÂîõú Ë2ˆÚNû¢OJJÊZ°`AâòåË›”}´×벟®7Å6"@hüiû~ËqGàFcbîKÌíŸ`­*gGuE­¶Â*œöZ!¼_ºšjßõzí[[Þ{¡¢½î•úöEƒ0¦ —©ë•=J—Z(&C¯ë¯Z*Íë£5‘æRAß àŽðë·:•N§§ÖãñÀ`ЇV]·¦ùDŠuHIIéãp8r4€ÏçÛêµÛ®Ò›ÂW´¿Ž=vë;oý5Ðs(˜¿.ûâãár¾ç±;JšÝ®oøeQG«H›ó÷HfH%‚}^áb!ÜðyÝ,¼.0;ÀÂFìÛïh¨ÛènªýÁÕ„rÞýŽ‹÷ísphð½ äĦýæâ¡úDË4)6vIº&Tß H! žƒ_ öîÝýù¨Q£šM&cBk£~Bݺ_!C||||nnî;@x½ï¶>Pa²dgŸÿ~Ú^î´6?¤ýß5kÏ>–ºZ¦ßÓy§MK2Ä%,À¿øËÂç…ðzáuÚánn¸ÍÝTWén¨9œ5ó¶rÝöµ£bÏ-͆]¼û—¿ÛÙàk_Ñ£ñgÎN2癃þ\ BF €È7sQ†mí£•ÇÕø­ S `³ÙÖÔTo±¤OúUÛ[·fsÌfóÏ@Ó*µ\^T)¼îLÙ?*ÈÝܯËþ‰íí¿WƒÕ¼ñˆ5eæ}§ïÿlýë9cNëkJM—”™=}D$Y½1º#Ŧfd²ðe²§øœ-Ó]õÕ·9ªË·e\´p“£rᅳþ+¿mñß«@€uÖ2®zxŒ \ÈLB´ €žåÁ:„š”””8+++ßw:G•û‡§ˆ²,Ãh4ž¤½¦â™–Êr§m×ïÞQám±.iúÖ¯}à;Osݘƒ›>ÚP¿ç{[ Tc÷ˆNR9É`DlzNbÒб“SÇO½«×”ß}Öû‚ß½g¹è†kÉ28>ü1ƒ+VßõUÕê{î«yáÞQìÓõ°€¿I1±[Ûã~¢¡Ó_Ÿ9s¦eüø  4d˜äÈ¢]‡–ýZ¦Yûí·?lÚôùøU«VY û¢b“;YÞ’>ìÔAÌL5ßmy»æù{/lÏ:Sq±”ºÓõP|¯ì¹™£'õ)#‡—àSžSø‚Û,„ð}aÛŸÓO}åvwõáU‡·ý{ ïÙÓtät:Ä‘œmŠvlíÚµ5•/´´´´ÒýÛ¶5HMMÉMIIª^ïЛEv—Õ~ZÕöÍ;«¿Ûò½Ói¿º½ï‡‹ŠDí«Kïn:¸÷Ú²OÞ*õ:íÐFïÚP!Q=¯¡zvɃ%w¸iàÈ'óλeköKQ— Íë ðöÛoÏÏÍÍ]²uëÖæÎû‡ý“¹sç& <ô£üüa£UÍŽn ‚š¯îw¹\ؼù‹¿.Z´ha»Wü(4õš~1ié/d:y\L’E×ðH­Z‡À9š}>Wm‡¶ÝÐøÖK G®Aû¢Ý-ɽze\–”””3vìØWW®\y)ã£X½zucMMíªúúzWÛ¾?²W066&“iBqq瞀Æõ«öRý¡i埾ÿJKU¹óx¯G² CRê¥Iý >Ë™ßyOU´;.\˜d6›Æ !`2™M'N\¹jÕª…………!fÎjm\ñÓO;ÿápعµîßÖždddö÷ù|ãÚ»îG‹Ê÷Ÿo©=ÐruÕW¯uÖUx"æ‚ÁÑí ‚@†Ø!:s¯Ïòn~fV;VõˆhwL˜0¡Å ÁB &&Æ0aBÁŸgϾêžüüü€Ö._¾ÜS^^~ÓÎ?|ìñ¸)+°XÒRRR®jïº xËrOó§ù•›?Zël¬õ)Sÿ„œá_E|Ä.Vö‘dbÐ 97>s~GÔ9ÚB‰#x„` yìØS‹o»í¶Ç Œê¹«W¯n¬®®œ·{÷®íBÍè`f &&±±ÆSŸz꩘ö®ÿ±€ßyÇU]Y1¯zóúukCàe†Føê>¿ ÓEiÞ/œ ‰ ^ÉZøÄN¸…ö'€×K²ÊÂPË11Œ7þÆë¯¿~ÅÔ©SÕóŸzê©}uuµ7íÛ··L!MkƒBæ2úX­ÖIí]ÿ£EúœŸ³Ìºï þ|­£ªôÇk«¿úøŸž–føýYȹaüÂFe¼é~è Ð+ûÇï!H… :£GŸrùܹs_™>}z`tÏþð‡ 55U¿ß·oÏ^õ·GZ’“SÛ=å;ÄϼǢ‹5›jYg¹²øþöý–ÊŠÒkj¿ÞðºÏÙS¨u]Ú…Ã,A ÄÚÎË^ðx‡¼Ý àp8š¼^_ˆðµdÐét9rÔ¹—]vÙkóæÍë«þ®¸¸ø?õõuW•–îÚåõzÛìdf ¦±=öXF{ßÃáõΠ÷äœe1¥X®·\rçEüéÖŠŸ¶\]ÿݦ…Ï«™ T£éë¦EtB0X¢9}+íN€5kÖì÷xÜîhn@-† >qÚ´iÿ¾îºG¨¿]²dÉ›šg”–îþ^ #Ý€öù@nnï~ñññ‹ÛûŽ‹Á5jbšg~ÂtáõÙ¼­¤±©ô›ÿµîÛ¹Wµ`V„‰0³¯±!B½OÀtFGßJ» ®®Îåp8ÊT+`xY!ÁС'Ÿ6mòk·ß~ûéêï—,YòÕÚtáž=»¿¶Ûí¢-7'™LæóŸ|òÉ^mÕ©½A^!!˜I'#{ìä¾fSÒKTX¬³~ñÖN[é·÷¹ê« ¦]4d U ’NðË5fuä½´;JKK=--ö²hš¾ÍÌ8ppÿÓO?ãåÅ‹_­öÜ{ï½ûÇ™ee{ÖUWW5¶E‚Ì̬>‰‰‰íòðçhAv“Âh€†¸DX†Ž>5-©ñ>¨ý`Í+M»¶..GX<€(„І…¥ŽµíNfv{Ëm,Gw }ûöÍž6íìgÏ?ÿüÕ—\rI&ÜyçM7ÝtÓ¥uu5w”•íÝŒ BÝ‚Ù' † ž}öÙô#Õ­½ Y0X0‹€@rû™ÌY½¯N8÷šIÌ,ª¶o*²îûá#"RèaAbð8 Mý›¿,@CCý×^¯· Í$FRR²~òäÂ+.¸à‚÷o½õÖߪ¯üÜxã+›ššÎ9p`ÿ—õõõÍѲ„ôô^¹ ÷wĽDÙìŠ? ¤eظlsJÆ“ …³Òx÷¦æÆÝ[nrU— ž£­;Ž@å81çuä½t¶oßþ®Ýn÷³€èš¾­Óé0jÔ)æL9ó¹ûï¿ÿ©Y³f¥À­·ÞúÓáÇ&Ö××ÜXV¶gssc‹–&“YÒëõ­[·Îr¤ºµHßÂÌŠ@Ô×ÉH’‘>rÒhCbʰ~úæ÷Ö};ñ¹œQ,€ˆÑ\ƒÌ:f£C.^RRr¨¾¾n[4kSÂÖˆ‘••pÖYS®¿÷Þ{o]°`AbQQ‘wþüùkØ?²¡¡þÎC‡–Z­ÍN5+HIIË$¢:â~Â!;ÜJ¨8æ èã`îÕû<ã„ßæ@ÍW›žsVتýjf ÆJ/h¨ùdÔZ=ÚB€;v¸ëêê7FvE×ühĈ5bôè1#§L9ó±aưdÉ’y ,0¹çÌ™óÇ=¬±±éþŠŠCe6›Õm0$Y–§¯[·.®#îI ¯²,ˬ¨pÒ€á'ÅY²î®ü¶Å^þãCÂÙâÑ~jò#ã@€øË³PYyø‡Ã"lm*ðÖ‰‘(?aì¤I§ÿeÈ!,^¼xVqq±áª«®rΚué#N§ód«µéþššªO„@•×ëmã³®íŸ[Ÿ®KŒS…¯TurL,â{8'vÜù îýç78«Ë^fö…Eë Z‹¸ƒ-@‡DyñÅ¿4hèά¬Ì!Êxšˆ£”!^NNNÖLšXUU5jÏžÝ7,]ºôºººWüñƒþà_:´`>¹Ñò?‰&ýëûV9ÙçÎ0Ä%YT͇h\B\ŸA}Ëwß`>3{ ¦?¤K̸PŠ5¥„µÛ;‚ú%‘³?þø£uïÞÝ+ÝnODØZçP[b0âO7Lš8vìøGGŒùÉO<ñÞÒ¥Kg'¹VÇŽ¸™‹2,ÎܯLié«Z\€>)u k2„×–I§ƒ)«ßéæÁ“² ù‹7÷xjÿ°`Vf  5d>±«#îKE‡ŽE[¿~ýš>}òfff÷S´_k ¢[Eáµåà¶¶‡÷e}ëëë >´÷é§ŸþÖív/·Z­Ÿ·æ$þæŽqqII¯æŽŸ’çlªã–ÚJ3èbbÊ1±Êð.¿àÔ™By¿`3ú 2ö9i:€g˜™S Ï[¡³dÞB:C|ˆÖ‡ÅZ @À÷Ç{m¡C ðá‡Ö=øàÒçÒÒ,ètz¨W_QÊÀÏ%†:HJJª!%%m°Çã\[[svCCCõŠ+jlòù|ØvÝu×UKÝ-3‘q2%½¶Êƒ-`_$åJz}PتðÂW*Çš“–=ÆŒYÉ[¶xê7¼{8¶ßÄêÒæª)d@ðA¡²ß'~Á€O?ݸ²_¿~ó222sUhª´?zb¨ïÑ…ZN‡ŒŒ¬¤Ì̬$fèpØ ìvû»½¥þÅ_vH~’$é=fþïO?ý´£¨¨(òÛ3gÒ(oYrß!3Ò‡M>4W”ÕÂãÞ²Þ˜¢X€è>èÌÙý&%îJ`+3‹ÌßÞø¬0'Í%P˜ùWÝÆ=0ƒõ¢C Ðá/†¼÷Þ{Û·óÍfó¶íK¯á‘º–Õ˜!6Ö„ÔÔ4snnŸÜ~ýúÌÉé}AjjÚ“ñññëóóó¼þúë!ÝÇñgÏN· ï?£N›cvjŠªÕÂç…ÇÖ\ÓðúŸ)¦A6™’…êóï„-~í–ã“ÍÆ¼A—«ÿ£òßOme—ã“€ö ­%á– ¼auQ‡~=¼SÞ Ú¼yóªo¾Ùö”Óéý¼iñY}b•!ÞʸG] „ÛµL¢2ÕŸœÎêoŽ"øÀ6DÐ'ZÆÑ3{ÙÙò·Ž¡pó¯Zt´l:å…„’’oaaá}FcìIùùÃ/”$¹Í40è"´)aÐED;OAkîB)Ûív¯ÕÚ\EDjkkçΟ?ß7~z/sfÞéÃÇ^Ç÷s÷¨®€..yIìŸì²jÅ=U×>öObVx0Á`!^mÏvo ]òRbIII#Ýö¾†æˆIDAT2cÆŒgú÷ïÿ¿))–‚ää¤>&S\ªÉd‚^¯‹’÷‰!„.—n·K¸\®Z‡Ã^ïõzª…%Ìünccã6µ#ˆˆ¤¸…Câúç_—qÖ%g›³ûf„k=i €ŸÌhÜûðW½ƼQãtq‰½þß#h}?4A\0`ÈFS”ötP1{ŸfæYÚÎ#\ñCã?z¯>Øá²è²·RYQŸ]~?{öl³ÓéÌLOOŸ8Á`ˆcH'"’$@™‹ $I!ØÆì«°Óív£Óéöétº}‹- ™JžúöMÌ;)ëÒEךsNšcÉJ‘tÅj¨Z¯Nãê×|ÖÌñž+Ü Õï4”¼Þ†”´3$ƒAyT}”« µs„†Ì`H/±T­ºû Ëœ·y4q|â!Öš¶Ä ñѨ矾@©yýç^‡¨Pg<©>Ã(©øíð©\ƒš¯ˆ^ÛêÍe»öÚÊü(c„¹Ïo®ËþÎ֌ߋ$@P£Õ2IRlØåü4 ±Jãv7b÷?~n+NˆÄ$ŒîŸkî7ä‚ܹg’Ò&ÊæÄT)&Ö?Á3ùç$RçTgúP.¸®ðz`¯Ø¿Á¾åÍ:lä}RúX%ø´ÁM (BÉ Æ ¨09â^±ëc!R˜Ù ö]Ëk×F|³£ð‹"É@Ž!qÊÄ,CRæ(Ñ<"wÁ¼Óuæ¤ñRŒÉ étÌà)„2;·òÃÀ4.‹F. [ï­´Þ·Ìÿ)ûÊÅ—K1±$|êèh†w ¡ ý ÁÁµ·8Rf-YÅÌw!®mZûðÆmÄ0œÐȘ}‡rÜ0‰äLòÉÙ ;YÒ†’¬Ë YI§Ó|¢þ/yÁ?‰üS·CãïÃgò„œÅCx\°–~¿Ö¶ù?߀©Ï)1©Yô@cúѪàS3€p4xwÝ( ZÞ´véžmÐ(8!@…źÔ\y€Ê'”Hù’LùdÌ8‰$IRf û0ê‡!I !”ÁSªÀµDœCý?T7€ ÀºÿÇïí{¿ 0IW8±æ4ö©òc^₈Ð|­[ Áß¶vÿ~“ß麘)—.ÎI/¦dICÀ00I€H"0HM¤àÓ2†[0”Ït"@¨i]ˆæ#èÿ@ÚççÏÞÂöƒ»Ÿ²íø²ˆò ¹ ®š¡vþ¨÷ýˆ°¡`-ծǂ.%€Þ8‰õÃÁL!‚f¡˜VEÀš2ùËŠ¶û¥èlj¦ùAÓ¯Õ)Ý´ù¿Ÿö»Ö×nÿ济éÓ eSÂDöiâ2UãµïòEK5Ö@î´ÈþXÐ¥ŸŽmzõ‘MÂç{‚…ˆlÎþµ«öpUSùKøÐ;‘ÁÞ{1$™‚~ƒç+B…ïuàÿ°øâð_oüº+Ûº5ty ÐL±w%±{4³8ƒü€Â4ŸeÉoþÓOà€¹GdÐ'I“²„™†úì@Ñ|¯ÓînÚµmQÓGk¿Të–ñ»»¦K¦¸ÓBL? >& ñý­g,„ÿóQ¢Ë?Ík‹ÜIµS‹g"^´|‘;\ã5ãè‡XÐE†e@S}7ìe;¯{weàñDbtIéK߯>]ôEL°(¾hÿ_@ø¸¸bù­%]ÙÆm¡Ë-ðòå7$]¶äk‰Å_Àˆ øUëYø5þx mÍgH„w÷ª>_#0àª>øïŠMk`eþ^@æ•WΆ^?L­ï-D°`ßúÊl{Çwè:}ªØ#!uÖ}'3ð4IÒähßï ~·×?ooàË¡þþ€ÀçbC? 3@×/^kÝ—u[?¹È¶éÀçâ3Ξm–ûúd]è']5m¥~p;Äü"ŸwTÅßï®éà&;.œpP‘rù}—É$¢ìð8!ìCŽª‰$ (x ê6Ö€x¬õÿ´m~{^ö’qwÙ׉ÚT0‹§ë^*~£³êÖ‘è±’f-™"1}ú…"”ðœ€ouÃKþ"M}kè±Ø'ô ØA0)ÏQÍ„/˜ñ¹ñYÃИ/8Ê‹¤¿ôX hæLÙ‚“Õk‹l]]—ÎBº9ºüi`º=èæè!@7Gº9zÐÍÑC€nŽtsô ›£‡Ý=èæè!@7Gº9zÐÍÑC€nŽtsü?ð}—–?´òmIEND®B`‚shutter-0.99.6/share/icons/hicolor/16x16/000077500000000000000000000000001476102223600177615ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/16x16/apps/000077500000000000000000000000001476102223600207245ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/16x16/apps/shutter-panel.png000077700000000000000000000000001476102223600264242shutter.pngustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/16x16/apps/shutter.png000066400000000000000000000012551476102223600231330ustar00rootroot00000000000000‰PNG  IHDRóÿasBIT|dˆ pHYsooñ¢ÜCtEXtSoftwarewww.inkscape.org›î<*IDAT8¥SMhaùöËn²é®­)ˆ’†‚,9èEEsõ&ÖƒxE/Á1)**êQ*­"bBU(Õ“ôâ!ˆ-DR‹-mÒn²i’îoöû¼X©¦$ï:ooÞÌ çZi©迊ýO# ˆÛ‘ƒ ÆØgìuþfßJST*%\˜¬ÇüþÀ8"JˆÈaÚãl‰1p¿‘»©ƒLæý¥îîn.MÏü²„ÌûT7ª÷ÜJÉrôâD~äÊìZþ¤Ó¯ö â/?4*•TÀYâc’_LˆÁ¶!ª¨¹M'¯h*À˜»Ûq´]§“R¡æUKÏäöޭܱ^g#õ} TJ®b6›ÝlÛîT­¶¢oQÛÂfqþØÌµ¾·ˆˆÑ[ヒà;khKÏëŽ=„ˆÈíÿ·Ó4£Ñhï]]/]€Øƒ½¡ïœsnUªol]&>zZ¤ÇcÃ…ByÖ0Œáp×mDZŸpÎ{p`€PJzÄ Òë+ï<Çé å@^íõ—8:úòŽ¢¨ç Að<¶<£›ƒ m1C[øJåà}îó)×®Çõ÷¬+°ÿ\âÐ"•#,°qŸ¨¶áŒOZµe ´«Õõ…ù¼žNN5„¸ŠœfoU龈–ÀY¹dë…ë ǽº;G46¡§“æZ~ƒåøåP@Ù°K$òGË,å„G\´’•áDñoîºÿƒ–¿ñ'¨~X¸d8VIEND®B`‚shutter-0.99.6/share/icons/hicolor/192x192/000077500000000000000000000000001476102223600201335ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/192x192/apps/000077500000000000000000000000001476102223600210765ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/192x192/apps/shutter.png000066400000000000000000000430111476102223600233010ustar00rootroot00000000000000‰PNG  IHDRÀÀRÜlsBIT|dˆ pHYs11·í(RtEXtSoftwarewww.inkscape.org›î< IDATxœí}w|eþÿû33Û7›ì¦7H€z‘"â"XO±Ü{=¶³œ`;c¾¢g»ÓóÎÆ)vAñ«÷=õlxŠ (‚ÒkBzÝÝlŸç÷ÇîìÎÌÎ&B Ù÷‹%3Ï´gfÞïOyžgfˆ1†$’¨àz»I$Ñ›H ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰ ¡·+ġʖóéž§ÆO„s„#F` p9 ÿe-c@¶<ö‰>ÝÞº¿^XÇÌÛÒ(ùf¸¾ "Pæ¯ã N&Âd06  ¡rðÝw¤(¼`ØÇ{¶—1ìq{9°½$ò{"PÎí¯MfæØt“¤*WŠ›8D0ÍÉN¶i`À׌±¯8ÆU“’¿•Ÿ<ÌŠô’è Š/„l×þ™ÄѹΨè½KLñ§“µÂSÚ뺬ÃW ì+ÞêYSU~mû!T¨W@/"kÁë%:ˆ·2¢óDâ÷è]¡ú€ƒ»ëÚäO Ž€õ ZÎ…¸¥U^ØpˆUì$Ð È¿óÕé ô€Î†FK\̰nˆÓ è4#fÚ‘T˜W>V0†çª¹ä‹#SÁÃCR=ˆü…¯ÎÁÝI„ãÉØwFrŠ3óGBq,`š¥ªu‰CKl+@Ï÷5¯@ kÁòz`gk® 6¹©£…Ý7ÑÁâ¼Ñ…\ÌLjžc!ñ®šG.ujU» IaäÝùÆ%Äá¯`pÈ­y<—ã-½r©ÆÂîSÏvÀ‡Q…=ªm4ö^o1\Võç‹¿ébM’8B(ºçÕÜž0WÉSm¢+Þ!±»Àzõ*]ºÅ]kÒˆ†Gu*'bFåŸ/ú¡+5<Höä-|k$Ç Ÿ§ãSB7ì'¦ûA˜ÿWeš+Åq:Òoç‰ÀˆÅm¯.Š ‚{°†xTÐ {It3 îY>ð1@™@È®Iò®zåJ­Ê4¦f +E¢©D!y •(B~åöLä>í¤ÚGɨQx÷›Ç‚¸¤)y•ˆì‰“Û8KÛS-¢]É 4r– \3tb¬ÀJî/U–%s€£…w/?û?Ö¨EN eiGÖ>ë;Η»ŒN}â(xh‹ý+kð}&Büì€~ˬ¼\<”:w7’è.x©:ó÷àÈ× ©àwbÿD^¢#¬2)ާˆ6ùe¢Ø`ñ=A\cÓÑšMåóüYËA28LdͺÁª?öøeÇÙtð2‰t4–'Ñ6‡Q׎v߆CÑÉD}uaìð=ÀÖÏ}¯wÝÞÅ5wG5{IˆHÈ»íŸåtº aË­&|È®*ï8 :r‰€,=X|XYâØ*VrŒ[ë÷³u•žÛxÄ*ÕH àAD|öüG¯â櫈¸x"k^V¦Mô=»m´bÄgÊC„|G Ÿ‹Ä>çXË7»Ë¯ð ô’8DdœuÃx]ZÖã$P’¾ „O@ö¸íµÐ­BP[|ƈ£Ÿ˜HŸq>çB—ÛËOoë†õY x‘ Ä¢5€(Ç’wSùƒœÞl!"Ä“ž4xJêU IbÒX7qEºZåx0ˆ L÷ˆbàSCŸ£¹yåž¿ßP€ÌõèÏ "ÊËË3-Z´èÄO>ùä7 ëÇŒóü¦M›:m© "Ê:áokÚ©ÄEF2k’^MøŽÉ¹5û âkD°PC•¢·ý]ÑÕööþ§o\ È 7K>}ýA·¿cÀ `Ú´i¶·Þzë·óÓÒìS­V rrr.2eÊǶw¶½iøøó7ÖþóÀgo~„=?¸c¼é˜ôñ„§|îŒäZÉu¢ß‹»uW°éÀ«Î¾YÚúÝ¿«c>àÉÎ*‰£ZYYYÖgžyîáââ¢ë-e„#÷@P\·n]S‡;\Z¨Ë,(ãôÆð|¤i´Ÿ(ì¡Nº” D¿Á–†_üÕ»þZýù²wQ»³‘1êð\’ˆâ¨@NNŽåÿxæ±!CН5HÔªGø|Þúššš„úèýEEE×êõzùÕ„c p¹\µF£1a dÊ–gÈ\Æ›R: o:&½v²KZˆý,èG ¥¾Ñ{`ç‹Ík>zÆ·cÝ^ÆX¿}1Uoã¨@II‰áþûÿçö’’á0q˵Ó鮃  /?]—ž=±V#ÙÒƒ%½:ê(óy&†h©w{«¶½ÙöÓ×sêfÛ;ï·H¢cU3fŒþ÷¿ÿýu#Gލ0›Í à fÈchkkiƒšd¢1côéÃNšË›mJâ+š8U¤W D±ŠáIk6:jwÂS¹ýkצ¯îoÝ»~5«ªêò›×"=Ý\Á &kÚ¯Àñ“f„ȦcŒ9‰‰ëDbëÌ?±g¯í¸5à(ÃQ#"Ò=òÈã—Ž;þ‹ÅÊ©¹¯ú@0„Ûínܳg¦ mThÈÌ?–Óé£;ê<H@zR¬W¦¬01ý§{ÇÏ8¿ý÷“í•Û+µê¨ØŒH»Ý”5õÜ"!;Fáµ>Ž3˜Žg¼0X:c àÄðPg ˆ1äñí¾Üùù‡Ð‹òï †£F ,˜9~ü¸§l6›NÝÌ h‡>à÷ûáv»%†A%Ó„ÔÌa1â+‰7J³3Òk^Ã;„ÚðìÛ²®õçU8÷mø˜Uî÷hŸAdYYVGÉ¯Ææ]rß|!Õ~"§3/€8Œ‰ ÆÂÄgÒ[bt且 Çæ2ÆÍÍe®ºÜk{I¹‡÷¿pkÇ-dýG…&Ožœ{×]wÿÅá°›Â% Œ‘æºjax½ÞZíug Ž3KÏRR>ÎÚ' ½òù5á5,>&2øê÷··oÿáå¶u=âÙ»uWâ3¨°Ðá(:fjÞ)×^kHÏ=“Ì):©¯Ò800áx‰’ ²lA ]sÍ£µòò£.Ùî÷(,,4ÝsÏËsrrÇ‘/·ix¿ß–––­}[‡µÚ“­˜3˜Ãûêˆøš–^"iˆ@m÷E_;Ü»ú¹móºÅm;·¿Ëj¶&|seçØK'ÍÊ;áò+ôy³K*Žd¤‡ÂºGCŽDÀ­Oà Æþšµßt}îÕ¾¬ú…ß&ªSD¿q÷ÜsÏ9C† ¹ZjîìjèÞüعsç­å~2d¤¤ØsãÆýÈÉ™Ö o‘žTótµÀùËwÿmûéË?¸úúûDuN6>‹Ï+9/ïä‹.6æ š.XÓ8PŒøaºK¿XT×±Âub²úEÌG´œ•2ƾÌúÝC×Õ-¹ó¥Dõëoè×8묳†O˜0ñ¡´´´è—R:#¼Œ^¯Ï}àÀ­õ9£1Ÿ·Úr£Äíøò k¤—浬íçÕ+ZüúNïŽu;4ë>k–`l§§M˜u§¥hÔ©:›ƒ(ü zämkñV?úÚ"j{mÉÄ+xÇèÅœ«šX;ØwûÑõÛä :4õôÓÏ\œ3ˆE¬Ÿü§´„áŸÖz^¯·áwÚÇÁ‘;‘7Z"BôÁB¤%("ˆH9@‘òè:Ñõ~‘yéç;°Ë×´þÓç\›¿º9ù-£&ç:sOÖ±§½‘6vúéz{GœpÂcªÿÆŽþËE§^>/NQGRÕU]ΈnÎÜ«ÿ8ÿ¢ŠŒî¾¯=~)"â.¾ø²Ë‹‹‹Ï]¢WP&üÉ üÇiú Ng/­€šÔ âËÅAñâužÅÖ 7Eºvmjm\÷Ù£Mû·ÞåÞ²>. £Y³ë„“Oµ–N{Õ1eö})CÇæqzS˜ä\<‘có]GlÅrÈËëÛˆ­7+`Зý»ÆÚ]ìè—9rdöðáÃo¶ÙRБuOä äË@@§ÓÅ £É“ͤÓs&³’ÔP“ a¨­§œôáX0çÏk´¬_yë¶=‹ØÆ¯â^#b{B¡9‹Ó'ðbú¤“N2fäqÑãpÊ}k A[„‡Ærį«;"ó(b"¿*óŠ?Ííþ»Ü3èw ":ï¼ß^˜‘‘>TIt$ìùíȃÁ€–0úí9¼5ÕÁñºx‹ßA()R‘>º](ˆÖÍ«÷´ýôõ¶<þ)¶U\û¾iÒœÖ!£_KŸ2ç¶ÔQSr£9B|Äi…<‘r.,éo¼8(qäBxÞL ·²/]4½{îp좧 `̘1YEEƒ/·X¬ªp&ÒÁÓ'Ðò@ B|'±|]JZf즫€.ç1¯ÀX­¿|_ëܶaqÛÚ¿Æ–-Sx¢ Î:íÜKíÃ&¼9eÎ sî Ž$’s*òÊÿr‰Cu™vÈ#¯»v˜'?O¹X"óFƱ÷3/¯Þ}wºgÐïpÊ)§ÌÍÉÉw(¡Öú@(âÀÙl%‚Õž#~"r(—Lj¡J|¸¶ýÐêܶþoN}Ë?Õo] ée&Û‰[îK+÷pƤYÃu)i1‹­ˆ÷¼<Rˆ@Ã’«c|¨¶Ñò±s…jç¢t0áÜË*²ŽÐ­?"èW(--Í2dè•V«­ÃÄVBWá`Ð2q9€ 7å…ÇÿÈÃtB|y …ˆ×îÍž–-ë–¶ØclåJEóaÊ̲Ì4«åöánÍœ8#—7Ybd´ôÄ~ñ‚ˆ#w\™ª•'NˆžSL°  ùumˆ þ•?¿Â|hw¸çѯ0kÖœ“ssó ÏuÞÄÙ•D8õz½Æ8 Ž—^Œ©´è]'~dí•ۃ͛×þ/5´ÜÏV-SÄü¶é¿¡·ÚßpŒž|aúØãlœ †.Äi4_ªZb„×nå‰K’ã’xU˜#÷pEHÅyÊêÅu™êkçÞ ŠŠ~Á­~QI7nœ½¤dèïRSÃMïj3§„Äë3 …B·q¼Ò*ÊãdtBü9¼5ûYËÆ5Ÿšÿвñÿ­=–/˜¢ËÈz+s⌓ìÃ'èɬâ¨È-[–¸½?žä K¯(—ÎA©-¿<ÌQ{ uÓhÌ(°¹éÛñÄáÝñžA¿@qqɨ¼¼‚‰è:¼­o0Ì êã1 Ò»¬q³!ñÖÓ×\‡¦_}h¨ý½{ý{Šv~ËIO2ÚÒ_Ìžt⸔ACIžè†É y´š=µ›:ÄòQ‹ãÇ…wóÊ\@yîÑu¥}EE„›Ó/*?ùðïü‘E¿À°aCNµX,|b²wͨ—ëtz³ &õzÇñ€v¸“(Ô‘ˆ ?³Ûü㪞ښ[Û¾{o«|ßÖS®œ`´Ú_Éž4s´5o0b[òfNyÈ+‹³öš-?Óqq¼¶¥Wx™ÄÎ9rÂñÂQ ÷|VY…õoz _`Ú´i6‡Ã1Õd2uÊàP¼Á`°p'ñJ«¯ŒÕî?F¢0mœÛ68½Í5/´¯]±Z¾[ëÉóÇL)ofOœ1"%ˆŠü1RÇ<‚œàñ¡šüÊ0GMp™heuÕôj2«¼`lÛ˜ H&”È&ƒƒ:¶øðpäÐ/ ;++k€ÙCiÕéô"Šã8žE“`¨¬>ØSθn”Îb|;küqÃmƒ‡QØÚK„—ÇûMvÕ?y¨— 'ˆñB‘¹ãx?vÎêýGÎ4Êõø0(¶œ@78.º÷W‡qï(ú… 4Ôb±d«Ë&N´žN'XAˆk¶ãÀóqaC‚pGZF„ü>4mZ»Ççl¼§nå2—´¿ÔÓns茦eYc§ K2‚¢¡k×—‡5Q/ ²ú E€xA(­»Ò Hç¡öáb™e×"w§a|9#nIñ•ño(èèp82‡‚pHÍœ­+Ÿ’’âP“ù¥§$;²úÑ1²¬å—ïgÓ‹í_½½VÚUTp¼™þiË24}ØXNnéc->±Î­¸°¦#«/go'„C‰ñ#e ñH[Å…Aò2€#Þê ÞP7½‡Ð/`0è‹AHÍœ­Ëó¬V[\ï¥ l ¸Þά¾w]µ/àqÛ%ý_Š>Ïj&² ÎéyÛåëéDD˜w«1-À --i.¶²óçt##QÝ‘ìð5 ŒprF“Uo±Nœ=M°eþŠ7§GzÃDÆ :‚ô%I)TB,TŠÖ©ƒëOìVš?ÿ)öì³}â¥[ýB¢(ºƒÁ⢠ᵽAÌs8ŽL… î—€ÛuŒÑ‘Mòàmn€¿¹±YÏ„W4ÝV·u#¶ýä$޾ ú|Ÿ±5œÐ¶®qÙ³­Ÿ¹ìæÏ×¥6gÍ ÏàˆÎdb0!QH;÷6Ž‚L‘˜–ÖL?÷–V0Vªe`eÐçÝ'<5 î …°Ë3ˆ¯V?‡ »& €'òkð6½‹ÌL“){¢Ý6rÜ Îb›AzË ðÜèHÍbAÁüX^±þÒ:ö–ÌÓüë`ÎÿH¡_Àél]×ÞîFJJ¬W½»a"Àn·g †¡VÉ—…Dÿ·¾–úsS ‡šµÈZvnr‰bàï-<÷9Qß~¶Ûcµ¸Þ½¿^=þÿ`‘Ö’q'§ãîµå!%;O¯·¤€8>Ü”ÊñÇ…ù¼YA¯§$äó"ä÷"äó"äõxý­¾–z·ÉímH?íªŸÎÆoÏ6Uú¼†J¶ýŸÖqYø[®Èïu"z €.ýÜ[ŠõiÙç@Ð Ž¦(Â!¹(áix:ÄĉH  ëhhhØÔÒÒ\™••] ^ÖÕX?ÑúŒV«•KK³O °âž†êÄ ¼ÎG~_k#¼ í…ž×:VÍËDÂŒòŽO° P=ÌQ\b0§gŒ‰ Œ‰áiÆÀx¼`€Îœž¥e¢‘‰b>c"‚í®áWÛô€«õwþ¶æzK}CÀÝz íIJÕU_´}ÛØÎïz§ˆ B~!¢-þœ}ÕýƒI°ž ó@˜*½C%\oYp™áˆÆöé&Ða¦Áyç—^Z:rÅôéÇÏäy>ÚfÝÙK8ŠRùóz½øøãÿ|!üìrUnŸwçÇŽ’qsR !u"\»îëvO}å£Í+?|†wŽ î½žÀË7ÕàRJLdc|¢4-ÊÉŠÖrQDÐÛk| 5¼õ•[‚®Ö¯<ûv~Ä3Ï.×Îå½òç?<(dç3Q¼€‰ì˜pýbuˆwGó[‹JŽäµê*úEGØŠ+[[[×·µµjôìüðõº&“ ‹9³²²2/n"{®­r§SN~"ÀßÖOS]0(ÿ¦ÞæH¡éÍ?ý= úOªþqMuÕ÷_ùÁÄHû¾Vï´ÔI%Ï]äM¸±,Þ`‚13©¥ÇäeN;í¤ŒcO)Ï>¥ì£”I'/Ï8õò‡Ì#=ŽrÆwúM¨zvá¾Ú%w>R÷âÝ“®D÷X,ï`¾è·'Ñ/ÕÕUK÷ìÙ»U™ŠÄ‡6N½Ünw¤êõú"õq[=ž…|æw6² e×/^€žw.{²¾'Î_BÛ²GVû]¡I-{·¯Þµò_® ×#·|؃º76Êýø]ù:Ä Ð¥fÀ\P’j÷«™ŽIsdŸtþ¿³›ùLʸÙ3)sDJWëZ¿ô®mõKï} á•òI:ޕʈNèžøó»ér6ú&L˜°±ªjßûÍÍ8<ÂCÓs¤¥¥e ‚0T}\öÁ“>€žiøyƒ‡1‚ßÝŠöÆZD»1¸þýçšæÝ­'{›êŸÙùñ»-í5J/ ³újò‡ÿFÿƒ¬ ~"ðf+Œ9EöÔ±Ó/ɘuÎy³ç>oŸvæ,JO·Lk^~ÄÝüZÅÊæ7økÛür(ç}$ÐoP^^.ÖÕÕ-ݽ{×&Qj¼r]i¥8¬Ö]jjêT­}53ý}A¯wgÝk|íµ¨ýá[Ç O׿³¨úœj—À¾6дâ±;m-×ìýïZvýÌâ®Hø)îÿð$ÅëAc=ô0Øs,–’ çÛ§ñŸ¼__¿4}ö§Pff—=B_D¯ €ˆô‡#µ¸¸¸Óá²ï¼óÎÏ55µïÖ×׉ÝúH¿””ètºcï¸ãޏX—-+÷}=-Mÿªÿé»Ñï{½©”¿£»¯Å¡ åƒ§ßö»ZN­Y÷õúšu_zX(©ƒ.YïµB$jÞk4©©wÃñl¹°ôÛø?,8ëæ×S&9’ä]Ýý½Ú JDŠ+n}ðÊ”A/ IDAT÷ƒo|ºÏ¿è] KKsËóá¯J" " DøõD挙ÄÍ8Õ ètöóî¸ c¬uÕ»KZ·ÿð@ËÏëê™ “^F^&Dôz@^• Tö_©ùz³ò®ûkŸË«zM©©©!§½:áµEÀaôèÑCÎ9çÜç¦NzåäÉ“ã^i¸xñâï\.ç…{öìú®¶¶&¤Mx@~{´¼€Ã‘N?ãñÇŸØSפ;@"Yä$ÍŽL >þd+§ÊçÜ|0ÆÄÖî9çΟñTí D-?C4þg2AHBPç LžC0¹”^D~¹ ¡²#w懆^ÀæÍ›ƒmm®ýÒÛ´B­2"ˆ#²Î:ë¬ÇgÍšuÇŒ3ââô‡~ø—`08¯²²ò«ª|q¶ˆ)›Bµ<ÏsÈÍÍÍ0 wöÌé&pAÆ1’ÎÙ˜jGÁ”lL0¼`ÿõ á /[ ÖíýKË–õÿ ´5ÊÂĨ’[•Õ äeÐÜNd8—Ôãôz½&Ƙèñ¸wEˆ¢šô¢¦ŠŠŠ-§vú½'žxÒâÙ³gç«÷_^^¾ãPVWWóÉþýûܒЦI433‹aöSO=Õo¼‰ˆ<HD¶fç#gì” Òëß´œ6?Z7­jjݵ©¼më?Š ¿&o#¸Å%·ªðH÷È=lxš€¼¬ùN;b'èÕ ©©i‡4”A"|¼å×A¸,77W8唓çŸrÊ);õÔSG¨÷×]wÕswQccÓ»;wîhöz½Šå‰’`ɨñ<ììœ4NwO\î@øcFHk/*åÒŠ†é úÇ¥–4ßÏßljÝõã"×^inÄ3ÊšD•á‘v™:oPäò <ÃIGîä½*€ 6ì q„O$­2‡ÃN8ñœ3Î8cɼyófÏš5K1FzÁ‚N¯·ýr·ÛùÇ]»¶hjjdÓA–‘‘Á ‚0û™gžé^€tLBá4@AZ sÔ$ƒÁb;Ùzòï~+­ïrïϽã‡xê«Ä¨µWye4Êd‰²|¹ÜHšÙØ#wö^À×_Ýèóù&ÐÅbů~5cúYgÍ}i̘q Ï8ãŒLùqÊËËÅ… >í÷ûÏ®®®ÚPY¹¯=R¾*‘'à8™™Y):î¾½8‡ 1"Äh* r&Ÿ®7™þdž}y>°M›ü {yʹýÇ÷‚ín¥hd–E-¿2$Bd•¸I#¯ˆüÓ—¡ËèUx<ž@{»{_<¹E Âk•Å~:&L(8ýôÓî?öØiK~ó›ßLSwš-X°à{³ÛÚZߨ½{g“ÛíêÔ ééé<Çñ³—,YÒ÷½€Ç„ßE¹'“Øgtd!mØèÁ½q‘”²íëë[6®¾¿}ß/›ÅPHFbù¶2R+Ÿ˜ b"ˆþ ¢e¥cÊ*ôGú2t½*€ÜÜ\oCCã¡P°‹„︌1   @˜3gÎY³gÏyyþüù7—••¥ÊyË-·´üþ÷¿¿:ðß\Uµ¿º¾¾. бW%òGºY„û{ø4¼:QD¸)4!‘%ã F{ú©ÖY'mçÛµncÛ/ë*|µûZ¥k)·þah…DñžF2©Â1¡ÎbŽû Io¡W°iÓ&MMÍÛÛ=qäÖ ×UaX­VL›6­dΜ96ì™ .¸`¼úØ7ÝtÓkÇÐÒÒôáž=»ZÚÚZ:ôééžã¸9/¿ürßö¼ÀˆÂ@mý¥iâxdŽ?.GgI»7uzY”Œ­u›ÿåÚõÓÓAwkœh˜Æ¼2ñ…2üa*ȧõ>ÓÚë2òɾp»Ýí]É:^G)Žã0lX‰yöì“/˜4iÊ+óçÏ¿Zí æÏŸ¿ýºë®;; ^\__÷Keå>§×ë:{iivÏóôΕêÈçg‹vÆ9LWCjR‹†—À¤¿LÚ–íÞíunXõ¼¯vßz0QÛú'È¢–_3üaÊ!($ ¡ººº±±±éÛ0q;ïÖ0ב0fΜ9væÌ+--]võÕWŸ3þ|Eòüùó?ðx<ÿý55ëêj½áþ Än2»ÝÎswò›o¾Ùw½€×Ïä!üo4‰L§²è¬iWY§–E?â­Ù²·}×OOœÍ¡Î­¿z¿ rEx°`ÒD±uëVw]]õj¿ß¯IøD"èº0Dèt:Œ9Ê6gÎ)§LŸ~ü oΟ?ÿ”²²²h2vÓM7ù®ºêªÇŒñxÚ_=p Ò]__Óîõ¶G÷Çq?RRRy§._¾|P/^¶„97O‚Àâ=€¨ôR[ ×RÓ/2M<½HÚÛ¿©©mˆGC­®˜UïÌú+—)û"–_ZJz>üðßÛÚZwLj«=¢«yBgÂHMMÔ)Ssf̘Y6vì¸Wý~ÿ‹7Ýt“b¼úW\QsÉ%—ÜŸ–––ǘx½ËÕ¶¶¡¡Ö][[ÍdjŸMï‚\¶Á’Ê'$¿Š°œ ƒmؘ‘F»ã*ù~\õ?×^½ë%& “PmÇY™¥W‹Gò,Ôwr€>ñ}"j=p funn^1ÇIšd`ŒT/ºêjYøzËËÔóžžãŽKTSS{Ùöí[uÏ=üÇãþgeeå†e‘¯¨œ~úé>K#?,_¾<Ÿçyá¼óÎÛÛ §ÞýCÙú”T Å(ù´ò9™-¹ƒyWFÎoŒæ¼êýáÓmÀöï÷‡Mú«>£`®Îž5(¿3uÒÛÏD0°ðÓ€}}BÛ·o÷]wÝu/ R|¾Ýîà;&î¡ #|“âÅ’““ƒ¬¬¬!UUU×íݻ猴´´]wÞyç[DôÉâÅ‹wÉ×7o^Õal7!ý’ Á?0&niZ¶èu©œç¹\Å–ª¶øro€h W8GÇ#eÈèQ¾†šËDÇ=ùv®ßí=íqÞœòÒdV\™Lkåê„8æ% Ô硎$ú„à³Ï>[;f̸m¶ÔÓ9Ž‹4LX-ëÝÝ®€ ·¶¶ ®­­™V]]}`Ñ¢E?x<ž7B¡Ðç‹/nîÖ“>DdüöîÐ  K¾¿ÝɈ @0šKx“™¤‡ŒüŒE>V¡†1=ú´ô9Ö1³žrmZYŒ±Ùò_+Ì,¸HpäLµèÈEŸ#(­¿zª›_,oé­k§FŸÈ`ûöím›6ýülss“¨Œícƒã´Ê:Ï&M”PÛl©())5üŒ¡ãÇOøMQQÑsv»}íâÅ=õ§?ýéÄùóçǯµ‡`;oÁ™"µéCGÏ8U*,»-ú:BÒéŠxƒ9r"-AbäË,b„üZ¡ÇÁR0l,g2«8 ó@£·®ò¢ß«L eý$ÑãE¸ŒmîÁËÕ)úŒ`Õª/¿Ü·oï%2v¥÷·ó‘¤“@+…Áq2221vìxDZÇW2|xéõv»ãÍáÃG|ÿÈ#ÜýØcê©kCDä8ïö{t:áASO°e9†t:@ÅfŸÉ&­Ãò£QAnõªo‹IZŸžk2däŸO²ÇMc¬þ¿¯¾lwý¢Î Râð(æÄ>%€>ÀÆ›o¸áæç Ÿh·ÛÃAP‡áVˆt8eêýÇæ òóó¹üüül§³-»¡¡axccãïŸzê©f€ûž±Ð—‚ lðù|›n½õÖnýPæÙ SìçÞ¶D—’vÚàãO¶RÒÀD† ß@ ™ F7¤M8'•ÁÆéMa«%(”!*ü‘ ‡`²À”=hŠ~Çæ?G+ÐÖÖl­ž7YÇ©b~ù¾Â×U-ù<1$ÐV¯þúÓÒÒ’Õ©©©Ó¥ÁœaB† +A‹¤À‘F8oöoµ¦ÀjM1\lôxÚ³ÚÛÝ¥n·û<—Ëé-Y²d›(Š_X#Â÷W^y¥êûÃ]Gêi7 ÌÆ×SòΟz‚™ôQ"{[À·¯nY¹ <œ'Ãd¶AP„'rRvÖ?`Ì.fÎ/820ÆÄ”aã_Ó͹âÎhÊeªý¨C*ex$]¿ðMûXÔç°~ýúúo¼ñÅüü‚év{lÐ`bt.Œî–Ç0™Ì0›ÍÈÈÈ40x<žiOûTÇã üºW_}µ…çùµŒ±/xž_k³Ù6DšW;Dʩל¤3[^È5qPæÈ‰<@ˆŽtƒ·¥ L ®‘ÖçB‡Þšje¢Ê2ˆ _4ÈÆ Ø0däŸA…c–²ý›¢oÖuíÜØ˜2­q ésï ׃%Øgì˜ o €˜ÏاЧr «V­zoÇŽíŸø|>˜ýàzãè®æ]Í1”O« ‚€””deåpEEŶaÃJLùù¹v»ã‹Å²˜ã¸•.—«åwÞ¹5ÑùUp©§]}£Ñ–öjáñ§gŒ˜ÀËÈçF=ÍõÑïûFÚŽ³ –”tiy””¢ô‰Tõ/^D̹C¦™RíŠü†1òíßô ø]jëí„jºªiÙÂ>Ó ôQ¬_¿¾þ¿ÿýú¾½{÷Tî8 ® £ã‡mçi5€`0a³¥"33Û”—WhÔëõ:Ƙ泱Y³Ê¬©§U=eÉ.,|ÒÙ¹Öì‚Ø>E‰Øáúz›ê<"7JÛr&[!o4›äÄWU£ùSN~i^°¥[Í…COU×­éË÷ªƒö—Â#Eµ†Vh_jb Œaõ¢Ì!£O ¬Vãw?þ¸á¡ºººÐá•îNaÜÓjòùP(„††:o ØÊ»F}ΖO Z2–;†Ž¾lÐÌ_gèÍ)Që­üÈ5CÀ݆€Ûé7pžMÒöz[êDÞdŠ$&y“¨šôÊAsŒ1ðôVÇXõ·cA´T?#бgŽ%$'¼ZÑýïöu }.°lÙ²Ðĉ_µÙÒÆOž<ùj›-­ËZе4˵ütœcĶ;¸2Qdp»]Ìélõr÷5cì¼y󿹤ã¤^o¶ÝlÍɹ(}ÔÔ¢Ô¢Q˜8*°H¸áªÞ0öEý{Kœ@g¥å£³ØbV8ƒC6-³Ì ¬7ƒÎžYjÚíÜòã×¼óô¶œkÿü%ÇéNHèÔI1˜~ï¿ãN¨—Ñg6lh™6mÚ½<Ï™'N<梔”ÔCîÐÂ`ÑÖ¦®‰Àår¢µµÅÍq´—1¶ ¬¬,Jš<_g54œmpdß‘6lìØ´áãL‚Á$#°¼2,6Å\v7|®·¥2]{p°>=¯D²&Pé±hŵÈ.·äR9oI+¡´ü\•ªëȹòÁ—™A8A3ä‘×2$~Þ´ì¡>ÿ}\°fÍšÚéÓ§/˜q„I祤Øk¸ƒb­Ã†ö|(‚Ûí„ÓÙædŒÕ¸û /Y‹­Çž5Þž‘¹À’7aNú¨)Yú4y¢;Ž‘^~  ×OC­“‚Á/¤b“Ý>ÎàÈ*Œµ!–”BÖ ×$ ÈÇIå¼ÁÈ[—à;uµ5o=Á³AþÅ B.‘VÄŸLï£Ï V­ZUuüñÇßæóùÚFwQvvŽžã¤€ºìp„+cŒ¡½Ý §ÓÙîóyB‘fÏç÷ìÙ³¢¼¼<(m“rÌ™|Šõw)E#.sŒ˜4Òœ;à¸plN‘ 2Ùqâ>QÊÐ^_  ®nûticø|ˆÒOÿ݉:Kj,lÒ$>ÄT[m¹HÐCgK;†hŒž±M~y š>|Ê™=ÿ±·ˆ±kyU™è×qï¡¢_¾ù曽³fͺµ¹¹uãØ±co+*R`0Ht…Ã%á»ZÖ5ñ„Ë”"`ŒÁëõ ½½=èt¶ºcc/p·üÊ+¯T„4y²ÎŒŒS¬ùE·¥ Ÿpœ­¨ÔÄ úpDŒ(BtˆÅ‚S@$¢ûÀ¾Ö@{s4ü±—iHuŒäŒ&UÞ žø€:D‰k AHÉ‹T§€BŒ1–sÍãÿdL¼F™h´ …Eõóår­ï¶ö:ú`åÊ•-eeeO~õÕ7ÕÔÔÜ2xpÑŒììì£ÑˆÃA8dâËÔ"ðz½ðxÚáv»ÚÚÛÝ"jà8îo^wÝuߪëL“'ëÌ>ãxGîÈ«S:Û6llŽÎbC8Ée Æ"ä—*Ä@ ˆI@nþ‚>ÚëªêO_I¥>ΧOÏgí; …4âtõ_ÎdcÌζˆ[óümkr~÷ðÆØ­íåÓ¶´ã;Û{èW­C>™5kÖw{÷î>.//ÿw……ƒf¦¦¦fšLf˜Lf‚Ð-=½Á`~¿~¿ííí—«­- ¹‰h5cìžçWÝ|óÍÛµêIC'§ZÌÖ©.3ç >ÞR0¬Øž%~˜è¤ ?1îdÕü4{®ªÝbÐã~ßõéëµR™µpÈq:«Í.ÿ#´³ø õÚ" ^§O2®À.ª@dìe0ö ÂsDõûšlu/wv_{ ýNV®\Ùàò²²/víÚ9.##c‚Ùld4†Y­Ö,›--Çjµ¦›Í& &(Œ¬Œìa0~ø|>ø|^×ëmõz½Q ˆ¨žˆv5<ϯõù|?–——ûÕË\2¾@—1è„ì±Ó.²?Θ•o×YSã-¾ÂÂS¤ŠGÝÄDÎÝ[ö=-¯HÅD³„ì¹£ŽçMÖ ÛžÉD #¾:áU¬''3¢ÅhHt®Á½&¸ˆ1FjñÈ<ÍÃìÙg]¸¥½‚~+ Ë–-óXùaîܹf³ÙœËó|~JJÊ‹Å:…繡DOD¿.‘ˆãž§p›fµ(bK àÛ¦Óé‚P  ²¼¼¼½³:Í ÅMCÍE£Ï¶O>ílsþÐ)G¶ŽÓkϧ˜Åd¡@D†ãÿÈ^ã’_O]%ümM«Ý_¿íýÅàÚL]ÚÌQ$èÂf€Œô…:á%õ Ä%± gJ(€¦¥ ÷e^¾è 0q–v,his.éìúõ&ú½Ôxÿý÷ÛìŒü¾ðÜ‘:•”ØÌ¼cxæéã.6åŸnÈÌ/ÕÛìLJIÍbÁ ±ˆqW…>ÒzRü/O„#SQ£îÚ·­:ÐP³$Ü FJzÞ0½=k‹¾ÞQòhÏ+û òrQdL, 1ôŠÌR'Ò‘þ˜GØOv:è¯7qÔ àH‚ˆ8äçÛͶÂÁ–â±gäMùͯ é¹St©ÞdXòH8ÈÈ {ÂäG,“ÿ %kÌ œÍh¯­úÁÕ†obõ™%dÍy>oM3Äš?#ÿI¤"¤”ÊUáŽV“(bAèPð±åÐãQƘCA~Æö™=ú#f|º It"“cO+9nTÖ¹7ž©KÍœ®·¥OâLVƒ`4ƒ8.B`1L~âo8¬‘ÂDÚú#óÑuÂÉ/IÃŒ£ÕÃ]µ»ÍßPõ"ÛþaÔ¢šòöçš²N9™ÓéM€˜€¨%³ø5‰F¶'¾cP·¬Ü•qqÅ`ìù] Ðܪ÷;{I¨@DzØí&“Éa3sÂäìóï8Mo˘!XRFr38>l¥‰‹ZÒ¨¥‡,l„Ã|&‚V胈gÅÿˆí,äóÀµÇzâŸËëjqìl>5cx,ü‘>R7EYâËÅ¡@Çuì0“LoxÈpAë[ýص+޻Р"€€Ô±æÌã§RÒ&ç^vßÎhÃëL£H§7ðzˆãâTq½±àñjc‚`Q/ ‚‚ü,ì/Éâ0…õwíÝÖä­Ý÷´ó»O£ÇÈcÍ›sæy¼É"KZÈÅûP‰@‹øPZ}U(D¼¡S4¾ZÞ–váçÃñdëòE}nÐ[" aô<]ÆÄÒbžtÃ9ž†æ^¹h§7Œ'âÇÏ›!àx‘†¢ˆ•—H*‚‹³öárYèIp¥| ÜÊ£‚œüD1’̇Dþœ-píÙü‘‹Õ} ?Kº­X—‘wR˜·²8òG‘±¿|Z"~x}yK8¾]@˼ àíNWìc8êsÙ£À_  °!à¸!D4,÷šG†qEŒ £ˆ5Ç!6!¼ÔúHö;jL‹@Jv¡Æ#¸Jqa¢e€…çÝ{¶ìj«ÜúW¶éûhšD[ˆ‘?Ú,*%Ç,&„·c¡ \û¶¬ñîÞú"S=“1uÖ4Á’:NžüJˆ%Á±<@)‚ΛDë1€±˜l$ëш>ûHdWÀBÈT[-i:îá @¶ŽòmÉÊ^L­ñíZ³è›ÖåÒ[ؤýHVJÏçJ6ÊqT<îY×[ÀÛ¾{ËÓžÝöÈÏ™rr,ºüaW’Þ­gôYa1ò®OQTWzìQùP=“ÕGTO¸Ld¡×µ®ûÑ„~팦ÀÓ~Ÿþ*V›YÔÒ’¹{åè›Xè ƒT˵'¬9µâѶ|Ù/Ö{+Åù’•W…A·-‹@ô{оgËûmõ•q­)™£gOÒ¥fÌU·üÈci"jé#u‰Zûè|ÄK(¬Ä2Öæóúúì(ÎîB¿ö5/?âFeŒ1¯–PZx ËŽxoÉ*Ë<‰ú³Øò2¹7ˆYãD¨G-¯¨,CA¸÷mû©ùçUl÷ÅKd‰ MºÂÒ[8AÞ̵îÒ{?eó1/¤å}Äè+™Ü#D–‹bè¥ú% œ½tk{ ýZÐôö¢Ù-’uSZ£u#.Œ‰†Z"ˆÿÌUÇPìCN¾Ø~!$Œ(é”ö×í«wnYu‡oûú¸ä3óÔ9“ùûܰÑfÑm ª… šZòIf bbmAOôøÍìô{@ËòŸ…È®dŒùÐùµÄ¡™h‰AÛËþFßÕ#ˆ’dP“_ñŠ“˜µ¶Ö];~¸¯íÛàgês$"£.oØíÄëxåûdû–çZÇWZžȽCèÞêܲ§neã¨4/[ô’Hâ LdÕrrk‘:¼\ëÅN$» ĤØV#Ü"Uz‚è*˜ˆÇ÷¾mkØøé+Œ­ŒkyÉš{ã$ÎléäÞF” J.V•d‰¸vŸbInIDATx^ ®©Îqýµ7îao਴¾ñàZ Lck; y€ðŠ–yˈV. ÆÂ E«Š<ÜP[Z9i%qˆ"Ä žºýÕ~²|«©q«Ï‹ˆôBFþÄéb,ßPx™7‘ê‹ñ5¼(¯wtÚÅB¡«Xyy|ûêQŠ£JPÿÆÃš[[O€Èžea|g”d²XZþWj0hYYµÅoú”,tþæºí®oWÞÌÚª´Î)·lá42­xÛŒä꺪=Œ¶å—{.ÆX@ÙçüÒ÷¬WqÔ ØOúšÞ|à:Åé`ìû¸–Ÿ¸FÃky ­åòÖE™"ÉL@B&‚…‚´6ìrmûþʶ_¾Ü¡u.D¤§Ôô‡AÉÛûÕy@Ô³)B"ã+ZŽä¹»¾ú¹Û?ìá[Õë 0)Ž^9.ºï*·„L…Çðƒ@áG"#C¤p±pÊy©—6~ihåP–‡7ŽŽóab¢»eUˆÿ^Ѷöÿv0AD”sÅ¢Ë9£ùŸ×SDiËW”Èˤi¦ÑùK¸¯öùüÕíÿ8ê Á~eEçÇýD¸DBT2‚+È.û«)(ù‡–#¿4c!]moº>zùú–½~x/ýŒ›mú‚¢_ˆ£¼ÎÏ©&%‚Ë–±8´ƒ±«jþyç[]¼ŒGŒ$¤_tßhâø… šGDFiœ¿ñy‡èÓ[QÏ Bl95ù™èq>Pùì‚EŒ±„o— "ÊÿØ"ÆØ]á-ãÁâfÔ®€Å‹–±=S»da¿xpåHaÀ @‚íòÅé1pˆæƒh¨’ô2QJò«¼äËä⼂(zE¿ïêÊgn}ƒi½úY†œß=4„8þg†(ýC­£ÿA9…Ù#Óq" ö™.ˆó+—ÞÕ¥±þG3¬$2/ùÓ©Œg׸3@ÄkÆøZ¡4„  L İšqøý¾¿\÷²Y-ä\ýðûÕõ3aªt@™°ˆ`ˆá‰ºö’;زy¡®ïûèÅ€€ŽË+ ¤»`3AÜ4"²É ®•(ÂUèñ ëÀpßþ¿ÝðA‡V çªÅg2п¢‰ò_@+ O)b`­ÄèÆÚ¥w¿ÚÕz $TQÁeïáF3Nw<€é šN ¡Ú-> kh-ˆ>!?®üÛ-õY Â²'L>‹g3€bU4ÖÖ¸w2âGÞž1BÿSõz¹f?Ã@FRìkÌFˆŸÀqœ) ²r z"®–ˆÕúÁ]‡3Š2ã² ¢{Ãs’°´¡Lâ`bx"-¬{í^Í÷—&‘@ŸBöÅÍ:Šz!ÚþOø–cô‡ºWþøU§ pôëbŽ6C¡»ˆÁmÃW¨@-‰¸Þ/acHÄâæ×ïK«c-‰x$=@Aæ…y"‰»AÐÇJ»äZô!´¤þµÿ9ªßàp$ô}!oƒ>jú ÐLrÃ`¬dDÿLÕsïì~±ÜÛSõ<Ú@Åôhÿj|OÄìÑ*­ƒìÖeìî…juH  À`ðßâóê7¢ƒŒqíÄĵ€a•sEßüÆVG2Hb@ã¨| ‰$ºŠ¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐH ‰¤’ÐøÿvóŠcðI×QIEND®B`‚shutter-0.99.6/share/icons/hicolor/22x22/000077500000000000000000000000001476102223600177535ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/22x22/apps/000077500000000000000000000000001476102223600207165ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/22x22/apps/shutter-panel.png000077700000000000000000000000001476102223600264162shutter.pngustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/22x22/apps/shutter.png000066400000000000000000000017511476102223600231260ustar00rootroot00000000000000‰PNG  IHDRÄ´l;sBIT|dˆ pHYs˜˜¢È‚˜tEXtSoftwarewww.inkscape.org›î<fIDAT8µ•kh\EÇÏ™ÇνwÝìn6ÔH£4‘¢¶P%¡­±`C„¶é¥>@¥ + Rl•R©øÀj$ í—˜”P >0–в©–V·y˜½»Ù½Ï¹ÇO-ÉfW!æËÌùÿþçÌ$"X`ëBý¿`ÌfYú¥OSkæÔkÅÆ×>¿ƒBÄhBú™"úʰ‚cûžr¯å‹z ·ö¿Ê•ÑÈ$"^ß'$D9QD´TIH¸¾á''§î7 ±ùÁ'ÎÅ’¦s‰ˆ€ˆ‘þ6 ƒ·g~ùrŒu-}MGGG·1F§ƒ h“ñÔA¡ )•ÎðlT˜Ûæ&ÂÂìó7§ÛŸk}:kÔFDdL¼¯µN¸®[’*¶E* ƒo¢âì°ÙØøA,‘ìÊzT*óh™_7ï{%þ¯àþþÃ-ˆ¸Ã÷ð¼ Å¥L#èß ð†[·¼+•¥¸e¡p©@Ùéëø¡jΪâY–¡|?!h­Ûá… h…¥Bnj;(£ÕH4uPà”=¿|‘71Æ;iYÁV€§§§ïÞ¹ó>–Ëý>,„èfŒµ—g~Úþlj7ò×D™_œß”áOpã–.ˆYàü=7ÂPí¥ª.Xa…ïûÛLÓUJœ*KßsÎn?ñø½;–‹ÞÛS,\Íx…ÅAŠPÈ.âºMmÛ¾ä8n²¥å¶“ÉÄ„m/€GªE©æ1ÆçC¯’‹ÂHÝk‚ÇÇÇÏØ¶s7fÆË ©‡„ˆ]9½+›Í ìéá›{öDo2Ã|&,Ì¿¥}tà/UƒW=ÁÎt:5$¥Ì0Æ€1Z‡—Î_-½sr.Ñ…@%Ï)µð{Ü…ü N©ø¬W.ÿ5òÍ]Ë9«ºb÷îž±#GŽ·74X\ÊÌøŸ®øÁ1·¢•ÊrËùË™2»µv@kÚT*GÏÍWsjΊì¹+-*QX7m•fÜ”÷*à;¥}g 1 1 Ð{aö³Þj1j‚ ôëÙŒ{×)@v'é˜#fôÒâ>Íåò|ˆÂð»<&>©¥¯éñŠÃ‡¨ ÍÍ@,VŒY|Ò™/¾ŽÀž$¢ã —é0õ…7QÝ öï—õæÖ=èÿk¬ÛŸ÷{¯Çr¼ÚÜIEND®B`‚shutter-0.99.6/share/icons/hicolor/24x24/000077500000000000000000000000001476102223600177575ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/24x24/apps/000077500000000000000000000000001476102223600207225ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/24x24/apps/shutter-panel.png000077700000000000000000000000001476102223600264222shutter.pngustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/24x24/apps/shutter.png000066400000000000000000000027011476102223600231260ustar00rootroot00000000000000‰PNG  IHDRàw=ø„iCCPICC profile(‘}‘=HÃ@Å_S‹E*ÚAÄ!Cu²"*â¨U(B…P+´ê`ré4iHR\ׂƒ‹Ug]\AðÄÍÍIÑEJü_ShãÁq?ÞÝ{ܽ„F…iVÏ8 é¶™N&ÄlnUì}E„1†ˆÌ,cN’Rð_÷ðñõ.γ¼Ïý9úռşH<Ë Ó&Þ žÞ´ ÎûÄQV’UâsâQ“.HüÈuÅå7ÎÅ <3jfÒóÄQb±ØÅJ³’©OÇTM§|!ë²Êy‹³V©±ö=ù Cy}e™ë4‡Ä"– A„‚ʨÀFœV iÚOxø[~‰\ ¹Ê`äX@ä–ü~wk&'ܤP¼8ÎÇ0л 4ëŽó}ì8ÍÀÿ \éµÌ|’^ïh±# ¼ \\w4e¸Üž Ù”[’Ÿ¦P(ïgôM9 r ô­¹½µ÷qúd¨«Ô ppŒ){ÝãÝÁîÞþ=ÓîïUr›±µ`bKGDÿÿÿ ½§“ pHYs × ×B(›xtIMEå.0«qåß¾IDATHÇíU[h\EþgæÌ9'»Ù´»Ym²µ‰5Š`í‹T­¨}±ˆJ5^j*4Ô¨UÑXC$Å"J iíCƒ¥mP’© ˜FXj‰­µµÔЂnØd7ÙÍžìž9sù}Q”&ñòØïqø.ü3Ã÷\Å ÿ„|í®#˨c €P€E0x’܈¾_ßošüW‰×ÔS`‡ ä/% " …ˆ©ìôp๨€‘‘‘åJ)ñÐ'gª™[1L(s !„ü!ÄÓÆ@?úu–¾9Ûö¨7Ûú’ùÉ“ÉÕ¶íœB7[âN"T™Ø* ™ýF)@­ÀHµy¡7À\.ÿe©TJÙæšš{ñ„RütSGÿ:ßóbÌvoü E)­•£5]𛎿]UuÍ6˲”҈ãØ;]×1ƒÍJù‡w}W W,i/NN—¥ nùÍì×BìÑvQe×Ý}ðžÊÊ¥/0ƯG„<œ¸œŸ*Ens—Æ ¹O¥?“ÆïR¥bà¥~¹YiúHïÆÌ±wS‹*»ØSíw:¡ðÛ ­±œ²{y8¼ŠÙ.Êt!uá1Ž÷£™–B‘,L–.®›îí8µ¸.jk£x>ةߡ¨@`‰“´ ºíMAÑcFk02èOjñàÔ\Vl΀ÁAôêso¹û ".4ÕF2è û”4é@0ø_øræidÐÿ_@ô‰ÖÝ@èj0Ð;u¬ýøÕýŸñ;IXÐÓV>4ˆIEND®B`‚shutter-0.99.6/share/icons/hicolor/256x256/000077500000000000000000000000001476102223600201355ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/256x256/apps/000077500000000000000000000000001476102223600211005ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/256x256/apps/shutter.png000066400000000000000000000643141476102223600233140ustar00rootroot00000000000000‰PNG  IHDR\r¨fsBIT|dˆ pHYsììu85tEXtSoftwarewww.inkscape.org›î< IDATxœì}w|Åùþóîîõ;I§rê–lܱ1Ær  &ƒ!ØÄôH%BO~ ¡…ÐBZ’CòMà¾IÀô°ƒmÜä"ÉêÒõ¶;¿?®íîíÞdcë¤{>>ëvvfvvnŸç}çÝÙYbŒ¡€ àu ( €C‡‚PÀ(FA (`£ 0ŠQ€ Å(@Œb €F1 P@£( €QŒ‚PÀ(FA (`£ 0ŠQ€ Å(@Œb €F1 P@£( €QŒ‚PÀ(FA (`£ 0ŠQ€ Å(@Œb €F1 P@£( €QŒ‚PÀ(FA (`£ 0ŠQ€ Å(@Œb €F1 P@£¡n@#D º>ofæ€"o 3²(Y d!A´@â¬À$ 2°€À#Ȉ$ A‰Ä@$‚`¿?ìc^9Ôç2Ò@Œ±C݆ò´ê ¡b`o#Ï£Nb¨åuŒ±ZÕ±Z"VP%>UH£"Ë¥ovØ`7í¸]LÂnì2¹Ý»î<»ïÀÙè@A È´ê ÁåÝ=•ã¸YÐbMÀ|hZ”&–ìb„ÝhcØEÛ¶ïçu’fc ]TÜø{‡ ¿àšÌ`Ñ- eÙµs@v—`Ðu1lc`o¸·EowÞwî¶¡Ö8RP€¨ýÑŸËEN:•ˆ†Å ˜b{”D*­4Ò¯^¦·#ÄÚÁð{[‚ôv—m×§¬¹Y:°-Þ(@¨½é™1¢D§át€Ž&ùx] ”öå‚e%;Soéçá=ÆØ[<¤·­A÷Ú­]:­®(À(FíõZÌxv=NTì äƒBZ ÚO`iÔ= õhש) Aü‹þ,ˆ¦—öÜ·<0Ô& W`”V<Ï×4†V0×Ü̬ù“_†ƒµÏñë9·«ZÛÐýˆý©ÝV÷*k>.º (À(AÕõÏØxŽ¿„~ Q¾oÿHNƒrô²ê*dƒ./—‹8d–ø×JÀQ ?Úu÷ÅžÁ7dø  #´jW˜x Àn% 4–˜ cµ‰=t? ×’C»5Kåzmg†tQˆ—€„G¢Q<Øuÿ¹í¹lx¡ #µ·üy2~`¾~.%Ñ3Ó”rÉtpÁt7²dË9d9 üÜÚnÝöP¾ÝE(À­xž¯½ «œ¤“ ÑGpÊ–q…"Ã¥™‰žÚõhçW ÃE!Uî]Ž/Þ{Çù_æÞ¸C‹‚Œ0TßòÇ©îIÍI¤¥ó0;ÑÓÈ=d2¥à¯É47=—ûƒº3 2{ ºs3p ÚïZùyæƒ`¡ö–?ß@ Ÿ‰É;@6²Sîþ¦JrÉ5däèågÛ©rÛõˆ^Ïa'EiNë½+»37èУð4à¨ææç ÐÕ™¢ò”ÕòkGý²ú« PÚ†ÑIEV9˜jDiùX2©Š1Ù±ÕÇHì“I)ccÁ³³<¤ÓÐaƒ‚ä9hÕ*®îÖÉ1F—(ÒCv]’ÐÛY ÆUÕÃ4öº>Ò6à²|jQ¼ $ÅÀC<{+‡9ä( ò´ê ¡.´ïŒhefÂg#û`|ø,¡¿¯ÂÈ T&ýR™ÆrAЬJ^ýwYë]Ëwë7hø  yŠi«ž7„Ù_@X–¾7%É®#éSzsiÑÁº78¨‰ÿ© zwÏ}+FÌCAÈ#WsÓß#¢³Ó‚SªP¹þ»”N³ghDΉû5rÈqN_÷çÏN×Éœ¨RË奜 ŸÙUaôÜ‚_á@’À˜Ä F>’DñU ¾X÷òû]o<Àcyõ þpBÁ8@ "*--uœzê©5«W¯>Ùh4š×­[÷.½Çô+­ˆÈX~ú5ß쎓9Á Û‘ú’Nz=ÂgŠöç@ôC° “D@ÁÄè ü5ÒÑòBÛS·íeŒ‰À…½M#ØOUTTØ~úÓŸN?úè£or:ß0™Ìžçàr¹v¾ùæ›'|Ĺjr©nB3g¶k“^Ç’çJxí `nD'Aøþ‚‰ÑØ'ÙÌÂþ¿…[[þÖþ§ŸmfŒEñdó?è(GAöDÄŸqÆu—^zéO***Î/**6FD«Õ:vîܹu¤PYYQÅ7®¼Œ³MÇô™Ÿ…ìC#y¦;:$H‘X$Ô"úývnûŸö?=¾è 2ÆÂøãOÛˆ‚ Dd¼õÖ[:ñÄW^^1Õb±Ä9ÅÀâ3ÓcˆF£ƒz;qަEÓMeÕWðf{<1ùŸj3Ç `¬âLÇÌ¥eŠ?{@ %1è{5Ô¹÷÷ÿå+p»ýB…@ÞÁCA†—Ëeä‘Ç—N›6õ×åååNƒA€œøŸSÎclpüpÔ”Z§û}ÞQR¤&­¦¥WO RfNCvËž¾?§˜.gɤp,äw‹¾ÕÁ­?Õùþ_?G¿'6®/à`£ ƒQmmméÃ?|í˜1 7––:yžçeë@(çœKC$Éüš-, ùâŠÓÈh‰×«OÙØÊ àP¯Ü§BÔÛ‘é“DHA?D¿w{d ãÏGÿü³§us;º»½khQ€ADüâÅ‹®½öÚû]®ÊSˆbDW»þ±ü ’$Âçó…s>FIƒ³bÉYglŶ4·|0¤×LÏDö\‰Nz74Á¢ˆ~õô¾îØýLÇK¿ÿ7Ê,½lÏžó4]¾£ 9€ˆ„+¯¼òÈÓN;íéÄx?÷()À! ‹ï¿ÿ~Î路Úì†Òê39«rìŸôúVžt¸‰ð¹’\?“¢}ˆôw­ñmÝð`ß»/_gclD¼Nk$¡ Y@Dü9çœ3å›ß\ú'—«r‚ÑhßÇs¤?V…‚Á`0'€\Óìeóž)8J+cf&¾6é3^÷Î`–!Bî›`’ÑëF¤¿k­¿åÓ{þû÷×ÐÝÝQß_ ˆˆ;ùä“;ûìsþPYY9Á`0$‰Ÿr³S@,=–¯Ë`0ä4 ÈÈÆ+ê— ö¤X¬5±G6Òg²îÚãMÏ! ¢ÞDû;·voùM×/¼„òVƺrþphPÍ™3§á»ßýî“•••G F0ÆŒ‰Éxšƒh4Š`Ðß)ŠbV j27g‰P\1—nís"½¶[¯ë)d,–c„Ÿ!îêwî ¶n}¼ÿ½¿?æÅÖ¿¯0ÆÏ@DD‡vXÝõ×_ÿHeeõ“É„˜UO¬(£ï$<€H$Œ`0Øi·Û³ZAKM_µÑ5æ8Þ^’$¿&q“û’ 9ZùL„Ïx ™¨Þ%½÷ìëµï|ÆóÁKô{£[YO‹[«††/  †††ªU«n¿¯¦¦öD«5ðK_~[.=ËÃ!ŽÀãñtQVˆ–zÁQ:3Yr·ö*‚§Hë2^ï¡¢T“$Dzö±`ÇŽô½ûσþ¶¬µuÈoÀ‰?8Å ’ã.´X§Îœ*ðÂtÆQDÆ3Nâ™H<ÀxÆÄ6€Ö‹Öð'û~ñ#ßPY@ PÁårUÝsÏ/~6fLÝ™6›]u?A| &êá c$†Ûíî1 €-Ч'9Ë”ä'ÏÓ­}º— Ez=«öff>€¸ÕïØÕáÛºþ~ïúwÿêÚ¾}°÷ñ‰ˆ€:3J¼¦ò£¾9®ö‚Ÿ}ƒÌ¶£H¦Ï8.qZŒÀ%VáÆ øRí~ ëÁÄ­FÃß·>tUh0í( †‚ÈPWWWö³Ÿýüú††ÆKŽ¢xª2º¯ç¨‡áp=k×®Í0ïê¨5Ìœ±@°#^RµÇ¿)8¬OúÌñ€A^% 1«ß†@ÛöWÖ½v¿?ØþëÜ>é¼Ô k†Õë,]|öæêñ_ç­ö%œÑ: ‚âbs¥cñGýÀXLâó,òÓ^Æh2#6àÎö…£=5ß»ÿY)*>±ï‰mL»F; ÇØ±cÍ—^úÝ¥cÇŽýaII Òoë©W–͈D"èèèØ—í¸Q&4ŠÊfsVG¼öøÿ]ü –^]NUDcCv¸tË/¼îÛÙëßöéo=›þûçðî/6 æù{ªª²A2T»–-;Ã\Q{Yì“9Á„øòÝ,.¢qƒ%úÍ ²S¦2ÆØ8žûAõe¿ü€ýdßc?z5×6Žfq§œrÊáÓ§qgi©“Ñýؾtâ+=€Xš:‡Ù¶mÛ2 qE –Ç—Wh?»µÏ•ô¹>‘Ä$†pw+‚­ÛÞó|òöÞ¾î5lÏç½™ÎGQsl‰Ífl¨œ÷­åFWÝy‚Í9†3Ûã¼ÌÂ'Éb«{'Ó²Š%FÊõþçá•êËîù'1\ßöø ›rmóhDAÔ××W-_¾âgåUDò‡÷Ò§÷¦Ç KK‰E pûýþŒ·Ãì‡Qn(q!ØRÑÿXi âgtñ³>+á•5‹/‚mÛݾŸroúà©È®/>Íu2UO¨°Øì+ž´Üâs–PTZÅYì@ÂÚÇ-= $uâØñ{-` m€J(TéI0î lIåwîyLàùæÖG¯ö¯ê>õ0yòdÇå—_q~UUÕ7RS|õ§÷&ög‹øý¾žlwB<_m±ÙããS•Ä„µ é5/ÿéï†צ͞ÏÞ½› t¼nù<ëTf""KÝÄÎfŸ^9çÄ3®Úe†âŠ2ÁêHºëI’«I-û …•×DÐ÷d"!ø¾Ϭ¼øîó;~㿳Ëhè"âÏ?ÿü¹'N¸Åé,Íazo¶8@L $‰Áïöq—12ͯåí¥oñ÷ô™<…PçøZ¾x¯Ýëw†Œ¾ÿ°m³Þ¤ÚIå–Ãk?læ™–ÊÚ“ %®"Áæˆ÷ÅÉŸ’Fá‘„\E@= Qo¢‚‹ÿWyñÝ¿ì48oa^6è%ÚF*FµLœ8±aÑ¢ãïp¹*Ê=êé½jâkbé„H$‚P(Ð+BF0–Ti°+=âgzd8½H:“­;àÝþÙK}Ÿ¿sotëÇïd ô­à ã6Í,4k¥mìÔ‹LµNÁV¬tóåäf©sK=A©ïë‹@‚Т„ l¥àD¡ô.H8bJò£ÊHÏq®ïܵ²ó‰›¶e:¿Ñ‚A­V3’P___zé¥ß½ªªªzvâñE<ä9cÛ‰Oìj“§1¤ìYl;# ] J“vpŽÒéœÅäŸ4³!NXJx$I'òSÜû‰El=²x©8Ñâi ‘I”•Døv|qo|ï©þïÝùrý[ÙÈo7¯Ò6½óüÒ™'ÉuP[[;i̘1«,8 åÎ'öæ¶ (ŠˆD"Q›Í¦ë`¨âÍ6‡’ø©/éÄ—¹ùšÖ^Ezu™ø·P×^¸·¬Ýàûòã|nü…í\Ôkcñ´“Jmfîbë„é+c&e­ âù¤0&ˆ¤ü®áòË‚zòýéÔåÎÍÅ' rëý•Çv”}Å®­¸àvO×Ó?¾M¯/F*FUpÚ´i¥'ž¸ä’²²òòÔ¥‘ s"¨ è)ƒ‚Ê`*-$ŒÝ”‰ˆÑp8¬ëð¶’ñ¼É"‹ážÄâUÉD¤‚zHô’û B™ŸR!±DZ¸¯îÍë6z¶¬¿Ã÷iųlçëºä·ñõq(±ÝV¥ç•YûY‰R(€/þ;àÙñÅÓ>°­/kNN¢i+Œ–9K¯´Õ44;§Î>Þ9eO‚!EöøRej×>öì„ÌJ«Ý{]€2ÜŒ«Éžhcò¯2Ÿò#¯NåU(eªÌ‰D‡Äá岕?¯×ê§‘†Q!MMMÖcŽ9f™Óé,ÉäºgèMJlËÓDQ„$IºÓMñð)ÆÊ.ΤÕGâCI|$v§H,ÅÀ¦µO˦¿P(t/ûàeÍ%»JŽù¦ÓVÌ~f«{]éô3Š;Ä%ˆ¯mÝsì£+IGmÍ!ëÙ9ª?¤¦øÿjïAÁú´öÉÛüRCñåÒwëý†#£B"‘H}mmÝR‡£(ñä4ÈŒm‹¢QõçÑ3,Ö÷ B§þ‹'k ²?•Æ$ l^õîü⥈Ûs§gýË]ZM±,ZÙÈøâíuc/vµ°Á^;VFdNáúë‘<í»–Û®eÝu]|—^îhWË”eu½€ÔV¼Ì4Îþ}÷»Œ`Œx "~æÌ™G—•ULãùÄ[º?½7sPPkø@ÊëL^Ú ˆKÑ]A|¤‘9ÍÕO›,¯Œ\ŒÁûå'Ì·s㚨»ïöÀÇÿ×¢ÕDZߞbäØê;½rö¢rKYU’øJ²Ë…€S’Iõ=A>=Ðrß3÷•dNž«ê£ô ¬3 Ê}$KSˆ_æ«ùVߌx˜9sfåøñOu:Kr¶à@®q@KLxž‡Ñ(”è6Š €Ór÷Sf+AŽÔ÷´‰Ÿº¬=;¿€{û§Ý}·{×þó3­&ó퉼Ñü£î°…U³Ù öbM+¯eõ³Eþ3Š€†‡ øhV·žŒ^duYå>¤Õ§¨ã¼òsV]¨û[æ9F¼¨p:sL&³,)»×èÝ Hl'Ā禢+V¡A ¸”Õ×s÷³?uƶým;àÞúÉÆP×]þ^|Gëð%'\xYl¿±U7|Í5k¡…¯Fœ êÅÖæ$qé$—[ûô[}j€‚xJ_f±UdÖ¨å!“ò,ÒE%S}Ê\îs­XU¥Õ—ùŽ/'N<ª¨¨(ùãåö´_"o.AÁt1‚`°y½^¹ê(ÁbKev÷ãÉH'~’\²í¨ß÷ÖO:ÝíùÞÿÇ‹Z‡u.º¨‚á1[UÝüÊÙ‹,‚9A~Niñ“õr2’sJÂËX›Ñº§NPFr¤Õ£$¬Œ¸šÖ:›*§úÇÑ œ¢€ßèþ–yŒ-MMMÅ ó¬VÛnëåP—çy&“Ñj6›µ€ œœÓÉ‹Paõe-  ~Š ñ] poù8êÙ÷ºÝlxRë°Ö%×3³áIsEÕ¼êÙ‹¬‹-F|U¤_aÝ!#‰&uD@å%(òªÙ©"nš7<ãl^€¬«²ZUt éÙ(¬‚c§—Ó¼\ó÷ÌcŒhÁU\ìœi³Y“iûÈìEÄŽËÃ`l¡PÈ 0A"ÆÀ%'±kYý„u‹m%"øq¢y÷| {ËÑpðÞÎ×W{ÕÇ´xI‘7ýÁ\êšS;÷«`µËÈœ°ì / ÝÒ§ñÕW‹€Üªk¹ôzCÙsñR‚¡’D·¥zIã—Ðù–BD.ºà–2Šò#ZŒFcÓéœÆóÂ"ù4㙇±  Žãm‚ èzpi¤$V”çkD¼n¸·Ööö=é{ç…µêÃ9N¾¸Â`0ÿÉä,›S3ï«Á^$#}ºeOm«fü!=½ִè\ae¡Y&Í}WÕ!ë ä‡d)©ƒÈ³(ãšÃEò£r þAÍß4O1¢ ººú0“ÉlŒÌä eùT‚ÀƒçyÇqšžqÉyJR'2É/J ˆ]å`Œa`ÓÚH¨¯çmŸÙü„úP´bÏsÖ‡ö¢Ùµs·š%H÷”ã~¥Sä?)‰&ª¬¹‚|‰Oz¢Ú%WZít2j•I•$Y éiòÒÊëzòrÜ9¥+›OQ÷s¾bÄ ÀªU«8‡£¸ÁhŒÍãÈí¶Þ`ãÚbÂóx^°‚`…øÄ’[©‚ê±¾¾ÕO–ð¶lF sïVQ ßÉþý‡´÷åû«näŒæ“\GηÆêáMâ+½ÝïЙ(éö´‡j=Èâ¤Yo¨Ú©&¯¬<Òå"ÙÉÿßTB–æI°GÊÎ]U„€+¯¼òŠÍá°U ‚1§H~æ8 tý3‹ Çq0x cLS8Æ·I’Š|H’@®V?!w?ÜÛ7ö„ýÞßû^ÿsšë_¼ìš%d4\W:~JQQm£Âå×#~Š )÷?5ÜÐë”b 7P#»³õ–•J//¯JÖ—ÉÝé¤WSÕŽ:&‰7kœPÞaÄ Çqv£ÑâJx@:‘ci™ŸïÏu8 £Ñdæ8NSܯ>Ý‘õ‰>ošE'Ù÷Ø·t«O˜$¡ï‹Âû}ŸÃö[õ1œ§ÿ°‘ãùǬåUE®Ã›Tä2ýO]6Ë/¼ú" Æ˜(BŠ„!EÂ`’˜îää¤öe´þŠ3W FšÈöPª“Ó¼†Ìu`ìò‘àŒØxž·™ÍF— ’D¦¤Ú§„ e}³->¸òF£Ñ¢'±ÜÑ-‘€g.dÁÀx…ÉãêŠFÈóå IDAT÷Ž/èÙ·+*Š·±ç—×M'_m*±˜žåM–ªÚÙ â…¸j ñŸ¬.åJ>‰òï,F4€ @ ù !C! yƒ,‰HR4¢Ñ(£QHb`!I”"DĈã Äq&2 œ`2qÁD¼ÁB¼`ǃ8>þð–ˆMpH0‚”s©ò徘¢Ïä«Ɉ*;SùY)kT—K,?žLcL]¢X#—¸yŒ+Ñh”cŒñ±k#vÉÈ#ûZÄMå´^ &·òòH}r‰,Jí7VŽãìГhgÄÛ‘Mmõ3’Ÿ€P7Ü;7÷I¡Ðã¾×žZ§®»Èjþ8nN]Ó1£Õ‘ª—È–1S_ r÷!ìíGØ=€°»7r÷ú¥H$ȤˆŸ‰Q‹D}b$äab¤5ô·@»Hd‰“‚Ä II’$‘…ˆXe,Ê Œ`€10"’(@‚Àoàl;Ì6Þh´ñ$X™Ádâ'Xì‚Õ^Kfs=ovŒáŒæ Á'@—¼ò4J*_l“Œ”„–˃Ò?”é¦Ú`bìZ±ê!¶º9ë T†+F¬˜Íæ¨$I!IÁ˜z\N6­E@céú^A,=]L¬Vçt:§ëµã¸b(eÑH0*\~ÈÚÛ”¹ª lû, úÖz|ž‡ÕõÒªU\ 'üÐZVÁÛ«êÒ‡Þñk?â÷#ÐÓŽÐ@Bî~ìï Dƒþ‹F¼R$ì‘¢Ñ)ØÆv“Ä:AR'$ÖH´ÛóáŒ>Æ´×:Ø_­àÑø¾‚`´9‡Ä¢6‰q6Ciu¹¢v¢ÁQÚÀÙ œÉÒÈ,cÉh*{Å8 ¤Üv9¡e–?žH—‰¤;¡¦¿J8x Kî&Pm Âgxê«è‹ƒ+¢Ñ¨ŠF%)b§ÜyµW9–>¸á€Ü‹°Ûmp8c/ºè¢’'Ÿ|²_Ý8&`;¥HÔç…±¤4QZA~R @õv"ÐÝÑÏ€_±÷V§½|´ä‹Ð© [>~*'F~øº÷ÁßÕ_g[8ìKbÔÏ¢¢[ŠF>#Qú LÚB\t ÏG·öýûY͵¾jÄ—*ÈÛð1ý*+- ‡!¿<™íuSjÌÕµ[Ù8ÎVto²Í&ƒ±¼ÄÅžþT Êý§¸h'úš©…Cí¨ÀÑõDô4S—ò#Vˆ(*IbÜH¤¦ˆ›Í‚ÇÒõ‡±ôDéÛ͋ÅZ-Šb€4xëvR4ðÀXRªº tùcßbßvnY$ô…ÇÞû²ö‰s?Lfq–ÃÝÚo÷>ø:Û#aσ KŒµ±hôUˆÑw â#wQ×N½%ÂöDD8îB“S0š˜ÝJý/qï¯×c‘/þIàK"z 55fx`…Ùʦ/™É—UÏ,¶œÁÒDÇq±ˆ>XìÎA8x˜ AŒ%1àGÃÁ0 ‡"LCLŒúÄp¨¯äøs÷FB¾)*î˜Ô‚0í L´ìŒ—wÇñOíðPn(Y0§Ô<¶é8²XOoXB ;52’ˆ©½ ÉXX{ê*kë‹Í~äF¬¬^½:|úé§èv{ÄÊÊj^;’èYð¡Þ”{EEE‡Ãq„^Go„úº‹¡ …7[Ò‚}rò‡zèn÷Kû5{ôQÝõ»_¸c3€fåµàüöM3Àø³l啨š6 –âR> KL’ÿMOçÀ˜™1ÉÌDb8„h(€¨waïÀœˆw`i¸¿§_ ùz£¡`—±;Ðî˜ûÍOÄ+$iA oØø^o®í{ÁøÇCDÏøsÑüåvûÄKÈh> 0[NwÒGû&¯9¸À¿Ù•‡#V  íèïïÝ%Iâ8.D$_k8ª#»a³Ùa³ÙÆ_rÉ%Žßýîwuû [-IÒO|{,Å “Í‚šü0°s3“$©Õã-?ä/³ìŸbùÌùEä_¾îŽ%ÞŽV²””)¸Aê¿L¹-’ǃ7YÀÍ0Ú‹a „1V!¼Ÿ{RÔçAÄç93âéëxÚ£¾-ö¦“Þ½ÞõĤ/_¾ß6˜ \\Âz‰è9«+Ïû‘™3WŸÄ .ðM6­ aòN pÄÍCA†ˆh¯ÏçÛæñxÇ'&méYðXZ:ñ!K\Àn·Ád2»xžàsuûzþúÐÞ’Óôš·m×Òâ†IMòñ ÐÕb ‡Ùëͺoó9X`ÍÍRÕùן ÓñÅÇçøºöqu³’Xu‰4K%¿iNæQd ðf8“&§ Œ1cN1p†ú»§†ºO õu´DÝýŸóÎ’,“æ¼ mÚ {ÙÚµºRZ«b?šˆX`ñ¯þZ¿â~KÈ9…û6€S˜­S¨ ¥Ä¹s8aD @GGG[MMÝV¯×}bQQjÖ¦¶ÔDj QÞjµÁb1— ‚ )1pŠø½§„ºa*©H#?пc3cë²8ø'‡Þûþð € œËoZãíh}pÛ«ÿ°×ÏY(Ø*ªc1ÄÈòôI¯)ŠÆ…1pF3,µ0—WsRtʸˆ§o\ÄÝ»42е/ìîÿÄÔ·o­yÜÌ7 µ„й]lãÆAOÒÙ³ú‡/x¡â’{œYƾ àë4o ²üäÒˆ}Ö®]éííþOggW§$IHhuîOû mÍ€xž‡ÃQTÆkÔkã@(ø¿ êó´íÖ$Ä熯«5ÊÀ~'ݰBßówýA„8?ð~Üòö¿B›Ö#á&§=0DˆTOöˆ­ÜuHdNm)çê8^€±¸ Öºñ(ž:·ªdúü%eGkåñg¾àœ¿ä‰âÒÉ?0ÕO™NcÇê/Í–]¿»ÁÓñä­Ït=ýãSÂF© ô8b‚ž°ŒÏ õ‡y©ZƒA4ýoWWÇ»==ݧWT¸äHÝÏÏPÖ¡åEÛ,Ë4½ö±— 9—ßôœ¿³íJiÒBbî{‚ ý;·€1¸9AH{àg¸Àý½›é¢U ‹zûïìܸþ"W‡£¶éN0[ / m8@*€¥ß’ƒz[&‰™<‚µ‚ÅV^SdZªÆ- ×O<7ضcµ©jü?Âðîdûö YDžhîðtüƒÒ7sd˜Í ÑÍ=ÏÞ½w¨õJPžN`Î>ûì ¦OŸùдi‡q‰7Þ ñd|BÊíäŠ'é0¨òmm­øðÃÿ®éîî>õÑGÕ¼MTvæM‡K·Á^U/”>+yÜHÀ‹½ï½"AÂ}Ïßñ“ƒÓ[û‡¢S¯ZÆóü/MVGmÍœãL–òªxä_$ùIu·@Jy`ªüòý‰üŒIʲªºû¤HwÂý]_†:öüÉýñ› ‹»XWWZPv4bD‡Ão÷ôt~Ø×ןÁßß်|,Íf³Ál6— ‚Р׾žîúœÍÞŽ½ðìÝ//¡{ó‰ˆ G ˆ~8p¿ø«¿3Q\ôô½¾ûÿxÝ»¶Æ÷h Ò\~(·“yµökäÕ¨‹ŒN¬c&M,š2û6×7/þgå1Ëo2ÕO™Neeyÿ8ïþbTÀ /¼°£³³ã_íØ ý_õ'–ž)ºh0ËxžŸ©}SMwèŸ=_~†¶Þbm¾É‚½Ýà;žÕwh¾Ök¸¢ÿÅ_ít˜gD|϶­}³§{Óz,°šD\ä JšSêÿ5—ÑÕˆØíFÁá„¥zìëØ·T}ã¢W«O¸¸Ù>eÁtª­Õ}l{¤#¯ ªªÊVUU媫«+£Ø³œ‡_joo{³³³S7 7˜Uäudžçát:+ ìLícÍÍRßêŸ/%ƾòôm{Þcô>wûsžÃ{VßpÛ{¯Œø¼÷v¾vï¾õï0&êLæSÄû2Xz}†§Ê©<†´Dà­]5.sý„kËŽ=ó­ªg_EGÅ`¯©‘€¼‰TUUÙ|ðÁ‹ÆŒsK øbõêÕ7­Y³æ³­[·j¾îZ çœsÎy'N¾ëˆ#ލ1MøêâÊ´Ý»waÆ_÷ûý§Üwß}iOðt/ùηyƒ¡Ù^;v|õ¬…g4§á“rˆHò}™ò)cÊﲘ‚$A xõ¹ß ìÜð£ž5ùŒ1vÈçZ,ä…â]qÅGLš4éÁÚÚÚꆆ†Î=÷¼Ï=÷‚S&L˜ó8Îh4¾ÔÙ¹ï_­­­ìÀÄ *¯]§Óé„Õj­ãyþÈ¡õ@~càßO< /sïÚ¶nï»ÿ „=iGÆ@š_Óóää-事À™mJ*Z'/x½æüÛ®!*+"ÊènŒä…ÔÕÕ™çÌ™s¶ÕjåÀ`0¢¶¶¶ú¤“¾þÇë®»î{ãÇwåRÏ“O>ÙïõzŸmooýÄí¹î@¦á@,]k)ñÜ‚‚v»6›½’ã¸ÙCï…ü†ûÕ'ß–Â ¼í;_k{ï?îPÿ úÛOd>ÇC°:lgåõß»õ…Šã–WŽÈ ðz½¦¢¢¢“L&S’\Ç¡ªªÊ<{öì»o½õÖëÆŽ›ÓËÀ[ÝÝÝÛ±c{O8‚z¯Eäý[J<ö·¼¼¼Èd2?.*=¸_{f‹ä/öwíýû¾_ë õ©D`ŒFÉ`g±}Ý2íè5µçß6a¤ÿ^y!S¦L±™L¦F%!cWKyy9¦M›vÃ7ÞüƒÆÆÆêlu­^½Z ƒ¿éèhÿëöíÛѨ˜Õ‚ÇÒ²-%UyeNg)Ìfó„›o¾yÂþõF~Ãóî:)$^ãÛ×ú·}½ÖêëÒä=Óø–Üd:û2"S^å>âxÁ<•ŠËßsåý q¼C^À™gž9™ç!EB姢…#œqãu×]åÔ©S³ŠÀÓO?Ý~ÑÞÞöŸÝ»[¤l\o8 /ébR\\ “ÉìaÎè“|FÿÛì„ÐuÞ}»ÿÒ±öîP_×IªÉéDàC8Ó« ×<òÍÓ¨á‡a/DDÅÅ¥5D¤°þr‹ÌCee%Íš5óæË.»ìŠ\Dà‰'žØøÑں烶¶¶xª¾¥}r (++sr7b^+µ?è}eõ€1Èßämkùs纷»B}ZSÔÖ?G+ÎTÛzysQ"3c칺«5#‡Üy‡a/ÀqŒ KþħªªŠfÍšuóÅ_|ùäÉ“k²ÕûÛßþöÝ_íÙ³ks__ÏŒÐð"***x‹Å2sÕªUºÏŒ&ô|ð¬Û,oõµm{ºóã·;B}鮢?Õ^˜{µxÏ ‘¨“”a‡÷â¸k¬Ô+•¯È 8ŽÉîñj‘?ñÃÕÔÔp³gϹ墋.ºüÈ#¬ÍVsUUÕêþþ¾ß·´ìl÷û½P?s ûp@(ƒÅb©"¢%ûÝ%#]ïüÃãðÜæÙ½í÷]ÞÝv÷"Æz nX0˜üLwC7‰ˆüÿL¸úW¦ìÉäƒ$Eù„UÕ"¿Rµµµüœ9ón9묳®œ>}ºîš|ÐÜÜ,…B¡_÷õõ¾°cÇw8ѵàrhyÙâG¨¨¨,6 §¯ZµJùÊ›Q öÉ¿}>wï¾½[Ÿéùìýž¨ßK×Ê«±'ýwÐ"jyšíQþ'Çü Ëï7©‘Ƨgù•ÂÔÅPWWËÍ™3÷†•+W^ÕÔÔ4&Sý>ú¨_ÅŸ÷ôt½ÒÒ²=¹”ø‰@Q¾¼¼F£q,Ïó DßäŠW¬*-Yyë tòÕ KÊ6¾îEÄ}··eËs=?ôH²[´€¡»ö+. HdŠ $ÓïÕ~ÿÁIšWÈดuÕ¶üéC`̘znîܹ×-[¶ìê™3g6f:Æ<ÐF›»»»þ»kW‹(I"2Å´†ÚqåpÀápÀá(*åy~éì£|Gá’𪳨èÃò3o™,ßïþï«=·ÿ.ÏŽÏŸïÛôQ‰Ño“ˆ$™•ô÷µ|;ž7£¯ÈŸªO~žKù€¼Žcœù3 Ô×áæÎ÷Ã3Î8ãsæÌ—é8÷ÝwßçÁ`ð'ûöµ½·cǶH$Õðô‡zqµWP^^n6'Ýyçe¢òŽå?žÀálN0.ñXë\~ãEò<þO^Þè¹Û½í³ÿØúI”É„8ô KßLão–:˜Î°A»ì·ê¿ûà\õòù €ËÕò«…ÆŒÃÍ;÷ê¥K—þ`Þ¼y'âÜ{ï½o…B¡kºº:ßܾ}k0Ž-)w`†±í²²rFÏó' >Ê ðRÔ @*®©Ç„–òÖòj+#_ÙÓÓ³fûö­Þ@ÀLÃT;)ÃŒFŠ‹KŠA¸`ÕªUùðˆùÀ$IEf œ@åc§xÂÍÅË®=[ž×·áÍý­»î÷ìØøZ cÒý— Ô}žú²Ì‰Mõ0"–G+ %ò|7bÃþâcŒI­­»wF"áœ,¿ž0@CCÍ™ÓtÞYgu÷qÇwì¢E‹t×D¼ûî»·Òåýý}ÿÚ¾}ë€×ëK#²¶d›#Û®ªªâŒFãt»ÝþõÙ_Æ`(À$&Ib4–@„ªéMpT7š9žûUé©×-Ïøü·=»¿xijcãÖ¨?¶‚W H'm†€žÆ°-=†ª]^N™EuIZžñ„óÃ^à_ÿúWK$•cíÁ @MM-Ž:jÖ×W¬Xq¿Ýn_º`Á‹Þqo¿ýö=<Ï_îõzÿÑÒ²­×íŽ=Æši8kÀá(‚Ífs ‚péî®a‹gò$QŠFS‰D¨™õ5²”VI<=]|ÚŠ•“~ûKžŸÿγãs7£ªe^€Ê3PZíl1YžäÏ”5ÆP€ƒööv0jÍFp}aPZëòòrÌœyÔ‘Ë–-»¯±±ñœcŽ9Æ©wìæææî@ p¥ÏçûË®]-½½=Ø¿8’Û.W¥A„£~øá¦ÛcÃލ)Æ¢)"ÇúÔÍ9N0;Šj‰ñÏŸôÒD¶õå8à~Ƴóóçü{·3$ú[Óý×"mf"+†,½ ´ÊÄ•…Àލ»ì¾‰¹÷ÀðC^€Á`ˆúýþÝ’¤Gül°ƩOQQf̘ÙxÒI'Ý5yòäïžp º³ï¾ûnOOOÏÿ“{öìiïèè@¢-räz[0–7ö„ Åb)fŒ]v ûl8¢m‚`¢[LIGÁdAíìE&ƒÅvñÆGhÅ >Qηù6oë®ßywm~-Ü×)«1eú™,%øžA’øŠjy rÏ !>©QHßBW ä…ƒÁH ܉D4É,wÉ# ‹G1£lÑ¢ãÿßôéÓ¸dÉ’Ézmx衇BŒ±["‘Ðm;víÚ ‡Ãû "”—W˜ é?üðØ¯¬‡ Xs³†€$Fen{Ra,r¢òˆ9VÎh:Þá.>_^6¼å½ÝÛ>~Ä»ks‹ $‰˜ÑýO¤eëk¤Å´Z.é5$@`ó†ÐÃy!v»=â÷û“»åÏ, ƒÁ`À´iÓ,G}Ì5MMM7/Y²dÁ ™õ‘£¹¹YºõÖ[ï‰D"—¹ÝëvìØæKÄí8@¶á€ÓY AŠxž±æMyj§œÁQÛˆ¢ºq¥¼`ø‘ó5ÊËúB/»·|òßÞ­0Ù›žÒ¼¦¨?u À_šgÈ~@MBáuòúÁ®¼€–––p__ÏîH$%™åÖ7Wa@Ú>Žã0iÒ$~þüçŸpÂâ_2ÆÎ_¼x±î$[n¹e €e¡P𯭭{ºÚÛÛ ªV¼ÕÄÒ•b JKË,‚ œÿë_ÿzÄO "&ù˜QZU +?ŠLÅÎFIâV‘ì6)k]ëöu=çkÙôL°c¯Êú§×ƒ„Ð!yòŽQ²ujQÒñ䮂„±Uçßk;@ÝsБÀ“ÚÛÛU·³[~}ë¯# 444bþüóN<ñÄ{&Ož|Ë©§žz”^›®¿þú}~¿ÿ¢p8ÜÜÛÛ½c÷îá`0˜q8 í0”••ã¸2£Ñ8òc‹$™+sÿåš7šQ>µÉ*Xl‹mol[)/îßöážmŸ<áoÝöVÔÛ¥ ¶ôZŽ»†‰øjÁPŽÀ"stêúb />úè£ápXÒ"¿žW»0¤Ò‹‹‹ÑÔ4»|áÂc¯™5kÖÝßúÖ·Î:í´ÓZmjnn–®¿þúßXî÷û?ܽ{§·¯¯€öp a=äC0Lp:KÍÇ]õÔSOå´¶a¾‚1É@ŸŸ+,4$œ­²Eõª³ùË ç4Èëˆìذ®ãûZw´J‘ˆÒúËíyâHýÞ)3©SÞ„ÊS2 Fl“ËÛa@Þ@kkë€Ûíþb0wrežç1yòdnÁ‚£sÌq¿p¹\7žqÆSôÚvÍ5׬ç8î”h4údggG÷Þ½{¤H$ñVjµK”Ãòò ‚PÊ»á«ëÅCˆç §UÒj'~³xJÙ”™dqº&Áߤ 0&¤ÞW=Û×ßìØ‰½í)i”S¢¢¶â©qŠÒJƧڥö"ÔžÆ ‰,ã#çÃy#^¯××××ÿN Ð!yn–?wa\.æÏŸWôÑÇ\?yòä;Î8ãŒÓN>ùdÍ!®ºê*÷ÕW_}5À®ðù<ÛvíÚèîî‚(J²\J/@~Ñ ‚Ng©‰ã¸Kžzê©»p(“˜8>¥~É”î68ƒeS›ì‚­èö5_œ®¨gófOpûÖ|»·þ!Òߥé)§7¹•.D)¡µG£2E×ôóy#]]]¾;·¿í÷û³<7a@Ú>¥0Ä>&“ 3fÌ0Ο¿`Ùܹóïr¹\ׯ\¹²Q¯W\qÅjÆØI’îïïíÚ³gWØãPyêá@,­´´ ‚ Xxž¿í téAGìÞ>ÇñI+­$¨l|'𥢠E “ÆðfËe¥M+ŠåõÚ¾ØÕÿùۻ۶Ħ§†©¡ÒH›Ê“¾Oæ$(Û£€JLˆòö%£y#Œ1öòË/àõzû•„ÍÝòçÔ ¾¾ ÌŸ<þ‚ªªjîX¹rå)矾fô÷Š+®è¹üòËoEqq$~¥³³ÃÛÞ¾W …²6'Ï,™Æq<œÎR}ëüãÈ{‰ÈÞ:# \b &¤Ö_ ø°)d**=2dÏTW‰º? ìØôX¤·3Va2/B).j¤ ÝíWçÖ¨'y±Hà` §§ÇÝ××ûAj>€6ù‡. ™= »ÝY³š Ì_9}úŒ_8Ž»Î=÷ÜV¬X¡¹¼×å—_þée—]¶ÀEÁ`pk{{[°««bÜZi Š‹K`4y"ºó uëAC‰©ÏÄ10Žç’Ö7ÝkW˜e00&  ]›c¥ãkg(ÞÅöì øv¬ýg¨§õ )€‚¼­?S_ÃcH ‰Ž'!;DAœN§»³³ë]ŸÏ`pÏM²×Çq;l<.P6Ü‘W°qãÆðG­{Ãï÷3=²C†t·?ÛpÁjµâðçq_ûÚÑG45;jܸq–••Ý~饗ÎÒZkà¼óÎó]|ñÅ?ã8n¦$I÷ûý¾îŽŽöhGÇ>)×—•Ýî€Á`݃Ì/µË+ˆQ2\âxß×Á IDATzC ×3˜àhœTf*r.·ÎY¦ˆº3ÆDïî-ï„:÷®ƒ>ÙÈ,»¾õg²ç•ÀgŸ}ÜÒßß¿IkLÖªåÏ<\ˆ=Tt¤aÞ¼³Žüå—_N&¢3D1ú¶Çãf}}=èèhGbB˜[‚ÄX)H0ò&3”n¿r øÈˆJ<û˜‰%æÒŠÓÌ3OLë—`ÿ§ÁΖGE¿[Id… 7뵨%A‘1o@wEœáŠmÛ¶y[Zv¼;~üa—˜Í‰¡!}¼†ä>¢„@(ÓcÐ+§S[Ü}Õ;–ËåByy¹­½½ík;w¶Lëîî:媫®zçùÕ<ð@‡ºDss³àE/>óÌ36³Ù|8€é¦3Æ>_¾|ùsƒjà0†È$'ÇsFÞhÎHþ¤˜ÇþÄÉËc©¬ƒÙU7+ØÝ~:€{äõ³ÞíæŠqÏšËjÏ0˜,S‰8MAQ[yMë¯ëòk Á‡ÁõÊÄÒµÊé×'"BMM-*+«Š÷îݳpϞ݇÷ôôœ~íµ×þƒ1öŸûï¿“VçwžÀ‡ñψI¬„Œ&N0LJäOƒ'*á`¯Ÿ`õ´/µqìÿy?}ó3ù1B%|‹oÏ–_:l%¿ãí±i ‚kyƒ°þ©__¦L*xn·»£½½õ\®ÊïÚív\1²ê“\Ï+¬'¡_Žã8444¢ºº¦¬µu¶ÖYn·ç¢[n¹å½h4ú¢Íf{£¹¹9¨wžù†ŠoÝZðc"šÃ$ZÑ¿úg;åû‰‰%¼ÙjbIó ò+ÝöÑbsi%Ì®ú&ß¾–ã(€mÝ¢òú›ªÇýÛl¶,'(ãI‚'þjxY­¿¬®Ø0¢å«êÓ¯ùÀÎ;ûß|óÍÕýý}!íh=2ŒÝõö)ÝÑ\cò‹V¯œÁ`@cãXÌ›· hæÌ£f466^ZZZþˆ(²üøÇ?þÞM7Ý”ñÍEùçŠ[¬å8î{ÌIw¨óHŒ 6»%Á9ÑÕC9ùÓ‚¬®Z³µ¬öûôÅé/ììÙÛîß¼þިϒ»þj!I':RI®Ö ðùëɃ‹¼ô ¥¥eS{{ûš²²ò“Ífùôü”5Ö¶þZé™â™=‰Áx D±Aee¥àñx::ö5ìÛ·¯) \~Ûm·½EDk¼ÕÜÜÜ«Sé°Dñ™7œÌÿ'Áb³5ýunχoIÁ4×L0«£™g2ò)< òÇÒ¥•0–VÌô¶n› à_òã0Æ$*ªûØ6yæßy‹ã,p\šàh]æälýˆRA66mÚÔ¹iÓçÏ×ÕÕ\Y™0™ ©¿/žCS2×7aìv;ìöñhhh,íìì(íîîžìv»—G"áΟÿüçox•çù7nºé¦¾Œ>Ä(9ý†Ë9~a)­0Yp€>ù¡ÌCKE]¹¤âjjZÃÖ®(æií îÚü{ÞQ¾‚·ØI6êÿ›<”†8$)ËŸü¦øìéy¶Ù}»ô "o€1&N›6í3f¬s:³ †Ø$³”ÄÌäè‘u(eRûr=ð<êêTW׃Á@e__oeOOÏ$dz<vßu×]or÷ Ïóo]wÝuݺrA+VðÅ¡Ú;8ƒáŠâºqÖÚ¦cˆâ––ĘU‘ÁK©cB©`¶¨Hï*"*,rì»±¬ ¦ŠšÆ-{&Ø(?cL"GõÇæ±G¬áL–Å øoÆ´>Zg¨¶ú:Ö_bµJç òVâØ½aÆÇJK+©®®Ö™1—›W 7\\™¡z 1a0›Íq1¨1ƒÁо¾Þо¾¾Ã¼^ÏrƘûþûïÿ‚1ö.Çqÿ5~ÿûß?$Ñg×¢+ìEŽêG9£°¬bò‘V×´£RÖ L”˜$±¼Œ)\RíżŮ ¶bÜ­¨…Aå ;LeÕG8óQP À»¯/Ò³û Þ^´˜3ZÒEEøÓ#z i–?öáòwüä¹lܸ1Ÿ÷Da‹Åâ{â‰'6p÷)€Ç}‡7_vÙeuÍC…ãäïk„‡Œö¢‰5s7Û*ª•dñyÁ"! ,ºAQXŠV { g0¦%Ô°J2&<  ¡¸ æòêÛ?™ à´F{½ýwßcœÙþ¥e×úYdÞ†â“fýc F8”X½zµ8}úôw?|Ú?KJœ§9v068ËŸÝýÏ~— Û±¤0X­6Øl6à%I²øý>‹Ïç+ƒUáph1cŒq'Y,–ȳÏ>»‰ã¸õDô‰ ølùòåƒzx…­Æ=×fëÕ¶ÊÚꚦc£­H,Å• 3€Ð@$I ñŒ”@|µÁQRªpýµ¬~â{r(mòljHcyÍa6ט¯Ñ¢E°×_W¼?Œ1¡Êq«]vùÍ/ÔË ­íú§b4‰®gòö)ÿJ&;Ӝԕ/È{€7î}ç·s:K¿6~ü„ržO*7F¦¡CîžÄ.d*'/CD°Ùì°Ù À‡‡‡-¡Phn$™Å˜ÄI’D<Ï‹Ï?ÿü³Ñhô¦•+W¦MMVÃvâ%5E&î^ÁZ´¤tâôÒŠÃgˆGb> ËèĨ¯¯2°Y^Ñî˜"XíÉ…”dGÊÍOÖ—‹k’_á”Ã\=öøàGkþ `[ÚItîì—îGI0ÝžO¯O+. % )'%‘ogë£Íþl}8œ‘—Ô`Œ±¾¾¾w>ûì“_¶··±L“rÒ'þ@w_æO¦2Pcðå”e2•Ko¿Á`€Íf‡ÓYŠªªŒÓ ÔÕá\®J2›-€ A8"[¿:_°H„,N×iuóN(uÞÅ,¿Œ É63†`c¢ø{ôÑäЃ&íà̶ÞlcR2¯œ`J«Ï4ó¤“?–…7[a,¯ZƒAóíJŒ±Pÿ'ï<ÍÄÈ@&ÒË:3ƒëŸòLÀðÉ~]¸Ã#€>øÀÝÔÔô¼ËU5Çjµž^R’zßgæx´+äêÈrä¼ïÀx Zu%ʤÚÏqˆ8„BA€Z–2QrÚ £­Üp…ÉQò=[Mãa•3¿Æ¬v>d)^’ìíJ’2h2˜\‚ÙZ&Xl*+ìV?‘GFÈùSÛk±Ý\Ý8“ˆ^cŒ)ßÒ ðé]RÓâ'9^¸ 8鑯ëä¹$zN-ò¿$ý¯^æ F„ÀÚµk·¿ñÆk´´ìÚ …²Z\ “W08Ë»_î@y Ù<‰@À®®Q’¤=ÇÍ]¾|ùN­>tûí)EUæÇ­e®˧͞X3o1Ÿ nºÕ—À/Ie‚}݈|~£Š`±Ðƒ­¸ž·Ø“yåõÈ·•$WNc(ØæÍV˜Êj¦ vr‰Öy1ÆBbwë“L’â?0ÒêNz ²Cåú'ÿŠ‘{ièWëðÀˆñà8îà ÖÝm6›~1nÜø"ƒAд˜¹Ì L+‘åQ`­ú†Ç)ˆ‰„100ÀB¡ þ{W'GUç¿¿W}ÏtOÏ=™ÉL2ä2(—À‚áCVV”ìî9”à ®®~X\ü¬’4*ÄUwQù°¬PA#*qwe—¸ˆX/ räœI&“c&3Ó×t×oÿ讪÷êè™IB`ÒïûIOW½÷êUu¥¾ßßQ¯^ !~ à=ïÿû‡<{Zö¡X¢8~u$™þH]Ûì·¶,9%o©¼£„M°21+‹–5ܳ˜ß͇žû‘Ä¢hS{7U”¥$ ½}Õ·ÚHLd¹måC±8Âõ oNÓöù‹=?½ë¥Y×ßñ$Hü‰"".ÒÛ_׿²?Æ“\ù¦˜u¨8æ`Æ ¹3Î8ãáP(Tà¶yóæ×y“‚ÁO? Œ#) Gj C±8ƒGÍfJDtP±À×ýîÔ½óýoOÅ¢ŸŠµÍ>/½`ɬô¼·Œ°ë7ìO “ÆwoË— íÙp=@‰z—ÅšæuN6N^â;ëŽæ&¼CR©mEPˆŒdz±i°¯PÁs@„þÄr<¤—½·"דùH•ýÌs›6mÚöÙg‡ÈˆÑçz{‹;"0}Ë_]¦6GÀt¶;´1 åº2ñ‡‘ÉŒ‚þ9—Ë}íÚk¯v·n>ý’TV„¯Ž7¶_]ßÕ»´iñ;"‘†&³YNøUƒdý £Ã(ŒŒŒ›?—›Dc™žpªiA¸>-‘ ’O­æ«/%ÜTÂC *d5b‰dݼ%'ѯÙçÄ3³Ù¸ìCÇ.ù*ˆ’î°Æþ5²ÐØ®¿ê-˜¦¡àÍŒ7zê©k ƒ¢n™;·7j!oì@°0ê­JÓdd³YŒ"—ËNÑ8ÝFV_qÅ^wŸˆb§¾ç¬H¼áú†öÙ¤.í¨ïžò :&¬"3—wé7ŒîD±4&ÌʾLç‹XÂ!·Õ·Ô‡ºî¶úò²ÔÞ• H Ñ–î¥hm­ü§é~ü¾Ñø‚Õk\çXty×Rܯ¸þ?¿=ðÐÊ­Á'fæà˜xæ™gvŸqÆ÷‹f)›Íþõܹ½muu~ˆT÷ ŽÄ£ÀSÝn:áB¡ÇØØ(ÆÇÇ&LÓ,Q?€ï‹Å5+V¬Øé·‡ä).©?㲿Œ·t]R?{Þ’†KC¡D]™ò8%ʰÚ&³{g¡”Ï=1ºá~ÅÓ§[Oˆ¤[ÛaJÖ¿²¯òWñ}B¹‹üÌ #”LN$ Ì\êúÈí÷šl\çD Þä¢C|o þ‰_ß3Ç´À¦M›ú—-[vçû^=øÉÞÞãNikk‡3s÷¡<Ö{(۔낄aªá‚i–0::б±ÑR¡Ï3ó(€ÿB<˜J¥¿âŠ+<·À qò= ðåuís.OÌš{rjîâx´¹Ý—ø†}ѵ¨.”W&2cÈí£R锣žwrCËÂN2êR¹snâ{<«\ZVs²’€‘H-…È*O"º1pÏ-Ou¬Xý"ƒß¢loŸJ¢°"8„Ò1áþ5 °aÆáåË—ÿà¿Ø¸}ddø#Ç7yggW4‘¨C0Á`’az»·ó­!B.—C6›A&“ál6“eæ À¿3 ãÁb±ø“n¸!p΀Ԣe-qã¢DÛ쿨ëœ{fýœEéxÛl8yù(`—U^æ»Q®È `"—ÙÅfA¹ýfW8Õ´(”Hù¾¼L|Ùp[}yY ‰77.<{1€Wš™g­X½àÛýB Ï­A¥¯íhÕsA}Ï4Ô„ågŸG¡¯|O ŸÏòùl–ÙÌ3sÖ4Í!O !ž)•Jÿ{Ë-·¼6•ßC½ËbáhfIò”‹ßïì½(ÚÚyZ¼­»>ÖÜ!â—¡®Ë^€¤“`´ÿ5sbtøÙ±.þ¥R1ÿ¤–HsÇñF"©Z{Ç~D—Ö}â~ÙR—›Ê.z¥ #ÔŠbÑï= ¸ßd¾ØÎü[}úÅÿå²ÜýÀêû?Ô¤X¨Ü+~ÀË—]v٠Ø#„èM¥R'744,FãÝ‘H¸)O4Äãñ†h4*Âá„pvŠ;[ù–/¦B¡Àù|n4ŸÏgM³”aæ 33ó6¯Q¿b‡bëÄÄÄïW®\©<ÎZ Ô½¤),iì™wI¬}Îù±¶Ù'F[f‘dcY¥>Äg°å•T¾ÙEvb볕ÏÙC1;ŽìÀ¶ù±ñÚuJò1’ϵ‡êÓo±:)³nŸx•ä¾e>î¾ÝÎ-Rè€B¡f”o›TEœóëÆ94ÂŒ8$WÉï¬ï›áoLÖçLCM €ŒuëÖ¢<­ÔóþmùòåMBˆn!D35‡Ãá¶D"1?ÏB„+›‘`‚˜ˆ†Á•» ÅR©´ ÀN"ÚeF¿išýñx|`:D—ADŸ·d¶)¢'´¼í”Ëb­]çG[»z£Í0"1€ÊºXü•iä8e’`;ÁîÿøÀVF÷oŽóÄÏÝu¡xCw8Õ¼È~zÐîI"½_PÈn¯»¬¾åò;aAy{f‘–Àƒ–°eÍÊ\ë5_X àzßÌ¿´N&uÏÚ•3ö AЀµk×îà™ž»¯¯O¼ð ôÃþÐômöz,ˆF³¡9uKÏ;59÷-ií<7ÚÔÞnh!õÍD&»;`Q½wË*ö¿TÄøÀÖ½…‘}?ÿ¿Ÿ)³âRoo¬yÞYg‰ú°2oàÙúkWÚ7{…ÀïV âÀ !Œ¶€Ãö@ßoš¸¾ù>@‘ÈSís&A À4Qy—ßQµ-©Fsmèiî=mY¤yÖÙÑæÎw†ZÂáúTe”žßÛßÂÙ·Ü}½™ÁÖxfilD¥¥}KЋÌ`?òÃC›™Cë-Æ»£m³—… Jâoýår¯xîÈV¿ÒF^ff°aDÇ0é”êƒ÷}î—-WÝö2˜¸ÉoÇr&}&Oý] ZÞD "BCO: µDºç¾¥õô3ϤšN%›N %R1£.‰ÙsØâ¿Çêû{®¸¿ÒÐ/$°K쎡€Ìî­™Âþ=?Ë<ûïÛÝ[…›Ú—†ÛN…r¬¸íÞK{ªæö»‰ïŽõƒÂ.û2¡)Ï…H&Åßí&ET¶„ò¥¯Mµ¯™-o0ˆ(„dg:¥¦ôY—ŸoŸsލo83œL/2¢u$âu¡@T™‡íðÜMx_w?ä bÈíþ<$E;…‘}È íÚŒbf½ç÷t-jé8ýÂ÷„ë]OÿA^t‘^êߟøÖº¿Õ—=ë†ÝØ@ÿ”§êÚ;ûšÂüYfîvõ]*¯:°îöÑ©ö5Ó à(ƒˆBhi‰#+‘Y]Í­_wn(ÝvN¨.u–¯ëÑŒh¢â’—c{‹Ìvr*–Ê⻃k ¼ÏO’8™ŒïÚVÊïx|ü76»ëÂEt…ÛÞ-¢•IDä½ÈÖß)HîWæ";|¬¾+‰Áç¦ìðÚ•…¦+o½Ìwºò·üÁY}ë™ -¯#¨<€ Št:Љ‰Xú.lÿ³Oœ$ÉãE$r¼K,¡H„†ˆñ¯ÃÙâÍ÷TýÓÃk¿¸z:}ÌDh8 ²©Œò§)ÜxþÅsZ¯¸ùáXâ$„Ã'Špô2Âi2BåÑjFX²òp.rÉšà‰ñDÙv…Àåî³¾û´U~‡G í¡|Œc;_ïõáìs?ã9»´ÇOì¹4Tyû •ð°~„«Nùœ(ù÷¨@i¹Ò†@yö™°¶¬Y™kXÞw’…+©„'<|ìŒ÷¯-‡"x×»"³Þ5·ýª¾Â0æ± ùBóa„N$Ú! Qù¨ ÎñZy%©‡ÉE R¤†öqUxBåþýÜ'‹à7ôW–¹¡~d¶üw©ù±Ûú@]×ÂEFCËYjòO::áåBï(Aÿ9doÁåXu„—|À$Y»r?€còv_´L‚ÖëîHŠb±— £D½0ĨiÈÄ'¾à‹2áÊßä"¬ËªËí]ĶsiÒuÏ ÉÊK‘¸[ìöRLï^–ºžL¼ë²8{$׺µšÜ^ÝöâwræAoâê;£­Ýï£hìÇ~™ìV§’+Àì.÷#zк*`dû[öÏèWvMÔ´̸óИ_⋽Ŭ.ª‚g •C.c ¢JÏßP–•°ÁÉ4Èa|ê‰s–%;lŸ“âØ0²»·¯ÏíüwÞâ`ƒˆ¨þ¤K‹úôù†W&‡ôNó©¿üOöŸñA«ZDM 3DË=Öþ.¾Bh@»O¿ŸU^Eà³/wäerÈâM:£¼£ýTMSÜprµa¹=;FFÿø›û [7ûgÖÒÉ·½ý£F¼.¬’]&´ko²õ·×’;ES%~e f°I5•Å?\S¯›.¬ýÒO˜yCù~rå’3Ê`›žÒ€3çεk•[ñ¨m‘Ü}ÊeR¹¾œDó¶súó¾`“}–åu§Ì”ÊÔ~Ü/ýÌí@fç+÷‹ìÈ~O>5.>ç­¡úôÊ·þLéþ}ûïÛ]Çåd«ÒÎý:1ùÜÚuOößõñ߸S#5íÀD‰®Œ„ù)€æðµê’]^ó³îJ99V¬z¾ž€ÛÂ;~Çpm¸­¾êA8GÃ`isçOõ¬-‹c‘ÝùꌾøìÝùmÏû¿F¼±1_xâÇDLµþ¼àœ@«T¶þ¶uw–ý,¾³n‰så\±©­ÿ4QÓŒÿhÕ®Ry¿2”Ÿ·,eêÝ–ÈÚV±R𔩞<}û-û[y?«hYßàWx«^€deÍr½™Ï!¿këïG~·þK…í/üÁï¼5-}÷b£.ý+öWöaú{ÖËD«Z6Óï¸ãõñ^éï8øã£uÝ+¨y€ƒñE0Îx›gb9p‹TîGð)‹ØsA»]~7™ƒÜái¹ÿ¦ÓÖª3‹%äölß?¼ùÉÏeÓ±gü\@KK}tîâ# ³k_e’«¡€#X2yMµÎCz5  >˜™Í¯ÐÉ¿éC @Ö®úmIäOÌÇ-ÒʆÞ&1¬u2+¤Vb|ö.3ܤ۸sÞØ^&¾y¹.¿W)óêæ¾±þõüì.4 Œ%IDAT³¾OÔ5ŸðîÅF~”¨Fz«Ì?`˜ÌßÜu÷Íw• ᆀI0øàªÁý}þjbó,~í&¨B^ëݵ/vÏbêq¿ÿzP™jIK(Ü7–Ùú‡ë¼ø‹Ì\˜ätDBÍ]wa2‘'ûø‹‚+iú•»Ù¾ðÈžÙ™O¼îÿù5˜¨¯O4ý±´«@h Ì À‰÷•X^Žã]피`·Uú(WTÉ HõRžÀnîðSÉly᪽þ×Ï™wd«þv"ÑqMß5"ž¼4U»ÁÊ—SÊ®2Ÿœ”16…GÃçïXû©ªÇ«15h8¤¯üL£@ô6"º†Gì¤\ɽ©$ýd«÷´„AÞÆY¶ËÙ„™Û—ïÿý_ ®»çÌøMû7_zcc]ç¼ça“Ÿ!vøí¹¼Ü¢ÀVŽÏUg•+ü ±|÷{L½Ÿï„€Ã@Óo=^q'€s&5ó¯ øy•vrùNƒS¯Èe²˜&JùÜ@~çËË÷üôÏ0ó¤³ç‘èX±úËdˆ›§}’\J ®J×Ë¢á-'æ{çäÿJö9²ÐpÐ|UßEDø˜.!"á&·*Q}CØmËͤeEÖ1¹.ä~>úÚï®þÏûvð'ÎìºîŽEfÈx@dZ'&È -¼]æ'låW??¸æ–[§µo)A ÀDã•«æTú+´D­2¹ª„€Ûpçª ?/€ÍR‰'&nÛy××ï¶æ«eûݘuýêGºHI!LÉÂ{£· Èb ç8ÃÀ{îýÌýÓØ³Æ4 àu-ï‹´ÄźÀ™jrjüÙÊyVYu!°}E í4KÅ«v~ããÙw¾`t\ûe`zDýU”`²ë‰Ý¢ÀÞ0¡,¿5A¹wÍg^œÎñjLZ^g´_Ów‚ ãF"º zoHg<Ø¢0wßy±§"C¸Eþ[;¾:ý¬y÷ò¯Å ÉÂïÌŽñ·à½²ü³ÿì þ©!™ü»—ÿùã“&'5ZŽš?Ø—"#ô>A| ÎQ‹çV!àÍT¾ƒÜ}÷Ðߊ±Àê‰XîÎÝ«=cÞöá/}ž@Ÿ=ÔíËP¯/²;9Æ6b¾qÏŸýÙáíScªÐð€úúDËöÐÛ©d\Áç ¢ÔèïÀ+ð!>a‡=Æ„ÇòÙÜ£Cßþôa½Ð²mÅ—ç£d> jí`úðKþ©åw„/%E韶¬Y™;„i"´¼IÐrͪ.6Ž'ÆñBÐft€DŠ€$¥˜‘$"&`‚™±›ˆ‰épi}ÿÝ7ÑX¹õÚUp‘m_Kž{ýe‰Í»ÃEþ‡þWî=”ãÔ8âMUõ䤭ËeDà–  Ëeè©2HkÈXŒœuõ&mÝêÝ@}ÏžGœ|î°36ÖhØuLÄ¢à>¸iŒÍV&ÂÔÀD(T°â±g÷}õ_3¼€èÆŸü~jà£öâ6ˆpi]S×+áå²ÊljÞQ8øÔ·¯_¿å3ÐðÔþMž»ðh´û>0È4HOƒh­@®‹Êå!ˆxüDÙ¿rõÔÁõåZön  ?9º†ûèÜ=‰Ä¨W,?éomƒ°m°ißÀÕ ih¥PJZ‡›}jäåÍžÏö{ô Žý ŸÐeÖ³rÓW¦R™HC÷0¤9£CDiT‹%”GÒÚ—HûéÆÍ7ܼ}ɱc`´˜A ¹†ðgé‡ Î:h¤Š¯À Õ ´uu¬:}5Ó}Kǯd¿pÍ9(ÍbšÉN Â0M°«ÚUÈS¸}ÑÞj)Ojp4â“VhývÍm_^Dê¾–yaÓ‘¹üð¹ÀH«½ÿ=aŽi°.AHBš —0>Zô¢ ›—’Wz—k#ímV´³‘eÜŠ†ëˆ~{rWÿ-ô&3ŸÁ?kÒ`N<ÁMÂ4¡] ·âƒñЩ|:»!¾t ÄcB†°B!DîêD5¹7úÅ÷Þ4€zøú9­âR2.Mâ¢/è?“KîkêºÒgÁ†0„\àB ܵ gÏw‡¿ôâ+7¤º‘â`³Ùc-BšJ‘ÏÕ#Ò/Žd/f¿ë †tîrÊu)Úu˜r+àŒ l Ãg‚ »¹îÐåõ>7'À[CCji`º¾@2°ÅLÊt|QbâÌ–ZPž½¶~ç®;—ê¶BŠYI2¿sËn§S*¬¬äóq§P2ÝL†Çzö÷äömÚwÃL?$µy¶/9ºc 5ñ=ã³²’÷.‰þ¥e•nºê|–¼[\»&´ Þ67øH±¥ã©ü7béa+y±ð‹-Võõí"ú‘U¬¨õÚ¬À®õ‚ÞË™FzïÕtã~ã;zÒ{3?<ö/ok쩱k€¾ÔûõB¦øœ/hÂs]8•2J—R~Ñ—ÚùÄŠZßÌd€)eÏDK´R{¯’¢- ̽6¯[7—sЄ—4gÃZc0 `Ûh…îÄÓ?ûÓ¼Ñ:ö«Y+ !ÆÙó¤õ0Œ#´Ï@»tÕñOdгZ£ ¡šË?8/@{ccŒ¥f88{IÄ~ FÕþËÙûç(å'K¤BÒ–ý•Ò$tµ[T¥jÞµíÕØœM¿œÃv„1zŒª0TM€uÛþ˜,L„ ƒc<¿Û™*—§;$ˆ ýuÈäÊÌ Ð½¨ñŒáÒ\P¯=ì>>˜N÷&3ÀŠCýßÿÀö7‹é?j%«o‹£88*…%Þñ*•é6­5Tµ‚tÌþûõ6o(DE5µ<ÄýGZVƒéá²›Ýñ·K[Gò§{ž'³ƒcˆ.Œ¶ÔEë@dÁUU¢:^ _<ÂHk€‹*m]Ÿ{O€/.èìMŽl!ð5G‹&8cÅÊ¥—{‡ýC¥»•bx¾…ô¹ ¢ cS¹bÜ[Ðʃñ£Z*t0ÉF´RMN±.ÑZáÔ,ÅÍ?8ÔJy#®=ÝÊ™ÑF@Ì0ÄZ_8é·aríyð<é üÑÖKÛhP® ­„mÂ-K‰îœ¼2ü\yd„Ì%K?]ËWÍf4qräÌ?û¾Å-ë~°V$ ÍH Êuà9ÓcôÌyÄÚN’©Õ¾p<×…ç¹ RОƒá>þ¼“/zumm¿.î~âí›°›#Ý2ró'NÂsªP®;=ž;=ŠCà ízÐÞ¸°%Wž å:P®ƒñ IXõõ{`r9ù³û7¾–`žk9Ût ©Nô•Sév 2;Ñ0x n¹ fU×-{÷hdi;´Ö˜HŒòGž‰Îåô¦f¶m3ë3‰Cj¢ü,n›ãÂxk4¶hC|øìIfðv3„7UÆÄÅ$DÐ_*:‹Ðoj_Ão`.YðÌÁeß>ñ—äy0ãõ޵°y{v÷ÆgoÅÎû~œº† vu¼NW„`oŒíŠÎ+·ý8½]ùzqn‹ƒÆuîIEND®B`‚shutter-0.99.6/share/icons/hicolor/36x36/000077500000000000000000000000001476102223600177655ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/36x36/apps/000077500000000000000000000000001476102223600207305ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/36x36/apps/shutter.png000066400000000000000000000036361476102223600231440ustar00rootroot00000000000000‰PNG  IHDR$$ᘘsBIT|dˆ pHYsùù†tEXtSoftwarewww.inkscape.org›î<IDATX…í˜kl×Çÿ÷Þ™Ù‡íõzí]Z¯‰1Ô¶•¤BEjEZT)¥J•¤Vy¥Qí&²ú ¢T¡Èu ‰DQBJ%!D 4m¡MÓи Ti ­S«¡É¿°ï®ggæÞ{úÁ†$ˆ5넨ù¿tæ~™{Îoιsï™aD„’øÿàz} t3†Ó¦Î.kd"]ÁµQÁ¥ÞöÐ9"´XÙ­XÔUëö6qÁ¾ ðe*„ðn‚4#ú§‚î%…Ã#[WÿþCb¼Úmx‚=ÆÀ`j¼4u!"€05ê—ûÌ{è…¯©ë}~ ’Í‘ ž…àß`Œ1v `ïaDÿÑŒN@ëוÆñÁ3ÌЩS§]×M/^¼øüœµ»?#J#o0ÆÙ5 ÆÞ¹™(¢Aú9ö‰¾ÍËG ‰Qp†Nž|ce,V¾gllü!ÆØÚÇ÷oâ†ùÆH©”v²[²Éó»‡þh²à§RAzé¥?¬ª©™õ¼eY|ppàÞ÷JÍÜcŒ 0ƧÊÈÌøÁlò¿?´'(J£+ñ»•ç^òœÜ³#»Ö¿XÐM3´sçÎŠÆÆÆ§”Ò\)…l6›%eK¸a‚sÆ8Z»Ã‰GÔùc%µ;¹ø¢RƒëˆôWbm[v]œc?Bzºx7Ý++k:97¢J)(¥0:::Á„1K¸0•8û8éTdî'ü‘Ê¥ÂïgÂô›&¸1iBˆ¶XŸØË–tN›„iZ[[K_ÛU)„%&U\†ÜPÿ“Âà"2ÿÎ]V(–´ÀMÂ0Á§À¹0ÃX©ÖÞ7Psó§›ãÖU¥Š‹Cq0æpa@¦ÇÞéÞŠ†Û7qε´3ý*så¸ÌŒíÓ¹ìïÈsÿÒÜsbœƒqÆÅúòû›ý¾€._Nzžw F)Ã0âž“ëaœ!{ix›$³äížå}Ý¿üdÏÚ/Õårö9£(3ü—^–ãÃßÊ&ûæ‘òZã]Œ3O ³%_̼õlii]]]}{÷î?‹Å¾< ÄÁ9›ë9éÍ™Á³óÎ?õð.š|MO]§&ì=Ö¬ÙÏ +:W–Ú÷úË«àO¥ÜñÔ“g{†V`Þ,*Ê÷†¯}wwwq,ëhëééÉÖ×Ï?YRR5MZ«Ô[oý}þš5kòntµß~zA8ß/ÅwHdž—³!s6äDº×sœ•‰ßéÍ7÷†%K$A!Œ…ÕÕ5¯455UŽ^\ï8®­”‚išáººÛÚò9€\ºÿüè@b§3zñO¤  I#&šÁXWý÷vøf´}ûö1ÛÎ)åÕÕ5¿)-¤“ÉÁ¶=1¬”B üzWW—ÈçÔ*ªŒÇêlM öïVv&AZ´Hƒ45ŒÛöçftúôi™É¤ÿí8.´¦’x¼ö…êêÙ ´¥RW^±,«1 ®ÊçTsµŠJ‚åu 6dÏnÐRBk­H+0¢O͈ˆ(•Jp®ëBJÉËÊÊV64,xNJçÉäH»a©Íe-–Á-¿ò<˜E¡Ó {™+û´” ¥¦LŽÎ‰þý¶m+ÇqqÕãUU5OD£ÑmDlÝÑ£¿ÝrèСeWËW¿ö™Ï7ßuן—®å¹0Ãå­öà™Ús]%=h%!¥¼8c ööö¾¡¡ÁŽãÀuÝ÷ÀüÁ`ÑâÒÒðºh4vÐ ÖÍß°ocd~ÓQ.Ì2_0$¥“ƒtpÓw»å‹ÔH×9¤¥%=ÒÚ;“/î´çÊk¯u¯_´è³v(j·,_Ø4-0Æà8nFky†Hÿõ@Ï…¿œ1*W—|bîR 7=z„YÖ”cCK %=ˆpYÜÉNìÐR®Ðžs|ì›Îå‹YPûÑÒÒbÅãñX$© ¾Ão&úåuˬâÐr£8¼HXã\€´ò.÷¾¹´¨¦ö×FH+ -%<;Óqn[ûOÊWÿøuéz›®Üœ·§.¨A;îk¼[\òßa¦ýÍÂÍFeCƒ° ÚsAZƒqo|ì é÷ŤV!HZ)h%¡‰Œ^`KèÕÍrºX‘'!î}UñÉfLyBkR`BÒ˜¹ÐÉ‹COëœ "MiéÉ#@¯vL S0ÐXi²%’®ücìqDA¤¸2À€¤›¹|¢Ž¤Z 9¹ÒäÞ³qø™uyŠë5£&?¶ºó6p£…›Ö}Ü0rÃçF·†üþÀŽïþ£²õg§ZD:ɤzxøù ¿*8ÀLÞ­ª·DVõïéÈ@ùªÎІ q5~:¾¿ãÒLýÞ’/W`K:âʉúÌÁ-ÿ¢àô–Ý*}äþ~| t3ýWººuÙsIEND®B`‚shutter-0.99.6/share/icons/hicolor/48x48/000077500000000000000000000000001476102223600177735ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/48x48/apps/000077500000000000000000000000001476102223600207365ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/48x48/apps/shutter.png000066400000000000000000000053521476102223600231470ustar00rootroot00000000000000‰PNG  IHDR00Wù‡sBIT|dˆ pHYsLLi†½9tEXtSoftwarewww.inkscape.org›î< gIDAThí™{pÕÇ¿¿³»÷&÷‘÷bB 1 b)ªRZ+•ë¬bé XElR­Ô–¶N*¬(Š©ŒÖZµ X@AÞ" y@ž$éÍMî½{^ýcsC´gøÍœÙ{w÷|?¿ßžs~¿³¤µÆ·ÙØ…ÐS»p¡í"À…6ó›è$íÑ3ó ¦õ¥D¸š|­µ&]ÐH¹7%Þ{p_ÑmöÙ<›Î×4JÅÌÌà±ÉÀ½t=ˆNymTiÍpPký2Ä‚š÷=c?ç }Þªt´–4®œZ»cÐèСuÈÖ‹½í ••Œ‹|Ý­½þ eÍ+½Âc=1ÊB‡ð“_G¡OBh ­ÑBЛpðtâ^Ž@꽿÷{2swÁ0úZü—Þ"G7%4Ôf!ÙGÕOܼOw†äôvÎ "Ú¾}ç½RÚ#GŽ\1)™ ™eõêÐR½–â3Òêoª5TZþÇ;*uWOþ¦û:Î  ¸¸˜mÛ¶mqbbÜô–––ùÖ¥ß]<Ô;`Ø}Ä |  «x­!CÁ×eàÄâŠg~¾Ak­ §œ‹Œs(..vû£~Ü$)B¡Pb’³¦1Ó¢“Â™ãøŽA¬ÂÁƒ¢¡fΑ’뉈r~ñÜð¬Y‹kÎk숽­aù£­çpÖ Ù¨QW=îóù&I© ”B[[8@DŒÅÆÞÌ Ì0;šsN€ˆ4V.hÙûÞˆp}ÅáÜ™ÏÍïÿðÒ}ÌãÙaÖKÌ´þå²\•™?{º˜&–ç`ùòåy÷!¥$”’p" ¢à*¯éöôqD0:ޤo¯>4óèÇ+ ½©‰ôÝîÔÌ"Ã㿌™˜i9°–™@¦U˜æ?²š¦/µÎ@jjêS†Á¼Qï+%ZÓïg¸c\ŒˆB@ ;XqðA»¦âŸùß»ó­¸þƒ‹ÌXÛ°,–fšNFí–ÔpúܩÅ1½ðì³Ï^ãóÅß/¥Ó8çÞ¤þÌåvÄ3ZK<²¶nkÞ™2üêüÙù×.7 ËÕáõ€.¯1ÄÈ4~Ò*Yi¯$$$@QñN|>_‹ó§1ÃÈ`ˆÔW½®Ûø{‰‡¯ð¦õí×)ÜìâyÃt® gÌ9'"Ÿ4éññÝÑÕíYˆ1#OJ "c)£ÛíΑaûÒŒ1ˆP°¹µ®òw)ù—¿ìï›[ BmÚ4׉H{… ‡ËU8T­‰âX Ó•ÒÐèCŒ¹;Aˆ öº¶øýï"Ñ+íí¡º¨×¥T`,z4²ëÛøÆ„@suljfV¨îøJ­bêì`ðýcÛ7- ÕUm¯eŸ÷I½zD|Fß9†éÊQÂi;Ra7Ö•6}±ï]O“²F  ·û:"¢€ƧF&XÛ+ [3224cŒºB0fdë5Evî¯_ÝÃþÛÈÛk+ž¬©¨À¼®÷ÓôéŸøyj0)oðO•¶ Ù·?|¹ƒÚí``‡ÝÚ¼®bò¹zß¾‡Òïyrn RõgÒuÚ\ˆˆhË–-·5ª–,Y¶2;;{Šiš°, ¦i"5nÞüá çÅ¥“e\r|уïœîyy._˜”ù,­”!í@ÚHÛ†ÝÚ¼‹gU>?÷Ãî:ö´ƒxãÆyééé«·nݺd̘1Æ_š´u"à¬'%?¿àš¥í?xÀ©_Êžžöð‰ýÛ“v8üÕÿ ·ç 3.mCÎìÅÏ÷ @ çÉÉÉ÷=ñÄoWqΛkjê‡Ã‘®³Q||­¥¥Ý_E#Ç›>ûd†µµ@ëÎ@kí¤¯dLÏšQò@ªª7F"·N˜0a½Ëe¼U]]=5l«‰B$$ÄBOî.@BVÎLßtmëáÝ÷+Á•VÐ ÐP0¤ç÷`ÆŒp8áœCŽÄÄä±—]vù»–Å*jk«'´´4ïVJBk .Îßm"›œ7d’4] áúª´’ÐJ9M+@)@©ô”© ö@k-ƒÁàVÎ8çàœ#.Î?bذᤥeÜ]QQ~gccã’P¨½Éçó]ûæ›oŽè´‡LӊϾ´°¥ìó…"ÔV®”D'ˆv`Ú#hnnyÕ/ „BDîìììC‡[ ö44Ô …ÚV›¦ùý3ŠŸ8Ñ‘G —?!Ë—“{¸¶j¶BG“D%%”RÐLžq=#ÀÞ½»×ƒÁÖhœh8 ^¯/§ `Т¤¤¤ÒP(l655©¥K—fžê9¹SŸIXøÚ+}üÃo1¯R Ä&¦ÜUuäл¢½uµ’ZF#!ÁÃfÏÖ¨­Y³vEjjÚ]N­BœJËiè<áp[k$Âw*%>ÕZ¿<~üøOsg•\—•¿Ð˜Wþ5?î{Õuï“å6”P‚#P¾÷~a‡0oê&%lHΡ¸Íë_œç:“¶n%sìŸÛÜÜRÖÕû§Šç¦éöû|þÑ.Wìx[ˆùsþúTrÁ•k=i™ƒÛëjö¹<1Bƒ Ém(aC ÛðÃã/ÌÿHsûJ@J±¥;ÚºPTTT[Vvà–††º¶mwŒ…/ƒØ6G0Ølj:±¹¶¶æá_¾¶iò¼]áÛ ù³,¯´#ˆ[>ŽMϧ¤tR Ρ8Àr´ÖZJµX -”P˺£í¬¶UŠ‹‹Yl¬ï&¯×Óϲܩ–e¥XsK)ÊlÛþlÏñãÛþ^ãþAlbæm®øäëM7ÖÉ. 2ŽœØ±etÌ%Ù±| WꎂHIn¯/_x_F¿{滃’“‚^̬Zó§P¯üßÍDÔçÆû“))g˜wƒéñO4=þ¾ù~Gz "´×V¾¨ú|a|Þwv)¥:¬â&Å—•Ì $N),Ô’×·¬^Эt⬈ˆ'Ï¿Ãt[C ËÂL×òr˜é,FGÁB†ÆLáäöJòpÓîm#cÒûÜdúŸÔZŸ\¸¤„R"èV"¥¬dæiwáNeg·­2n¦K)>O èÌ:D @GÍ¡5´V e@3 ’@äDÍs± ueªo¿©Ò¶;òåL—RA)þvÙ¢Ùg-8Ë¢^¿]Q,|”b­JrHÁ¡„3¥à܆²mHnCÚ6"'j—•—Ìœ+ †N×Jv²K -¹Ý¤Txz0’&N1\®?3ÃLûjË:ê\ÅùŠÊ’úi)Ób½.—ë0€´“¸Z©ãJ«Éõ˺ŸÿÕÎù MӪ߼ÚÚÓG >FrþŒ´ùѨץm’¶ýHeRý4­‹#ýˆ´#i^·m(Û~%Ü.‡ôDÜ"-uñëÝá'Ë-ø7"&ÀpÀ¾f—ç½t“1÷dÃ]eÝój¡är!#þ²MT¡F…® }Í€}ŠÑ^í•LìhylaWï?ld.Ûô "ZÌ+ £aß i!¤˜Cø‰zz˜|ªñѾì+Ž3.@ÚݯÄhËZƒ™tXDÀ#$`ˆ`Þ¿@¡¬ Däa¤.ox¬äƒ¾à9£s@ö²×G[¬QCA(Úß*ÂwX8"0S„¦ð']SûúŠéŒe@êâ¶Ä”=à,7L–ýþßAÁŸÈŒÑ!RØ ¢B;—]}°¿¸ÎXXcbV1MËeÌ$oŠˆ>;-í¿U’ŒðDl'×h'q||ôþËš‹kH3€1ÆvíÚUj·Û/[¾|ù¬ªª*?dÝüô\=-ç-¦qŠz‡ ÿA2ÄŸ»eCêEõC6`C–åååú§ŸþuMrrò R ÏîÝ»üϾ÷wr]gAâ÷#fý0y"i(·«Š:Û7{vñŸˆHÎÓmH(//·]rÉ%â¯$Rðz½ñññ Ò®Yö#KLÂdpÆ"£9˜¯`ÙݹËÓx쮆Š{?¬^4ÿ¡ Z€ ØæÍ[ðf||â¥D¥>Ÿ¿³ººZ€%5û¦ë&ùÀ¸g ß¼îV_Ký#µ«×=Kô7#ùg·fÆdŽžË¢ì?$¯„ì )O”ï&¶¹6î«*ó;0sÀÖ­o?‘••u—¦iÐu 𦡭íÔç3fÌ˜Ê ¬£.[Vc‰OJG úaX0èðž¬Ûê>¶ÿަªÇ¥]¹¤ :óœÛ4Güµ`Ü¡¤I%%”PB@IqBJã“kî[;X•/¿üòÌsϰD)Δ2‰ùý~8ó&ÑíŽtö­éoŽwý×›k>x~¾/³2õ¤%é¶Áì ¼dŒñôôÌŒ1=˜úA7 ÖØìéšÍÎ5°€s®i8cè>¶¯ªæƒç祌œâÌ[|áë ã&­Ôcâb¸¦ƒë¸®ƒk¸ø|¯WƵ›S|-[YQù€9à®^ýü\‡#všIZ…"̃Ïgt€ãÈ1£ÏÃÑg B×á=oÔ½·m^ÖÔ+fÆŒûdtjf>)¥$ˆ1@Ц™U£€s#Tq>;)G«°p <œII΀HA©°)Ê `ÜÊ9D‹ƒ¼ûðß߬ûóÎë²~tÁUΠ^udåås݈¸nfˆ¦œƒ2‡s¦…¿/$.Ø‚¤ëÊo:cLž<ÙbµÚ΋$$¯” ΘΘI:Ø×r¼ÖÛpüæô©…EÎq“ž°9Sã#ÉÝLu:”dSØÁ9g`+’JÊãΈӧOÏŽŽÎ9}ìÝjÕ³æÌ™% á F‰sF„žÆÚ5zrb†sÌøbÒ²G„Ès ¤¤ß ÃíêÞIa+οéC*pBBþª¿\8X-ÁhD®ÑÑöôìììmmù@zz~cqÄëŒ1t5®nèð®ÌËù¡-.)ËUèkÃÝsÀïêØïwµ…¯§®«µ¹ §˜æ&=« Ýš—cµÇ¥2=:ºž Í’]ÎrÃäƒ"³% żØQµüØ÷*À—_袋%!"Hž1†¨(«>ztþĶƒ]ÛÚ[ŽZãÆ*ŸW¸OžxŽªÊüé·¬ZÝññѯÚ6-ßO…HÆ­OüwzþùOiœƒ¤ð)iøÈ݆۵ÏÛÚüISÃÞJúèívÆÏœÿàD²:fƒ³Ù ¸€N Q r>€²¾rp!´fͺ333ghš*€‚®ëª««Ko¹å¦§F.]³Õ9fâÏÚî}¿vÕ—~×w¦—;ìYiëÒ &_Îu‹E RP†é÷Â×ÞÚîïn¯î®O\õõkÛßy®< Ã=› ÿ\)ŒÏÚ_{øÙ¾òèW0Æ8™Ó<š›O¼8bDÚ Îy¯è‡‚Ýn ~W÷oÛíMñ¹:ÿiTNV•u¸*ç—ÏÜŸ2vB©%61)´¼j:¬ I‰ZLÜL%Œ™QI¥£n_ý;ÑÐðhûï;ീ÷Ëúœ;v|üS§3îžÝ»w—Ì›7¯¡¨¨H¿öÚ’²²²/>=ú𦡱ñÄgW^yÅtœÖÔê«eÎ_ñç˜sWG§fæ+a@”0 „?t- Òën”®ŽyµK?È}ú¼ ÄÆÆ\ìpÄ^\XXøáÚµkó·oß.êëkK;;;êO_•"$&&MZ½zõ… ëý~ûþ=ÿÕÓXsÐÔÐôÓãÅtK:‹ß6rÉ‹×ä>}@¿!„€Ý3î¼óÎ{¿¢¢bÚC=´»¶¶niO»»÷’¨`³EéII)Å4·Ñ~¸ú:oKãQP°ñi¶ÄÂ×A½¶èé¼þޣϸÝî)%"äLž<å­uëÖ]zï½K«jkkwvvž8½0r8b.®¨¨°ô¤\~olRfî{–ÄœYû>+ñ»ÚA&a‚ %E / "88c}žü‚Ög¼^»¦6›-e„‰¯WVV^[ZºdC}}ÍU­­-{#‡‚Ó™4Án½­¿ €EuS´3™;sóïT1qzבý+!@ŠE ”ݤÌl StIî‚r[îÓgzzÜB˜ä¥B"***vâÄÂÊÍ›7¯ª¯¯ßêTËìÆÆÛ…PŠÀG\\ÜõÉ‹W(FJE;SSâ²òVu6Õmò6Õn §qRAHEyõ¨éß‹uuǾðû}$„è%‚Å¢ÛòóP:gοfµZgµ¶žœÛÔÔøœËe‰ÄÄ„B§ÓYÚ_NtùIE¤$âsFOqŽ>÷‘κ/î–ž®R !e‚9GH…Qß‹¥¥¥G;;;÷ç3‚bH8Î1……“Öçää¼ÑØØ°®££í‚ÖÖæõç¤Ýsúvì¶èf"%•’f6Ù3Fý\dxšjTR —Š@JAÿ> "årum Ïáù x 99£æLž<å•Â]x¼»Ûuaø_BëÆsßãq$jV›Ó$+ëL²¥¹µ¾ò7/®öÿ1‰Kô~UP„~)ЯÝà¡C^t»=žp„‡B¤0ÑÑöøqãÆÝ>eÊÔϕ‹mmmÑñÿìû“æÜ7ê®—¶Äeåm´;3Æò([ ‰P¶ÔŒ«g^åð5Õ,%aH“¸ì5˜’µýáÔï½ÀÆ›*322OsX°Ëho›ï÷~:;;[ Ãÿ•”â Rj¿⫯e¥—”OȽÖ9®pZó»Öø›k?M™:«’”„Ù4›¢ªïª«|àɬEÏlaºå2% ¡|†Hq½ZÖÚW>ýîìÝ{°¼­­íhdÄ{gÂ7ß“R!666ÅéL¾(55íiiO&'§ToÙ²å>ÈžÿÐÏS &½•8vâ4éóÀÛÞúŽÏ0K_3úA·&¤^ÃcÌãù-I’ÊHI”5ý!? }´¬îàÁ¯æwuu»¾)Bï¡!|íñxÅ©S­»\®®‹*ß}5oÉ3¯¤NúÑ+öÔÌé¬zø½`”Œ1æ¼æ;5Í:‘[µ‚´ø)ã¹n‰æš¦k`šâšy¶€‘Y·‡ÚÜ¡†&àm:þÞ‰M+·d,(/Óâ¥0Båm¨ä•¢‡ÄÇA íWÔè×Ú?dŒ¸~©Ýç“w‚‹,×9 À.ª~§:šfîÚÌy2 _OcÍJLI\(…à·—æPhm8™¶s0¸#mP4mx¼ÇùŸ¿šK\m&&Ç‘d *P q*@„i¦Ä#ÒŸs€_Ó±7?¶=Û;ºå'*}Dn})°Ü©‡©êª!{`bÐʶ½ñðžÙ=‰¤zFIIJ³EÄú-ÂË™ˆ¸6 ø;š7Õ­¹%cÅ¢cW(!Ì.p°Ü{)üÉ—J4Ùý#’g…뫞ôœzµü&èÇJˆCJHPd'Doâ÷÷t@ÝX n¬P7Ö¨“Ïuº³þ‹wZB’06Œœ€„‘‹„D š©ÕÄ©ºÎ§œ¤õó”Þ,¿o#éÁwF(ÆÔ–ÝxøÛÖñœê·|W?4¨{q(Fˆ žA,œ(ŸXRÑzS'Ha×ÒetŠß"ÁÿnPØîÊ5ÅžžÔóœÜÅûݳm3c¦¡0:”XPáSÝIµ @ P@ÀL·¯º¶êLêzV…û$"{Þù›õw2ƒyFÜ Aï”1¶sÆ8GëÂH w`?@ w*K®iéÍ6œ5@{öìùÑGŸ¬R”`ÌÒÏ;ç<2ÜØ¿p%c 4å认»W "¦ÝÁH Uq%¸…|Í›«~{Ûñ³Õ€³èÕW_˜Ÿ_ðRR’%³¹YÝ{M²¥ß+M)±Ê‰ëƒâ\M3ª"ÞWD{ë³'>Úñ*íÝ«žºw¶^ôâ‹/þ°°pÐNƒÁ&¢(­úµÌi¿p¥L¼ò*d¬“r®s'‹€"µ½i¨þIJ“ëïþ§v}~oWû­Wmß^þ³¡C?g0ÈÉDD@± h¶lIIþ”.U ú¼µAOUÙ©?¾üG¢½*"bVñ‡É>p3Y.âœBH¼^ ñ/=®Öש¤Dt]³Ä­×nó6l7jÔè˜Íf‹$1$ $I‚'ª~wùåÓ#"Ë[´á]c¶k|¸ïÃÑ•UPƒJ°æÄÖöã‡îoüË:7âXCîœ+nHsÜÎ I ΄ ‚s ÎApõ ÁÅš:–º¥7ã±^‰æýë_§äçneÙB$@ 'Á ß `½ð’ )%u2ȰH.ż–€BþŽö#Î?ñ‡sÿ²ÎíºqÙO-¾õƒ”¼Û©öI’ÑÈP’€I “ß—™4„1Üèà-{³¹6§7ÚÐK€¦L™ú€Õj=_ ‘'‚`0è0»F•“R’2@ÔàtN"Øák=üÁíîÍ÷oÂÁWšònYùhÚ°‹Ê öœó™,“dˆÀ‰ÉQb1 Ø$Dþaæ/WŽë¶1 %K–ôOO·Ï#Šª&VA>ŸÏ ¥eŒb²±“zÂ9J í^oÅ{ k·–nr^}ûð?¹òuÛ°q‹%s²‘I20Y‡#2)¢<Œ‚‰M.Ònûœ•ÃÏ9 áÃGÝi6›­BDU£¹™*Èlqt¥Æ¨Þ¶¶Cï,ro]¹)wö½ól£ðºµpÄTf0‚¦)’â”çžá„‘ÜÆ_˺y…óœ*((0Ûl¶›¢ª‰‚ÑA€€ŒŒ!tîƒx‡××RñöR÷¶²§]sJ—f?ù±äÜ<“4—Ò²Xå|M1ñ) óˆŒ[Ï âââa‹Å¡Ãˆw3 ”ÑhÌ@Æ ˆÚøõ~ÚŽ}ºÍó\Ù眕³³FŽ_a¶ÙMQ0±ýŒÞ1 ÐÁ `áÐE;ž–qÓ}?9'€ìvûE’$A¬‚¢n¦½–$C:©j0ªMIíÕG?ö»?[æøï”9ttYRV®Mïo"²® rW®É€é?F `kðÒÒ„Æ|g4P4ÍYºjE¸B±Ç²,e„¼ÞwE(x‡lN`Š·Åï;U¹JJ,R¿K0È¥ø¼à?í© y[¾Rý_‘jRC¡fð6‘¢Öƒƒ9)¦L”¤LB9 QÊ&‰eJý™1 #ã+,Jw¨·ÀºïP[[[µ " «Aˆ((“É4@io~=ØÒPcÈÍÏdÐ~òøº?¯zÁqóÊ󿿦úÝ7öZ›Þ ÖW¿Ñú·MÚl€sþÿ®0¦;F’ʉPЯòOmo©ñÕU?מ8Bååq¬ÁzÉ4ëÀ¢é(§\’t9 ºµÁ'j!ËXZº¾§£í3ÔÚÚ|8‚ÅbŽùÕ400„ää”Ásçε¶¼òtó€Eë²\Å×´5ÿ  në}ŸÀô®¾Ÿˆ(Ѻ鹣'LEI¡ª ¸ BQ Øv:8]w¸àößœ{ã´»¿Ø]óôýåD´™ó–Õc¤ÿ"ÄŸÂ8b˜r¤c(ùÎ}þùç‡ŠŠ†ìׯÿ…ñn†‘c«ÕêÌÏÏ û•ÿ|Š÷Ôñ럽÷ÿ¾MUîúË…òõÙç]x½1%Õ‚‚J ŒÖt£lIÍUu´P•9ÖA£Tûè©ÿrÍ.ù@ñÖš w€ƒ°*gvivàíuI_ö´=xâ‰\Dd¯½öZ°¦¦æ‰P(×9dž&“ ²²—`mëbϧïn µ´.û¶åQyI¨ú‰;Y{pß2_Mõ©øFm A6[d“=w|JÁy OûdÀü‡Šõïðl)©oÞ±rí-éñI‚ÕuëÖ¥O›6­¶±±ñ™I“&-$"^ZZ*ÛíŽ=………ScƒÔØãÊÊãoΚ5sZO+×Ù2gÝsQfÁ°õ©ÃÎ\¡*šÛ© U®ÆœSB¤ú½gMK?<ƒàµG 4hÐ8ƒÁ`ÊÉqÞ¶oß¾­‹/¶”””¨õõ5 NƱÇöñk×®œh%ukÜ^öÏÓÿºÞ{âèg@áIyÒ׿:"2£åŽ‹ø+––&<œéÑC!áWUBÈÍÍuÕUWï*--µ=øàƒ‡ª««—´··µvnX­Ö”Ì̬¹‰V2Î’LÞæ#ŸÎòÕTÕWÄ"+YɈ¼¦¹êíw&Z\ut´…BÀ9Uåàr¹®˜pòäK^Ù¸q㪷Þz«€~ävW? ‚úZF†}ÂŽ;®O¤¢*'öac&÷+½¶±úýåÁÖ†c  ¡«'ü:¢&1>‘2{ˆˆx{{û>ÎÕ°‹©«¦¤$Kò˜1®˜3gîºñsæÌ™YWW;»¡¡áÁ`P1 ¦äää„UİC" Á%éƒGÞl1e¹:N[Ε ! šÂê‰Ðæ„ÊìéêëÞè¬U‚""8°pÊ„ “voÙòÜón·ûØu×]{iCCïššN¿'Iò¨^xal"•%•1 ’ˆs .Àšžšä° öÏ«_ 5ÖlŽÀˆË£±‡Ÿ¾ærå¶%''§Dײ:¯L˜ÍfSQQÑ §ÓyÅ–-[^nllÜž’’2%==}€Ïç;Õ“2í³îí¯ ÁŸœ™U$Í’¶¢¡%KNÞOíŠK›Ü—gX¦^ÆdC~DE±8%4X챂֮][ïñxží¬¢x—S#׬Vkê!E7;þe»=󽎎Ž_y½ÞÂo[žkþÚ[çyÛjµÞ.LCP’¸´ç`Lµg'\ÐöòŸ•–Ó ."ðâ\ŽøW=m+@‚Áêáß=–™™9×b±$Ū¦«\W–,Ë’Óéº.ðzÛçíÚõâ—œó¯Eý’1ø[CCÃû . êeàŒ’Ë6vsÔE·HfKjkÕÑ/ æäQšz4úš˜%ËuޏtµC2n—¦\µŠú{¢‰*ikBCðÕ«W«¬¬|4R «;ZlÒΩ‘œsIIIV‡#ç‚ÜÜ~Å ¸Çápí4hðç/½ôÒ|€ŒÎH5±¼ßE—ÞiJËHm¯=yJùÊý23"¬MA*¡‚lÍÈw]8åFÏ'¯û„x†„!´~*ª õãï ÀÎÏ?XYY¹³3žSU€¯AQ”uuu[]3ïš™=îÇoæŒ|-J²ÄU‚mÍŸ5¼Õà7¤ØFjÁi8qMEB0Xm„·e=q®ç$ÍÕ‚jˆ½H;žÚ»w¯º`Á‚ùŠ¢Hyyy?3Œìë®õ͹‚ÚÚZ©ªò&cì‘›ÿžj-¶9ûâé?5$§ç€À ØrúcûUYÈ©éc„ªD;߈« `†¤ ‘Q•sþ£/’Å$xxžœïj-/múN<õÔS͈XüÀ\—››·<=Ý6Êl¶ÈŒÅßÑ‚Á€ÒÑÑq‚så8碒sõ`[[Û¶•»?œšW´8küô›,™9N@BU"û„‚ÍõÞ`«çyknþ5À\¿C…;e0ϳN»&Nƒ"ž¤S¸âB}:Ñ6öÚæ…3fm6[¾ËÕ¢Õj"Ë’ ‘1D$E Vùýþ½™™™GæÍ›§¤M¼"#mØÄë ¶¬Ÿ™3SeKŠ)v GßÔÐôÙûÛ«ÖÿÏM—üñ€Á–=ô¸KÄ«ˆT|žã…ž-++²g¯:Ä…:‚8¯lÞ±j %ØÐ^ÛþR^^€/Âék†ˆ†þ7ÜsYÙ¡?\ï˜:ëj)Éj×WGW‰ mMKßXjkjóWU>lŸ~óPÉl/T f:¥3$Éb3éå©‚? œ¯ãª¸'Q8gi‡YÎìeÉ gŒ00y$ØdòˆüEO g†¤&Ë’‚s`@ ˆ"p1Ý+ÔqêøÎº¿>õiþ­eËQ"UѶôêÓ(aWBqÌœÂõ:$‡ZŸõ‘¹¢ugÙþ3iK¯¸––²Œ£¼%Ã(&I#˜,2Ib³B»ñ ÓnŒ˜Å@}EAmokõ¼¿g\Ûß7°ð±7ää´KõÍázø1*Bœ<ùØ‚¼3nL'ë¥Wø­‚É·1äY„$"0ä@ˆ @O`D …•V®  €@݉M­»7}霙3–)\U!<·™Â€˜Î½Ômél½²?¨©üáVäâçBð:"2Â¥ð8%vÔ«]Ôh×(ÀÓïÁÆÚÕýs"¢lw”!¤¸ñOd9ö+"¸¾7ÚÒÙzíy±¦eû9Ê#„àå‘ñ‰àḉƒÑðשDŽU_›Û_uìfúðå×/J/Iþ±P\‰{_Ü1WxÖ-ý¬·ÚkgåQû¬’ëQ–žd’¹S1)¶Ï‘€±˜á ÄÕÊPsÍuîgJþ…ˆ˜û«ß¾È.Ž|1Qx‚>ÎÅþàÙ¸ü7½Þˆ°µg57¬ppfºeéVƤLdLë¨õ]aú–}7‰·;Z믫ßTâȽõÑk )><ˆ<ƒA@D _Tÿô=Ož•„í¬?Ì2øŽÇMÍ­-ÅŒ¦!à Œ±!È$DÆ$ !²W¥Í5ö†¿R‰¶ò‰¥¥rvµ±‡Ä›®: BÜZ¿õ¾3º…ûΟöÉš»ÆjR¹1(K¡FÙèjËnæÍÞ†ˆOi5 ©µzÖ“€ÒÓnñ§D–‘±sþ@]gÃ¥F›Ì« C[x¼‚ý“ oRyIè;­Ï÷ €­øî[XCz§içê÷Î$T8Sû^ú>YßsóÝX n¬P7Ö¨ëÔõêÆúuc}€º±vüCH‡¹IEND®B`‚shutter-0.99.6/share/icons/hicolor/96x96/000077500000000000000000000000001476102223600200015ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/96x96/apps/000077500000000000000000000000001476102223600207445ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/96x96/apps/shutter.png000066400000000000000000000156651476102223600231650ustar00rootroot00000000000000‰PNG  IHDR``â˜w8sBIT|dˆ pHYs˜˜6ÓGßtEXtSoftwarewww.inkscape.org›î<2IDATxœí]y|U¶>çV¯élîÎJH„Ev ˆa2(Ž‚‚À(ˆƒ³8 £‚2™ ‚€¸€‚è¼aSTÆ—q*èFÐÊ–@HÒÙ“ÎÒ[Õ=ïîê®î$¦C㼜•º}««úÖ÷sî½ç. A§„OX¸ ðÿ]: ³tfé$ ÌÒI@˜¥“€0K'a–NÂ,„Y: ³tfQ…»-I˶X¸[èÁ€iý¹¢ç„‘(Õ¸Eõ¹êõ³lá(þ§ãºåoÕÙ›Ø8DÖ8ôÄÞÔŒ—øˆz8@çˆè |# Û_²zöXìŸ?ÉîÈB»qÄ€çÏå‹ ò®$€ýˆô¹…·­OÍ<ÛÞ2+ågI@ÚÒF7A.!Ü…Û¼­|¥ïO`v.äû‡DÀæ²úæÝ´ù÷O(~`n¤,}u¬3 êz€c+A­€î½ ÿQZ÷šâ.¢"Ž0ÑúĬï.£ø-Ëös! ñO; jµæeº] 4yô.ŵ4òH¢–¤Q"S²jú7—ó.JùY´‚,îŽÒi4à(¿»Ah·ÐøÖ˜ Å%T‚žkH€€^¬Éc]iràçÈ¥Êö¼ÛUO@ÖÂÕ:‹ñ#@–íÁ}¨Ö·Þ«AŸÛ”€Ë>àPñÙŸvÒQv€¸´Çívn];§©]/?*b yÈ0;XãQ‰¾2_yóEÉ ÅÉs¡œGÑ—pˆIìp¡ÊxŒòÆŠ!y)e¯æ: å×ÏŒP™SöT€+µ_Q´§ ð|JÀ?Õ´ïÂÒ;ªrÁ/CÂjëÖ­3''''Ïœ9ó; ÒËÈIQ#¦¼„‚Jåñ:x@Óó[CBœ¸$îEQÚ‰nÇž³«s‹ƒËp%$,ð»ßýN;yòùII ÷€~Ê”)¦‚‚‚F_¡1ù¾g7h,]ïóù{ô»TX‚âž _ vOàiFŠÎ Üaßéj¨ÝRúÜoèJ¹âlذ¡Ë°aÃ^1™Ì£A‡ÃÞ0nܸĒ’’fù;¦[î½&rÈ GÎc¡>—ócÚßzÛ“D—›Û>rÙêv”¼¿î=*,ttÈËý¹¢.hëÖ­ý¯¿>ûýèè讞ަÓé®Õh4\ù=MJy‚V§ò¸ Ð}€£¢JP¢î×|’Ü$VW¼ÖTt4¯òÍõ§‰ˆ`Ão:ð /_®X8zíÚõ™½zõÙaèJD ‡Ãf2™$ù{˜8Р‰1Þ‰ÈDlýÌüßaþ4ó¸+©¾òÛæÿšT´îîÙo<{*Ü®¦-¹"°zõê®×]7|wd¤!ˆç­õX€Ãvøða_óÎ4ê¦)ªs7¨drËÊYl²Õ9.œÜPòåËk¨  ¶çË÷«S¦-í&˜Ìc@¥C(tç\ª âåÀ%«$ŠX7/9x%ðPJ‡×S§NÕÌ›w×ÇÉÉI£c <AaaážñãÇðV¾ ×¾‘vÍ/1Èí(:`2àŠ ™D5—ž}§ñô·y5löÅg¢Þ3xÄMŒe.hµ™Ä% ÎsîK“$pi¯È¥Uå/=°§CAQH‡[Àĉ—šÍæQœ ú]çN§»Á÷å®ýcU‘±ƒ1ðíÕ|l|~·­ÚZ_pð¡ÊêïÐÞ½"€ñÆ)iQ]úÿ.þSf QñÄɶ, ¸7Ì Œ€r@NÂü5ŸsAœ^¹yYYGãÓ¡uÀªU«F¤¦¦=(»Î "p»¾î|lJÏt•>&ÙãçQáÛ1èìÉg ÁUQ|ºîð§3*ÞxríÝ+""&Üñ›9æÁ7í7ô°XLðÖ¦•gåsÙhA™ç>>¬#ñè@233µ½{÷{V«Õꃵ^I„Ãáð ħd ßøž|{щõGöÞ^ùÞ¦}Ø{dTÊ̇^ˆ4æ¯SR `Ìø—Óà«ècÉ‚ |ž0wåìŽÂ  X¸páÅŇ´¦õJkp8\¾ö¿y S©¼ÀCàÊVBÃé#_Û¾Þ7©ú£­ÇÌîš6vÒãÀ‘÷¨ Q&~@']œŸõ! C-1Ø–0gÅ”ŽÂ©CÈÊÊR''§ÞÇkÓõÈù.—ߘ6"5 I‰2é¦Âã'ìß3§êÀ®Ä|–pçý2 ¾ÛØgÈu‚FÛxØ z€Æû~”gdŒ Â˦9ùÙU‡0qâĉ‹y8ùàr«ƒx .—Ë)߇¨}@+ÀQ¦›/œ.²úf~åÇÛN&Þ”kHšíÞ•uãÊÈ®™‰((oÃÇ+4Zô/<?õ)ʨ펟µ<3ÔXuññÉ“Au×ã'F„ß…m¨ŒœUeÕu'ÿ½¤úý`NŽŠYÒ·'7Ek4«Pö÷‚ hê AÚìnZúþÀÃO!š8ª^ÆüübrrrrT:îšs=rZ¥RÇÈ÷"óô¾\„—Ý`;ùÍ«Õoox ©Ë臎™¤Ö@•~ÿ"­¥›ñY˜ì€:¬bXÜÒý¡Ä+ä‚`ŠŒ4ôj«Õœ¯R Ѿ› 1 …VÖ}èk©øØ2€ÄÙy+-¯Ÿ¡1 LPµ~Kwã]iY2¸¬5°ýgøüh쬥¡Â+ä±Áƒ³²t:¾5Àƒ;bDˆÌg’ä´µÐFD°—U7W”?RýÅ» s]dé;äžÈ„”ïôb€œ€È] 9À]\‡ärÔ‘èæ ¨#" ÞA0¥{ =Si<XCtttrjjj_¨p»šö8k+*µÑF p ì•Ö¯ªÿù|1@õŽå»0?ÿ ÊËã+ƒVýjR¿¬qºh£ ‰.Ü. ·¸èÉíµ•çºÎ_yÒÝPû­£ªôúógŽØà”÷x³³õÉÝo‰úˆñ„l ï+€@G‡¯0hÐ ›ÍV_l±Äwi]ë¹ Î †0c`oÝÛëÏ$Î_{::½·¡þüik³£v¹òù?>@“£qnÅ÷ß¾ÕeHöuÚ¨K—€K$©tq ݉‹Ý¹(Np5Ô=`ª)?ÓuþÊo¥Æº5—•ÿ³îóíG‰È{¼ÇŸ’~õDºDp+ÜŠcÑ¥Nú½¨„¼”——ÇËË­»Ün×E›Ÿò€`0zÉ÷sÉýjseY3{•õÛkëN^nw>^^†'Çõé6[IQ¯­¯ðçžJ•Ú)=bzš;pÄ*ËÈ_ìºð‰·’&Ý—ƒˆ‚ü̲-Ul{ø¹ª—ÿ|³Jh6¹ ^í@D@D>ÍÌÍÍ5 6|_FF÷¬à1y@ùùøñ‡þñ÷‡ïÚµKˆ¿kÍK‚ZÕ›æZ_Ék×lä„™ËF§v[jésm'$‰À%Ùä´”'9í$ÖWýÓUUöXÉëkö· ¤‹H»@DÕÁƒßv8ß/^¼xÙ¡C‡|³…—.}䞬¬¡/èõz <˜„ššjû¿þõõ yyy_]ì÷~ªX¦üáÚKòæ„kGe!€{A¦ðÅVI‘ÜN‡X_õHñ‹>­T²PI»\Ðo¼Ñßd2ÝššÚuÉêÕk^ÌÉÉÑÉךšlÛΜ9õ‘'ÔvGŒˆÀhŒÓ›L¦¹íÖ¥òͧÿ]{ºà沯?ý„$åä¶‹)Ÿw(TPéTѦ'S»áÍ´E›Bâ÷•Ò.L&Ó0"èÖ­Û¼eËÙ9uêÔ€õë×;­ÖÒ……g¿ý±°"BTTôÐüüü¡³}¼­ºþLÁtë¡}ûˆK ¿õ©êS™Z{;×ÀûWU,Èív«8ç IžÀZ·néw,X°à­ $<õÔS%eeÖEVkÙOD´í°D||ü5Z­vdHÞª iÛ«¦¦ð»éÕG|Nœ{{ѤàB¦"pq†oR4Av—ʸ?†²Lí"€sI’@IBzz·¦M›öÞâÅ‹{¬\¹bIIÉòÊÊŠ2ehZ%"ˆ‰1êccãæ…ä­Z‘Äùkÿx!âK}L7VQ°FíñC< .ïH˜±lNå?^Ú×ðýáU’ËI [¢Ò"ä•y¤°æøùOöE¹ÚEÀÖ­[+œN—M\>+Ó&“)aܸñÛ6lØðô¤I“¢òòò+++§•””vlÎ;O=õÔÚÜÜÜø îÞQWW;Üj-y²¢¢ü¤ÛíÎ L&KO.â‘P¼ ,œDÑ3Ñs "Äõ8Æä´Ljüêãò¦ó§墋@Ñ2£‹X¿h'îҥ݊3gŠ>r8œÐ’ÞJž&“9näÈÑKn»mâkÖ¬ùË©S§T¹¹¹455\WYiÝTSSu˜V«¹#?„à¾y ä!A«Ñ›ïFD,ëè›Îª²ˆ8€¯À½$ø-'°‚n¿´ûÿö·ÍßÕ××ñk»ÔJ«(D„ôôn™£FÉËÊúùêÕk8qâ„4mÚ´EN§cxuuå_DÑýYÞ%„ž/UTjm)'ã’ç•ÖktܹÉöŠÍççs—ÃáÑ~ ²ö+Zl¡)Z» (,,t”––îôWÄJ×ÓzžL c 23{öÏξ~õ€ƒnܸqË™3gú¾öÚkMžéžu[îZ=@ÐêL$I>$šS¤>¹ë¯ª>üÛaWõ¯J+QžÁ›öžC²ˆ/$&þå—û7ÖÖÖTW¾Ê&i A}µZÝ»gô¹öÚ¬yƒ]ûá/yëM›6¯[µjUÏŸRž¸©u%S—ÏR‡Žœ+l""SkÌœ{" žè§ß )=&ÄŽº3ƒˆÈUzêîv:}6o©ýD¼ Ø…$øµeËëóÏoÚ~Í5Ñ‹å9ý-¦“_R@LLŒ>&&f˜$IÃjjªgïÜùÚ9Ir—ˆ¢ø-|˜˜˜xd„ NhC¦=|SLJú³ÉCFôívࢳØ8d\´:"Òcă¬@M¬ÙlHÍ\K*þ±ílj×þï Î0­5K­€‰ìê!àĉcëfq‰Á$xÒ—NŒgà Ád²Ä›Í–x*Iâív»c±ÝÞl}çw*à¤V«½WIFÂ̇ÿdê3àþ¸Ì~ÉD Ö µµ5¯Hn§ÒG&úý?A`}@ KJ»ûe¯$¢š¤YoV«uÓÜÂ"ˆÈ^Õ“Ÿ n!ke<÷ÜsçŽ9ú›ÆÆFÇ·†Ún®¶î¾8 `0"ÍfK‹%![Tãm6[_€øœ©‘I³ùïä¬1y±}’åÁ–æò çšÞ}º :­K&Óê"¸$Ï q)À Ô1æ´„¾Ù7Xw®üL]‡‚ë ÿòRƦ/EBÛ~üño}Ôét¶áï¥d´–Ø£öç¹Ý"ÔÔÔT———}år9'MŸ>ýËäßOì7bo—‘îÒÍîÝÁÝdûˆH<šiô~ÿï — áÞU3šHc€wxÕå~!ÐJ¼ÚÏ9Hï† ³€åää¬AT§ôîÝk¾^¡ñ/ó’cW~±<¥‹Eêëk EÑýo§“çÏ›7ë»èqÓ{v™·â cïÁ·èââuˆàYçågCˆµ¨£b—|®GîP)µš8!Â0Dž$Ƭ;EcÊĹÙÿ=ïÚ2à!# Cé!".Y²ä–ôôŒe]ºtÍV«U ùÇHàœƒÃawÛíÍ¥.—»‚HúD’¤µwß}w ö•õgO—}±/«ñüi1sÖ=£9 ­ÒjâHö¦†³ïoM¡ï¿hH¼{í*"é!ù:ç§CÕ;ó‡† «$«Lœ8qï AƒÅÆšr"" Ý£££ºéõAô|n·‹755–677—J/&’Nº\®O´Zí‘ûÀ8bJÚŸ?=û@[fOŽHIÏdj­×oÖš ?çKNïkØ¿½"~⢠‚!2ÉÓò‡üML¿%cQæ^YÉðC× ¢„—˜üÎùšPbuŶ*ÈÍÍ5¨Tª´¤¤¤á‚ ‰‚€ˆ(Ëå8f·Û¿[³f5 p˜£2ÝÔõÚˆä u ©“´F‹ (׌ùænzî€æÒ²²{ÆÔöʩԹùODfxÀ÷÷p•nˆ‹"ØË‹û[·çùš˜–¹¾KŸè_:V÷úãý)„ ]±­ ¶oßÞǽG›‚™™ZSï1uÆÔÛÒÝ~ƒ6Ö*ˆÍ±u»E= Çý=¡ éŽÄ£5éЭ ªß\}KÒâ€^dPˆûBAáI2þH¦<‡Sô^—À^V´¯ôøG«,7ÏIRÅÄýÞ×+æþ9Ÿþû½a îK‹"ÑÛ‰GkÒáûÕÿ}ÕF¤EĹ»e$’+ÀW¤}±¸€‚ÁSœ]õ•çê¿/ø=Ú íÒo  GÁo¹—4™íç\±€ûŸÉ9?mw«æ])‚%,»&šgæ÷Ö ²[‘ Øöº^å>«\€ÄBwuÙ”’m+|û6'Î_Ù©tGÀ·²EžÝ&WÂJKàD{Õ*ÕԒͬºÒÈÖ[¦?Ökø¯~ŒÅù€÷‘ Þç~‘}èt6ÜeÝ´¤Bù¼ÄùkwÂm?¢|¿€V>[Yä\B{óB¾îåÈU±snêÔ§õvmÓM¨®gˆÃY2áß²‘•ââߊ6ü¦0ø–»VaûZ{¾? @ÅÀáÛþ{‡¾Ô%ÊUA@°`~¾*ùœ*É…jIÐ0QíÄ ©¶º¶F¡Ís=ˆ­‡‰=ïØ@@«¢zºpKÞU³oèUIÀåJܬüéôªr9YènQ ðœu{^E›\õ»§_ŠäšèoÐ@ ü/ ì¨í©ú(Tã·!ÿ¸Ü°HÍÄMÄP¥bì»êW+w™.Uþ#\ÐÏY:ÿ'½0K'a–NÂ,„Y: ³tfé$ ÌÒI@˜¥“€0K'a–NÂ,ÿÇþ4æç 6IEND®B`‚shutter-0.99.6/share/icons/hicolor/scalable/000077500000000000000000000000001476102223600207425ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/scalable/apps/000077500000000000000000000000001476102223600217055ustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/scalable/apps/shutter-panel.svg000077700000000000000000000000001476102223600274332shutter.svgustar00rootroot00000000000000shutter-0.99.6/share/icons/hicolor/scalable/apps/shutter.svg000066400000000000000000012636661476102223600241500ustar00rootroot00000000000000 image/svg+xml shutter-0.99.6/share/man/000077500000000000000000000000001476102223600151755ustar00rootroot00000000000000shutter-0.99.6/share/man/man1/000077500000000000000000000000001476102223600160315ustar00rootroot00000000000000shutter-0.99.6/share/man/man1/shutter.1000066400000000000000000000137371476102223600176240ustar00rootroot00000000000000.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "SHUTTER 1" .TH SHUTTER 1 2025-03-02 "perl v5.40.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Shutter \- Feature\-rich Screenshot Tool .SH SYNOPSIS .IX Header "SYNOPSIS" shutter [options] .SH COPYRIGHT .IX Header "COPYRIGHT" Shutter is Copyright (C) by Mario Kemper and Shutter Team .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBShutter\fR is a feature-rich screenshot program. You can take a screenshot of a specific area, window, your whole screen, or even of a website \- apply different effects to it, draw on it to highlight points, and then upload to an image hosting site, all within one window. .SH OPTIONS .IX Header "OPTIONS" .IP "Example 1" 8 .IX Item "Example 1" shutter \-a \-p=myprofile \-\-min_at_startup .IP "Example 2" 8 .IX Item "Example 2" shutter \-s=100,100,300,300 \-e .IP "Example 3" 8 .IX Item "Example 3" shutter \-\-window=.*firefox.* .IP "Example 4" 8 .IX Item "Example 4" shutter \-\-web=http://shutter\-project.org/ \-e .SS "CAPTURE MODE OPTIONS" .IX Subsection "CAPTURE MODE OPTIONS" .IP "\fB\-s, \-\-select=[X,Y,WIDTH,HEIGHT]\fR" 8 .IX Item "-s, --select=[X,Y,WIDTH,HEIGHT]" Capture an area of the screen. Providing X,Y,WIDTH,HEIGHT is optional. .IP "\fB\-f, \-\-full\fR" 8 .IX Item "-f, --full" Capture the entire screen. .IP "\fB\-w, \-\-window=[NAME_PATTERN]\fR" 8 .IX Item "-w, --window=[NAME_PATTERN]" Select a window to capture. Providing a NAME_PATTERN (Perl-style regex) is optional. .IP "\fB\-a, \-\-active\fR" 8 .IX Item "-a, --active" Capture the current active window. .IP "\fB\-m, \-\-menu\fR" 8 .IX Item "-m, --menu" Capture a menu. .IP "\fB\-t, \-\-tooltip\fR" 8 .IX Item "-t, --tooltip" Capture a tooltip. .IP \fB\-\-web=[URL]\fR 8 .IX Item "--web=[URL]" Capture a webpage. Providing an URL is optional. .IP "\fB\-r, \-\-redo\fR" 8 .IX Item "-r, --redo" Redo last screenshot. .SS "SETTINGS OPTIONS" .IX Subsection "SETTINGS OPTIONS" .IP "\fB\-p, \-\-profile=NAME\fR" 8 .IX Item "-p, --profile=NAME" Load a specific profile on startup. .IP "\fB\-o, \-\-output=FILENAME\fR" 8 .IX Item "-o, --output=FILENAME" Specify a filename to save the screenshot to (overwrites any profile-related setting). .Sp \&\fBSupported image formats:\fR You can save to any popular image format (e.g. jpeg, png, gif, bmp). Additionally it is possible to save to pdf, ps or svg. .Sp \&\fBPlease note:\fR There are several wildcards available, like .Sp .Vb 11 \& %Y = year \& %m = month \& %d = day \& %T = time \& $w = width \& $h = height \& $name = multi\-purpose (e.g. window title) \& $nb_name = like $name but without blanks in resulting strings \& $profile = name of current profile \& $R = random char (e.g. $RRRR = ag4r) \& %NN = counter .Ve .Sp The string is interpretted by strftime. See \f(CW\*(C`man strftime\*(C'\fR for more examples. .Sp \&\fBAs an example:\fR shutter \-f \-e \-o './%y\-%m\-%d_$w_$h.png' would create a file named '11\-10\-28_1280_800.png' in the current directory. .IP "\fB\-d, \-\-delay=SECONDS\fR" 8 .IX Item "-d, --delay=SECONDS" Wait n seconds before taking a screenshot. .IP "\fB\-c, \-\-include_cursor\fR" 8 .IX Item "-c, --include_cursor" Include cursor when taking a screenshot. .IP "\fB\-C, \-\-remove_cursor\fR" 8 .IX Item "-C, --remove_cursor" Remove cursor when taking a screenshot. .SS "APPLICATION OPTIONS" .IX Subsection "APPLICATION OPTIONS" .IP "\fB\-h, \-\-help\fR" 8 .IX Item "-h, --help" Prints a brief help message and exits. .IP "\fB\-v, \-\-version\fR" 8 .IX Item "-v, --version" Prints version information. .IP \fB\-\-debug\fR 8 .IX Item "--debug" Prints a lot of debugging information to STDOUT. .IP \fB\-\-clear_cache\fR 8 .IX Item "--clear_cache" Clears cache, e.g. installed plugins, at startup. .IP \fB\-\-min_at_startup\fR 8 .IX Item "--min_at_startup" Starts Shutter minimized to tray. .IP \fB\-\-disable_systray\fR 8 .IX Item "--disable_systray" Disables systray icon. .IP "\fB\-e, \-\-exit_after_capture\fR" 8 .IX Item "-e, --exit_after_capture" Exit after the first capture has been made. This is useful when using Shutter in scripts. .IP "\fB\-n, \-\-no_session\fR" 8 .IX Item "-n, --no_session" Do not add the screenshot to the session. This is useful when using Shutter in scripts. .SH "BUG REPORTS" .IX Header "BUG REPORTS" If you find a bug in Shutter, you should report it. But first, you should make sure that it really is a bug, and that it appears in the latest version of Shutter. .PP The latest version is always available from: \&\fBhttps://github.com/shutter\-project/shutter/releases\fR .PP Once you have determined that a bug actually exists, please report it at github: \&\fBhttps://github.com/shutter\-project/shutter/issues/new\fR shutter-0.99.6/share/metainfo/000077500000000000000000000000001476102223600162245ustar00rootroot00000000000000shutter-0.99.6/share/metainfo/shutter.metainfo.xml000066400000000000000000000033011476102223600222420ustar00rootroot00000000000000 org.shutterproject.shutter Shutter The feature-rich screenshot tool shutter.desktop CC0-1.0 GPL-3.0+

Shutter is a feature-rich screenshot program. You can take a screenshot of a specific area, window, your whole screen, or even of a website - apply different effects to it, draw on it to highlight points, and then upload to an image hosting site, all within one window.

Shutter allows you to capture nearly anything on your screen without losing control over your screenshots (tabbed interface). You don't need to open an external graphics editor like GIMP, because Shutter ships with its own built-in editor.

https://shutter-project.org/ https://github.com/shutter-project/shutter/issues https://shutter-project.org/contact/ https://shutter-project.org/wp-content/uploads/key_feature_030.png https://shutter-project.org/wp-content/uploads/key_feature_042.png https://shutter-project.org/wp-content/uploads/key_feature_036.png https://shutter-project.org/wp-content/uploads/key_feature_073.png
shutter-0.99.6/share/pixmaps/000077500000000000000000000000001476102223600161035ustar00rootroot00000000000000shutter-0.99.6/share/pixmaps/shutter.png000077700000000000000000000000001476102223600272352../icons/hicolor/48x48/apps/shutter.pngustar00rootroot00000000000000shutter-0.99.6/share/shutter/000077500000000000000000000000001476102223600161205ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/000077500000000000000000000000001476102223600201325ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/conf/000077500000000000000000000000001476102223600210575ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/conf/shape.conf000066400000000000000000000004351476102223600230300ustar00rootroot00000000000000#top rounded 5 0 width-10 1 3 1 width-6 1 2 2 width-4 1 1 3 width-2 2 0 5 width height-5 #top and bottom rounded #5 0 width-10 1 #3 1 width-6 1 #2 2 width-4 1 #1 3 width-2 2 #0 5 width height-10 #1 height-5 width-2 2 #2 height-3 width-4 1 #3 height-2 width-6 1 #5 height-1 width-10 1 shutter-0.99.6/share/shutter/resources/credits/000077500000000000000000000000001476102223600215675ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/credits/art000066400000000000000000000004601476102223600223000ustar00rootroot00000000000000Pascal Grochol Richard Querin Duncan Lock Nicu Buculei Gregor Fröhlich Lucas Romero Di Benedetto The Tango Desktop Project: http://tango.freedesktop.org The Inkscape Project: http://www.inkscape.org shutter-0.99.6/share/shutter/resources/credits/dev000066400000000000000000000007351476102223600222750ustar00rootroot00000000000000Project Founder and Developer: Mario Kemper Patches and Bugfixing: Vadim Rutkovsky Franco Zeoli José Borges Ferreira Alexey Sokolov Plugins: Edwood Ocasio Mario Kemper Martin Rabeneck (cornix) Stephan Tetzel TualatriX Marco van Hilst Swooshy shutter-0.99.6/share/shutter/resources/gui/000077500000000000000000000000001476102223600207165ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/gui/checkers.svg000066400000000000000000000002661476102223600232320ustar00rootroot00000000000000 shutter-0.99.6/share/shutter/resources/gui/stipple.png000066400000000000000000000001421476102223600231010ustar00rootroot00000000000000‰PNG  IHDRr¶ $ pHYs& ÿðSåóIDAT™cd``øÿÿÿÉðL×ùâU#IEND®B`‚shutter-0.99.6/share/shutter/resources/icons/000077500000000000000000000000001476102223600212455ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/Image.svg000077700000000000000000000000001476102223600302312drawing_tool/draw-image.svgustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/Normal.cur000077700000000000000000000000001476102223600327272drawing_tool/objects/Cursors/Normal.curustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/desktop.svg000066400000000000000000000723521476102223600234500ustar00rootroot00000000000000 image/svg+xml Lapo Calamandrei shutter-0.99.6/share/shutter/resources/icons/document-send.svg000066400000000000000000000220211476102223600245300ustar00rootroot00000000000000 image/svg+xml Jakub Steiner http://jimmac.musichall.cz shutter-0.99.6/share/shutter/resources/icons/draw.svg000066400000000000000000000564571476102223600227440ustar00rootroot00000000000000 image/svg+xml Graphics Category Jakub Steiner graphics category pixel vector editor draw paint http://tango-project.org shutter-0.99.6/share/shutter/resources/icons/drawing_tool/000077500000000000000000000000001476102223600237355ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/cursor/000077500000000000000000000000001476102223600252525ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/cursor/arrow000066400000000000000000000023451476102223600263330ustar00rootroot00000000000000/* XPM */ static char const *arrow[] = { "32 32 3 1 4 4", " c None", ". c #FFFFFF", "+ c #000000", " ... ", " .+. ", " .+. ", "....+.... ", ".+++ +++. ", "....+.... ", " .+. ", " .+. ", " ... ", " .++.. ", " .+.++.. ", " .+..++.. ", " .+....++.. ", " .+.....++. ", " .+.......+. ", " .+......+. ", " .+.....+. ", " .+.....+. ", " .+..+...+. ", " .++.+...+. ", " .. .+...+. ", " .+...+. ", " .+...+. ", " .+...+. ", " .+...+. ", " .+ +. ", " .+. ", " . ", " ", " ", " ", " "}; shutter-0.99.6/share/shutter/resources/icons/drawing_tool/cursor/backtext000077700000000000000000000000001476102223600277042textustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/cursor/censor000066400000000000000000000023461476102223600264730ustar00rootroot00000000000000/* XPM */ static char const *censor[] = { "32 32 3 1 4 4", " c None", ". c #FFFFFF", "+ c #000000", " ... ", " .+. ", " .+. ", "....+.... ", ".+++ +++. ", "....+.... ", " .+. ", " .+. ......... ", " ... ........... ", " .......+....... ", " ...+.+..+.+.... ", " .......+.+..+.... ", " ....+.++.+.+...+... ", " ....+..+.+++++..... ", " .....+++++.+..+.... ", " ...+..+.++++++.+... ", " ....++.+++.+.+..... ", " .....++.+++++.++... ", " ...+..++.++.+...... ", " ....+..++.+.++.+... ", " ......+..+.+....... ", " ......+.+.+.+.... ", " ...+........... ", " .....+..+...... ", " ........... ", " ......... ", " ", " ", " ", " ", " ", " "}; shutter-0.99.6/share/shutter/resources/icons/drawing_tool/cursor/ellipse000066400000000000000000000023471476102223600266400ustar00rootroot00000000000000/* XPM */ static char const *ellipse[] = { "32 32 3 1 4 4", " c None", ". c #FFFFFF", "+ c #000000", " ... ", " .+. ", " .+. ", "....+.... ", ".+++ +++. ", "....+.... ", " .+. ", " .+. ....... ", " ... ....+++++.... ", " ..+++.....+++.. ", " ..+...........+.. ", " ..+.............+.. ", " .+...............+. ", " .+...............+. ", " .+...............+. ", " ..+.............+.. ", " ..+...........+.. ", " ..+++.....+++.. ", " ....+++++.... ", " ....... ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}; shutter-0.99.6/share/shutter/resources/icons/drawing_tool/cursor/freehand000066400000000000000000000023501476102223600267510ustar00rootroot00000000000000/* XPM */ static char const *freehand[] = { "32 32 3 1 4 4", " c None", ". c #FFFFFF", "+ c #000000", " ... ", " .+. ", " .+. ", "....+.... ", ".+++ +++. ", "....+.... ", " .+. ", " .+. ", " ... ", " .. ", " .+...... ", " .++++++. ", " .++..+.+. ", " .+..++..+. ", " .+.+..+..+. ", " .+++...+..+. ", " .+..+...+..+. ", " .+..+...+..+. ", " .+..+...+..+. ", " .+..+...+..+. ", " .+..+...+.++. ", " .+..+...+..+. ", " .+..+.+...+. ", " .+..+...+. ", " .++...+. ", " .+..+. ", " .++. ", " .. ", " ", " ", " ", " "}; shutter-0.99.6/share/shutter/resources/icons/drawing_tool/cursor/line000066400000000000000000000023451476102223600261300ustar00rootroot00000000000000/* XPM */ static char const *line[] = { "32 32 3 1 4 4", " c None", ". c #FFFFFF", "+ c #000000", " ... ", " .+. ", " .+. ", "....+.... ", ".+++ +++. ", "....+.... ", " .+. ", " .+. ", " ... . ", " + ", " .+ +. ", " .+...+. ", " .+...+. ", " .+...+. ", " .+...+. ", " .+...+. ", " .+...+. ", " .+...+. ", " .+...+. ", " .+...+. ", " .+...+. ", " .+...+. ", " .+...+. ", " .+ +. ", " .+. ", " . ", " ", " ", " ", " ", " ", " "}; shutter-0.99.6/share/shutter/resources/icons/drawing_tool/cursor/number000066400000000000000000000023461476102223600264720ustar00rootroot00000000000000/* XPM */ static char const *number[] = { "32 32 3 1 7 7", " c None", ". c #FFFFFF", "+ c #000000", " . ", " .+. ", " .+. ", " .+. ", " .+. ", " .+. ", " ..... ..... ", ".+++++ +++++. ", " ..... ..... ", " .+. ", " .+. ", " .+. ", " .+. ", " .+. ", " . ....... ", " .++++++. ", " .+++++++. ", " ....+++++. ", " .... .++++. ", " .++. .++++. ", " .++. .++++. ", " ....++.... .++++. ", " .++++++++. .++++. ", " .++++++++. .++++. ", " ....++.... .++++. ", " .++. .++++. ", " .++. ...++++++... ", " .... .++++++++++. ", " .++++++++++. ", " ............ ", " ", " "}; shutter-0.99.6/share/shutter/resources/icons/drawing_tool/cursor/pixelize000066400000000000000000000024431476102223600270310ustar00rootroot00000000000000/* XPM */ static char * pixelize_xpm[] = { "32 32 7 1 4 4", " c None", ". c #FFFFFF", "+ c #000000", "@ c #AAAAAA", "# c #BFBFBF", "$ c #CCCCCC", "% c #B2B2B2", " ... ", " .+. ", " .+. ", "....+.... ", ".+++ +++. ", "....+.... ", " .+. ", " .+. @@@@@@@@@@@@@@@@@ ", " ... @@@@@@@@@@@@@@@@@ ", " @@@@@@@@@@@@@@@@@ ", " @@@..........#### ", " @@@..........#### ", " @@@..........#### ", " @@@..........#### ", " @@@..........#### ", " @@@$$$$$$$$$$%%%% ", " @@@$$$$$$$$$$%%%% ", " @@@$$$$$$$$$$%%%% ", " @@@$$$$$$$$$$%%%% ", " @@@$$$$$$$$$$%%%% ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}; shutter-0.99.6/share/shutter/resources/icons/drawing_tool/cursor/rect000066400000000000000000000023441476102223600261350ustar00rootroot00000000000000/* XPM */ static char const *rect[] = { "32 32 3 1 4 4", " c None", ". c #FFFFFF", "+ c #000000", " ... ", " .+. ", " .+. ", "....+.... ", ".+++ +++. ", "....+.... ", " .+. ", " .+. ................. ", " ... .+++++++++++++++. ", " .+.............+. ", " .+.............+. ", " .+.............+. ", " .+.............+. ", " .+.............+. ", " .+.............+. ", " .+.............+. ", " .+.............+. ", " .+.............+. ", " .+++++++++++++++. ", " ................. ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}; shutter-0.99.6/share/shutter/resources/icons/drawing_tool/cursor/text000066400000000000000000000023441476102223600261640ustar00rootroot00000000000000/* XPM */ static char const *text[] = { "32 32 3 1 7 7", " c None", ". c #FFFFFF", "+ c #000000", " . ", " .+. ", " .+. ", " .+. ", " .+. ", " .+. ", " ..... ..... ", ".+++++ +++++. ", " ..... ..... ", " .+. ", " .+. ", " .+. .... ", " .+. .++++. ", " .+. .++++. ", " . .++++++. ", " .++++++. ", " .++++++. ", " .+++..+++. ", " .+++..+++. ", " .++++++++. ", " .++++++++++. ", " .+++....+++. ", " ... ... ", " ", " ", " ", " ", " ", " ", " ", " ", " "}; shutter-0.99.6/share/shutter/resources/icons/drawing_tool/draw-arrow.png000066400000000000000000000003771476102223600265370ustar00rootroot00000000000000‰PNG  IHDRàw=øbKGDÿÿÿ ½§“´IDATxÚíÔAjAÐ×££‘H ñ^Ôãd§&äÙg‘@pÆdÜÔ¢HeVã|((º›ÿ«>ŸfĈ HÃß"õ,д/'=ÿb‰WC¤ùëq¢]«Ì+l±ŽóÔ&ozª Ì‘¦™È#ž±ˆMº À[ôv8ÄÀ3Ô¹@¯ð±Kò!öxÁ;>‚§F“Z6¥+“Uà «è?£¾qÂOê!E%2ÿëÿ’t«H1˜ocÄ=â ÝJ4U«ÖIEND®B`‚shutter-0.99.6/share/shutter/resources/icons/drawing_tool/draw-backtext.png000066400000000000000000000021441476102223600272040ustar00rootroot00000000000000‰PNG  IHDRÄ´l;sRGB®ÎébKGDÿÿÿ ½§“ pHYs  šœtIMEÛ 2‚Ä'äIDAT8Ë••ßk\EÇ?3÷ÞÝ{77©Ùf»[|ó‹„Å`±¥VŒ¥ ¾´}óÁ-¶ä±ÿ€¢ Pô¥ >‹¥ µy°H R‹ÒÒ†&ÛfK7û{oîÞé;>Äl·í¦Õ/Ã8Ÿ™9sÎ ˜­ô|'„0–e=")¥yÞ¶š¯0`Øb¸–u÷³ãÇ_عsgg̓Rй¹¹p5þ€½½|í­ öï>—Ïç¹téZkâ8FkÍÈÈ“““ö—//Ÿ5æÿÇùôÀ^±XD)õøæÍ›äóyç8´÷qÙ Ú€o„oOMMÉ••”RDQD»ÝF)E¥R!Š"\ו¿Á™^ŒžàmpcÏž=¦^¯Ól6QJ±¸¸ÏÏχJ)”R4 rù|ÿûR¾øŸÁ¶m›™™ñnß¾Í&¨°¼*¥L¹\îÜÀ÷}î3Áµg‚ìÍårÙÁÁAŠÅ"QQ*•Z¯5æL±XT››i­ñ}?ù.?lÛö'ûöíË,//EJ)îܹœH’‹ßÂK•JÅl®+¥Èd2Þ×0ûTp  !MLLÈ¥¥%”R„aH¥R‘Gàâ¼î³T­VQJÇ1®ë"¤ì_„Ÿ¶;pjzzšZ­F½^G)E©TbFá4ÀIcþ¨ÕjëÆ<¬+` ó.¤·[–ul÷îÝÞ­[·:´vÿ~ã”1+ Ô¨ 3ívÛÑZ?û¾\„7X},àµÁÁÁ\6›¥;whí„÷,ð-ð]D7ز,\×Õ_Áùo³WXRþ8;;{Ø÷}yõêU´Ö¤R)¦§§{Vf¡P P(tìõõuš¥ÒF:%ÀªâÑÑQyá”R!‚€……„O€ã8~Äö<²”»JIòkÞ´¾„óãããGWWW©×ë!hµZ”J¥x#J½GŸç…C;vøB|ßw7•‹›1>!Äþ±±±Ìõë×;N­F£ùœÖÐꥰ„¡“$I÷#Úó©!ïÂ9o` ¯µ¦V« µ&Œ¢ÔxK¶^²á嬅aØÝI;ŽùÎÊC †r9¯Z­âºÝ/ C¶ qEBöß4+'p¿Ke qÒ˜kAÆ6Õ×ß4á!ÝI?ßù6¨ôÐ  Â+ V¢Wá ¾®Ð›¬&jkTÛÐjAЄ¨Qâ5H*`Z€dA Üös}.øi²aøñ?o=ÐlÌA ‚õÚmˆ ˜48)H¥ cƒgƒ/ÁúäÆÉm€ç})2Ü=IEND®B`‚shutter-0.99.6/share/shutter/resources/icons/drawing_tool/draw-callouts.png000066400000000000000000000016771476102223600272370ustar00rootroot00000000000000‰PNG  IHDRàw=øbKGDùC»tIDATxÚí•OH#WÇ?/‰Ô•-ekKOƃ BEÌRj=E£‘ºz®PèA<÷¤'O^¡,(ˆG]Z1j–Zܦ!©Ä–ÂÒÔh£c4ÆÉ˜ÌüzØ™éŒh¥·úà1ïÍÌïûç÷{àÿvOS÷|ÿøèéèèè7Mó ¥ÔE&“y¤€ àÀü7ÄŸÛ###²´´${{{R­VåòòR*•ŠT*ÙÝÝ•ÅÅEà7à3ÀðàÙÔÔ”¤Ói©Õj¢iš\]]9àR.—¥T*9=Ëää¤1àÑ]™yÐÕÕµ»±±!µZÍw“T«U©T*r~~.gggrzz*…BAòù¼‹E‰ÅbìoÙ$SOOÏÚôôt¤¯¯+ÏÄb1”Rˆ¦i""ÎÓ‡ÃaLÓÄï÷ljF£ßO€+ÿ£‰‰ G¥¦i¢ëºÔëui4R¯×E×uÑ4Íã¢T*I±X”““9>>–\.'ù|^FGG^ twwF¥J)”R¬¬¬à÷û1 ãØvÐßßÿ÷rT¯’q}}M0øø& iÚ{ˆˆ“axxØ™ÛÀîn†C`‹°Ò^èºþ¦cŸÏç,//ßZƒH$ÂêꪧžÍõÊÍ# Ùv‘ l y¹D"Û…ˆËåÎÀçóýžL&C½½½ˆRеµ5O ‰Åbˆbwб–«( +›››OZ[[ikksЉD<nå7Áí~pp@:Xj+~{aaáY(ú¸½½Ã0PJ±¾¾î!°UÚãp8ìÏf³$ æç翳ΨŠ{Kþøñã‰ÙÙÙw‚Á ³ìÜíf-Ü5Ùßß'‘H066ö«u./®ø§Fã+{èºNSSÓ6x6›%›Í²µµÅÌÌÌ÷À—@(×7e ðn*•úÅýR×u£\.G¹\æèèˆL&ÃÜÜÜ:ð#ð5pa\â&T*EKKK=™Læwvvš“ÉdóöööC×?ö™ÿ'ðøxühÀ¹E [bQÀû;@8´Ø_ àç[\Úd×XÕŠ©Æm7ÚCàm ðY/­ç]M¬nZ æ?]™~ É5·ÕÉþÒÿ „(¶N£QIEND®B`‚shutter-0.99.6/share/shutter/resources/icons/drawing_tool/draw-censor.png000066400000000000000000000024511476102223600266710ustar00rootroot00000000000000‰PNG  IHDRÄ´l;sRGB®ÎébKGDÿÿÿ ½§“ pHYs  šœtIMEÙ 4+¯8¡C©IDAT8˽Õ_lSUÀñïí½½w]×u+[Çþo@Qö Å?¨5, øè &òä“&£ñè«ÆõÁ(‰&‰ab"d nLÊeÿ» ¶®]×®÷OÛ{}à–4f1>OòËÉ9ùå“_~çœøFWÏ6©«g›·°v­–ô.¸†ÛÚä;vxN€ø/ÐR`]Àï^}í 'ü¸sguã–-»·ûEQÖôXVZïížUÕÓ SSFFÌUÐJàù€ßw1j]RÕq0…BÂùƒ·×Ö׿.›æ–iz­l6é²m=ïv׿s¹CQ¾K$“ŸÝìØL> ø}ƒ¡PëuUÆ“©åðàÀ¸paÿþ¶ÚúúJ³Ù½™t:±8?tqiéÓt&sÖÖõ˜bÛM.—«¯ÄëÍ?[[{é«HDïêÙ¶8ðûC¡ÖU—âÉ”¸z{vÆ·nuWuw¿¡ÆÁ|*•’ƒAQª«;yáòåïûúû‡?9íêºêÖ´vlûq¼ÞÛD÷, ü¾L(Ôj:hø8<8p¥[Z:\™ÌS™XìòÂÒÒGÖÂe–õþž¾¾CgAÀî<~ü÷EÃ8)X–LIÉ>E ðû„P¨UQÕñ@<™jÞ* âᎎ=žLæÅôòò©W®¼dÛ~pÅ0ý¡©ùpÂSz´¦¾áÈùôJs¯$¢ Â}×-ËnXߌªŽO¦`Wxp æ˜ Húädµ¦ir<]8HhÛ#7~y:8ò¤â®ÞëvÓÔÛZYA>kt-NÌR#I´47¸þPÇÝñdª h,À»0º·À”4­4YùæVç=M¿†¯Ñ{s”¶x‚?}eÌ•(¸,–ßOdt‚x2åZƒ·‹@W!Ä—¼–µKJ¥Ê£ëCë7·¿ p)£‘4LîžfS‰ÏrŠÆÉ "Ù‘rK©ô›C—.žáÎ7!:° ®‹Åæ×76np Â3Âòr»«{³WÎËY¤×Ö°aÃè( ñ8v™Ÿ$7¾¶LÏܪœŸ›ý‹P°[z¬‡Ló˪`°öáX칩s¿a[Ñòr”T9³BV×ñ®]Ë™Š †d7‚Ðxœ³y‚P$Š‹†¦­—Ŷ-ŠÅcã?‘NNÌþqcd©˜ðo~(7ýHmpÖ  èMè?Ñußá3z4Þ†÷‰ˆ¸ŽmئQX®•¦Ë3·Çk¹»SÀ<0Ì ­f§¶°o Ð=@·¿4]@èl® °ì;gɯwÕÏmk×[‚¾°î‹7{æøÓÝõç_ÿeþçñ¢AaÃT—_IEND®B`‚shutter-0.99.6/share/shutter/resources/icons/drawing_tool/draw-eraser.png000066400000000000000000000014761476102223600266670ustar00rootroot00000000000000‰PNG  IHDRÄ´l;bKGDÿÿÿ ½§“ pHYs  šœtIMEÖ  OžØïËIDAT8ËÕ•ÏoLQÅ?÷¾÷†¶ÓaT…µ°èDÄBðˆ ;+aCJ$DXÙvcg#ØÒ……Ø  kiR©¥U”vª3¥5“¾éÜw¿ï>óÚ”ÖFâ&7'ïGÎ÷Üs¿÷\øß†Zá›Z៥Cû[âo…Â^ 8´ž›jIaÈp¸œ/§üÔÞÎíÛ¼mí»Ãõ=»NËÅóDaˆJ,bA©X—JJXK­^§óÒ•@ pl‘â ¹œž™›³ß …ãr`_ýìiæ'Ç!²M2$F‘X²"Ý;hxIãúMòŢР±#Ý ôÏŸˆ Sç-Il‘ÿÝ_yèòé®ë*S4 †‡! @ÁuÃMZ¤$¬õÔ=œ¦1À9: ãî‹:~ôGuË[¼ˆv¶6‡J¤q%zAÝ,¥¥¸W–¡Ï‚ÞGÊå_P5è‡9ñÔ6‘1ï#ãpþÄï}"TÔEu˰¶ËËC“1¸ó¼ùd#i0’Ê8Ÿ ‡¢º•^¬Y5ñJèøŒKæ~Ñ/„‰Ú\tU¸£I‹„ÃÅ=-Ç— ¯6’†Kæ,:¾€þ\^ûWxíji©jfrî|¯6& Ìštb¡ý¹BõáÂh#mL¥\š²h’0q0ª[³ –÷ÜÎ4j]áÍ›þ´¿]@éÊhÁÄ~EºxêôñP ÈsbN6W Ó³.MeèäBÒÔJhÜÖ í wo¯¨?¼ ÄËâùƒÇøþÓcF†N&j¢ºe¬†æB’pò@õ^™“,¼ô7¨[÷!eqf¤É"úc-h^â€"uì?Ò0¦Ç0úîzùqFÞ&NDukf­(óóÚ´]¾VV×Úcïã¦èg7£º5¹°|^ñáp–*·ÆÜŠ·2|*ó<Õ'˪,I ç\f>‘ˆ¬p‡ a«œÛš¦eèr8wÆý·ŸZ§ TéÜ ¹²ãxE„s…qÎeð4uÇ.„.Iü¿×o™W0C†Ì¶IEND®B`‚shutter-0.99.6/share/shutter/resources/icons/drawing_tool/draw-highlighter.png000066400000000000000000000013161476102223600276750ustar00rootroot00000000000000‰PNG  IHDRóÿasRGB®ÎébKGDÿÿÿ ½§“ pHYs}}ÇHtIMEÙ ,$JÃQNIDAT8Ë…’½k“Q‡Ÿsï›4M*ý0R©‚‹Ð‚'7QP4*X¥õ‡ª•⦣袣"ø¸D—¦ƒý@pÒ”Z:ˆ]Œ5Æ&U›·IÞ{Ú7ÆZê™.÷ò<÷œGæ§¹ë”NÄ@çn½Èšjï>¿yyà×·Ÿ5lb+w‡Iøæ @1káŽîTòúùãùMòäeÈh(1@T„B¨Šˆ4ƒ§æË±.FÒ™ºt$áæƒ´†Zb@¼÷¤Z‡RymÛõÜ( nõ\QUÝÜ“J^:±¿XmÙ¹. Pz7ö)Ì I•(P3†ÈæžTóµþéå–îàU7 pJ“5ü!>|îØ|9ÖµixBÕ}.f'/„#$ŒÁZË&Uøüȳ“g ž5àÍWn=ýðÞ P·œSÕ©…÷ãC€SÕzˆ"T¿~6½Î¼%)’ŸA$ sÏ3ªn¼˜¸,‡0€ñ<òÆ`_¼ ³²Éh‰ü›ÇáψØ\1;9h# …YÒŸÚƒ{÷ô íPU1†’ݱ¤êž³“gX¡ÿMîß¶Âa¼ºD"1–ó“……Sý!ܸ¥«wꨂçÁ«×–ÞÞÞm¾ïçæFGu5'#"ººp1‰ªêb½ƒFëG[ºÛ“[üJ¹ÜÚÖÞ^1"žsÎÖnYkHµ¨.ÅT—J¥Ò¢fÿÀ}ƒð¥¸¯%-5WL¢YƒJ‹«-µF"‘ŠX»\ _<ïg̹²ïûåx<^ù Ãð&f+l|%IEND®B`‚shutter-0.99.6/share/shutter/resources/icons/drawing_tool/draw-image.svg000066400000000000000000000374351476102223600265070ustar00rootroot00000000000000 image/svg+xml Genric Image Jakub Steiner imagepicturesnapshotphoto shutter-0.99.6/share/shutter/resources/icons/drawing_tool/draw-line.png000066400000000000000000000004101476102223600263200ustar00rootroot00000000000000‰PNG  IHDRàw=øbKGDÿÿÿ ½§“½IDATxÚÕÕ¿‚0Çñï•8±8ø„Í÷!e0(Xp9C@ûç:غ|~½Bî ðª ˜¸eãŒñ05p¤2Æ/@££3Æ[`¼ÌÎ=Ðé{vÀ~ú-B¸ÿü¥Šá©ÁxJ@Ç$á¡ÉxH@þ+ ÿ`‚ï˜á[ó`ÁÏÀ‹¯+mP¶Ü¸éÓ§6,YUSG»œ“ïÍäYÅ]ï*5°…Yoùl‚e3óÀIEND®B`‚shutter-0.99.6/share/shutter/resources/icons/drawing_tool/draw-locked.png000066400000000000000000000015101476102223600266340ustar00rootroot00000000000000‰PNG  IHDRóÿasBIT|dˆ pHYs|4k¡tEXtSoftwarewww.inkscape.org›î< tEXtTitleLockŒ¥·QtEXtAuthorAndreas Nilsson+ïä£IDAT8m“KkTQ ÇÿçÜÇLÇ™¾Ôj­Z)¶ÓÖ• âFܺô¸q%µèÂ+ApQj‹P„R ¢~×J‹¨ ED,Âh‘©:Zí´ó¸÷Ü“œ¸ðÁ´c „ä$?’¢D2;7“ëÚÑu=›Ížpì¶c\=ª].Ÿ nLŒOVóU#`vnÆïèŸÈKL‚R©T3I,mí­ÙÄ&xñüÅ“woOMŒOÒß¿‘ÖÑÙqyhpøXáC¡¸0??µüyù›î]Ýçóƒû¯:¹¾¶~ Àøäµö°ønñÑØè•[ OSw¦o÷õìÙ=ÚÚšëo¬ÑN„Û<­Q.¯.c“T*Õ/éT~àw4Æÿuðô¾êEçÝ>“Œ Í{}dá^vÌ’ƒ1ä9s<: e‹ùékjßÅ›²´a‰ïŸ^úôc°—ý£ÈÈtµ¡´‚VJ+|/÷à§=‡€ŸakêUiäôÛ:ÈäŽÈ‰ÁCuíù-"”8 ç,~ÛÛ{ˆûâ½xÿæsØ4‚ï·XáBM{Ù´ˆQÄ58ª© ¦ ˆ* »Žz5B­4cÅ^­êt*ÀYÇpœ€É‚‰Aä@VÇ"ÖM€0ôl&ã(LAœS`Ò`˜&Yò„´ç»&@­²¢‚tÆ ¥„ë°öÈ®‚’UP²æÌ„(¬iSM¡Õ”*ù-áÞvG‘öURXÇ ?Q ²Ø2œó¸ P©Da°§·˜u ǰlàØ‚‰~õ:Àä¼ ¥TîñÃ…T¦/GÜR&¶Ú$FYkQ ¶VÈ‘ˆXg“•2^*¥²"RU›ÏùÐðW€°ˆðæÜ_ƒv‚EÇIEND®B`‚shutter-0.99.6/share/shutter/resources/icons/drawing_tool/draw-lower.png000066400000000000000000000007221476102223600265270ustar00rootroot00000000000000‰PNG  IHDRóÿasBIT|dˆ pHYs × ×B(›xtEXtSoftwarewww.inkscape.org›î<OIDAT8¥“¿JAÆûçÎKR‰ØZû ×o%>CKßÂG±¶´_Ä,Tl¢˜Ã›=ãXÄè&ðƒafv÷[¾ÙÙ1ªÊ"„.«ªÚ‡TUEâÏìBö­9ë•YFÁ_ð“Às]U•Â¥ˆìŠu]“ú$>IK86UUÈNQà(€`B^M. ,Ëbæu0ˆzɹ 7K!\o3Vçy~áUUŒ1«ÀËùå©’¨›@'Óï÷½ˆøã÷‰i>o/ÆØøÌ}Ü7V׬7eflnbç,ÞY>œeä¾U<úfd7NnÀvÀµQÛÛ—æmpíñši¡®ƒ¼g¬oïõ|îGwûÇ;[±i™¯4±™–‘8UB«Èo—þ‰eY3³ðÝÆ…!\ÿÖÆ,ËÎýŸÌÄ9m|ø÷0}¹­ü²Jd;©IEND®B`‚shutter-0.99.6/share/shutter/resources/icons/drawing_tool/draw-number.png000066400000000000000000000010271476102223600266660ustar00rootroot00000000000000‰PNG  IHDRÄ´l;sBIT|dˆ pHYsrrL’–ÎtEXtSoftwarewww.inkscape.org›î<”IDAT8µÕ½ŠSQÀñß„m´2+l+kg•<€–¦Ûø  v6v‚µ•´KéG•R}€ìRmc¡H Q,\ÇÂs×»ñ$vw`¸œùøÏÜ{Ι™©&ÑÅ5ô‹öŠk†iÑ×™¹¨æ×À1Ä#\ļ@fÅÝ+zŸ±Ÿ™Ïþ‚dæ‘bc$Fè¶ýK±Ý“%gû˜ z€¬V JÎAÞ—€–í.-wSï”Üñ10†å•e}ïð£Øþgç‰a³o]|ĨôOpßk`\Å…%Û¨°º°‡ÃU…¯+À\¯lè!ö:~ŸÑùªó¸‰Æý<=)´%ÓÜóç𯕈ø‰xÙ¬#â~ ›¡·µI+™y¾Ud‚™ùªÛi*lRàÒì£|“S÷1mÀ»ešm"wñ¦m(ŒÝ¬^;x[ô'>µÖ—×ܾ£ ²•™‹ˆØÇÓˆxž™¼Ç‹ÒHóläK­ýˆànfæbíÚ`ÂՇЙŽÍÓôgökª‚ üD?Ó_nÿ»¥hõ(IEND®B`‚shutter-0.99.6/share/shutter/resources/icons/drawing_tool/draw-pixelize.png000066400000000000000000000004161476102223600272300ustar00rootroot00000000000000‰PNG  IHDRÚ}\ˆsRGB®ÎébKGDÿÿÿ ½§“ pHYs  šœtIMEÙ ).P èŽIDATHÇcŒ-í f@Üœœ¢èbŒŒŒŒèbÌ,ÌÿÑÅvlÛ¶ ™ÏÄ@c0jAÀ"((Z.ÈÎÅkˆ.ÆÉÉŽ¡™‹‹Cì÷/©£q0È"Ke`ggÅãà`'JìÿÿÿŒ£q0È"ùòÅ3Ó0Ša&&,E3¦ffL±_Þ_ƒÁe#‰âÄ€ÿtõ_²kð-rIEND®B`‚shutter-0.99.6/share/shutter/resources/icons/drawing_tool/draw-pointer.png000066400000000000000000000014161476102223600270600ustar00rootroot00000000000000‰PNG  IHDRÄ´l;sBIT|dˆtEXtSoftwarewww.inkscape.org›î< IDAT8µÕMH”AðÿÌûéjzèËBM­¬"ŠB*ˆ „ˆ°"‰ÌÖ„‚ˆÖÄC&©ÛîêE :Eavʰ",+(Ô½$Š¡•{©B×ÝØ÷c×wŸ½ &n°¹ < ÌÌ󛇙aD„ÿÑøbƒ^Ÿ»çf[sYÚa•+’úÐçsïI+ 5çj¹ ‰<ž–]i…U5c…³º– ²üØÝæÞ™6˜ˆˆsžã<[âõ¶ìH º®C„•ÕUN“KâSŸ¯u{Z*E†a@ÅÜÓ§ª4Æ…g§tI0c ‚ @†I’òOž¨ sÏ[ÛZ·.會1MÓ IRñ±£A¬ßÝî.ùW˜h"l¼¤üð‘"á…×Û¼1e˜ˆþàœÃ4M¨ªZz`ÿÁïŒ /}¾æ¢ÅòÅd°eYdYˆ¢ø{Y,ƒicÁàŒ6;ä’¬(QSïp(ñxœsèºþEÓ´H8.xÝ¿.öcCœð &S­"#£ï'üþ¡üìì*Û»O,,(š˜ü4¡Õ»î$ËþrÆ¡Pèãý÷"~ÿЈ¡Æ6LÏL‡Á0’—WPÈ«lêlZþ/0uußuü …_u5œo¼ØæŒuŒÂáp¬Z»&÷³jHgR†9°ÛÐbÛêêÞ$ÆôH´{*0µ^Q”¯›7mq€á–T^ø¬<1@`Ùõ×Ú^ ºu»sª¾ÞU Ëž—°DnÒËcŒIöb€@|;Ü“•™é”%yÐÔÍÂx|®À;sb¢Œ1“ˆæX²?φU;»—¯¸.]–eeõ‡‰É®¾Þ¾1æ¼ÐhDDIag»byÞ@t`‘•ÈýÊ0³øØ"JIEND®B`‚shutter-0.99.6/share/shutter/resources/icons/drawing_tool/draw-raise.png000066400000000000000000000006311476102223600265010ustar00rootroot00000000000000‰PNG  IHDRóÿasBIT|dˆ pHYs × ×B(›xtEXtSoftwarewww.inkscape.org›î<IDAT8ÅR1NÄ0œõù´H×ðÞŠÆâH‰"U~¨¨x<ààA4× ‘Æ ÎÚÉÒ$¹$—»p#¼»öz½;&cÌ‹µö>ÏsXk‘ç9ûƒ™¯1àlÏ^9— ”$‰ff]–%Z23úþTŒ™ÁÌAk½Ü„ΕRØr1äb—¤–ÑÉ·Á¯ŸžáC _ÕÛµªáC5ˆ…ÐÚ|¨qwu¹¢4M?‹¢¸˜oÁïÄ@´!Aǧ}¬µ’eÙŸ†¨Œ1ï~FtQ­÷NžHZ[7r« €¯CÉD$"B$"Sçf+w1cÌ›ssn°6ö«sî¶‘ˆpø'öѵؼâ¡óÿE…>ŽVaŒ£T˜Â/+ƒt6öIEND®B`‚shutter-0.99.6/share/shutter/resources/icons/drawing_tool/draw-rectangle.png000066400000000000000000000006121476102223600273410ustar00rootroot00000000000000‰PNG  IHDRÚ}\ˆbKGDùC»?IDATxÚµ•1NÃPDßl¢ ‚6gà"œ„‚#@‹è‰–+p‘Ô”–"²D‘’Ø4û‰±ÿwbbV²ü·™ù3^ÏÂ?—çX¿MUÍ^42kG‚ (°Ê€ÑéÙùbH[¦Owà˜gÀàöê‚|Vtši’!’¼2ó3\Þ<L€ø ¶Ï ¦Ï/ql™ù£Ú¹Ý{ï@a›¼^ƒ«ö»—«ñÚ÷o*Û8fÁ™?ñ¾¡à‡©“ ëÆ©¾F Nk€í¬ ŠZ8)ß㶤­i(H´'&vû´¢N‚¾S´ ßÄôRóó/V¥ ŒÞ³Ê« Á—…ˆ½¾2ï>eˆëÏŽ pìÕ~”¾U:ø«‡Ý›<3#g;îƒ%0q]_8ãÎ*,œ&˜úUb…_ßÒÒ92»“{IEND®B`‚shutter-0.99.6/share/shutter/resources/icons/drawing_tool/draw-text.png000066400000000000000000000020101476102223600263530ustar00rootroot00000000000000‰PNG  IHDRÄ´l;sBIT|dˆtEXtSoftwarewww.inkscape.org›î<šIDAT8••ÁoUÇ?ß™íì0mhÃR‰à kÄ`ÐÀ‰F=yÐ`¢”Dh þ &&&šxÑ?€¤&r ÈOT)¡Û†=LÙîv»;;Ïyó¼Ìn¶Ð}É73¿—|?ó}óÞÌç;IÒ'’œïû[äyž ‚`aW¯sŽF«×®]{þàÁƒ£9çÆ®_¿žöz½—œsmç­ì•töСC{ggg¹yó&ÖZò<ÇZËáÇ9~üxåöíÛ_lç÷vI{åܹsµf³‰1f‹îß¿Ïììl|$iÛpÛ‚%ÍHzãĉ^£ÑÀC–e Œ1´Z-²,# Cxóÿ$~ÿôéÓ®ÓéÐív1ÆpïÞ½|aa!¦ÞØØ`ÿþý“¾ï_þÏàJ¥rõÔ©Sµ‡Ž–ßh4RcŒ{üøñhqSÅk’<,éõz½>3==M³Ù$Ë2’$ÁZ›_5›M3|˜µ–8Ž àƒg‚+•Êå3gÎDËËËdY†1†ÕÕÕžµökçÜw­VË ç1DQT“ôé®`I{%]8vì˜÷àÁŒ1¤iJ«Õò€œsKëëëcÈóœ0 ñèén>wö|¯‰©Éé¹ß‹ #ñb·þØñ#¢0|àÆFkmÔÔÖ¶%’‰ÄØèØÈÀÀ׫woß»>þkâ~>çyÉd²as»-Pž,?JRb~~þsÛ“öQh{ÜÞúQŽ înnÿ­0øžÕrÄ® Ûáñ“ý)°Ý°üÁúOo>"­†e§{KŸTçSV÷ ÃÌmöÔéû12[›Y2¸|xQ"•Zk©NU¶81 ¶°04ÝI/ÕP±ˆ—6š›wZ=‹ ÷çcaäÃÝÕ„ªCM°…‚Ö®TH²09º×)XAW5“·xIÑÄø«Ìž‚ !ƒ À=eAr^ÎG>gSøÏç´e; 1· –¥Àá#ð$ˆ+i4"eŽÃe<®É‰Á47¤±²:ŽxÙ:ÜbaÔ ¡a”†Å….òÙ%fŹ1æ "±Œ0øƒ » ŠÖ T¥¾È0Á C³¹ËשIjò-Á|ØÌ‡¢$| éCI­¹*²Yß±—‚¢âpÝ‚V*„VŠŠHi(2ð<@‘æ[ÆXé—Xü`))w•”´Â(dR†Œ(€’Ò&cŒÔ2ÔfiÃŒ±cLnÛkdŒqeŒQÿ·ÚÜXk×Ô®IEND®B`‚shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/000077500000000000000000000000001476102223600253665ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Cursors/000077500000000000000000000000001476102223600270265ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Cursors/Alternate.cur000066400000000000000000000102761476102223600314660ustar00rootroot00000000000000 ¨( @ +CE1 vÿÿ½M'  ÿáááÿ­­­ÿÿv;,(ñøøøÿËËËÿFFFÿ¦P=ÿÿ@º×××ÿøøøÿ|||ÿðcÿÐÐÐÿÿNTTTÿøøøÿÙÙÙÿ555ÿÿÑÑÑÿÐÐÐÿÿN7Lÿáááÿøøøÿ¢¢¢ÿÑÑÑÿøøøÿÐÐÐÿÿN´Úÿÿÿ¼¼¼ÿøøøÿøøøÿøøøÿøøøÿÐÐÐÿÿN&ÿøøøÿøøøÿøøøÿøøøÿøøøÿøøøÿøøøÿøøøÿÐÐÐÿÿNNÿøøøÿøøøÿøøøÿøøøÿøøøÿøøøÿøøøÿÐÐÐÿÿNOÿøøøÿøøøÿøøøÿøøøÿøøøÿøøøÿÐÐÐÿÿNOÿøøøÿøøøÿøøøÿøøøÿøøøÿÐÐÐÿÿNOÿøøøÿøøøÿøøøÿøøøÿÐÐÐÿÿNOÿøøøÿøøøÿøøøÿÐÐÐÿÿNOÿøøøÿøøøÿÐÐÐÿÿNOÿøøøÿÐÐÐÿÿKOÿÐÐÐÿÿ>Nÿÿ#,— ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøÿÿð1ÿÿàÿÿàÿÿàÿÿàÿÿÀÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿÀÿÿàÿÿðÿÿøÿÿüÿÿþÿÿÿÿÿÿ€ÿÿÿÀÿÿÿáÿÿÿûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿshutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Cursors/Diagonal Resize 1.cur000066400000000000000000000102761476102223600326300ustar00rootroot00000000000000 ¨( @ ÿÿÿÿÿÿÿÿÿÅÿáááÿáááÿáááÿáááÿáááÿáááÿÝÝÝÿÆÆÆÿÿJÿùùùÿ÷÷÷ÿ÷÷÷ÿ÷÷÷ÿ÷÷÷ÿïïïÿáááÿÿ>ÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿ÷÷÷ÿáááÿÿ~ÿûûûÿÿÿÿÿÿÿÿÿ÷÷÷ÿáááÿÿ333222€ÿÿÿÿÿÿÿÿÿûûûÿÿÿÿÿ÷÷÷ÿáááÿÿ AAA ¬¬¬ÝÝݬ¬¬AAAYÿÿÿÿÿÿÿÿÿáááÿÿþþþÿ÷÷÷ÿáááÿÿ.9?555*“““¯¯¯ “““Zÿÿÿÿÿÿÿÿÿáááÿÿˆÿùùùÿáááÿÿÿÿ‰LMMM.sss \ÿÿÿÿÿÿÿÿÿáááÿÿ €SSS>ÿáááÿÿÿáááÿÿƒPyÿÿÿÿÿÿÿÿÿáááÿÿgVVVÝÝÝJÿÿÿÿÿÿÿáááÿÿ ÿÿÿÿÿÿÿÿÿáááÿÿh333ÿÿÿÿÿÿÿÿÿáááÿÿÿÿÿÿÿÿÿÿáááÿÿiÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿáááÿÿxÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ˜P.222ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿáááÿÿƒL* ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿáááÿÿ‰?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿáááÿÿ:¶ÿÿÿÿÿÿÿÿÿ2!ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿüÿüÿþÿþÿþþþþþþþþÿþÿþÿþÿþÿþÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿshutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Cursors/Diagonal Resize 2.cur000066400000000000000000000102761476102223600326310ustar00rootroot00000000000000 ¨( @ ¶ÿÿÿÿÿÿÿÿÿ?ÿÿÿÿÿÝÝÝÿáááÿáááÿáááÿáááÿáááÿáááÿÿ* ÿÿÿÿÿÿÿÿÿÿÿÿÿ÷÷÷ÿ÷÷÷ÿ÷÷÷ÿùùùÿÿh222ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿm ! ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿšX> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÝÝÝÿÿ 7(222333ÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿÿÿÿÿáááÿÿ}J+AAA¬¬¬ÝÝݬ¬¬AAA ÿÿÿÿÿùùùÿÿ~ÿÿÿÿÿÿÿÿÿáááÿÿƒL555,“““ÅÅÅ“““555*?ÿÿÿÿÿÿX“““NÿÿÿÿÿÿÿÿÿáááÿÿƒLMMM/sss hÿÿÿÿXAAA JÿÿÿÿÿÿÿÿÿáááÿÿQmÿáááÿÿKÿÿÿÿÿÿÿÿÿáááÿÿ ÿáááÿáááÿÿKÿÿÿÿÿÿÿÿÿáááÿÿáááÿùùùÿáááÿÿMÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿùùùÿáááÿÿ222tÿÿÿÿÿÿÿÿÿÿÿÿÿùùùÿáááÿÿ XÿáááÿÿÿÿÿÿÿÿÿÿÿÿÿùùùÿáááÿÿXÿáááÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿùùùÿáááÿÿÿõõõÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõõõÿÿÿÿÿÿÿÿÿÿÿµÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿþÿþÿþ?ÿþÿþþþþþþ<ÿþÿþÿþÿüÿüÿüÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿshutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Cursors/Handwriting.cur000066400000000000000000000102761476102223600320250ustar00rootroot00000000000000 ¨( @ € ,(ÿ‡G+ÿÿI,ÿ€€€ÿÿ„L0:::ÿ¶¶¶ÿèèèÿÿOOO£N0"""ÿíííÿñññÿùùùÿÿJJJ£L,///ÿöööÿðððÿðððÿ÷÷÷ÿÿ666“D(((ÿðððÿíííÿèèèÿýýýÿÐÐÐÿÿU2²ÁÁÁÿóóóÿîîîÿåååÿýýýÿÿ)))£EV~~~þýýýÿòòòÿÛÛÛÿñññÿÑÑÑÿÿU2AAAÿàààÿ÷÷÷ÿãããÿòòòÿýýýÿÿ)))£G Q„„„üýýýÿóóóÿÜÜÜÿòòòÿÓÓÓÿÿV5...ÿÛÛÛÿøøøÿåååÿóóóÿøøøÿÿCCCºGQgggÿüüüÿôôôÿÝÝÝÿòòòÿÏÏÏÿÿU2ÿúúúöøøøÿæææÿóóóÿúúúÿÿ%%%£EGNNNÈÿÿÿÿüüüÿ÷÷÷ÿüüüÿÎÎÎÿÿU1ÿýýýûûûûÿòòòÿíííÿñññÿÿ"""£BGhhh¾üüüÿêêêÿÍÍÍÿäääÿzzzÿÿIÿ÷÷÷îãããÿÖÖÖÿÔÔÔÿ¹¹¹ÿÿHGPPP­úúúÿÜÜÜÿ½½½ÿŽŽŽÿÿ>ÿÉÉÉÔÁÁÁÿ¥¥¥ÿðÿ- Cÿÿÿÿ$ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿƒÿÿÿÿÿÿ€ÿÿ€?ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿÀÿÿÀÿÿÀÿÿàÿÿàÿÿðÿÿðÿÿøÿøÿüÿüÿþÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿshutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Cursors/Help.cur000066400000000000000000000102761476102223600304370ustar00rootroot00000000000000 ¨( @   )6'SÿwJ+Sÿ²²²ÿÿK+ Pÿìììÿãããÿ¥¥¥ÿÿJ( Bÿìììÿüüüÿüüüÿãããÿ¸¸¸ÿÿ{?ÿèèèÿüüüÿüüüÿüüüÿüüüÿãããÿ¸¸¸ÿÿ8ÿÿÿüüüÿüüüÿãããÿÿÿÿ! ÿãããÿüüüÿãããÿÿbI'ÿÌÌÌÿÿÿÿÿãããÿ|||ÿÿ]E)É   ÿÿÿÿÿÿÿÿÿæææÿ“““ÿáG$ Mÿœœœÿæææÿÿÿÿÿæææÿºººÿÿt57JLGkÍCCCÿ¯¯¯ÿÿÿÿÿæææÿ~~~ÿÀAÿÿÿÿÌK;eCCCÿÿÿÿÿæææÿ¥¥¥ÿÒEÿæææÿæææÿÏÏÏÿÿi;BÿÿÿÿÿÿÿÿÿÏÏÏÿÿAòüüüÿÿÿÿÿæææÿ[[[ÿi‚LLLÿÿÿÿÿÿÿÿÿÌÌÌÿÒ7ÏŸŸŸÿÿÿÿÿæææÿŸŸŸÿUUUÿÿCCCÿ´´´ÿÿÿÿÿÿÿÿÿœœœÿ·( NAAAÿìììÿÿÿÿÿæææÿÏÏÏÿÏÏÏÿÏÏÏÿÿÿÿÿÿÿÿÿÿÿÿÿ\\\ÿp¼ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿƒƒƒÿÄÃcccÿÂÂÂÿüüüÿÿÿÿÿüüüÿáááÿ\\\ÿÁ}ÐóÿñÈ…ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿüÿÿøÿÿðÿÿàÿÿàÿÿàÿÿàÿÿðÿÿøÿÀ?ÿ€?ÿ€?ÿ€?ÿ€?ÿ€?ÿ€?ÿÀÿÀÿàÿÿðÿÿüÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿshutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Cursors/Horizontal Resize.cur000066400000000000000000000102761476102223600331220ustar00rootroot00000000000000 ¨( @ €,@77@, ,mÿÿJÿÿN/uÿÈÈÈÿÿO" ÿÁÁÁÿÿ‘N/„ÿÓÓÓÿÜÜÜÿÿY  ÿÞÞÞÿÁÁÁÿÿ‘R/˜ÿØØØÿäääÿßßßÿÿl)BLNNNOÿîîîÿÞÞÞÿÁÁÁÿÿ“R/—ÿØØØÿóóóÿòòòÿäääÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿîîîÿÞÞÞÿÁÁÁÿÿ“R/—ÿÜÜÜÿïïïÿ÷÷÷ÿÿÿÿÿñññÿëëëÿÏÏÏÿÏÏÏÿÏÏÏÿÏÏÏÿÏÏÏÿÏÏÏÿÏÏÏÿÏÏÏÿÿÿÿÿÿÿÿÿÿÿÿÿîîîÿîîîÿÁÁÁÿÿ“R—ÿÞÞÞÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÞÞÞÿÿ“ÿïïïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿîîîÿÿ““ÿïïïÿÿÿÿÿÿÿÿÿáááÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿîîîÿÿ“†ÿïïïÿÿÿÿÿáááÿÿNÿÿÿÿÿÿÿÿÿîîîÿÿpdÿðððÿáááÿÿJÿÿÿÿÿîîîÿÿmRÿÒÒÒÿÿ7ÿîîîÿÿkOÿÿÿÿ\ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿCð¿ÿà?ÿà?þà?ü?øðàààðøüþàÿà?ÿà?ÿCð¿ÿÿÿÿïÿÿóÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿshutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Cursors/Link.cur000066400000000000000000000102761476102223600304440ustar00rootroot00000000000000 ¨( @  4FLMMMMMMMMMLB) #¥ÿÿÿÿÿÿÿÿÿÿÿÿÿŽBštttÿÉÉÉÿÚÚÚÿÚÚÚÿÚÚÚÿÚÚÚÿÚÚÚÿÚÚÚÿÚÚÚÿÚÚÚÿÚÚÚÿÚÚÚÿÚÚÚÿ“““ÿÿLÿìììÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿìììÿìììÿÚÚÚÿÚÚÚÿÿMÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿìììÿìììÿÚÚÚÿÿMÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿìììÿÚÚÚÿÿMÿÿÿÿÿÿÿÿÿÀÀÀÿÿÿÿÿÉÉÉÿÚÚÚÿÿÿÿÿÉÉÉÿìììÿÿÿÿÿÉÉÉÿìììÿìììÿÚÚÚÿÿMÿãããÿÿÿÿÿÿÿÿÿÿÿÿÿÿÉÉÉÿÿÿÿÿÿÿÿÿÉÉÉÿÿÿÿÿÿÿÿÿÉÉÉÿÿÿÿÿÚÚÚÿÿLGÿÜÜÜÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÚÚÚÿÿBGÿÿÿÿÿÿÿÿÿÿvvvÿÿÿÿÿÿÿÿÿDDDÿÿÿÿÿÿÿÿÿXXXÿÿÿÿÿÚÚÚÿÿ( ÿÿÿÿÿÿÿÿÿ111ÿÉÉÉÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿV ÿÿÿÿÿÿÿÿÿÿÿÿVÿÿUÿÿÿÿÿÿÿÿÿÿLÿÿÿÿÿÿÿÿÿÿ?ÿÿÿÿÿÿÿÿÿÿ" Oÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÀÿ?ÿþþþþþþþÿÿ€ÿÀ?ÿÀÿÀÿÿÀ?ÿÿÀ?ÿÿàÿÿðÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿshutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Cursors/Move.cur000066400000000000000000000102761476102223600304550ustar00rootroot00000000000000 ¨( @  4FMNNNNNNNNNMC) #¥ÿÿÿÿÿÿÿÿÿÿÿÿÿCštttÿÉÉÉÿÚÚÚÿÚÚÚÿÚÚÚÿÚÚÚÿÚÚÚÿÚÚÚÿÚÚÚÿÚÚÚÿÚÚÚÿÚÚÚÿÚÚÚÿÉÉÉÿÿMÿìììÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿìììÿìììÿÚÚÚÿÚÚÚÿÿNÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿìììÿìììÿÚÚÚÿÿNÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿìììÿÚÚÚÿÿNÿÿÿÿÿÿÿÿÿÀÀÀÿÿÿÿÿÉÉÉÿÚÚÚÿÿÿÿÿÉÉÉÿìììÿÿÿÿÿÉÉÉÿìììÿìììÿÚÚÚÿÿNÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÉÉÉÿÿÿÿÿÿÿÿÿÉÉÉÿÿÿÿÿÿÿÿÿÉÉÉÿÿÿÿÿÚÚÚÿÿNÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÚÚÚÿÿNÿëëëÿÓÓÓÿÿÿÿÿÿÿÿÿÿÀÀÀÿÿÿÿÿÿÿÿÿÀÀÀÿÿÿÿÿÿÿÿÿÀÀÀÿÿÿÿÿÚÚÚÿÿN‹ÿ½ÿÿÿÿÿÿÿÿÿ¦¦¦ÿÿÿÿÿÿÿÿÿ¦¦¦ÿÿÿÿÿÿÿÿÿ¦¦¦ÿÿÿÿÿÚÚÚÿÿLÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÚÚÚÿÿCÿÿÿÿÿÿÿÿÿLLLÿÿÿÿÿÿÿÿÿLLLÿÿÿÿÿÿÿÿÿLLLÿÿÿÿÿÚÚÚÿÿ) ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ^ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ*Oÿÿÿÿÿÿÿÿÿÿÿÿÿÿ^ Pÿÿ\ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€ÿþþ?ü?ü?ü?ü?ü?ü?ü?ü?ü?þ?ÿ?ÿ€?ÿ€ÿ€ÿÿÀÿÿàÿÿü?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿshutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Cursors/Normal.cur000066400000000000000000000102761476102223600307770ustar00rootroot00000000000000 ¨( @ 1EC+*! ¤ÿÿ CÿBB'BÿÆÆÆÿØØØÿÿGÿÿ[JŽkkkÿøøøÿøøøÿö?ÿÐÐÐÿÿb£ÿøøøÿ°°°ÿÏ5ÿùùùÿÑÑÑÿÿ===ÿøøøÿøøøÿJJJÿ«:#ÿøøøÿøøøÿÑÑÑÿ¢¢¢ÿøøøÿÑÑÑÿÿdWL7ÿøøøÿøøøÿøøøÿøøøÿøøøÿ°°°ÿÿÿÿÿ@ÿøøøÿøøøÿøøøÿøøøÿøøøÿøøøÿøøøÿøøøÿÐÐÐÿÿ,ÿøøøÿøøøÿøøøÿøøøÿøøøÿøøøÿøøøÿÑÑÑÿÿlÿøøøÿøøøÿøøøÿøøøÿøøøÿøøøÿÑÑÑÿÿlÿøøøÿøøøÿøøøÿøøøÿøøøÿÑÑÑÿÿlÿøøøÿøøøÿøøøÿøøøÿÑÑÑÿÿlÿøøøÿøøøÿøøøÿÑÑÑÿÿlÿøøøÿøøøÿÑÑÑÿÿlÿøøøÿÑÑÑÿÿlÿÑÑÑÿÿkÿÿb–1ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÆÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€ÿÿ€?ÿÿ€ÿÿ€ÿÿÿÿÿÿÃÿÿÿïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿshutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Cursors/Precision.cur000066400000000000000000000102761476102223600315020ustar00rootroot00000000000000 ¨( @ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ6ÿÿÿEÿÿÿ6ÿÿÿÿÿÿÿÿÿEÿÿÿÿEÿÿÿÿÿÿÿÿÿEÿÿÿÿEÿÿÿÿÿÿÿÿÿEÿÿÿÿEÿÿÿÿÿÿÿÿÿÿÿÿEÿÿÿÿEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ;ÿÿÿEÿÿÿ;ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ6ÿÿÿEÿÿÿEÿÿÿEÿÿÿEÿÿÿ;ÿÿÿÿÿÿÿÿÿÿÿÿ;ÿÿÿEÿÿÿEÿÿÿEÿÿÿEÿÿÿ6ÿÿÿÿÿÿÿÿÿEÿÿÿÿÿÿÿEÿÿÿ²ÿÿÿÿÿÿEÿÿÿÿÿÿÿEÿÿÿÿÿÿÿÿÿ6ÿÿÿEÿÿÿEÿÿÿEÿÿÿEÿÿÿ;ÿÿÿÿÿÿÿÿÿÿÿÿ;ÿÿÿEÿÿÿEÿÿÿEÿÿÿEÿÿÿ6ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ;ÿÿÿEÿÿÿ;ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿEÿÿÿÿEÿÿÿÿÿÿÿÿÿÿÿÿEÿÿÿÿEÿÿÿÿÿÿÿÿÿEÿÿÿÿEÿÿÿÿÿÿÿÿÿEÿÿÿÿEÿÿÿÿÿÿÿÿÿ6ÿÿÿEÿÿÿ6ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿø?ÿÿø?ÿÿø?ÿÿø?ÿÿø?ÿÿðÿþÿþÿþÿþÿþÿÿðÿÿø?ÿÿø?ÿÿø?ÿÿø?ÿÿø?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿshutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Cursors/Text.cur000066400000000000000000000102761476102223600304730ustar00rootroot00000000000000 ¨( @ €‰ÿÿ¡ÿÿ‰ÿÿÿÿÿÑÑÑÿgggÿÑÑÑÿÿÿÿÿÿ‰ÿxxxÿÿÿÿÿxxxÿÿ‰‰ÿÿÿÿÿÿ‰ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‰ÿÿÿÿÿÿ‰‰ÿ†††ÿÿÿÿÿ………ÿÿ‰ÿÿÿÿÿÓÓÓÿÿÚÚÚÿÿÿÿÿÿ‰ÿð¡êÿ‰ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøÿÿøÿÿøÿÿüÿÿþ?ÿÿþ?ÿÿþ?ÿÿþ?ÿÿþ?ÿÿþ?ÿÿüÿÿøÿÿøÿÿøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿshutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Cursors/Unavailable.cur000066400000000000000000000102761476102223600317720ustar00rootroot00000000000000 ¨( @     +AA+ +AA+ hÿÿM/ kÿÿL+ Yÿ¼¼¼ÿ¼¼¼ÿÿPzÿ¼¼¼ÿ¼¼¼ÿÿAÿÿÿÿÿÿÿÿÿÿÿÿÿ¼¼¼ÿÿÿÛÛÛÿÿÿÿÿÿÿÿÿ¼¼¼ÿÿAÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¼¼¼ÿÿÛÛÛÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ+ LÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿkOÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿz kÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿP0 hÿ¼¼¼ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¼¼¼ÿÿM+ Yÿ¼¼¼ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¼¼¼ÿÿAÿÛÛÛÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¼¼¼ÿÿAÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿkÿÿÿÿÿÿÿÿÿÿÿÿÿÛÛÛÿÿ+ LÿÿÿÿÿÿÿÿÿÿhOÿÿÿÿÿÿÿÿÿÿhLÿÿY LÿÿY ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿáÃÿÿÀÿÿ€ÿÿÿÿÿÿ€ÿÿ€ÿÿ€ÿÿÿÿÿÿ€ÿÿÀÿÿáÃÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿshutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Cursors/Vertical Resize.cur000066400000000000000000000102761476102223600325420ustar00rootroot00000000000000 ¨( @ € pR3pÿpR3pÿÿpR3pÿïïïÿÿÿÿÿÜÜÜÿÿ“R3 mÿïïïÿÿÿÿÿÿÿÿÿïïïÿØØØÿÿ‘N/ kÿïïïÿÿÿÿÿÿÿÿÿÿÿÿÿ÷÷÷ÿóóóÿØØØÿÿ‘N,\ÿðððÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿòòòÿäääÿÓÓÓÿÿ@ÿÿÿÿÿÿÿÿÿÿÿÿÿûûûÿÿÿÿÿÿÿÿÿãããÿçççÿòòòÿâââÿÏÏÏÿÿ7ÿÿÿÿÿÿÿÿÿÿÿÿÿÏÏÏÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÏÏÏÿÿB6 ÿÿÿÿÿÿÿÿÿÏÏÏÿÿLÿÿÿÿÿÿÿÿÿÏÏÏÿÿNÿÿÿÿÿÿÿÿÿÏÏÏÿÿNÿÿÿÿÿÿÿÿÿÏÏÏÿÿNÿÿÿÿÿÿÿÿÿÏÏÏÿÿO  ÿÿÿÿÿÿÿÿÿÏÏÏÿÿV3 7JNÿÿÿÿÿÿÿÿÿÏÏÏÿÿdVOJ7ÿÿÿÿÿÿÿÿÿÿÿÿÿæææÿÿÿÿÿÿ@ÿóóóÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿîîîÿÞÞÞÿÁÁÁÿÿ,OÿóóóÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿîîîÿÞÞÞÿÁÁÁÿÿmRÿòòòÿÿÿÿÿÿÿÿÿÿÿÿÿîîîÿÞÞÞÿÁÁÁÿÿpdÿòòòÿÿÿÿÿÿÿÿÿîîîÿÁÁÁÿÿ€1OÿòòòÿÿÿÿÿÁÁÁÿÿ”OÿüüüÿÿmOÿmmÿÿÿÿÿÿÿÿÿþÿÿüÿÿøßÿñÿÿÿ€ÿÿÿÿÿÿ€ÿÿðÿÿðÿÿðÿÿðÿÿ€ÿÿÿÿÿÿ€ÿÿÿÿàÿÿðÿÿøÿÿü?ÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿshutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/000077500000000000000000000000001476102223600264545ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts/000077500000000000000000000000001476102223600302425ustar00rootroot00000000000000Callout_circle_center.svg000066400000000000000000000075671476102223600352070ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_circle_left.svg000066400000000000000000000075671476102223600346610ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_circle_right.svg000066400000000000000000000075701476102223600350360ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts/Callout_cloud.svg000066400000000000000000000104301476102223600335520ustar00rootroot00000000000000 Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_cloud_center.svg000066400000000000000000000115101476102223600350330ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_cloud_left.svg000066400000000000000000000114731476102223600345150ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_cloud_right.svg000066400000000000000000000121501476102223600346710ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_rectangle_center.svg000066400000000000000000000054751476102223600357060ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_rectangle_left.svg000066400000000000000000000057401476102223600353530ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_rectangle_right.svg000066400000000000000000000057351476102223600355420ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_round_center.svg000066400000000000000000000072611476102223600350640ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_round_left.svg000066400000000000000000000070151476102223600345330ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_round_right.svg000066400000000000000000000065501476102223600347210ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_rounded_rectangle_center.svg000066400000000000000000000067611476102223600374250ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_rounded_rectangle_left.svg000066400000000000000000000065271476102223600370770ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_rounded_rectangle_right.svg000066400000000000000000000065261476102223600372610ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_segmented.svg000066400000000000000000000065621476102223600343530ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_segmented_center.svg000066400000000000000000000066521476102223600357130ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_segmented_left.svg000066400000000000000000000071201476102223600353540ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_segmented_right.svg000066400000000000000000000071301476102223600355400ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts/Callout_star.svg000066400000000000000000000124321476102223600334210ustar00rootroot00000000000000 Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_star_center.svg000066400000000000000000000120531476102223600347010ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_star_left.svg000066400000000000000000000120251476102223600343520ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_star_right.svg000066400000000000000000000120611476102223600345350ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Clipart by Nicu Buculei - segmented Nicu Buculei image/svg+xml Callout_ubuntu_center_bottom.svg000066400000000000000000000066431476102223600366460ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Nicu Buculei image/svg+xml Callout_ubuntu_center_top.svg000066400000000000000000000066521476102223600361440ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Nicu Buculei image/svg+xml Callout_ubuntu_left.svg000066400000000000000000000066031476102223600347300ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Nicu Buculei image/svg+xml Callout_ubuntu_left_top.svg000066400000000000000000000066031476102223600356120ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Nicu Buculei image/svg+xml Callout_ubuntu_right.svg000066400000000000000000000065741476102223600351220ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Nicu Buculei image/svg+xml Callout_ubuntu_right_top.svg000066400000000000000000000065711476102223600360010ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/Forms/Callouts Nicu Buculei image/svg+xml shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/apply.svg000066400000000000000000001111171476102223600272360ustar00rootroot00000000000000 image/svg+xml Jakub Steiner http://jimmac.musichall.cz Dialog ok ok sure set apply Andreas Nilsson shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/cssed.svg000066400000000000000000003160331476102223600272160ustar00rootroot00000000000000 image/svg+xml bug-buddy 2007-11-02 Sebastian Kraft Sebastian Kraft de-DE bug-buddy bug-buddy icon for the Tango Desktop Project Sebastian Kraft shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/error-round.svg000066400000000000000000000432441476102223600303740ustar00rootroot00000000000000 image/svg+xml Rodney Dawes Jakub Steiner, Garrett LeSage Dialog Error shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/error.svg000066400000000000000000000250631476102223600272460ustar00rootroot00000000000000 image/svg+xml Rodney Dawes Jakub Steiner, Garrett LeSage Dialog Error shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/important-red.svg000066400000000000000000000102261476102223600306750ustar00rootroot00000000000000 shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/information-red.svg000066400000000000000000000731151476102223600312130ustar00rootroot00000000000000 image/svg+xml shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/information-yellow.svg000066400000000000000000000430161476102223600317510ustar00rootroot00000000000000 shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/notice.svg000066400000000000000000000121501476102223600273670ustar00rootroot00000000000000 shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/question.svg000066400000000000000000000157521476102223600277700ustar00rootroot00000000000000 shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/star.svg000066400000000000000000000057251476102223600270710ustar00rootroot00000000000000 shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/stop-hand.svg000066400000000000000000000207721476102223600300140ustar00rootroot00000000000000 shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/tux.svg000066400000000000000000003767041476102223600267500ustar00rootroot00000000000000 image/svg+xml Tux May 2007 F.Bellaiche <frederic.bellaiche@gmail.com> shutter-0.99.6/share/shutter/resources/icons/drawing_tool/objects/warning.svg000066400000000000000000000220561476102223600275610ustar00rootroot00000000000000 image/svg+xml Dialog Warning 2005-10-14 Andreas Nilsson Jakub Steiner dialog warning shutter-0.99.6/share/shutter/resources/icons/drawing_tool/transform-crop.png000066400000000000000000000021541476102223600274210ustar00rootroot00000000000000‰PNG  IHDRÄ´l;bKGDÿÿÿ ½§“ pHYs  šœtIMEÕ 2&ÂÙùIDAT8Ë­”mh[UÇÿçÜ›››&iš¦íÚ¢Ýâ@º±²Ž‚6Ðá7­/æi†Ö$¬?( "Š£R ‚_™ÎM+’¦)N³-Õ½›nVZú¢4«K“Øä†6/÷&¹÷¿¤Úú²†êçËy8¿óãá°ÃÕ×ßKn×§Øùªºxé» IJÿ¸¯¿·9šzvÿ¾ý6’”ÿ3¸¯¿·-šz)à.Bl,Ì’”0í|â9ï¡ÐÔÇPN¥’6%¯4°0%)!JR‚W.ôñîãG2™Ì7PI¥’úôOÓÊèØˆ¶òÎ=N™RZ _¾r[[XYÆ]m…BáRÀ4¤RÉÚÅÅ…¦……yg§ËÝèpز’«P¾6>ÔþÈ_ÀdÀ„$%TI’LW'®5{ô˜œI§u³ÅÂ[ÌVQVdõPk[½ÛãR†‡æËîøƒH&WSªªÚ¿½ÀŽÞwÔÆQι‹Íwï³î¨v{\€/ °(¥ö¹ù945í& üìüLÕ]ν‚ ÕÕ5un+ àå¡ÁaiÛTôø¼{4€¢( „`˜›! »ê VK¥µºº¦Éíqí%„œ^ÞV³ÇçŸz¦;12záFgWcŒ±x<Æff§ÙRø&I Æc]Ú“O?qoÙ$ŸÏ¿úÊköZ¶·?·Ç…ºº]X_O³l&«Ûí¸=.8÷§g?û¾¬Ìú^<ñüé3§Ôt:Í–n.²ÉëרÀçgÙ†yÉ”õõ÷>üo ò#¸‡îbß;ýÂj2Šœœ…ªje«ñUœûò2™,***îÿäÌÀ8¶í'ÔãóÖ‹êÈÛoV“q$¥Òé 2™ *­6BÑÚzH·VZÖx—*ß(²©þŒ[ÏË Å«o¼þ¦9'ç‹Ga6™áÜÝEV‡Y‰èkëk*Ïñ#ËËË¿0”Œ7—¾Ìóü»]®ãÎÚšZʘ0 ›Ëá£Ó§ ‘•[Z>ŸÿUQòc‘[‘÷ÆFÆc¥cÂ_€: €Î—lÓ5ý…ÇÐ&'ô¡àP!'gsL×odsòÀÜìÜ•ëS?J%+ mž­@-í”ôø¼ÍéõÌ´QŠ<ÏOéºîEc_u> €Z­Ñ  ”RÊû¦Õ‚ªªšªª „h”ãr¢Ñ¨QJX¡PÔxõÖJKËï8¿q[ivÔ(9£QТ‘UÕ4Ž£ „0•ç5MUuè<ÏQžç5Aôb±¨#·‰àßzUv1™D"Šâ–ˆ)ŠÂ¢+ñ-{¿m‡ãÛdñIEND®B`‚shutter-0.99.6/share/shutter/resources/icons/executable.svg000066400000000000000000000231351476102223600241130ustar00rootroot00000000000000 image/svg+xml Executable Jakub Steiner http://jimmac.musichall.cz/ executable program binary bin script shell shutter-0.99.6/share/shutter/resources/icons/fullscreen.svg000066400000000000000000000416201476102223600241330ustar00rootroot00000000000000 image/svg+xml Jakub Steiner http://jimmac.musichall.cz View Fullscreen shutter-0.99.6/share/shutter/resources/icons/lpi-bug.png000066400000000000000000000015411476102223600233130ustar00rootroot00000000000000‰PNG  IHDRóÿasBIT|dˆIDAT8m“oL•uÇ?¿ßsÿ<Ïå"èX/jA+c‰ÙÝ\cI‰– [/lØV½È^äæo¬åzQ¹ÎÞ±ø[nn¶ÖlÓ{ §9%H Cø{¹<÷>÷Þçô‚pnp^í{Îçì윯b·p\Á»’¢ü…w|X»ÐF¾v9‚ð^2@¦Z ÐÝÆÄãÛ¾Ü8òÇvÚžútÌ䨦EBÊÇaocÈðæšñhÿoÛö³cUs¤…­7~~.&"’vîÊHOnFúχ£“'EDäÚÙ§–.6Q±ÖpzZiš¹ýkß?* ‡$¿)igBRöuq¢ç$±xM"­ô¯Ô{ÂÍÜQÚ[äñ)gÎ#heì#6¶‹ÂŠ+x=åŒ\.ERS6ýÀÄÀ×qqùê@ Õ†?ójeÝ´ éœù6HOPTàÁ45JlÐÞàKŒ¾a*ÅÍ€®ªg íÌù}·í&G‰Ý®"9׈6,Š ü”ûц…6L’ÑNž®9…Ç\ÿk¸…}`ë0Ç&‡Ï ,MGÄŸ{­M´¶(*´(+  µ…Ö&‰© =CeÝt ¸þÉ–H+ß?8cø;j̬Í?=S{‘øx JùPÊ €H¨Å—sØôù+ò‘Ž+€®FüërÔŸ/ÿ¸Ùë›Wéù(m±ãµ^Îw–#®YØÍåŽGp{‰¤4„ê¹¥rr8QúìÇ%¼=Ê“±#óM”Ò€Ôÿ¹ÆuúØPüb<íÊ/¡zn¨p+o:£½¬òý·Ïž¾{)cËÞ~œ‰½(åÁ“õ>Ê !É¡åUTW:{~HJÔ'¸—v7³‡{Ž~~oðÔΔ3~#¹Ô‡¶ªñæÇ^räÒÉbF¯~³îàñ—±.{n÷£ìZþƒª:lp—}Ðâžµç®?‘]xHÿÓ{ÐëývXpk'‡N—Ý9s@«ý¯þü Nj•™"ÍT7léR’pb³}í³³î5’XÑ»ñggñ*Ðà¦9° n"ƒQ¼¾ým:×4ÌCñŸX7 ûZIEND®B`‚shutter-0.99.6/share/shutter/resources/icons/lpi-help.png000066400000000000000000000017251476102223600234720ustar00rootroot00000000000000‰PNG  IHDRóÿabKGDÿÿÿ ½§“ pHYs  šœtIME×añLÔbIDAT8Ë=’OL›e‡Ÿ÷ëŸïkKK ”Mt™HŒ ù3`ó 1“D˜‡Ä‹‰;oó@[ׯ£ªýq+@åÙ–'‹¢øî˵µè@.Ÿ¥§«ÇÙòñ'Îì³gemoâêì¦T*a¼T(þ*³ãí®[ÒZûë›rÇØ­à0œ¨D‚Û‹‹NŸfòéSd<Ža8Xß’¯­§ý‰FëAGÂèë}‹ïÆÇy»·d"ÉÊÌCîÇbè{{ü²‡±qNõàõy¹?=ÉçÏ‘››±‰ÁÁÁo^©´ö—„~,µ["—Ïó×/‡ùúÊ•ÿw«ÕB™aÅa+­CCCÏQòW«ÜsHa?,…Mû{y…`0B°¹¹ÉòÊ >Ÿššêêjij|]ij?UúŒuxxX$ð°>ÀX]]%’L&I&“,--©‰‰Û&ÿ©›þÖé”!IEND®B`‚shutter-0.99.6/share/shutter/resources/icons/lpi-translate.png000066400000000000000000000010741476102223600245340ustar00rootroot00000000000000‰PNG  IHDRóÿasBIT|dˆóIDAT8¥“ËkQÆ¿{g&cl•RS:H«©"‚TQºhpᮋdáF*®ÜˆºQ¤ ÿ‚ øh…ní"Õ«E)c©/hAJÛ ©¤f¦™¹¹¶i¦vªàY]ÎýÎï~çƒKr¹ì ¢Ó!!x)MÓˊ˾žžÞ—f~tdž1¦þ¥c*?:2ß Õ¹–a¸>ø5&"_Ç4ÜJÛàBX!ÀÊa|¢ˆê‹lÙÒöýàijã"ªà‚ÿ@ðèý`na ÷³à|]D÷ù'ߥRkàwÖuºò §ºw ïø.´µšx>1‡SÈôv!“²QñXÇ«÷3—†Ç —W¬YÁJ´ãÆ£O¨z ÷vâö…“`Rarº©NÛ+Dgp`Ÿ…£ví­1¸Çìfjð뮿ªmÊ `\b¦\Er[®ÏCCÔåo€FiÉõªÖÎäî¦ë·¨ ¹a¨l9t] ¤Ç7CJ©DX´˜:[M€ÏØŠƒåÑÑ,>|î±bu‰˜NA A[‹E7À@ö‹WøVF|“¡íßn0h”Åœ3hD"nRLJòæ½×ÞÇbéZ™«ò3°óï¦YoøÈÙÁNèêªFi†”P'ü‹ÎÝ3ŵÚ_”ãFÏ´vDIEND®B`‚shutter-0.99.6/share/shutter/resources/icons/notify.svg000066400000000000000000000062271476102223600233050ustar00rootroot00000000000000 image/svg+xml shutter-0.99.6/share/shutter/resources/icons/sel_window.svg000066400000000000000000000226521476102223600241470ustar00rootroot00000000000000 image/svg+xml Jakub Steiner http://jimmac.musichall.cz Windows window manager decoration behavior shutter-0.99.6/share/shutter/resources/icons/sel_window_active.svg000066400000000000000000000326241476102223600255020ustar00rootroot00000000000000 image/svg+xml Lapo Calamandrei Create a window window create new shutter-0.99.6/share/shutter/resources/icons/sel_window_menu.svg000066400000000000000000000421361476102223600251720ustar00rootroot00000000000000 image/svg+xml shutter-0.99.6/share/shutter/resources/icons/sel_window_section.svg000066400000000000000000000264521476102223600256750ustar00rootroot00000000000000 image/svg+xml shutter-0.99.6/share/shutter/resources/icons/sel_window_tooltip.svg000066400000000000000000000373561476102223600257300ustar00rootroot00000000000000 image/svg+xml Group Chat Jakub Steiner group chat IRC internet network shutter-0.99.6/share/shutter/resources/icons/selection.svg000066400000000000000000000615361476102223600237660ustar00rootroot00000000000000 image/svg+xmlGo Homejakub Steinerhttp://jimmac.musichall.czhomereturngodefaultuserdirectory shutter-0.99.6/share/shutter/resources/icons/shutter_cursor.png000066400000000000000000000003601476102223600250450ustar00rootroot00000000000000‰PNG  IHDR©¥–sRGB®ÎébKGDÿÿÿ ½§“ pHYs  šœtIMEÙ  -ÆÚ”tEXtCommentCreated with GIMPWKIDAT8Ë퓱 À@ Ääì¿@úßSiébáâÁ‡!®14$Ô¢‘cÁÕ±t¤#­åÞ2 &]B¼÷—ý¤šV…›7é)Ò–<] hMPn"ßIEND®B`‚shutter-0.99.6/share/shutter/resources/icons/shutter_cursor_frame.png000066400000000000000000000003671476102223600262260ustar00rootroot00000000000000‰PNG  IHDR©¥–sRGB®ÎébKGDÿÿÿ ½§“ pHYs  šœtIMEÙ  1ë{à tEXtCommentCreated with GIMPWRIDAT8Ëí•1 À0ÃäÒÿïÝóOeI×&…:œÁÜ"´™ çP3%Yà’x°!%-éZ®7b· ÷‘½ªÊ´ÐV8À iÍ´¤–fÇêÝÑqKø IEND®B`‚shutter-0.99.6/share/shutter/resources/icons/throbber.gif000066400000000000000000000152441476102223600235510ustar00rootroot00000000000000GIF89aBBóÿÿÿLLLzzzÜÜÜ   øøøÂÂÂ!ÿ NETSCAPE2.0!þCreated with ajaxload.info!ù ,BBÿÈI«½TÌ»ÿqÖ±UÅa€lK‰'e–áÞ aÚr,Á+œ0X4¤^epXÁ!Gw@ š•YfT1xRNJ•*à…†;±gh%ˆ»¤]~[ò5LIXLs{_}RŒru“•l_^ŒLd!;a|]_k,qM§ƒ£šmn8© i-¹¯¦·9§~¥‹o³½Å±Å˜ÂiÄ.)Œ^ϺÃÁ)MÎ×.^ÊÛ?ªàáÉÊÇxæèmëìiÍðpÉË-Éôàœø²p%PX¶_ +˜O]{¿š XÈP‚‹ šA0à—“ŠÿB9F@!È)ûNª\ɲ¥K?b6‰ó¥$Œ89zlr ‘Íœ8m J´hÅ’ßV Y cLŸ-À¸"M&mŠ›:U™§Sý©”7U‘Q8bÏ~(™Ö`Ê)Â+Õ¤˜Ô”"UÈN'Ö¶ÿ¤N]q@R–“kjkÓágoÅÉÝÔqòòú1Ðñ>ÌuGu|´f!œxÞÓXÊRÖ™I³Âp©ÎÇÆaoõÊ£2ŸýxÊéC _LìPr`Dz/8ò͘BfI¶ëeýÜÑY‘5E^%—´Gßœ}‡¯‡^8÷åØ }…ÊñÝèÊÖöNÿz…‹cÑÇzi$„Ÿ0ÓY@àMèR B€Tä<!ù ,BBÿÈI«½TÌ»ÿ!ÖqXÅa€lKfyV&áÞ a®Tüd0° ¤Þl’*VˆBAp@Tš´¥„êœ |QNJÀ“ÀTJŠî`›¬»áËY¡¶%`Àù Œs¾lGI[GpkV~ze‡t"‹”G†/˜,cz5a€wo8S¦)„Aˆ!&h©Tdj¡7k´Aª·ŒgÀBsÃÄj&ÊaªžË€º#ºÑ˹Ô­ÚÛ9¬/ìçàéáÖ\âò§ôéú¼Êí›·ÎÞ uÿä}K8°¡žxƒñÐ `@ˆçÑ['¡ÀŠÿàeì°q]Á>†É!]Áo\d‰Cš8sêÜɳƒJ{JB@´èºŸ áðTg”(F¡P£JF¦9–6c¦T©4§Q<&Ù\SŽ™*èFµä"pT5Æe„gÖ]bŸÊcÊöC¶o.ËVÔ`KÀŽx&ªÏ½#Õ­…˜²¯ÈU±©Ã¬æñ@¦‚¥I¼/ÛÚÐ5G£N…àtªq­h€iË-` U¹êZ€­qƒðHZ’ç×z'ë‚—.˜d>•N!¸·ÚUwWïö•U5É9#âÉã#‹/’‡p½/¥r7Ú™$JøæÇ{B_ù)úíEã#+­M:4ñRܯØ`OðVWá ÅK4JòÞ\êí!ù ,BBÿÈI«½TÌ»ÿ!ÖqX…`€lKÇV™åA¸8hö|¾¦Un*ƒ‘¯R8 ,ƒ'±³ ˜Î%ep8N´i'¥¢bBIXrîMÚ^ñ¥ðn“5&›4Ër`€MqIMRl&W{x[‹{’—[1Ž.di"›S0no&•,U˜†bŠm§8U„¤9½¤"ASŸ¿f&ȹI»ÉŒhơу±)ÈÚ×¾žµd ×D`¬ϰè-ÚÝðT\¬ÍsdÖøXœðë@@À~ÿ* nax’DèÐ˰=Ó`¤aEšÿ–-ÃÔ«€»D 0pE”ž ´„I³¦Í›8¡PÚ)1g©•@FáI©•Í‚H!¾ôÉ´©Ó§æüÖ²d”(9“²$…àjÑHS*])ájƒNe®|ù *™nƒI˜Éw({Aœù¦ëD¾×¾!€ÈÒÃÅ(÷l ÞËá.XŸ‹vEûÆ#5o@s™´,F/àL&†§—òÐF>Y¬z\j3…‹Åf3Ø´+Ñ¿œ#ÕLíÖG³éØY÷/Áœ/DfÒZhËË_ ö4[ÎEáº1é~±»ïRÒ›™/'ô¿‚¶“éz|y㾿GûôøKw?u²Û: œ…|÷RzõQ{¿·_zy)(žðáô u¸Ô_EÓá!ù ,BBÿÈI«½tÌ»ÿ! –pX…`€lK‰[%Ä”I¸8hÌk}¾¼œPR(X4ÆM‚8 PÏag'¸Q‚èÄTH×ÃRzÁz*0£P­iS’Œ1 eUßK\)ˆ×t0k)sZ)‰;_€‡†`Xp‡Nvœ,‹€od"¡§‰,vY€)™B~†*B­gn“.¼@R¹½qÂdÄÆŸ&·­¡ËMÎ-˜“ÑËÀ³šY˜ÛCXž—YÚäé&b±š’îS^çö:fí÷ŠçtáøUìß7ÿNȦÐ+ˆêukØ"¼"FdG±CÆs ÿúe ­Ž>ÎUBHà!Êy_ÊœI³¦Í%5Ö»9!¤ÏœOÒ„çs Ï£H“*5Ö2fÃŒò¼!(b’gÈ•W¬•,0±æGŸQ´²+XÓ"È4d•pº”UWŠâæ Éñe¶µiN•˜wÛ]¼i#ykw-^S‹°mø·ØT Êõvw bƒ‡Ÿ î‹«)gߊ|îœ×f7FšœÆ³iÑ!êiêͰjn\IÁÖ’T﹄ï"Kð…ËÚ·ÓåÎÊ A,Ú œjêç»äýJý/R×o]±ëý\h@-åq q\/wwk-8¯.¯|t»Ö+ˆŸ|xù'9ן 1ÛÉUimíGN!ù ,BBÿÈI«½t Ì»ÿ•1– XÅ`€lKÂV™¥@¸8( +E¿¦^nX U ÄìDAÄPÆaG4P6QÉo2HVœLi¡ 1óölºMЇ¬ø²³rm¾0¦ ys0*Hv…Xh^fHYn—‡]2Œ˜9)„/™C|¦lO8¢“†sHžp€9T£´“¬f¶C­eSÁR¸¼ÅªÉbéÍÈÌcU¼ÒÓ{Úqd¥ÝRNᚢÜåšèŽØ’îSðÈõ:ãíöÔȹZðåC«~žA¨°7)ŠlØ">&DÑÓGñ™cèÿò1"‘^G Œ@8¡ÂŒ.OÊœI³¦ÍEFè,rsBÊù"FÑS Ð}Š*]Ê´)´‡=ɲ°-c93Sb1eõj‰6ÉMwØ¥‘RÒºæt—ÓbÛØÚ3„ÕºÍÀYc±íªÛ“"BrÔdõ¬L!§¾ˆ· ^•âØikœjp³ö îVíeƒ O3R®fÑÝH£ûü&ô¯¿Ê üiô×I$Y¿!Jµç‘ ÜÌŠ÷$Õ™uÀž`ÖÔ@¹q_𦠮Y3¹_ʾ{y¹á©®79´-oïÓHžxÖìÈõÆçŠ×~*ÉãkŸ’ÆùÔ–Té&Ì|þÙ…žLìYà^÷õàŠE÷Öz!ù ,BBÿÈI«½t Ì»ÿ•1 –f!ƒ®,E˜•°Uƒ@´8(¦ô<2Un@*…QÌ'A –”ØÙÝ(¨é6I'N&õò*%»3@F Ôníøbðö®.€ÀÆç/<`J[LYm_sjvxd–Ou–+YVc|6!Šr+uR(Œ9N®nƒ8ufm´‰Dª·€²ž9µÁ¦¾sªÅÉ|³Ÿ¼!ÎÉ{ºu›R•×TN§”Þºà5Š®dÞÔèÚ§çtÝßðOôUïøœXHWÁd#IØï JêHpämaC‡/íÛ'ÇEoÿ;h”ŒN®äî¡\ɲ¥Ë—+ºƒIAãûºéœ6æ7•賨ѣHáyRgG:Ù±zÀ–%ŠQÿ¹Ìx3è#FN&­”¨‹G 0MÚÂ#Zp"Öš4òöš¾ªrÑ@eÈRD×’õÀÖ…÷"¨Ô‰‚:¹)f߃‡hPçªè¼yXØÎ,€ìËûô1@AIþwt›’¢¸Îl±ê ªVà3:‡#±?jû¾éŠwcÌÀ[rÛA£²^Üö—\íÕLûÚܼ|Í£VµjÔb¹‰ä¦k¿á8 ¿üær Çy‡d}·' ¨8ãK>‘¿x d‡D|ø,EŸ'˜ç“wÑCÜ‚üíQL Ó¡ô<!ù ,BBÿÈI«½´Ì»ÿ•Q Ö0XÈ`€lKÃV™å@¸8(ªóI¦Un@*šã„FIÉšO"FT¸½b=ä@)!|RB#” eÓü™¸a ^à-Á¾ØŽsdM[QNnV~iI/h€‰uQfU9c‘?u8_”@—:›cp8†‡v ©?Ÿ.´¯µ,sº~l_½»œ¾!&°a‹™Å^È “ŸÁ~¸!¦€#£Ì.)ÙS›ŒÞ¶á6Û#Ôæ"éÄ·ÝæئîrÖ÷ãöþ^˜&+«ô+ØbGº.«FÙ'F¸‹âÌ1‚¡téÿÊq¸E1à$(Sª\Ér¥‘—0[–8€ñ¢Ž eΠÉSÀ=:ƒ JÔ#I¡cj$3¨Ïx”˜ÂTXÒŸÅžâ^¬j´ÎS3\e.,ªh,CJG25[ÁŸoIe+°Ô[yç†-ã­VôÅvWÛV9{[ˆì”qÓÄÜ €<‹jÀP4Óê8H·fDRnYž0²ˆ4Ÿ÷Ê{XJŸ!žj¾À¹‘\ÊÞŽÂ ôÃÑf›<—4å¨óu›r<É'¼Æcà-qæ+è¦ðVø$4)whømšî¤·“öÙ[Ñè%Ñ' Ÿàó’Ûâ§|ª¯ý{†øÒR—zòùW~HÍW Ö •Û) :YøP!ù ,BBÿÈI«½´Ì»ÿ•Q–f!…®,%n•jko=C8¤· „€8b° aP¬ šBŽ¥ Ù1 Q–½h‡p­æ(?ÏÌÊ-Óc¸K i —þÆœ·rYvKX"]}SUO…^dU{p,D‹Bx4!m7q™dA\nž¡f‹6l?°,¢¶ˆ‰¼¹·­º•µˆq¾o`ÆD³pÉǰSL‘ÀÁB`ySÔÕ+d¼‡˜ÎÕ†¼£ ²OäÁ\ñÌÜS¦òö8ì÷Ý^ñú6ˆÀkˆ¸'ÿrðF ¶;ê)ôÀ‹`™y 'Z(¥±£Ç ÿC<ØOd…Rª$¸ì‘Ëz"Q6TƤ͛8sz”•Ï ˜.d-êQ&ÁG_ZúËÌJ0–Îê9‘ˆÌ0¯t†£ªu^Ö–V¼òÇU ‚”«ðI-J>~Öš\¢ÒMR²9Ϧ´ãbj%€èÔ@uà€]]zÙ’*|@±p|‡1åÇ*°¬Æ±3*‰>æŒæ@Í OßÉ|c@áE› ‹‰]ò¾ ¸À*|úìá-°È¬$Ú‚¦\ŸN™Á´‹È¿‰拜Bá/’cH¾Œ¡Àkì­pQ}äÁò vã]õõÒ|O¶÷PBdê㛫 e¢úõ¼gÞw6Åf€DV\Uè‰W‚ šÄœ=!ù ,BBÿÈI«½!Ì»ÿ•VQXDa€lK‰[…œ²êÞ hSE<¦n *„Q Ù³hˆ˜p’ôILµ# íT§i†&îÊ&m÷SfàæO¾=¯ÙpRýÜZÍnP`{/…!J3VeŒ.{…b‚A!&9_H‘CŽ˜—8ƒ#`§]ƒ¦v7¤‰wf®£“²l&µC¤Š¸)»³‰Š¨¸„:š†·ÆD)ËeUÈÎ-@ÑÉ{Ö×"Ú±›I¾àTÑä.§çèaßïòáîó7ÖFFÅöØ3ÑÔFŒÐÇÏ‹‰­þœÈ­à•=ê©rˆáÅ‹3jÜ%ŸG#ÿ' ùÑcȇ¤TIæ¤Ë—0c®A -¤††† 8Àó@Èh){¨г眡¥\£§€m2u¨X)Ìx2;¨ˆU6D´ä‡ (×al½D€ÛuÊòðõ]Û”Ó¤ÍK‘€Ê§ˆÖ1.¤V¯xòíB åYxÌë/åps/WvÜq'ÝÁXˆ0e™Wæ ‚»èë—ó ¢Ÿ)àY—CãØhß[[a'U eù–šTYx‚I=Á-â?ÞÊ3°sìN5;38>ù]ÉzÀSàùb'iÝ× (®ðý·„ìXÊp«¹—øb+HfÇØyÔày/ˆÇÑlX°_o¸iÔØ>WFý]!ù ,BBÿÈI«½!Ì»ÿ•–fˆ®,%n•jko=!EX¤· „@ª Š;Ø¥Ü!…J7ÅšÍ@(ô š£ü\<2o ¯T™Äp¦tmNyiMÚ Ot€ysc'}sxQŠYr"T+D†.S`‚‘‚X R#‘–P][š‘+RDd¥-Rj^«¦G°„‚4m§”´.^ŒP³¸?Á¨¥ª»ÅÇ<›…žÉB]½z“ºÐ8^^l¹Ö×Ü<½Ä“ãÉÃ7ªæ»­ßð’ÍñÑ5÷ƒô6"^éî < `Þ>>Ò Hפ‹vH˜P0 J%±£Ç ÿCÂHRdŠ SxH’ I3)c~yI³¦Í›ô0j<ø†ƒCˆ4e2 H2#Í.1€¨g¿”C¶á\Ònê‡.U ‰Y7àÞL‰óµ£#p@Ö#ä¿y±`Zyv ÖÏðˆþ@¤öKÄ÷†w€ÐÑ„Þm×”™Uú]!ù ,BBÿÈI«½”Ì»ÿ•¡Ybˆ®,%nz¦m Š4U†¥jÿщà›È2XF ļŠC²²C2ƒÕ&çéÒ@Ñž«tÕ†¼±œ$‹5!Õæ w"ý2QL)\‹”5yD"_lQ‚5Ws@zPXe—‘/Zx<{+–—y‘5¤PzŸ,¡¥qcž®-¬²q©µ³n¯!±‰¥`½!¥"“Š—ÅM(É—‹”Î[ѪÕ¸ØAÛˆ˼âä“áÚï΄ëõ+ÄöfˆßÒù³ÐÑ$ÐU-˜:r´E[xgà7„z2ÇnÀAˆ]äaÜȱ£Ç,ÿ\’‚Ä“" (9!Ú€/_6cI³¦Í›â´]äȉ¹e$KÂde@J~XB‹ùÒ Á—1êzç–¨V;ÃjkŠ©t<XÔhÀá\ÍH;Ö‚§×–ÛÏ‚·E;;þ´ˆÁÛ')ù(†á›K@Þ8脽2  \=tÓÆ@Yò*¶–ƒ4FÅ œ¹Šm ì˜‚Ñ™@ú Ž‚Ù†ÑÒF(Çvª5Е¢< a è˜Àìí+3•Ê&¬›|5ä¤)¯ ›eH‡7ÐöhÛ×éE%ö°ÆŒ´WßÒðäíÎV0zýå$ÌcCžfø}g5Bè\D`ÆÙÃÜ:!ù ,BBÿÈI«½”Ì»ÿq–f„®,…G¹UHÚÞ Ï“I¡6œ0X£O” =º$¥p(CÕ¯öôPZ‰œYÃà²{‚‘(0DF>AÑ{54Ûò:,‘F=KfY{k€w(h†Œ“8Uz}Œ-vz\7Hd™C† •z+¦h¯ž³¢‡C¥UˆL®lQ¶ˆ¡¢Æ¤H‘ÀLy7™µ'ÍÎL¯v¿_Ö¼º¿¦àÝÔºÊÛéæv¢A™Üæ†Ð7Óö—ý=  —S ”#( _:LÁ0 Ã-¢>4S€^•‹ÿ2ÖˆwaŸEiH¢\ɲ¥Ë—8$˜s‚8s>€¤' U0o Õx²¦Ñ£H“²Z“U‡}zZ š3Ÿ„ˆUªP\H0”Nœ3xRä—ÔNN1\TŠh_»n¡Þžˆ* ¨½}妉ȓìÅP ¶ÇsÑKÀ`9ð­{ïC ý> ¨2åã¢Úí’Y2¯ÂzqÐÂÚ耴–®Pjë–Õ¬I¦öœãôo†(j6vDÃxÂÎPdMêÍ%=GÍ s¹}K16ü‚8v·#q‘ðGq€ó£"‡ hf ÍU÷û=‹"ŠÞ±×éˆ\Hë5â¦ÃŸR1D‘ê^TQ#3Ûq7]8õ•ûÕñ_S N•ßÁ4O5&BÛQõ;shutter-0.99.6/share/shutter/resources/icons/throbber_16x16.gif000066400000000000000000000026601476102223600244140ustar00rootroot00000000000000GIF89aöÿÿÿúúú’’’ˆˆˆîîîÈÈÈØØØžžžŽŽŽÆÆÆ222RRRìì즦¦”””òòò‚‚‚²²²¤¤¤šššôôôøøø¨¨¨ÎÎÎDDD ```ÞÞÞèèè¼¼¼***666FFFÔÔÔÄÄÄ<<>>HHHÐÐÐÊÊÊZZZ´´´êêêppp¬¬¬¸¸¸ººº^^^\\\bbb†††ààà~~~üüü¢¢¢,,,VVVPPPÌÌÌ888XXXðððÖÖÖœœœâââæææ@@@ªªª$$$ ®®®rrrJJJ444jjjÒÒÒÀÀÀ&&&|||BBBTTT °°°äääLLLööö¶¶¶fffhhhÜÜÜ   """!ÿ NETSCAPE2.0!þCreated with ajaxload.info!ù ,h€‚ƒ "&%ƒ‰ ! (Š‚ — )‚‰‘ #'*Ÿ‚ ”Дй”‘¾$ˆ¡ ÃÅ ÃÑÒ©¾´‰Ö‰ª¬ƒÝ$$ÞÑ%ˆÓÑ!ù ,k€‚ƒ457ƒ‰Š3 /9:=9ƒ+//8; ;0ƒ, 2.6! 5ƒ-)1‰<><2ƒ.0³Š0? ŠÂÃ%$Ä‚$%‚ÆÈÊÎÑÒƒÄÕ‰׉ŠßÉÇ‚áÄ%ËÓÈ!ù ,h€‚ƒƒˆ‰ %*‰‚@A &Eƒ 8>Fˆ¢‰BC4GŠŠD´´ "&%$¹!(¿Á )Áƒ #'“˹­ŠÓ‚ Õ‚•ˆÜ$ÀÖË%¾ÑÑ!ù ,g€‚ƒ„…†‚%%‡ƒƒ$$D NR„…I Q…™…HJOS‹…0¦…457%‹3 /±³‡/¶8«‚.6ª«FPŸ†K L0Œ˜…!¶ 5–ŽL T2‹‰‚MQÞ¿†!ù ,h€‚ƒ„…†‚%%‡ƒƒ$$Œ…†„•‡›‹žŸ‚ˆ‹ %¦‡©    NE…ƒ+VXV¼‚“• "&%U>©F„™!©(GWYB[‡ ©)GZ‹ #'*†!ù ,g€‚ƒ„…†‚%%‡ƒƒ$$Œ…†„•‡›‹žŸ‡%ž$Š¢Ÿ¥ ‹P†] ]ƒF !„DS,ƒ\ Á)457I `ƒC <23Á/^_ „MQ2/Á8«.6†!ù ,g€‚ƒ„…†‚%%‡ƒƒ$$Œ…†„•‡›‹ž "&Šž‚! (ž$Š §)ªŠ #'*¤„+NR¶AOa–„6§‚—™a\Y3§‚Í‚[ZH§» †!ù ,h€‚ƒ„…‚b=J‚%%†‚Fc L$$ƒ„\ O…š‚d>"2†…0?1„457°„3/¶$Ž/8»Ž.6¶…2ǃ%B+]ª…, ¯„¡£‚S_SD–˜‚ÚÌæ;shutter-0.99.6/share/shutter/resources/icons/web_image.svg000066400000000000000000001252521476102223600237140ustar00rootroot00000000000000 image/svg+xml Globe Jakub Steiner Tuomas Kuosmanen http://jimmac.musichall.cz globe international web www internet network shutter-0.99.6/share/shutter/resources/license/000077500000000000000000000000001476102223600215545ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/license/gplv3000066400000000000000000000011321476102223600225270ustar00rootroot00000000000000Shutter is free software; you can redistribute it and/or modify it under the terms of the GNU General Public Licence as published by the Free Software Foundation; either version 3 of the Licence, or (at your option) any later version. Shutter is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . shutter-0.99.6/share/shutter/resources/license/gplv3_hint000066400000000000000000000002401476102223600235500ustar00rootroot00000000000000Shutter - Featureful Screenshot Tool Copyright © 2008-2013 Mario Kemper Copyright © 2020-2021 Google LLC, contributed by Alexey Sokolov shutter-0.99.6/share/shutter/resources/modules/000077500000000000000000000000001476102223600216025ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/modules/Shutter/000077500000000000000000000000001476102223600232405ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/modules/Shutter/App/000077500000000000000000000000001476102223600237605ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/modules/Shutter/App/AboutDialog.pm000066400000000000000000000055611476102223600265170ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::App::AboutDialog; #modules #-------------------------------------- use utf8; use strict; use warnings; use Gtk3; #Glib use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; #constructor my $self = {_sc => shift}; bless $self, $class; return $self; } sub show { my $self = shift; my $shf = Shutter::App::HelperFunctions->new($self->{_sc}); my $shutter_root = $self->{_sc}->get_root; my $d = $self->{_sc}->get_gettext; #everything is stored in external files, so it is easier to maintain my $all_hint = ""; open(GPL_HINT, "$shutter_root/share/shutter/resources/license/gplv3_hint") or die $!; while (my $hint = ) { utf8::decode $hint; $all_hint .= $hint; } close(GPL_HINT); my $all_gpl = ""; open(GPL, "$shutter_root/share/shutter/resources/license/gplv3") or die $!; while (my $gpl = ) { utf8::decode $gpl; $all_gpl .= $gpl; } close(GPL); my @all_dev; open(DEVCREDITS, "$shutter_root/share/shutter/resources/credits/dev") or die $!; while (my $dev = ) { chomp $dev; utf8::decode $dev; push @all_dev, $dev; } close(DEVCREDITS); my @all_art; open(ARTCREDITS, "$shutter_root/share/shutter/resources/credits/art") or die $!; while (my $art = ) { chomp $art; utf8::decode $art; push @all_art, $art; } close(ARTCREDITS); my $about = Gtk3::AboutDialog->new; $about->set_logo_icon_name('shutter'); $about->set_program_name($self->{_sc}->get_appname); $about->set_version($self->{_sc}->get_version); #~ $about->set_website_label("Shutter-Website"); $about->set_website("https://shutter-project.org"); $about->set_authors(\@all_dev); $about->set_artists(\@all_art); $about->set_translator_credits($d->get("translator-credits")); $about->set_copyright($all_hint); $about->set_license($all_gpl); $about->set_comments($self->{_sc}->get_rev); $about->show_all; $about->signal_connect('response' => sub { $about->destroy }); } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/App/Autostart.pm000066400000000000000000000052341476102223600263100ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::App::Autostart; use utf8; use strict; use warnings; #Glib use Glib qw/TRUE FALSE/; sub new { my $class = shift; my $self = {}; #read data binmode DATA, ":utf8"; while (my $data = ) { push @{$self->{_data}}, $data; } bless $self, $class; return $self; } sub create_autostart_file { my $self = shift; my $dir = shift; # ~/.config/autostart in most cases my $enabled = shift; my $min = shift; my $nonotification = shift; #copy in order keep original data my @data = @{$self->{_data}}; my $path = $dir . "/shutter.desktop"; open FILE, ">:utf8", $path or do { warn "WARNING: can not create/update file $path: $!\n"; return FALSE; }; foreach my $line (@data) { if ($line =~ /Exec=shutter/) { #add options my $options = ''; $options .= " --min_at_startup" if $min; $options .= " --disable_systray" if $nonotification; #remove placeholder $line =~ s//$options/; } elsif ($line =~ /X-GNOME-Autostart-enabled=false/) { $line =~ s/false/true/ if $enabled; } elsif ($line =~ /Hidden=true/) { $line =~ s/true/false/ if $enabled; } print FILE $line; } close FILE or warn "WARNING: close $path fail: $!\n"; return TRUE; } 1; __DATA__ [Desktop Entry] Version=1.0 Name=Shutter Name[de_DE]=Shutter Name[pt_BR]=Shutter GenericName=Screenshot Tool GenericName[de_DE]=Anwendung für Bildschirmfotos GenericName[pt_BR]=Captura de tela Comment=Capture, edit and share screenshots Comment[de_DE]=Bildschirmfotos aufnehmen, bearbeiten und mit Anderen teilen Comment[pt_BR]=Aplicativo avançado para capturar imagens da tela Exec=shutter Icon=shutter Terminal=false Type=Application Categories=Utility;Application; X-GNOME-Autostart-enabled=false Hidden=true shutter-0.99.6/share/shutter/resources/modules/Shutter/App/Common.pm000066400000000000000000000153751476102223600255610ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # Copyright (C) 2021 Alexander Ruzhnikov # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::App::Common; use utf8; use Moo; use Gtk3; #Gettext and filename parsing use POSIX qw/ setlocale /; use Locale::gettext; #Glib use Glib qw/ TRUE FALSE /; has shutter_root => ( is => "ro", required => 1 ); has main_window => ( is => "rw", required => 1 ); has appname => ( is => "ro", required => 1 ); has version => ( is => "ro", required => 1 ); has rev => ( is => "ro", required => 1 ); has pid => ( is => "ro", required => 1 ); has debug => ( is => "rw", default => sub {TRUE} ); has clear_cache => ( is => "rw", default => sub {FALSE} ); has min => ( is => "rw", default => sub {FALSE} ); has disable_systray => ( is => "rw", default => sub {FALSE} ); has exit_after_capture => ( is => "rw", default => sub {FALSE} ); has no_session => ( is => "rw", default => sub {FALSE} ); # private attributes has _start_with => ( is => "rw", lazy => 1 ); has _start_with_extra => ( is => "rw", lazy => 1 ); has profile_to_start_with => ( is => "rw", lazy => 1 ); has export_filename => ( is => "rw", lazy => 1 ); has delay => ( is => "rw", lazy => 1 ); has include_cursor => ( is => "rw", lazy => 1 ); has remove_cursor => ( is => "rw", lazy => 1 ); has gettext_object => ( is => "rw", lazy => 1, builder => sub { my $self = shift; my $l = Locale::gettext->domain("shutter"); $l->dir( $self->shutter_root . "/share/locale" ); return $l; }, ); has notification => ( is => "rw", lazy => 1 ); has global_settings => ( is => "rw", lazy => 1 ); #icontheme to determine if icons exist or not #in some cases we deliver fallback icons has icontheme => ( is => "rw", lazy => 1, builder => "_setup_icontheme", ); #recently used upload tab has ruu_tab => ( is => "rw", default => sub {0} ); #... and details has ruu_hosting => ( is => "rw", default => sub {0} ); has ruu_places => ( is => "rw", default => sub {0} ); # TODO: this attribute looks like isn't used. Consider to remove it later has ruu_u1 => ( is => "rw", default => sub {0} ); #recently used save folder has rusf => ( is => "rw", lazy => 1 ); #recently used open folder has ruof => ( is => "rw", lazy => 1 ); sub BUILD { my ( $self, $args ) = @_; setlocale( LC_NUMERIC, "C" ); setlocale( LC_MESSAGES, "" ); $ENV{'SHUTTER_INTL'} = $args->{shutter_root} . "/share/locale"; } sub _setup_icontheme { my $self = shift; my $theme = Gtk3::IconTheme::get_default(); $theme->append_search_path( $self->shutter_root . "/share/icons" ); return $theme; } sub get_current_monitor { my $self = shift; my ( $window_at_pointer, $x, $y, $mask ) = Gtk3::Gdk::get_default_root_window->get_pointer; my $mon = Gtk3::Gdk::Screen::get_default->get_monitor_geometry( Gtk3::Gdk::Screen::get_default->get_monitor_at_point( $x, $y ) ); return ($mon); } # Methods that were used in the old implementation and needed for backward compatibility sub get_root { shift->shutter_root } sub get_appname { shift->appname } sub get_version { shift->version } sub get_rev { shift->rev } sub get_gettext { shift->gettext_object } sub get_theme { shift->icontheme } sub get_notification_object { shift->notification } sub set_notification_object { shift->notification(shift) if @_ } sub get_globalsettings_object { shift->global_settings } sub set_globalsettings_object { shift->global_settings(shift) if @_ } sub get_rusf { shift->rusf } sub set_rusf { shift->rusf(shift) if @_ } sub get_ruof { shift->ruof } sub set_ruof { shift->ruof(shift) if @_ } sub get_ruu_tab { shift->ruu_tab } sub set_ruu_tab { shift->ruu_tab(shift) if @_ } sub get_ruu_hosting { shift->ruu_hosting } sub set_ruu_hosting { shift->ruu_hosting(shift) if @_ } sub get_ruu_places { shift->ruu_places } sub set_ruu_places { shift->ruu_places(shift) if @_ } sub get_debug { shift->debug } sub set_debug { shift->debug(shift) if @_ } sub get_clear_cache { shift->clear_cache } sub set_clear_cache { shift->clear_cache(shift) if @_ } sub get_mainwindow { shift->main_window } sub set_mainwindow { shift->main_window(shift) if @_ } sub get_min { shift->min } sub set_min { shift->min(shift) if @_ } sub get_disable_systray { shift->disable_systray } sub set_disable_systray { shift->disable_systray(shift) if @_ } sub get_exit_after_capture { shift->exit_after_capture } sub set_exit_after_capture { shift->exit_after_capture(shift) if @_ } sub get_no_session { shift->no_session } sub set_no_session { shift->no_session(shift) if @_ } sub get_start_with { my $self = shift; return ( $self->_start_with, $self->_start_with_extra ); } sub set_start_with { my $self = shift; if (@_) { $self->_start_with(shift); $self->_start_with_extra(shift); } return ( $self->_start_with, $self->_start_with_extra ); } sub get_profile_to_start_with { shift->profile_to_start_with } sub set_profile_to_start_with { shift->profile_to_start_with(shift) if @_ } sub get_export_filename { shift->export_filename } sub set_export_filename { shift->export_filename(shift) if @_ } sub get_include_cursor { shift->include_cursor } sub set_include_cursor { shift->include_cursor(shift) if @_ } sub get_remove_cursor { shift->remove_cursor } sub set_remove_cursor { shift->remove_cursor(shift) if @_ } sub get_delay { shift->delay } sub set_delay { shift->delay(shift) if @_ } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/App/Directories.pm000066400000000000000000000042701476102223600265750ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # Copyright (C) 2021 Alexander Ruzhnikov # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::App::Directories; use 5.010; use strict; use warnings; use Glib qw/ TRUE /; use constant { SHUTTER_DIR => "shutter", UNSAVED_DIR => "unsaved", TEMP_DIR => "temp", AUTOSTART_DIR => "autostart", HIDDEN_SHUTTER_DIR => ".shutter", PROFILES_DIR => "profiles" }; sub create_if_not_exists { my $dir = shift; mkdir $dir unless -d $dir && -r $dir; return $dir; } sub get_root_dir { return create_if_not_exists( Glib::get_user_cache_dir . "/" . SHUTTER_DIR ); } sub get_cache_dir { return create_if_not_exists( get_root_dir() . "/" . UNSAVED_DIR ); } sub get_temp_dir { return create_if_not_exists( get_root_dir() . "/" . TEMP_DIR ); } sub get_autostart_dir { return create_if_not_exists( Glib::get_user_config_dir . "/" . AUTOSTART_DIR ); } sub get_home_dir {Glib::get_home_dir} sub get_config_dir {Glib::get_user_config_dir} sub create_hidden_home_dir_if_not_exist { my $hidden_dir = $ENV{HOME} . "/" . HIDDEN_SHUTTER_DIR; my $hidden_profiles_dir = "$hidden_dir" . "/" . PROFILES_DIR; mkdir $hidden_dir unless -d $hidden_dir; mkdir $hidden_profiles_dir unless -d $hidden_profiles_dir; return TRUE; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/App/GlobalSettings.pm000066400000000000000000000036671476102223600272530ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::App::GlobalSettings; #modules #-------------------------------------- use utf8; use strict; use warnings; #Glib use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; my $self = {}; $self->{_image_quality} = { "png" => undef, "jpg" => undef, "webp" => undef, "avif" => undef }; $self->{_default_image_quality} = { "png" => 9, "jpg" => 90, "webp" => 98, "avif" => 68 }; bless $self, $class; return $self; } #getter / setter sub get_image_quality { my $self = shift; my $format = shift; if (defined $self->{_image_quality}{$format}) { return $self->{_image_quality}{$format}; } else { return $self->{_default_image_quality}{$format}; } } sub set_image_quality { my $self = shift; my $format = shift; if (@_) { $self->{_image_quality}{$format} = shift; } return $self->{_image_quality}{$format}; } sub clear_quality_settings { my $self = shift; $self->{_image_quality} = { "png" => undef, "jpg" => undef, "webp" => undef, "avif" => undef }; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/App/HelperFunctions.pm000066400000000000000000000126111476102223600274270ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::App::HelperFunctions; #modules #-------------------------------------- use utf8; use strict; use warnings; use Gtk3; #Glib use Glib qw/TRUE FALSE/; #-------------------------------------- ##################public subs################## sub new { my $class = shift; #constructor my $self = {_common => shift}; #import shutter dialogs my $current_window = $self->{_common}->get_mainwindow; $self->{_dialogs} = Shutter::App::SimpleDialogs->new($current_window); #gettext $self->{_d} = $self->{_common}->get_gettext; bless $self, $class; return $self; } sub xdg_open { my ($self, $dialog, $link, $user_data) = @_; my @args = ("xdg-open", "$link"); system(@args); if ($?) { my $response = $self->{_dialogs}->dlg_error_message( sprintf($self->{_d}->get("Error while executing %s."), "'xdg-open'"), sprintf($self->{_d}->get("There was an error executing %s."), "'xdg-open'"), undef, undef, undef, undef, undef, undef, sprintf($self->{_d}->get("Exit Code: %d."), $? >> 8)); } } sub xdg_open_mail { my ($self, $dialog, $mail, @user_data) = @_; my @cmd = 'xdg-email'; push @cmd, $mail if $mail; system(@cmd, @user_data); if ($?) { my $response = $self->{_dialogs}->dlg_error_message( sprintf($self->{_d}->get("Error while executing %s."), "'xdg-email'"), sprintf($self->{_d}->get("There was an error executing %s."), "'xdg-email'"), undef, undef, undef, undef, undef, undef, sprintf($self->{_d}->get("Exit Code: %d."), $? >> 8)); } } sub nautilus_sendto { my ($self, $user_data) = @_; system('nautilus-sendto', $user_data); if ($?) { my $response = $self->{_dialogs}->dlg_error_message( sprintf($self->{_d}->get("Error while executing %s."), "'nautilus-sendto'"), sprintf($self->{_d}->get("There was an error executing %s."), "'nautilus-sendto'"), undef, undef, undef, undef, undef, undef, sprintf($self->{_d}->get("Exit Code: %d."), $? >> 8)); } } sub file_exists { my ($self, $filename) = @_; return FALSE unless $filename; $filename = $self->switch_home_in_file($filename); return TRUE if (-f $filename && -r $filename); return FALSE; } sub folder_exists { my ($self, $folder) = @_; return FALSE unless $folder; $folder = $self->switch_home_in_file($folder); return TRUE if (-d $folder && -r $folder); return FALSE; } sub uri_exists { my ($self, $filename) = @_; return FALSE unless $filename; $filename = $self->switch_home_in_file($filename); my $new_giofile = Glib::IO::File::new_for_uri($filename); return TRUE if $new_giofile->query_exists; return FALSE; } sub file_executable { my ($self, $filename) = @_; return FALSE unless $filename; $filename = $self->switch_home_in_file($filename); return TRUE if (-x $filename); return FALSE; } sub switch_home_in_file { my ($self, $filename) = @_; $filename =~ s/^~/$ENV{ HOME }/; #switch ~ in path to /home/username return $filename; } sub utf8_decode { my $self = shift; my $string = shift; #see https://bugs.launchpad.net/shutter/+bug/347821 utf8::decode $string; return $string; } sub usage { my $self = shift; print "shutter [options]\n"; print "Available options:\n\n" . "Capture:\n" . "--select (starts Shutter in selection mode)\n" . "--full (starts Shutter and takes a full screen screenshot directly)\n" . "--window (starts Shutter in window selection mode)\n" . "--awindow (capture the active window)\n" . "--section (starts Shutter in section selection mode)\n" . "--menu (starts Shutter in menu selection mode)\n" . "--tooltip (starts Shutter in tooltip selection mode)\n" . "--web (starts Shutter in web capture mode)\n\n" . "Application:\n" . "--min_at_startup (starts Shutter minimized to tray)\n" . "--clear_cache (clears cache, e.g. installed plugins, at startup)\n" . "--debug (prints a lot of debugging information to STDOUT)\n" . "--disable_systray (disable systray icon)\n" . "--version (displays version information)\n" . "--help (displays this help)\n"; return TRUE; } # to help migration from Gtk2 to Gtk3 # Native Gtk3::IconSize doesn't work for some reason sub icon_size { my $self = shift; my $size = shift; my @result = Glib::Object::Introspection->invoke('Gtk', undef, 'icon_size_lookup', Glib::Object::Introspection->convert_sv_to_enum('Gtk3::IconSize', $size)); my $one = shift @result; die "icon_size($size)=$one, @result" if $one != 1; return @result; } # to help migration from Gtk2 to Gtk3 sub accel { my $self = shift; my $str = shift; Glib::Object::Introspection->invoke('Gtk', undef, 'accelerator_parse', $str); } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/App/Menu.pm000066400000000000000000001033731476102223600252310ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::App::Menu; #modules #-------------------------------------- use utf8; use strict; use warnings; use Gtk3; #Glib use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; my $sc = shift; #constructor my $self = { _common => $sc, _shf => Shutter::App::HelperFunctions->new($sc), }; bless $self, $class; return $self; } sub create_menu { my $self = shift; my $d = $self->{_common}->get_gettext; my $shutter_root = $self->{_common}->get_root; my $accel_group = Gtk3::AccelGroup->new; $self->{_common}->get_mainwindow->add_accel_group($accel_group); #MenuBar $self->{_menubar} = Gtk3::MenuBar->new(); #file $self->{_menuitem_file} = Gtk3::MenuItem->new_with_mnemonic($d->get('_File')); $self->{_menuitem_file}->set_submenu($self->fct_ret_file_menu($accel_group, $d, $shutter_root)); $self->{_menubar}->append($self->{_menuitem_file}); #edit $self->{_menuitem_edit} = Gtk3::MenuItem->new_with_mnemonic($d->get('_Edit')); $self->{_menuitem_edit}->set_submenu($self->fct_ret_edit_menu($accel_group, $d, $shutter_root)); $self->{_menubar}->append($self->{_menuitem_edit}); #view $self->{_menuitem_view} = Gtk3::MenuItem->new_with_mnemonic($d->get('_View')); $self->{_menuitem_view}->set_submenu($self->fct_ret_view_menu($accel_group, $d, $shutter_root)); $self->{_menubar}->append($self->{_menuitem_view}); #actions $self->{_menuitem_actions} = Gtk3::MenuItem->new_with_mnemonic($d->get('_Screenshot')); $self->{_menuitem_actions}->set_submenu($self->fct_ret_actions_menu($accel_group, $d, $shutter_root)); $self->{_menubar}->append($self->{_menuitem_actions}); #go-to $self->{_menuitem_session} = Gtk3::MenuItem->new_with_mnemonic($d->get('_Go')); $self->{_menuitem_session}->set_submenu($self->fct_ret_session_menu($accel_group, $d, $shutter_root)); $self->{_menubar}->append($self->{_menuitem_session}); #help $self->{_menuitem_help} = Gtk3::MenuItem->new_with_mnemonic($d->get('_Help')); $self->{_menuitem_help}->set_submenu($self->fct_ret_help_menu($accel_group, $d, $shutter_root)); $self->{_menubar}->append($self->{_menuitem_help}); #we provide a larger (more actions) menuitem actions as well #this will not be added to any menu entries $self->fct_ret_actions_menu_large($accel_group, $d, $shutter_root); return $self->{_menubar}; } sub fct_ret_file_menu { my $self = shift; my $accel_group = shift; my $d = shift; my $shutter_root = shift; #Icontheme my $icontheme = $self->{_common}->get_theme; $self->{_menu_file} = Gtk3::Menu->new(); $self->{_menuitem_new} = Gtk3::ImageMenuItem->new_from_stock('gtk-new'); $self->{_menuitem_new}->set_submenu($self->fct_ret_new_menu($accel_group, $d, $shutter_root)); $self->{_menu_file}->append($self->{_menuitem_new}); $self->{_menu_file}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_open} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Open...')); $self->{_menuitem_open}->set_image(Gtk3::Image->new_from_stock('gtk-open', 'menu')); $self->{_menuitem_open}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('O'), qw/visible/); $self->{_menu_file}->append($self->{_menuitem_open}); $self->{_menuitem_recent} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Recent _Files')); $self->{_menu_file}->append($self->{_menuitem_recent}); $self->{_menu_file}->append(Gtk3::SeparatorMenuItem->new); #~ $self->{_menuitem_save} = Gtk3::ImageMenuItem->new_with_mnemonic( $d->get('_Save') ); #~ $self->{_menuitem_save}->set_image( Gtk3::Image->new_from_stock( 'gtk-save', 'menu' ) ); #~ $self->{_menuitem_save}->set_sensitive(FALSE); #~ $self->{_menuitem_save}->add_accelerator( 'activate', $accel_group, $self->{_shf}->accel('S'), qw/visible/ ); #~ $self->{_menu_file}->append( $self->{_menuitem_save} ); $self->{_menuitem_save_as} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Save _As...')); $self->{_menuitem_save_as}->set_image(Gtk3::Image->new_from_stock('gtk-save-as', 'menu')); $self->{_menuitem_save_as}->set_sensitive(FALSE); $self->{_menuitem_save_as}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('S'), qw/visible/); $self->{_menu_file}->append($self->{_menuitem_save_as}); #~ $self->{_menuitem_export_svg} = Gtk3::ImageMenuItem->new_with_mnemonic( $d->get('Export to SVG...') ); #~ $self->{_menuitem_export_svg}->set_sensitive(FALSE); #~ $self->{_menuitem_export_svg}->add_accelerator( 'activate', $accel_group, $self->{_shf}->accel('G'), qw/visible/ ); #~ $self->{_menu_file}->append( $self->{_menuitem_export_svg} ); $self->{_menuitem_export_pdf} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('E_xport to PDF...')); $self->{_menuitem_export_pdf}->set_sensitive(FALSE); $self->{_menuitem_export_pdf}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('P'), qw/visible/); $self->{_menu_file}->append($self->{_menuitem_export_pdf}); $self->{_menuitem_export_pscript} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Export to Post_Script...')); $self->{_menuitem_export_pscript}->set_sensitive(FALSE); $self->{_menuitem_export_pscript}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('S'), qw/visible/); $self->{_menu_file}->append($self->{_menuitem_export_pscript}); $self->{_menu_file}->append(Gtk3::SeparatorMenuItem->new); #~ $self->{_menuitem_pagesetup} = Gtk3::ImageMenuItem->new_from_stock('gtk-page-setup'); #~ $self->{_menu_file}->append( $self->{_menuitem_pagesetup} ); $self->{_menuitem_pagesetup} = Gtk3::ImageMenuItem->new($d->get('Page Set_up')); $self->{_menuitem_pagesetup}->set_image(Gtk3::Image->new_from_icon_name('document-page-setup', 'menu')); $self->{_menuitem_pagesetup}->set_sensitive(FALSE); $self->{_menu_file}->append($self->{_menuitem_pagesetup}); $self->{_menuitem_print} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Print...')); $self->{_menuitem_print}->set_image(Gtk3::Image->new_from_stock('gtk-print', 'menu')); $self->{_menuitem_print}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('P'), qw/visible/); $self->{_menuitem_print}->set_sensitive(FALSE); $self->{_menu_file}->append($self->{_menuitem_print}); $self->{_menu_file}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_email} = Gtk3::ImageMenuItem->new($d->get('Send by E_mail...')); $self->{_menuitem_email}->set_image(Gtk3::Image->new_from_icon_name('mail-send', 'menu')); $self->{_menuitem_email}->set_sensitive(FALSE); $self->{_menuitem_email}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('E'), qw/visible/); $self->{_menu_file}->append($self->{_menuitem_email}); $self->{_menu_file}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_close} = Gtk3::ImageMenuItem->new_from_stock('gtk-close'); $self->{_menuitem_close}->set_sensitive(FALSE); $self->{_menuitem_close}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('W'), qw/visible/); $self->{_menu_file}->append($self->{_menuitem_close}); $self->{_menuitem_close_all} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('C_lose all')); $self->{_menuitem_close_all}->set_image(Gtk3::Image->new_from_stock('gtk-close', 'menu')); $self->{_menuitem_close_all}->set_sensitive(FALSE); $self->{_menuitem_close_all}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('W'), qw/visible/); $self->{_menu_file}->append($self->{_menuitem_close_all}); $self->{_menu_file}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_quit} = Gtk3::ImageMenuItem->new_from_stock('gtk-quit'); $self->{_menuitem_quit}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('Q'), qw/visible/); $self->{_menu_file}->append($self->{_menuitem_quit}); return $self->{_menu_file}; } sub fct_ret_edit_menu { my $self = shift; my $accel_group = shift; my $d = shift; my $shutter_root = shift; #Icontheme my $icontheme = $self->{_common}->get_theme; $self->{_menu_edit} = Gtk3::Menu->new(); $self->{_menuitem_undo} = Gtk3::ImageMenuItem->new_from_stock('gtk-undo'); $self->{_menuitem_undo}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('Z'), qw/visible/); $self->{_menuitem_undo}->set_sensitive(FALSE); $self->{_menu_edit}->append($self->{_menuitem_undo}); $self->{_menuitem_redo} = Gtk3::ImageMenuItem->new_from_stock('gtk-redo'); $self->{_menuitem_redo}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('Y'), qw/visible/); $self->{_menuitem_redo}->set_sensitive(FALSE); $self->{_menu_edit}->append($self->{_menuitem_redo}); $self->{_menu_edit}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_copy} = Gtk3::ImageMenuItem->new_from_stock('gtk-copy'); $self->{_menuitem_copy}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('C'), qw/visible/); $self->{_menuitem_copy}->set_sensitive(FALSE); $self->{_menu_edit}->append($self->{_menuitem_copy}); $self->{_menuitem_copy_filename} = Gtk3::ImageMenuItem->new_from_stock('gtk-copy'); $self->{_menuitem_copy_filename}->get_child->set_text_with_mnemonic($d->get('Copy _Filename')); $self->{_menuitem_copy_filename}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('C'), qw/visible/); $self->{_menuitem_copy_filename}->set_sensitive(FALSE); $self->{_menu_edit}->append($self->{_menuitem_copy_filename}); $self->{_menuitem_trash} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Move to _Trash')); $self->{_menuitem_trash}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('Delete'), qw/visible/); $self->{_menuitem_trash}->set_image(Gtk3::Image->new_from_icon_name('user-trash', 'menu')); $self->{_menuitem_trash}->set_sensitive(FALSE); $self->{_menu_edit}->append($self->{_menuitem_trash}); $self->{_menu_edit}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_select_all} = Gtk3::ImageMenuItem->new_from_stock('gtk-select-all'); $self->{_menuitem_select_all}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('A'), qw/visible/); $self->{_menu_edit}->append($self->{_menuitem_select_all}); $self->{_menu_edit}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_quicks} = Gtk3::MenuItem->new_with_mnemonic($d->get('_Quick profile select')); $self->{_menu_edit}->append($self->{_menuitem_quicks}); $self->{_menu_edit}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_settings} = Gtk3::ImageMenuItem->new_from_stock('gtk-preferences'); $self->{_menuitem_settings}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('P'), qw/visible/); $self->{_menu_edit}->append($self->{_menuitem_settings}); return $self->{_menu_edit}; } sub fct_ret_view_menu { my $self = shift; my $accel_group = shift; my $d = shift; my $shutter_root = shift; #Icontheme my $icontheme = $self->{_common}->get_theme; $self->{_menu_view} = Gtk3::Menu->new(); $self->{_menuitem_btoolbar} = Gtk3::CheckMenuItem->new_with_mnemonic($d->get('Show Navigation _Toolbar')); $self->{_menuitem_btoolbar}->set_active(FALSE); $self->{_menu_view}->append($self->{_menuitem_btoolbar}); $self->{_menu_view}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_zoom_in} = Gtk3::ImageMenuItem->new_from_stock('gtk-zoom-in'); $self->{_menuitem_zoom_in}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('plus'), qw/visible/); $self->{_menuitem_zoom_in}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('equal'), qw/visible/); $self->{_menuitem_zoom_in}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('KP_Add'), qw/visible/); $self->{_menuitem_zoom_in}->set_sensitive(FALSE); $self->{_menu_view}->append($self->{_menuitem_zoom_in}); $self->{_menuitem_zoom_out} = Gtk3::ImageMenuItem->new_from_stock('gtk-zoom-out'); $self->{_menuitem_zoom_out}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('minus'), qw/visible/); $self->{_menuitem_zoom_out}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('KP_Subtract'), qw/visible/); $self->{_menuitem_zoom_out}->set_sensitive(FALSE); $self->{_menu_view}->append($self->{_menuitem_zoom_out}); $self->{_menuitem_zoom_100} = Gtk3::ImageMenuItem->new_from_stock('gtk-zoom-100'); $self->{_menuitem_zoom_100}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('0'), qw/visible/); $self->{_menuitem_zoom_100}->set_sensitive(FALSE); $self->{_menu_view}->append($self->{_menuitem_zoom_100}); $self->{_menuitem_zoom_best} = Gtk3::ImageMenuItem->new_from_stock('gtk-zoom-fit'); $self->{_menuitem_zoom_best}->set_sensitive(FALSE); $self->{_menu_view}->append($self->{_menuitem_zoom_best}); $self->{_menu_view}->append(Gtk3::SeparatorMenuItem->new); #create an image item from stock to reuse the translated text $self->{_menuitem_fullscreen_image} = Gtk3::ImageMenuItem->new_from_stock('gtk-fullscreen'); $self->{_menuitem_fullscreen} = Gtk3::CheckMenuItem->new_with_label($self->{_menuitem_fullscreen_image}->get_child->get_text); $self->{_menuitem_fullscreen}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('F11'), qw/visible/); $self->{_menu_view}->append($self->{_menuitem_fullscreen}); return $self->{_menu_view}; } sub fct_ret_session_menu { my $self = shift; my $accel_group = shift; my $d = shift; my $shutter_root = shift; #Icontheme my $icontheme = $self->{_common}->get_theme; $self->{_menu_session} = Gtk3::Menu->new(); $self->{_menuitem_back} = Gtk3::ImageMenuItem->new_from_stock('gtk-go-back'); $self->{_menuitem_back}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('Left'), qw/visible/); $self->{_menu_session}->append($self->{_menuitem_back}); $self->{_menuitem_forward} = Gtk3::ImageMenuItem->new_from_stock('gtk-go-forward'); $self->{_menuitem_forward}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('Right'), qw/visible/); $self->{_menu_session}->append($self->{_menuitem_forward}); $self->{_menu_session}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_first} = Gtk3::ImageMenuItem->new_from_stock('gtk-goto-first'); $self->{_menuitem_first}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('Home'), qw/visible/); $self->{_menu_session}->append($self->{_menuitem_first}); $self->{_menuitem_last} = Gtk3::ImageMenuItem->new_from_stock('gtk-goto-last'); $self->{_menuitem_last}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('End'), qw/visible/); $self->{_menu_session}->append($self->{_menuitem_last}); return $self->{_menu_session}; } sub fct_ret_help_menu { my $self = shift; my $accel_group = shift; my $d = shift; my $shutter_root = shift; #Icontheme my $icontheme = $self->{_common}->get_theme; $self->{_menu_help} = Gtk3::Menu->new(); $self->{_menuitem_question} = Gtk3::ImageMenuItem->new($d->get('Get Help Online...')); if ($icontheme->has_icon('lpi-help')) { $self->{_menuitem_question}->set_image(Gtk3::Image->new_from_icon_name('lpi-help', 'menu')); } else { $self->{_menuitem_question} ->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/lpi-help.png", $self->{_shf}->icon_size('menu')))); } $self->{_menu_help}->append($self->{_menuitem_question}); $self->{_menuitem_translate} = Gtk3::ImageMenuItem->new($d->get('Translate this Application...')); if ($icontheme->has_icon('lpi-translate')) { $self->{_menuitem_translate}->set_image(Gtk3::Image->new_from_icon_name('lpi-translate', 'menu')); } else { $self->{_menuitem_translate} ->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/lpi-translate.png", $self->{_shf}->icon_size('menu')))); } $self->{_menu_help}->append($self->{_menuitem_translate}); $self->{_menuitem_bug} = Gtk3::ImageMenuItem->new($d->get('Report a Problem')); if ($icontheme->has_icon('lpi-bug')) { $self->{_menuitem_bug}->set_image(Gtk3::Image->new_from_icon_name('lpi-bug', 'menu')); } else { $self->{_menuitem_bug} ->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/lpi-bug.png", $self->{_shf}->icon_size('menu')))); } $self->{_menu_help}->append($self->{_menuitem_bug}); $self->{_menu_help}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_about} = Gtk3::ImageMenuItem->new_from_stock('gtk-about'); $self->{_menuitem_about}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('I'), qw/visible/); $self->{_menu_help}->append($self->{_menuitem_about}); return $self->{_menu_help}; } sub fct_ret_new_menu { my $self = shift; my $accel_group = shift; my $d = shift; my $shutter_root = shift; #Icontheme my $icontheme = $self->{_common}->get_theme; $self->{_menu_new} = Gtk3::Menu->new; #redo last capture $self->{_menuitem_redoshot} = Gtk3::ImageMenuItem->new_from_stock('gtk-refresh'); $self->{_menuitem_redoshot}->get_child->set_text_with_mnemonic($d->get('_Redo last screenshot')); $self->{_menuitem_redoshot}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('F5'), qw/visible/); $self->{_menuitem_redoshot}->set_sensitive(FALSE); $self->{_menu_new}->append($self->{_menuitem_redoshot}); $self->{_menu_new}->append(Gtk3::SeparatorMenuItem->new); #selection $self->{_menuitem_selection} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Selection')); eval { my $ccursor_pb = Gtk3::Gdk::Cursor->new('left_ptr')->get_image->scale_simple($self->{_shf}->icon_size('menu'), 'bilinear'); $self->{_menuitem_selection}->set_image(Gtk3::Image->new_from_pixbuf($ccursor_pb)); }; if ($@) { if ($icontheme->has_icon('applications-accessories')) { $self->{_menuitem_selection}->set_image(Gtk3::Image->new_from_icon_name('applications-accessories', 'menu')); } else { $self->{_menuitem_selection} ->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/selection.svg", $self->{_shf}->icon_size('menu')))); } } $self->{_menu_new}->append($self->{_menuitem_selection}); #~ $self->{_menu_new}->append( Gtk3::SeparatorMenuItem->new ); #full screen $self->{_menuitem_full} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Desktop')); if ($icontheme->has_icon('user-desktop')) { $self->{_menuitem_full}->set_image(Gtk3::Image->new_from_icon_name('user-desktop', 'menu')); } elsif ($icontheme->has_icon('desktop')) { $self->{_menuitem_full}->set_image(Gtk3::Image->new_from_icon_name('desktop', 'menu')); } else { $self->{_menuitem_full} ->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/desktop.svg", $self->{_shf}->icon_size('menu')))); } $self->{_menu_new}->append($self->{_menuitem_full}); #~ $self->{_menu_new}->append( Gtk3::SeparatorMenuItem->new ); #awindow $self->{_menuitem_awindow} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Active Window')); if ($icontheme->has_icon('preferences-system-windows')) { $self->{_menuitem_awindow}->set_image(Gtk3::Image->new_from_icon_name('preferences-system-windows', 'menu')); } else { $self->{_menuitem_awindow} ->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/sel_window_active.svg", $self->{_shf}->icon_size('menu')))); } $self->{_menu_new}->append($self->{_menuitem_awindow}); #window $self->{_menuitem_window} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Select W_indow')); if ($icontheme->has_icon('preferences-system-windows')) { $self->{_menuitem_window}->set_image(Gtk3::Image->new_from_icon_name('preferences-system-windows', 'menu')); } else { $self->{_menuitem_window} ->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/sel_window.svg", $self->{_shf}->icon_size('menu')))); } $self->{_menu_new}->append($self->{_menuitem_window}); #section # No sections for now: https://github.com/shutter-project/shutter/issues/25 #$self->{_menuitem_section} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Se_ction')); #if ($icontheme->has_icon('gdm-xnest')) { # $self->{_menuitem_section}->set_image(Gtk3::Image->new_from_icon_name('gdm-xnest', 'menu')); #} else { # $self->{_menuitem_section} # ->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/sel_window_section.svg", $self->{_shf}->icon_size('menu')))); #} #$self->{_menu_new}->append($self->{_menuitem_section}); #menu $self->{_menuitem_menu} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Menu')); if ($icontheme->has_icon('alacarte')) { $self->{_menuitem_menu}->set_image(Gtk3::Image->new_from_icon_name('alacarte', 'menu')); } else { $self->{_menuitem_menu} ->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/sel_window_menu.svg", $self->{_shf}->icon_size('menu')))); } $self->{_menu_new}->append($self->{_menuitem_menu}); #tooltip $self->{_menuitem_tooltip} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Tooltip')); if ($icontheme->has_icon('help-faq')) { $self->{_menuitem_tooltip}->set_image(Gtk3::Image->new_from_icon_name('help-faq', 'menu')); } else { $self->{_menuitem_tooltip} ->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/sel_window_tooltip.svg", $self->{_shf}->icon_size('menu')))); } $self->{_menu_new}->append($self->{_menuitem_tooltip}); #~ $self->{_menu_new}->append( Gtk3::SeparatorMenuItem->new ); #web $self->{_menuitem_web} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Web')); if ($icontheme->has_icon('web-browser')) { $self->{_menuitem_web}->set_image(Gtk3::Image->new_from_icon_name('web-browser', 'menu')); } else { $self->{_menuitem_web} ->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/web_image.svg", $self->{_shf}->icon_size('menu')))); } $self->{_menu_new}->append($self->{_menuitem_web}); $self->{_menu_new}->append(Gtk3::SeparatorMenuItem->new); #import from clipboard $self->{_menuitem_iclipboard} = Gtk3::ImageMenuItem->new_from_stock('gtk-paste'); $self->{_menuitem_iclipboard}->get_child->set_text_with_mnemonic($d->get('Import from clip_board')); $self->{_menuitem_iclipboard}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('V'), qw/visible/); $self->{_menu_new}->append($self->{_menuitem_iclipboard}); $self->{_menu_new}->show_all; return $self->{_menu_new}; } sub fct_ret_actions_menu { my $self = shift; my $accel_group = shift; my $d = shift; my $shutter_root = shift; #Icontheme my $icontheme = $self->{_common}->get_theme; $self->{_menu_actions} = Gtk3::Menu->new(); $self->{_menuitem_reopen} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Open wit_h')); $self->{_menuitem_reopen}->set_image(Gtk3::Image->new_from_stock('gtk-open', 'menu')); $self->{_menuitem_reopen}->set_sensitive(FALSE); $self->{_menuitem_reopen}->set_name('item-reopen-list'); $self->{_menu_actions}->append($self->{_menuitem_reopen}); $self->{_menuitem_show_in_folder} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Show in _folder')); $self->{_menuitem_show_in_folder}->set_image(Gtk3::Image->new_from_stock('gtk-open', 'menu')); $self->{_menuitem_show_in_folder}->set_sensitive(FALSE); $self->{_menuitem_show_in_folder}->set_name('item-reopen-default'); $self->{_menu_actions}->append($self->{_menuitem_show_in_folder}); $self->{_menuitem_rename} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Rename...')); $self->{_menuitem_rename}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('F2'), qw/visible/) if $accel_group; $self->{_menuitem_rename}->set_image(Gtk3::Image->new_from_stock('gtk-edit', 'menu')); $self->{_menuitem_rename}->set_sensitive(FALSE); $self->{_menuitem_rename}->set_name('item-rename'); $self->{_menu_actions}->append($self->{_menuitem_rename}); $self->{_menu_actions}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_send} = Gtk3::ImageMenuItem->new($d->get('_Send To...')); $self->{_menuitem_send}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('S'), qw/visible/); $self->{_menuitem_send}->set_image(Gtk3::Image->new_from_icon_name('document-send', 'menu')); $self->{_menuitem_send}->set_sensitive(FALSE); $self->{_menuitem_send}->set_name('item-send'); $self->{_menu_actions}->append($self->{_menuitem_send}); $self->{_menuitem_upload} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('E_xport...')); $self->{_menuitem_upload}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('U'), qw/visible/) if $accel_group; $self->{_menuitem_upload}->set_image(Gtk3::Image->new_from_stock('gtk-network', 'menu')); $self->{_menuitem_upload}->set_sensitive(FALSE); $self->{_menuitem_upload}->set_name('item-upload'); $self->{_menu_actions}->append($self->{_menuitem_upload}); $self->{_menuitem_links} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Public URLs')); $self->{_menuitem_links}->set_image(Gtk3::Image->new_from_stock('gtk-network', 'menu')); $self->{_menuitem_links}->set_sensitive(FALSE); $self->{_menuitem_links}->set_name('item-links'); $self->{_menu_actions}->append($self->{_menuitem_links}); $self->{_menu_actions}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_draw} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Edit...')); $self->{_menuitem_draw}->set_image(Gtk3::Image->new_from_stock('gtk-edit', 'menu')); $self->{_menuitem_draw}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('E'), qw/visible/) if $accel_group; if ($icontheme->has_icon('applications-graphics')) { $self->{_menuitem_draw}->set_image(Gtk3::Image->new_from_icon_name('applications-graphics', 'menu')); } else { $self->{_menuitem_draw} ->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/draw.svg", $self->{_shf}->icon_size('menu')))); } $self->{_menuitem_draw}->set_sensitive(FALSE); $self->{_menuitem_draw}->set_name('item-draw'); $self->{_menu_actions}->append($self->{_menuitem_draw}); $self->{_menuitem_plugin} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Run a _plugin...')); $self->{_menuitem_plugin}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('P'), qw/visible/) if $accel_group; $self->{_menuitem_plugin}->set_image(Gtk3::Image->new_from_stock('gtk-execute', 'menu')); $self->{_menuitem_plugin}->set_sensitive(FALSE); $self->{_menuitem_plugin}->set_name('item-plugin'); $self->{_menu_actions}->append($self->{_menuitem_plugin}); $self->{_menu_actions}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_redoshot_this} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Redo _this screenshot')); $self->{_menuitem_redoshot_this}->add_accelerator('activate', $accel_group, $self->{_shf}->accel('F5'), qw/visible/) if $accel_group; $self->{_menuitem_redoshot_this}->set_image(Gtk3::Image->new_from_stock('gtk-refresh', 'menu')); $self->{_menuitem_redoshot_this}->set_sensitive(FALSE); $self->{_menuitem_redoshot_this}->set_name('item-redoshot'); $self->{_menu_actions}->append($self->{_menuitem_redoshot_this}); $self->{_menu_actions}->show_all; return $self->{_menu_actions}; } sub fct_ret_actions_menu_large { my $self = shift; my $accel_group = shift; my $d = shift; my $shutter_root = shift; #Icontheme my $icontheme = $self->{_common}->get_theme; $self->{_menu_large_actions} = Gtk3::Menu->new(); $self->{_menuitem_large_reopen} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Open wit_h')); $self->{_menuitem_large_reopen}->set_image(Gtk3::Image->new_from_stock('gtk-open', 'menu')); $self->{_menuitem_large_reopen}->set_sensitive(FALSE); $self->{_menuitem_large_reopen}->set_name('item-large-reopen-list'); $self->{_menu_large_actions}->append($self->{_menuitem_large_reopen}); $self->{_menuitem_large_show_in_folder} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Show in _folder')); $self->{_menuitem_large_show_in_folder}->set_image(Gtk3::Image->new_from_stock('gtk-open', 'menu')); $self->{_menuitem_large_show_in_folder}->set_sensitive(FALSE); $self->{_menuitem_large_show_in_folder}->set_name('item-reopen-default'); $self->{_menu_large_actions}->append($self->{_menuitem_large_show_in_folder}); $self->{_menuitem_large_rename} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Rename...')); $self->{_menuitem_large_rename}->set_image(Gtk3::Image->new_from_stock('gtk-edit', 'menu')); $self->{_menuitem_large_rename}->set_sensitive(FALSE); $self->{_menuitem_large_rename}->set_name('item-large-rename'); $self->{_menu_large_actions}->append($self->{_menuitem_large_rename}); $self->{_menu_large_actions}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_large_send} = Gtk3::ImageMenuItem->new($d->get('_Send To...')); $self->{_menuitem_large_send}->set_image(Gtk3::Image->new_from_icon_name('document-send', 'menu')); $self->{_menuitem_send}->set_sensitive(FALSE); $self->{_menuitem_send}->set_name('item-large-send'); $self->{_menu_large_actions}->append($self->{_menuitem_large_send}); $self->{_menuitem_large_upload} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('E_xport...')); $self->{_menuitem_large_upload}->set_image(Gtk3::Image->new_from_stock('gtk-network', 'menu')); $self->{_menuitem_large_upload}->set_sensitive(FALSE); $self->{_menuitem_large_upload}->set_name('item-large-upload'); $self->{_menu_large_actions}->append($self->{_menuitem_large_upload}); $self->{_menuitem_large_links} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Public URLs')); $self->{_menuitem_large_links}->set_image(Gtk3::Image->new_from_stock('gtk-network', 'menu')); $self->{_menuitem_large_links}->set_sensitive(FALSE); $self->{_menuitem_large_links}->set_name('item-large-links'); $self->{_menu_large_actions}->append($self->{_menuitem_large_links}); $self->{_menu_large_actions}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_large_copy} = Gtk3::ImageMenuItem->new_from_stock('gtk-copy'); $self->{_menuitem_large_copy}->set_sensitive(FALSE); $self->{_menuitem_large_copy}->set_name('item-large-copy'); $self->{_menu_large_actions}->append($self->{_menuitem_large_copy}); $self->{_menuitem_large_copy_filename} = Gtk3::ImageMenuItem->new_from_stock('gtk-copy'); $self->{_menuitem_large_copy_filename}->get_child->set_text_with_mnemonic($d->get('Copy _Filename')); $self->{_menuitem_large_copy_filename}->set_sensitive(FALSE); $self->{_menuitem_large_copy_filename}->set_name('item-large-copy-filename'); $self->{_menu_large_actions}->append($self->{_menuitem_large_copy_filename}); $self->{_menuitem_large_trash} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Move to _Trash')); $self->{_menuitem_large_trash}->set_image(Gtk3::Image->new_from_icon_name('gnome-stock-trash', 'menu')); $self->{_menuitem_large_trash}->set_sensitive(FALSE); $self->{_menuitem_large_trash}->set_name('item-large-trash'); $self->{_menu_large_actions}->append($self->{_menuitem_large_trash}); $self->{_menu_large_actions}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_large_draw} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('_Edit...')); $self->{_menuitem_large_draw}->set_image(Gtk3::Image->new_from_stock('gtk-edit', 'menu')); if ($icontheme->has_icon('applications-graphics')) { $self->{_menuitem_large_draw}->set_image(Gtk3::Image->new_from_icon_name('applications-graphics', 'menu')); } else { $self->{_menuitem_large_draw} ->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/draw.svg", $self->{_shf}->icon_size('menu')))); } $self->{_menuitem_large_draw}->set_sensitive(FALSE); $self->{_menuitem_large_draw}->set_name('item-large-draw'); $self->{_menu_large_actions}->append($self->{_menuitem_large_draw}); $self->{_menuitem_large_plugin} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Run a _Plugin...')); $self->{_menuitem_large_plugin}->set_image(Gtk3::Image->new_from_stock('gtk-execute', 'menu')); $self->{_menuitem_large_plugin}->set_sensitive(FALSE); $self->{_menuitem_large_plugin}->set_name('item-large-plugin'); $self->{_menu_large_actions}->append($self->{_menuitem_large_plugin}); $self->{_menu_large_actions}->append(Gtk3::SeparatorMenuItem->new); $self->{_menuitem_large_redoshot_this} = Gtk3::ImageMenuItem->new_with_mnemonic($d->get('Redo _this screenshot')); $self->{_menuitem_large_redoshot_this}->set_image(Gtk3::Image->new_from_stock('gtk-refresh', 'menu')); $self->{_menuitem_large_redoshot_this}->set_sensitive(FALSE); $self->{_menuitem_large_redoshot_this}->set_name('item-large-redoshot'); $self->{_menu_large_actions}->append($self->{_menuitem_large_redoshot_this}); $self->{_menu_large_actions}->show_all; return $self->{_menu_large_actions}; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/App/Notification.pm000066400000000000000000000044031476102223600267450ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::App::Notification; #modules #-------------------------------------- use utf8; use strict; use warnings; use Net::DBus; #Glib use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; my $self = {}; #Use notifications object eval { $self->{_notifications_service} = Net::DBus->session->get_service('org.freedesktop.Notifications'); $self->{_notifications_object} = $self->{_notifications_service}->get_object('/org/freedesktop/Notifications', 'org.freedesktop.Notifications'); }; if ($@) { print "Warning: $@", "\n"; } #last nid $self->{_nid} = 0; bless $self, $class; return $self; } sub show { my $self = shift; my $summary = shift; my $body = shift; my $nid = shift || $self->{_nid}; #notification eval { if (defined $self->{_notifications_object}) { $self->{_nid} = $self->{_notifications_object}->Notify('Shutter', $nid, "gtk-dialog-info", $summary, $body, [], {}, -1); } }; if ($@) { print "NotifyWarning: $@", "\n"; } return $self->{_nid}; } sub close { my $self = shift; my $nid = shift || $self->{_nid}; #close notification if ($nid) { eval { if (defined $self->{_notifications_object}) { $self->{_notifications_object}->CloseNotification($nid); } }; if ($@) { print "CloseNotificationWarning: $@", "\n"; } return TRUE; } return FALSE; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/App/Optional/000077500000000000000000000000001476102223600255455ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/modules/Shutter/App/Optional/Exif.pm000066400000000000000000000026401476102223600270000ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::App::Optional::Exif; #modules #-------------------------------------- use utf8; use strict; use warnings; use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; my $self = {}; #libimage-exiftool-perl eval { require Image::ExifTool }; if ($@) { $self->{_exiftool} = FALSE; } else { $self->{_exiftool} = new Image::ExifTool; } bless $self, $class; return $self; } #getter / setter sub get_exiftool { my $self = shift; return $self->{_exiftool}; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/App/Options.pm000066400000000000000000000076241476102223600257620ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::App::Options; use utf8; use strict; use warnings; use Encode::Locale; use Encode; #Glib use Glib qw/TRUE FALSE/; #Extended processing of command line options use Getopt::Long qw(:config no_ignore_case pass_through); #print a usage message from embedded pod documentation use Pod::Usage; sub new { my $class = shift; my $self = {_sc => shift, _shf => shift}; bless $self, $class; return $self; } sub get_options { my $self = shift; GetOptions( 's|select:s@' => sub { my ($select, $sel_ref) = @_; $self->{_sc}->set_start_with("select", $sel_ref); $self->{_sc}->set_min(TRUE); }, 'f|full' => sub { $self->{_sc}->set_start_with("full"); $self->{_sc}->set_min(TRUE); }, 'w|window:s' => sub { my ($web, $name) = @_; $self->{_sc}->set_start_with("window", $name); $self->{_sc}->set_min(TRUE); }, 'a|active' => sub { $self->{_sc}->set_start_with("awindow"); $self->{_sc}->set_min(TRUE); }, # No sections for now: https://github.com/shutter-project/shutter/issues/25 #'section' => sub { $self->{_sc}->set_start_with("section"); $self->{_sc}->set_min(TRUE); }, 'm|menu' => sub { $self->{_sc}->set_start_with("menu"); $self->{_sc}->set_min(TRUE); }, 't|tooltip' => sub { $self->{_sc}->set_start_with("tooltip"); $self->{_sc}->set_min(TRUE); }, 'web:s' => sub { my ($web, $url) = @_; $self->{_sc}->set_start_with("web", $url); }, 'r|redo' => sub { $self->{_sc}->set_start_with("redoshot"); $self->{_sc}->set_min(TRUE); }, 'p|profile=s' => sub { my ($p, $profile) = @_; $self->{_sc}->set_profile_to_start_with($profile); }, 'o|output=s' => sub { my ($o, $output) = @_; $self->{_sc}->set_export_filename($output); }, 'c|include_cursor' => sub { $self->{_sc}->set_include_cursor(TRUE); }, 'C|remove_cursor' => sub { $self->{_sc}->set_remove_cursor(TRUE); }, 'd|delay=s' => sub { my ($d, $delay) = @_; $self->{_sc}->set_delay($delay); }, 'h|help' => sub { pod2usage(-verbose => 1); }, 'v|version' => sub { print $self->{_sc}->get_version, " ", $self->{_sc}->get_rev, "\n"; exit; }, 'debug' => sub { $self->{_sc}->set_debug(TRUE); }, 'clear_cache' => sub { $self->{_sc}->set_clear_cache(TRUE); }, 'min_at_startup' => sub { $self->{_sc}->set_min(TRUE); }, 'disable_systray' => sub { $self->{_sc}->set_disable_systray(TRUE); }, 'e|exit_after_capture' => sub { $self->{_sc}->set_exit_after_capture(TRUE); }, 'n|no_session' => sub { $self->{_sc}->set_no_session(TRUE); }, ); #unknown value are passed through in @ARGV - might be filenames my @init_files; if (@ARGV > 0) { foreach my $arg (map { decode(locale => $_, 1) } @ARGV) { if ($self->{_shf}->file_exists($arg) || $self->{_shf}->uri_exists($arg)) { #push filename to array, open when GUI is initialized push @init_files, $arg; next; } else { warn "ERROR: unknown command or filename " . $arg . " \n\n"; pod2usage(-verbose => 1); } } } return \@init_files; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/App/ShutterNotification.pm000066400000000000000000000153271476102223600303330ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::App::ShutterNotification; #modules #-------------------------------------- use utf8; use strict; use warnings; #Glib use Glib qw/TRUE FALSE/; #Gtk3 and Pango use Gtk3; use Pango; #-------------------------------------- sub new { my $class = shift; my $self = {_sc => shift}; #Use notifications object eval { #notification window (borderless gtk window) $self->{_notifications_window} = Gtk3::Window->new('popup'); if ($self->{_sc}->get_mainwindow->get_screen->is_composited) { my $screen = $self->{_sc}->get_mainwindow->get_screen; # Glib::Object::Introspection doesn't support method call via # cross-package inheritance, call it as a free function instead # (X11Screen inherits from Screen) $self->{_notifications_window}->set_visual(Gtk3::Gdk::Screen::get_rgba_visual($screen) || Gtk3::Gdb::Screen::get_system_visual($screen)); } $self->{_notifications_window}->set_app_paintable(TRUE); $self->{_notifications_window}->set_decorated(FALSE); $self->{_notifications_window}->set_skip_taskbar_hint(TRUE); $self->{_notifications_window}->set_skip_pager_hint(TRUE); $self->{_notifications_window}->set_keep_above(TRUE); $self->{_notifications_window}->set_accept_focus(FALSE); $self->{_notifications_window}->add_events('GDK_ENTER_NOTIFY_MASK'); #shape the window my $pixbuf = Gtk3::Gdk::Pixbuf->new_from_file($self->{_sc}->get_root . "/share/shutter/resources/icons/notify.svg"); #~ my ($pixmap, $mask) = $pixbuf->render_pixmap_and_mask (1); #~ $self->{_notifications_window}->shape_combine_mask($mask, 0, 0); #add a widget to control size of the window my $fixed = Gtk3::Fixed->new; $fixed->set_size_request(300, 120); $self->{_notifications_window}->add($fixed); $self->{_notifications_window}->signal_connect( 'draw' => sub { return FALSE unless $self->{_notifications_window}; return FALSE unless $self->{_summary}; #current monitor my $mon = $self->{_sc}->get_current_monitor; #initial position unless (defined $self->{_notifications_window}->{'pos'}) { $self->{_notifications_window}->move($mon->{x} + $mon->{width} - 315, $mon->{y} + $mon->{height} - 140); $self->{_notifications_window}->{'pos'} = 1; } #window size and position my ($w, $h) = $self->{_notifications_window}->get_size; my ($x, $y) = $self->{_notifications_window}->get_position; #obtain current colors and font_desc from the main window my $style = $self->{_sc}->get_mainwindow->get_style_context; my $sel_bg = Gtk3::Gdk::RGBA::parse('#131313'); my $font_fam = $style->get_font('normal')->get_family; my $font_size = $style->get_font('normal')->get_size / Pango->scale; #create cairo context my $cr = $_[1]; #pango layout my $layout = Pango::Cairo::create_layout($cr); $layout->set_width(($w - 30) * Pango->scale); if (Pango->CHECK_VERSION(1, 20, 0)) { $layout->set_height(($h - 20) * Pango->scale); } else { warn "WARNING: \$layout->set_height is not available - outdated Pango version\n"; } if (Pango->CHECK_VERSION(1, 6, 0)) { $layout->set_ellipsize('middle'); } else { warn "WARNING: \$layout->set_ellipsize is not available - outdated Pango version\n"; } $layout->set_alignment('left'); $layout->set_wrap('word-char'); #set text $layout->set_markup("" . Glib::Markup::escape_text($self->{_summary}) . "\n" . Glib::Markup::escape_text($self->{_body}) . ""); $cr->set_operator('source'); if ($self->{_sc}->get_mainwindow->get_screen->is_composited) { $cr->set_source_rgba(1.0, 1.0, 1.0, 0); Gtk3::Gdk::cairo_set_source_pixbuf($cr, $pixbuf, 0, 0); $cr->paint; } else { $cr->set_source_rgb($sel_bg->red, $sel_bg->green, $sel_bg->blue); $cr->paint; } $cr->set_operator('over'); #get layout size my ($lw, $lh) = $layout->get_pixel_size; $cr->move_to(($w - $lw) / 2, ($h - $lh) / 2); Pango::Cairo::show_layout($cr, $layout); return TRUE; }); $self->{_notifications_window}->signal_connect( 'enter-notify-event' => sub { #remove old handler if (defined $self->{_enter_notify_timeout}) { Glib::Source->remove($self->{_enter_notify_timeout}); } #current monitor my $mon = $self->{_sc}->get_current_monitor; if (defined $self->{_notifications_window}->{'pos'} && $self->{_notifications_window}->{'pos'} == 1) { $self->{_notifications_window}->move($mon->{x} + $mon->{width} - 315, $mon->{y} + 40); $self->{_notifications_window}->{'pos'} = 0; } else { $self->{_notifications_window}->move($mon->{x} + $mon->{width} - 315, $mon->{y} + $mon->{height} - 140); $self->{_notifications_window}->{'pos'} = 1; } $self->{_enter_notify_timeout} = Glib::Timeout->add( 100, sub { $self->show($self->{_summary}, $self->{_body}); }); return FALSE; }); }; if ($@) { print "Warning: $@", "\n"; } #last nid $self->{_nid} = 0; bless $self, $class; return $self; } sub show { my $self = shift; #remove old handler if (defined $self->{_notifications_timeout}) { Glib::Source->remove($self->{_notifications_timeout}); } #set body and summary $self->{_summary} = shift; $self->{_body} = shift; $self->{_notifications_window}->show_all; $self->{_notifications_window}->queue_draw; $self->{_notifications_timeout} = Glib::Timeout->add( 3000, sub { $self->close; }); return 0; } sub close { my $self = shift; my $no_clear = shift; #clear body and summary unless ($no_clear) { $self->{_summary} = undef; $self->{_body} = undef; } $self->{_notifications_window}->hide; $self->{_notifications_window}->{'pos'} = undef; return 0; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/App/SimpleDialogs.pm000066400000000000000000000265621476102223600270650ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::App::SimpleDialogs; #modules #-------------------------------------- use utf8; use strict; use warnings; use Gtk3; #Glib use Glib qw/TRUE FALSE/; #-------------------------------------- ##################public subs################## sub new { my $class = shift; #constructor my $self = {_window => shift, _gdk_window => shift}; bless $self, $class; return $self; } sub dlg_info_message { my $self = shift; my $dlg_info_message = shift; my $dlg_info_header = shift; my $button_text_extra1 = shift; my $button_text_extra2 = shift; my $button_text_extra3 = shift; my $button_widget_extra1 = shift; my $button_widget_extra2 = shift; my $button_widget_extra3 = shift; my $detail_message = shift; my $detail_checkbox = shift; my $content_widget = shift; my $content_widget2 = shift; my $info_dialog = Gtk3::MessageDialog->new($self->{_window}, [qw/modal destroy-with-parent/], 'info', 'none', undef); $info_dialog->set_title("Shutter"); $info_dialog->set('text' => $dlg_info_header); $info_dialog->set('secondary-text' => $dlg_info_message); if ($content_widget) { $info_dialog->get_content_area()->add($content_widget); } if ($content_widget2) { $info_dialog->get_content_area()->add($content_widget2); } $info_dialog->add_button($button_text_extra1, 10) if $button_text_extra1; $info_dialog->add_button($button_text_extra2, 20) if $button_text_extra2; $info_dialog->add_button($button_text_extra3, 30) if $button_text_extra3; $info_dialog->add_action_widget($button_widget_extra1, 40) if $button_widget_extra1; $info_dialog->add_action_widget($button_widget_extra2, 50) if $button_widget_extra2; $info_dialog->add_action_widget($button_widget_extra3, 60) if $button_widget_extra3; #show a detailed message (use expander to show it) if ($detail_message) { my $expander = Gtk3::Expander->new_with_mnemonic('Show more _details'); my $detail_label = Gtk3::Label->new($detail_message); $detail_label->set_width_chars(50); $detail_label->set_line_wrap(TRUE); $detail_label->set_alignment(0, 0.5); $expander->add($detail_label); my $detail_hbox = Gtk3::HBox->new(); $detail_hbox->pack_start(Gtk3::Label->new, FALSE, FALSE, 12); $detail_hbox->pack_start($expander, TRUE, TRUE, 0); $info_dialog->get_child->add($detail_hbox); } #show a detailed message with checkbox my $dcheck = undef; if ($detail_checkbox) { $dcheck = Gtk3::CheckButton->new_with_mnemonic($detail_checkbox); my $detail_hbox = Gtk3::HBox->new(); $detail_hbox->pack_start(Gtk3::Label->new, FALSE, FALSE, 12); $detail_hbox->pack_start($dcheck, TRUE, TRUE, 0); $info_dialog->get_child->add($detail_hbox); } $info_dialog->show_all; if (defined $self->{_gdk_window} && $self->{_gdk_window} =~ /Gtk3::Gdk::Window|Gtk3::GdkX11::X11Window/) { $info_dialog->get_window->set_transient_for($self->{_gdk_window}); } else { $info_dialog->set_transient_for($self->{_window}); } my $info_response = $info_dialog->run; #-1 when response is an event, e.g. delete-event $info_response = -1 if $info_response =~ /event/; $info_dialog->destroy(); return $info_response; } sub dlg_question_message { my $self = shift; my $dlg_question_message = shift; my $dlg_question_header = shift; my $button_text_extra1 = shift; my $button_text_extra2 = shift; my $button_text_extra3 = shift; my $button_widget_extra1 = shift; my $button_widget_extra2 = shift; my $button_widget_extra3 = shift; my $detail_message = shift; my $detail_checkbox = shift; my $question_dialog = Gtk3::MessageDialog->new($self->{_window}, [qw/modal destroy-with-parent/], 'other', 'none', undef); $question_dialog->set_title("Shutter"); $question_dialog->set('image' => Gtk3::Image->new_from_stock('gtk-dialog-question', 'dialog')); $question_dialog->set('text' => $dlg_question_header); $question_dialog->set('secondary-text' => $dlg_question_message); $question_dialog->add_button($button_text_extra1, 10) if $button_text_extra1; $question_dialog->add_button($button_text_extra2, 20) if $button_text_extra2; $question_dialog->add_button($button_text_extra3, 30) if $button_text_extra3; $question_dialog->add_action_widget($button_widget_extra1, 40) if $button_widget_extra1; $question_dialog->add_action_widget($button_widget_extra2, 50) if $button_widget_extra2; $question_dialog->add_action_widget($button_widget_extra3, 60) if $button_widget_extra3; #show a detailed message (use expander to show it) if ($detail_message) { my $expander = Gtk3::Expander->new_with_mnemonic('Show more _details'); my $detail_label = Gtk3::Label->new($detail_message); $detail_label->set_width_chars(50); $detail_label->set_line_wrap(TRUE); $detail_label->set_alignment(0, 0.5); $expander->add($detail_label); my $detail_hbox = Gtk3::HBox->new(); $detail_hbox->pack_start(Gtk3::Label->new, FALSE, FALSE, 12); $detail_hbox->pack_start($expander, TRUE, TRUE, 0); $question_dialog->get_child->add($detail_hbox); } #show a detailed message with checkbox my $dcheck = undef; if ($detail_checkbox) { $dcheck = Gtk3::CheckButton->new_with_mnemonic($detail_checkbox); my $detail_hbox = Gtk3::HBox->new(); $detail_hbox->pack_start(Gtk3::Label->new, FALSE, FALSE, 12); $detail_hbox->pack_start($dcheck, TRUE, TRUE, 0); $question_dialog->get_child->add($detail_hbox); } $question_dialog->show_all; if (defined $self->{_gdk_window} && $self->{_gdk_window} =~ /Gtk3::Gdk::Window|Gtk3::GdkX11::X11Window/) { $question_dialog->get_window->set_transient_for($self->{_gdk_window}); } else { $question_dialog->set_transient_for($self->{_window}); } my $question_response = $question_dialog->run; #-1 when response is an event, e.g. delete-event $question_response = -1 if $question_response =~ /event/; $question_dialog->destroy(); if (defined $dcheck) { return ($question_response, $dcheck->get_active); } else { return $question_response; } } sub dlg_error_message { my $self = shift; my $dlg_error_message = shift; my $dlg_error_header = shift; my $button_text_extra1 = shift; my $button_text_extra2 = shift; my $button_text_extra3 = shift; my $button_widget_extra1 = shift; my $button_widget_extra2 = shift; my $button_widget_extra3 = shift; my $detail_message = shift; my $error_dialog = Gtk3::MessageDialog->new($self->{_window}, [qw/modal destroy-with-parent/], 'other', 'none', undef); $error_dialog->set_title("Shutter"); $error_dialog->set('image' => Gtk3::Image->new_from_stock('gtk-dialog-error', 'dialog')); $error_dialog->set('text' => $dlg_error_header); $error_dialog->set('secondary-text' => $dlg_error_message); $error_dialog->add_button('gtk-cancel', 0); $error_dialog->add_button($button_text_extra1, 10) if $button_text_extra1; $error_dialog->add_button($button_text_extra2, 20) if $button_text_extra2; $error_dialog->add_button($button_text_extra3, 30) if $button_text_extra3; $error_dialog->add_action_widget($button_widget_extra1, 40) if $button_widget_extra1; $error_dialog->add_action_widget($button_widget_extra2, 50) if $button_widget_extra2; $error_dialog->add_action_widget($button_widget_extra3, 60) if $button_widget_extra3; #show a detailed message (use expander to show it) if ($detail_message) { my $expander = Gtk3::Expander->new_with_mnemonic('Show more _details'); my $detail_label = Gtk3::Label->new($detail_message); $detail_label->set_width_chars(50); $detail_label->set_line_wrap(TRUE); $detail_label->set_alignment(0, 0.5); $expander->add($detail_label); my $detail_hbox = Gtk3::HBox->new(); $detail_hbox->pack_start(Gtk3::Label->new, FALSE, FALSE, 12); $detail_hbox->pack_start($expander, TRUE, TRUE, 0); $error_dialog->get_child->add($detail_hbox); } $error_dialog->show_all; if (defined $self->{_gdk_window} && $self->{_gdk_window} =~ /Gtk3::Gdk::Window|Gtk3::GdkX11::X11Window/) { $error_dialog->get_window->set_transient_for($self->{_gdk_window}); } else { $error_dialog->set_transient_for($self->{_window}); } my $error_response = $error_dialog->run; #-1 when response is an event, e.g. delete-event $error_response = -1 if $error_response =~ /event/; $error_dialog->destroy(); return $error_response; } sub dlg_warning_message { my $self = shift; my $dlg_warning_message = shift; my $dlg_warning_header = shift; my $button_text_extra1 = shift; my $button_text_extra2 = shift; my $button_text_extra3 = shift; my $button_widget_extra1 = shift; my $button_widget_extra2 = shift; my $button_widget_extra3 = shift; my $detail_message = shift; my $warning_dialog = Gtk3::MessageDialog->new($self->{_window}, [qw/modal destroy-with-parent/], 'other', 'none', undef); $warning_dialog->set_title("Shutter"); $warning_dialog->set('image' => Gtk3::Image->new_from_stock('gtk-dialog-warning', 'dialog')); $warning_dialog->set('text' => $dlg_warning_header); $warning_dialog->set('secondary-text' => $dlg_warning_message); $warning_dialog->add_button('gtk-cancel', 0); $warning_dialog->add_button($button_text_extra1, 10) if $button_text_extra1; $warning_dialog->add_button($button_text_extra2, 20) if $button_text_extra2; $warning_dialog->add_button($button_text_extra3, 30) if $button_text_extra3; $warning_dialog->add_action_widget($button_widget_extra1, 40) if $button_widget_extra1; $warning_dialog->add_action_widget($button_widget_extra2, 50) if $button_widget_extra2; $warning_dialog->add_action_widget($button_widget_extra3, 60) if $button_widget_extra3; #show a detailed message (use expander to show it) if ($detail_message) { my $expander = Gtk3::Expander->new_with_mnemonic('Show more _details'); my $detail_label = Gtk3::Label->new($detail_message); $detail_label->set_width_chars(50); $detail_label->set_line_wrap(TRUE); $detail_label->set_alignment(0, 0.5); $expander->add($detail_label); my $detail_hbox = Gtk3::HBox->new(); $detail_hbox->pack_start(Gtk3::Label->new, FALSE, FALSE, 12); $detail_hbox->pack_start($expander, TRUE, TRUE, 0); $warning_dialog->get_child->add($detail_hbox); } $warning_dialog->show_all; if (defined $self->{_gdk_window} && $self->{_gdk_window} =~ /Gtk3::Gdk::Window|Gtk3::GdkX11::X11Window/) { $warning_dialog->get_window->set_transient_for($self->{_gdk_window}); } else { $warning_dialog->set_transient_for($self->{_window}); } my $warning_response = $warning_dialog->run; #-1 when response is an event, e.g. delete-event $warning_response = -1 if $warning_response =~ /event/; $warning_dialog->destroy(); return $warning_response; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/App/Toolbar.pm000066400000000000000000000324031476102223600257220ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::App::Toolbar; #modules #-------------------------------------- use utf8; use strict; use warnings; use Gtk3; #Glib use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; my $sc = shift; #constructor my $self = { _common => $sc, _shf => Shutter::App::HelperFunctions->new($sc), }; bless $self, $class; return $self; } sub create_toolbar { my $self = shift; my $d = $self->{_common}->get_gettext; my $window = $self->{_common}->get_mainwindow; my $shutter_root = $self->{_common}->get_root; #Icontheme my $icontheme = $self->{_common}->get_theme; #button redoshot #-------------------------------------- my $image_redoshot = Gtk3::Image->new_from_stock('gtk-refresh', 'large-toolbar'); $self->{_redoshot} = Gtk3::ToolButton->new($image_redoshot, $d->get("Redo")); #~ $self->{_redoshot}->set_is_important (TRUE); $self->{_redoshot}->set_tooltip_text($d->get("Redo last screenshot")); #-------------------------------------- #button selection #-------------------------------------- my $image_select; eval { my $ccursor_pb = Gtk3::Gdk::Cursor->new('left_ptr')->get_image->scale_simple($self->{_shf}->icon_size('large-toolbar'), 'bilinear'); $image_select = Gtk3::Image->new_from_pixbuf($ccursor_pb); }; if ($@) { if ($icontheme->has_icon('applications-accessories')) { $image_select = Gtk3::Image->new_from_icon_name('applications-accessories', 'large-toolbar'); } else { $image_select = Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/selection.svg", $self->{_shf}->icon_size('large-toolbar'))); } } $self->{_select} = Gtk3::ToolButton->new($image_select, $d->get("Selection")); #The GtkToolButton class uses this property to determine whether #to show or hide its label when the toolbar style is GTK_TOOLBAR_BOTH_HORIZ. #The result is that only tool buttons with the #"is_important" property set have labels, an effect known as "priority text" $self->{_select}->set_is_important(TRUE); $self->{_select}->set_tooltip_text($d->get("Draw a rectangular capture area with your mouse\nto select a specified screen area")); #-------------------------------------- #button full screen #-------------------------------------- my $image_full; if ($icontheme->has_icon('user-desktop')) { $image_full = Gtk3::Image->new_from_icon_name('user-desktop', 'large-toolbar'); } elsif ($icontheme->has_icon('desktop')) { $image_full = Gtk3::Image->new_from_icon_name('desktop', 'large-toolbar'); } else { $image_full = Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/desktop.svg", $self->{_shf}->icon_size('large-toolbar'))); } $self->{_full} = Gtk3::MenuToolButton->new($image_full, $d->get("Desktop")); $self->{_full}->set_is_important(TRUE); $self->{_full}->set_tooltip_text($d->get("Take a screenshot of your whole desktop")); $self->{_full}->set_arrow_tooltip_text($d->get("Capture a specific workspace")); #-------------------------------------- #button active window #-------------------------------------- #~ my $image_awindow; #~ if($icontheme->has_icon('preferences-system-windows')){ #~ $image_awindow = Gtk3::Image->new_from_icon_name( 'preferences-system-windows', 'large-toolbar' ); #~ }else{ #~ $image_awindow = Gtk3::Image->new_from_pixbuf( #~ Gtk3::Gdk::Pixbuf->new_from_file_at_size( #~ "$shutter_root/share/shutter/resources/icons/sel_window_active.svg", #~ $self->{_shf}->icon_size('large-toolbar') #~ ) #~ ); #~ } #~ $self->{_awindow} = Gtk3::MenuToolButton->new( $image_awindow, $d->get("Window") ); #~ $self->{_awindow}->set_is_important (TRUE); #~ #~ $self->{_awindow}->set_tooltip_text($d->get("Capture active window") ); #~ $self->{_awindow}->set_arrow_tooltip( $tooltips, $d->get("Take a screenshot of a specific window"), '' ); #-------------------------------------- #button window #-------------------------------------- my $image_window; if ($icontheme->has_icon('preferences-system-windows')) { $image_window = Gtk3::Image->new_from_icon_name('preferences-system-windows', 'large-toolbar'); } else { $image_window = Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/sel_window.svg", $self->{_shf}->icon_size('large-toolbar'))); } $self->{_window} = Gtk3::MenuToolButton->new($image_window, $d->get("Window")); $self->{_window}->set_is_important(TRUE); $self->{_window}->set_tooltip_text($d->get("Select a window with your mouse")); $self->{_window}->set_arrow_tooltip_text($d->get("Take a screenshot of a specific window")); #button section # No sections for now: https://github.com/shutter-project/shutter/issues/25 #-------------------------------------- #my $image_window_sect; #if ($icontheme->has_icon('gdm-xnest')) { # $image_window_sect = Gtk3::Image->new_from_icon_name('gdm-xnest', 'large-toolbar'); #} else { # $image_window_sect = # Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/sel_window_section.svg", $self->{_shf}->icon_size('large-toolbar'))); #} #$self->{_section} = Gtk3::ToolButton->new($image_window_sect, $d->get("Section")); #$self->{_section}->set_tooltip_text($d->get("Captures only a section of the window. You will be able to select any child window by moving the mouse over it")); #-------------------------------------- #button menu #-------------------------------------- my $image_window_menu; if ($icontheme->has_icon('alacarte')) { $image_window_menu = Gtk3::Image->new_from_icon_name('alacarte', 'large-toolbar'); } else { $image_window_menu = Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/sel_window_menu.svg", $self->{_shf}->icon_size('large-toolbar'))); } $self->{_menu} = Gtk3::ToolButton->new($image_window_menu, $d->get("Menu")); $self->{_menu}->set_tooltip_text($d->get("Select a single menu or cascading menus from any application")); #-------------------------------------- #button tooltip #-------------------------------------- my $image_window_tooltip; if ($icontheme->has_icon('help-faq')) { $image_window_tooltip = Gtk3::Image->new_from_icon_name('help-faq', 'large-toolbar'); } else { $image_window_tooltip = Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/sel_window_tooltip.svg", $self->{_shf}->icon_size('large-toolbar'))); } $self->{_tooltip} = Gtk3::ToolButton->new($image_window_tooltip, $d->get("Tooltip")); $self->{_tooltip}->set_tooltip_text($d->get("Capture a tooltip")); #-------------------------------------- #button web #-------------------------------------- my $image_web; if ($icontheme->has_icon('web-browser')) { $image_web = Gtk3::Image->new_from_icon_name('web-browser', 'large-toolbar'); } else { $image_web = Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/web_image.svg", $self->{_shf}->icon_size('large-toolbar'))); } $self->{_web} = Gtk3::MenuToolButton->new($image_web, $d->get("Web")); $self->{_web}->set_tooltip_text($d->get("Take a screenshot of a website")); $self->{_web}->set_arrow_tooltip_text($d->get("Set how long Shutter will wait for the screenshot to complete before aborting the process if it's taking too long")); #-------------------------------------- #expanding separator #-------------------------------------- my $expander_r = Gtk3::SeparatorToolItem->new; $expander_r->set_expand(TRUE); $expander_r->set_draw(FALSE); #button edit #-------------------------------------- my $image_edit; if ($icontheme->has_icon('applications-graphics')) { $image_edit = Gtk3::Image->new_from_icon_name('applications-graphics', 'large-toolbar'); } else { $image_edit = Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size("$shutter_root/share/shutter/resources/icons/draw.svg", $self->{_shf}->icon_size('large-toolbar'))); } $self->{_edit} = Gtk3::ToolButton->new($image_edit, $d->get("Edit")); $self->{_edit}->set_is_important(TRUE); $self->{_edit}->set_tooltip_text($d->get("Use the built-in editor to highlight important fragments of your screenshot or crop it to a desired size")); #-------------------------------------- #button upload #-------------------------------------- my $image_upload = Gtk3::Image->new_from_stock('gtk-network', 'large-toolbar'); $self->{_upload} = Gtk3::MenuToolButton->new($image_upload, $d->get("Export")); $self->{_upload}->set_is_important(TRUE); $self->{_upload}->set_tooltip_text($d->get("Upload your images to an image hosting service, FTP site or export them to an arbitrary folder")); $self->{_upload}->set_arrow_tooltip_text($d->get("Show links to previous uploads")); #-------------------------------------- #create the toolbar $self->{_toolbar} = Gtk3::Toolbar->new; $self->{_toolbar}->set_show_arrow(FALSE); $self->{_toolbar}->insert($self->{_redoshot}, -1); $self->{_toolbar}->insert(Gtk3::SeparatorToolItem->new, -1); $self->{_toolbar}->insert($self->{_select}, -1); $self->{_toolbar}->insert($self->{_full}, -1); #~ $self->{_toolbar}->insert( Gtk3::SeparatorToolItem->new, -1 ); #~ $self->{_toolbar}->insert( $self->{_aindow}, -1 ); $self->{_toolbar}->insert($self->{_window}, -1); #$self->{_toolbar}->insert($self->{_section}, -1); $self->{_toolbar}->insert($self->{_menu}, -1); $self->{_toolbar}->insert($self->{_tooltip}, -1); #~ $self->{_toolbar}->insert( Gtk3::SeparatorToolItem->new, -1 ); $self->{_toolbar}->insert($self->{_web}, -1); #~ $self->{_toolbar}->insert( Gtk3::SeparatorToolItem->new, -1 ); $self->{_toolbar}->insert($expander_r, -1); $self->{_toolbar}->insert($self->{_edit}, -1); $self->{_toolbar}->insert($self->{_upload}, -1); return $self->{_toolbar}; } sub create_btoolbar { my $self = shift; my $d = $self->{_common}->get_gettext; my $window = $self->{_common}->get_mainwindow; my $shutter_root = $self->{_common}->get_root; #Icontheme my $icontheme = $self->{_common}->get_theme; #expanding separator #-------------------------------------- my $expander_l = Gtk3::SeparatorToolItem->new; $expander_l->set_expand(TRUE); $expander_l->set_draw(FALSE); #-------------------------------------- #button ascending #-------------------------------------- my $image_sorta = Gtk3::Image->new_from_stock('gtk-sort-ascending', 'small-toolbar'); $self->{_sorta} = Gtk3::ToggleToolButton->new(); $self->{_sorta}->set_icon_widget($image_sorta); #-------------------------------------- #button back #-------------------------------------- my $image_back = Gtk3::Image->new_from_stock('gtk-go-back', 'small-toolbar'); $self->{_back} = Gtk3::ToolButton->new($image_back, ''); #-------------------------------------- #button home #-------------------------------------- my $image_home = Gtk3::Image->new_from_stock('gtk-index', 'small-toolbar'); $self->{_home} = Gtk3::ToolButton->new($image_home, ''); #-------------------------------------- #button forward #-------------------------------------- my $image_forw = Gtk3::Image->new_from_stock('gtk-go-forward', 'small-toolbar'); $self->{_forw} = Gtk3::ToolButton->new($image_forw, ''); #-------------------------------------- #button sort descending #-------------------------------------- my $image_sortd = Gtk3::Image->new_from_stock('gtk-sort-descending', 'small-toolbar'); $self->{_sortd} = Gtk3::ToggleToolButton->new(); $self->{_sortd}->set_icon_widget($image_sortd); #-------------------------------------- #expanding separator #-------------------------------------- my $expander_r = Gtk3::SeparatorToolItem->new; $expander_r->set_expand(TRUE); $expander_r->set_draw(FALSE); #-------------------------------------- #create the toolbar $self->{_btoolbar} = Gtk3::Toolbar->new; $self->{_btoolbar}->set_no_show_all(TRUE); $self->{_btoolbar}->set_show_arrow(FALSE); $self->{_btoolbar}->set_style('icons'); $self->{_btoolbar}->insert($expander_l, -1); $self->{_btoolbar}->insert($self->{_sorta}, -1); $self->{_btoolbar}->insert($self->{_back}, -1); $self->{_btoolbar}->insert($self->{_home}, -1); $self->{_btoolbar}->insert($self->{_forw}, -1); $self->{_btoolbar}->insert($self->{_sortd}, -1); $self->{_btoolbar}->insert($expander_r, -1); return $self->{_btoolbar}; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Draw/000077500000000000000000000000001476102223600241355ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/modules/Shutter/Draw/DrawingTool.pm000066400000000000000000006623231476102223600267400ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### #perl -x -S perltidy -l=0 -b "%f" # Native Gtk3::IconSize doesn't work for some reason # FIXME This package should be cleaned up when fixing DrawingTool package Gtk3::IconSize; sub lookup { my $self = shift; my $size = shift; Shutter::App::HelperFunctions->icon_size($size); } 1; package Shutter::Draw::DrawingTool; #modules #-------------------------------------- use utf8; use strict; use warnings; use constant { DEFAULT_FONT => "Sans Regular 16" }; use Gtk3; use Exporter; use GooCanvas2; use GooCanvas2::CairoTypes; use File::Basename qw/ fileparse dirname basename /; use File::Glob qw/ bsd_glob /; use File::Temp qw/ tempfile tempdir /; use Data::Dumper; #Sort::Naturally - sort lexically, but sort numeral parts numerically use Sort::Naturally; #load and save settings use XML::Simple; #Glib use Glib qw/TRUE FALSE/; require Shutter::Draw::Utils; require Shutter::App::Directories; require Shutter::Draw::UIManager; #-------------------------------------- sub new { my $class = shift; my $self = {_sc => shift}; $self->{_shf} = Shutter::App::HelperFunctions->new($self->{_sc}); #view, selector, dragger $self->{_view} = Gtk3::ImageView->new; $self->{_selector} = Gtk3::ImageView::Tool::Selector->new($self->{_view}); $self->{_dragger} = Gtk3::ImageView::Tool::Dragger->new($self->{_view}); $self->{_view}->set_tool($self->{_selector}); $self->{_view_css_provider_alpha} = Gtk3::CssProvider->new; $self->{_view}->get_style_context->add_provider($self->{_view_css_provider_alpha}, 0); $self->{_view}->set('zoom-step', 1.2); #WORKAROUND #upstream bug #http://trac.bjourne.webfactional.com/ticket/21 #left => zoom in #right => zoom out $self->{_view}->signal_connect( 'scroll-event', sub { my ($view, $ev) = @_; if ($ev->direction eq 'left') { $ev->direction('up'); } elsif ($ev->direction eq 'right') { $ev->direction('down'); } return FALSE; }); #handle zoom events #ignore zoom values greater 10 (see: #654185) $self->{_view}->signal_connect( 'zoom-changed' => sub { my ($view, $zoom) = @_; if ($zoom >= 1) { $view->set_interpolation('nearest'); $view->set_zoom(10) if $zoom > 10; } else { $view->set_interpolation('bilinear'); } }); #clipboard $self->{_clipboard} = Gtk3::Clipboard::get($Gtk3::Gdk::SELECTION_CLIPBOARD); #file $self->{_filename} = undef; $self->{_filetype} = undef; $self->{_mimetype} = undef; $self->{_import_hash} = undef; #custom cursors $self->{_cursors} = undef; #ui $self->{_uimanager} = undef; $self->{_factory} = undef; #canvas $self->{_canvas} = undef; #all items are stored here $self->{_uid} = time; $self->{_items} = undef; $self->{_items_history} = undef; #undo and redo stacks $self->{_undo} = undef; $self->{_redo} = undef; #autoscroll option, disabled by default $self->{_autoscroll} = FALSE; #drawing colors and line width #general - shown in the bottom hbox $self->{_fill_color} = Gtk3::Gdk::RGBA::parse('#0000ff'); $self->{_fill_color}->alpha(0.25); $self->{_stroke_color} = Gtk3::Gdk::RGBA::parse('#ff0000'); $self->{_stroke_color}->alpha(1); $self->{_line_width} = 3; $self->{_font} = DEFAULT_FONT; #obtain current colors and font_desc from the main window $self->{_style} = $self->{_sc}->get_mainwindow->get_style_context; $self->{_style_bg} = $self->{_style}->get_background_color('selected'); $self->{_style_bg}->alpha(1); #$self->{_style_tx} = $self->{_style}->text('selected'); #remember drawing colors, line width and font settings #maybe we have to restore them $self->{_last_fill_color} = Gtk3::Gdk::RGBA::parse('#0000ff'); $self->{_last_fill_color}->alpha(0.25); $self->{_last_stroke_color} = Gtk3::Gdk::RGBA::parse('#ff0000'); $self->{_last_stroke_color}->alpha(1); $self->{_last_line_width} = 3; $self->{_last_font} = DEFAULT_FONT; #some status variables $self->{_busy} = undef; $self->{_current_item} = undef; $self->{_current_new_item} = undef; $self->{_current_copy_item} = undef; $self->{_last_mode} = 10; $self->{_current_mode} = 10; $self->{_current_mode_descr} = "select"; $self->{_current_pixbuf} = undef; $self->{_current_pixbuf_filename} = undef; $self->{_cut} = FALSE; $self->{_start_time} = undef; $self->{_stipple_pixbuf} = Gtk3::Gdk::Pixbuf->new_from_file($self->{_sc}->get_root . '/share/shutter/resources/gui/stipple.png'); bless $self, $class; return $self; } #~ sub DESTROY { #~ my $self = shift; #~ print "$self dying at\n"; #~ } sub show { my $self = shift; $self->{_filename} = shift; $self->{_filetype} = shift; $self->{_mimetype} = shift; $self->{_name} = shift; $self->{_is_unsaved} = shift; $self->{_import_hash} = shift; #gettext $self->{_d} = $self->{_sc}->get_gettext; #define own icons $self->{_dicons} = $self->{_sc}->get_root . "/share/shutter/resources/icons/drawing_tool"; $self->{_icons} = $self->{_sc}->get_root . "/share/shutter/resources/icons"; #MAIN WINDOW #------------------------------------------------- $self->{_root} = Gtk3::Gdk::get_default_root_window(); ($self->{_root}->{x}, $self->{_root}->{y}, $self->{_root}->{w}, $self->{_root}->{h}) = $self->{_root}->get_geometry; ($self->{_root}->{x}, $self->{_root}->{y}) = $self->{_root}->get_origin; $self->{_drawing_window} = Gtk3::Window->new('toplevel'); if (defined $self->{_is_unsaved} && $self->{_is_unsaved}) { $self->{_drawing_window}->set_title("*" . $self->{_name} . " - Shutter DrawingTool"); } else { $self->{_drawing_window}->set_title($self->{_filename} . " - Shutter DrawingTool"); } $self->{_drawing_window}->set_position('center'); $self->{_drawing_window}->set_modal(1); $self->{_drawing_window}->signal_connect('delete_event', sub { return $self->quit(TRUE) }); #adjust toplevel window size if ($self->{_root}->{w} > 640 && $self->{_root}->{h} > 480) { $self->{_drawing_window}->set_default_size(640, 480); } else { $self->{_drawing_window}->set_default_size($self->{_root}->{w} - 100, $self->{_root}->{h} - 100); } #dialogs, thumbnail generator and pixbuf loader $self->{_dialogs} = Shutter::App::SimpleDialogs->new($self->{_drawing_window}); $self->{_lp} = Shutter::Pixbuf::Load->new($self->{_sc}, $self->{_drawing_window}); $self->{_lp_ne} = Shutter::Pixbuf::Load->new($self->{_sc}, $self->{_drawing_window}, TRUE); #setup cursor-hash # #cursors borrowed from inkscape #http://www.inkscape.org my @cursors = bsd_glob($self->{_dicons} . "/cursor/*"); foreach my $cursor_path (@cursors) { my ($cname, $folder, $type) = fileparse($cursor_path, qr/\.[^.]*/); $self->{_cursors}{$cname} = Gtk3::Gdk::Pixbuf->new_from_file($cursor_path); #see 'man xcursor' for a detailed description #of these values $self->{_cursors}{$cname}{'x_hot'} = $self->{_cursors}{$cname}->get_option('x_hot'); $self->{_cursors}{$cname}{'y_hot'} = $self->{_cursors}{$cname}->get_option('y_hot'); } #setu ui $self->{_uimanager} = $self->setup_uimanager(); #load settings $self->load_settings; #load file $self->{_drawing_pixbuf} = $self->{_lp}->load($self->{_filename}, undef, undef, undef, TRUE); unless ($self->{_drawing_pixbuf}) { $self->{_drawing_window}->destroy if $self->{_drawing_window}; return FALSE; } #CANVAS #------------------------------------------------- $self->{_canvas} = GooCanvas2::Canvas->new(); #enable dnd for it $self->{_canvas}->drag_dest_set('all', [Gtk3::TargetEntry->new('text/uri-list', [], 0)], 'copy'); $self->{_canvas}->signal_connect(drag_data_received => sub { $self->import_from_dnd(@_) }); $self->{_canvas}->signal_connect(drag_motion => sub { my ($view, $ctx, $x, $y, $time) = @_; for my $target (@{$ctx->list_targets}) { if ($target->name eq 'text/uri-list') { Gtk3::Gdk::drag_status($ctx, 'copy', $time); return TRUE; } } return FALSE; }); #'redraw-when-scrolled' to reduce the flicker of static items # #this property is not available in older versions #it was added to goocanvas on Mon Nov 17 10:28:07 2008 UTC #http://svn.gnome.org/viewvc/goocanvas?view=revision&revision=28 if ($self->{_canvas}->find_property('redraw-when-scrolled')) { $self->{_canvas}->set('redraw-when-scrolled' => TRUE); } #~ my $bg = Gtk3::Gdk::RGBA::parse('gray'); $self->{_canvas}->set( 'automatic-bounds' => FALSE, 'bounds-from-origin' => FALSE, #~ 'background-color' => sprintf( "#%04x%04x%04x", $bg->red, $bg->green, $bg->blue ), ); #and attach scroll event #to imitate scroll behavior of #Gtk3::ImageView widget Ctrl+Mouse Wheel $self->{_canvas}->signal_connect( 'scroll-event' => sub { my ($canvas, $ev) = @_; my $alloc = $self->{_canvas}->get_allocation; my $scale = $canvas->get_scale; if ($ev->state >= 'control-mask' && ($ev->direction eq 'up' || $ev->direction eq 'left')) { $self->zoom_in_cb; $canvas->scroll_to(int($ev->x - $alloc->{width} / 2) / $scale, int($ev->y - $alloc->{height} / 2) / $scale); return TRUE; } elsif ($ev->state >= 'control-mask' && ($ev->direction eq 'down' || $ev->direction eq 'right')) { $self->zoom_out_cb; return TRUE; } return FALSE; }); #create rectangle to resize the background $self->{_canvas_bg_rect} = GooCanvas2::CanvasRect->new( parent=>$self->{_canvas}->get_root_item, x=>0, y=>0, width=>$self->{_drawing_pixbuf}->get_width, height=>$self->{_drawing_pixbuf}->get_height, 'fill-color-gdk-rgba' => Gtk3::Gdk::RGBA::parse('gray'), 'line-dash' => GooCanvas2::CanvasLineDash->newv([5, 5]), 'line-width' => 1, 'stroke-color' => 'black', ); #save color $self->{_canvas_bg_rect}{fill_color} = Gtk3::Gdk::RGBA::parse('gray'); $self->setup_item_signals($self->{_canvas_bg_rect}); $self->handle_bg_rects('create'); $self->handle_bg_rects('update'); #~ #create canvas background (:= screenshot) #~ $self->{_canvas_bg} = Goo::Canvas::Image->new( #~ $self->{_canvas}->get_root_item, #~ $self->{_drawing_pixbuf}, #~ 0, 0, #~ ); #~ $self->setup_item_signals( $self->{_canvas_bg} ); #set variables $self->{_current_pixbuf_filename} = $self->{_filename}; $self->{_current_pixbuf} = $self->{_drawing_pixbuf}; #construct an event and create a new image object my $initevent = Gtk3::Gdk::Event->new('motion-notify'); $initevent->time(Gtk3::get_current_event_time()); $initevent->window($self->{_drawing_window}->get_window); $initevent->x(int($self->{_canvas_bg_rect}->get('width') / 2)); $initevent->y(int($self->{_canvas_bg_rect}->get('height') / 2)); #new item my $nitem = $self->create_image($initevent, undef, TRUE); $self->{_canvas_bg} = $self->{_items}{$nitem}{image}; #this item is locked at first $self->{_items}{$nitem}{locked} = FALSE; $self->handle_bg_rects('raise'); #PACKING #------------------------------------------------- $self->{_drawing_vbox} = Gtk3::VBox->new(FALSE, 0); $self->{_drawing_inner_vbox} = Gtk3::VBox->new(FALSE, 0); $self->{_drawing_inner_vbox_c} = Gtk3::VBox->new(FALSE, 0); $self->{_drawing_hbox} = Gtk3::HBox->new(FALSE, 0); $self->{_drawing_hbox_c} = Gtk3::HBox->new(FALSE, 0); #mark some actions as important $self->{_uimanager}->get_widget("/ToolBar/Close")->set_is_important(TRUE); $self->{_uimanager}->get_widget("/ToolBar/Save")->set_is_important(TRUE); $self->{_uimanager}->get_widget("/ToolBar/Undo")->set_is_important(TRUE); #disable undo/redo actions at startup $self->{_uimanager}->get_widget("/MenuBar/Edit/Undo")->set_sensitive(FALSE); $self->{_uimanager}->get_widget("/MenuBar/Edit/Redo")->set_sensitive(FALSE); $self->{_uimanager}->get_widget("/ToolBar/Undo")->set_sensitive(FALSE); $self->{_uimanager}->get_widget("/ToolBar/Redo")->set_sensitive(FALSE); $self->{_drawing_window}->add($self->{_drawing_vbox}); my $menubar = $self->{_uimanager}->get_widget("/MenuBar"); $self->{_drawing_vbox}->pack_start($menubar, FALSE, FALSE, 0); my $toolbar_drawing = $self->{_uimanager}->get_widget("/ToolBarDrawing"); $toolbar_drawing->set_orientation('vertical'); $toolbar_drawing->set_style('icons'); $toolbar_drawing->set_icon_size('menu'); $toolbar_drawing->set_show_arrow(FALSE); $self->{_drawing_hbox}->pack_start($toolbar_drawing, FALSE, FALSE, 0); #DRAWING TOOL CONTAINER #------------------------------------------------- #scrolled window for the canvas $self->{_scrolled_window} = Gtk3::ScrolledWindow->new; $self->{_scrolled_window}->set_policy('automatic', 'automatic'); $self->{_scrolled_window}->add($self->{_canvas}); $self->{_hscroll_hid} = $self->{_scrolled_window}->get_hscrollbar->signal_connect('value-changed' => sub { $self->adjust_rulers }); $self->{_vscroll_hid} = $self->{_scrolled_window}->get_vscrollbar->signal_connect('value-changed' => sub { $self->adjust_rulers }); #vruler #$self->{_vruler} = Gtk3::VRuler->new; #$self->{_vruler}->set_metric('pixels'); #$self->{_vruler}->set_range(0, $self->{_drawing_pixbuf}->get_height, 0, $self->{_drawing_pixbuf}->get_height); #hruler #$self->{_hruler} = Gtk3::HRuler->new; #$self->{_hruler}->set_metric('pixels'); #$self->{_hruler}->set_range(0, $self->{_drawing_pixbuf}->get_width, 0, $self->{_drawing_pixbuf}->get_width); #create a table for placing the ruler and scrolle window $self->{_table} = Gtk3::Table->new(3, 2, FALSE); #attach scrolled window and rulers to the table $self->{_table}->attach($self->{_scrolled_window}, 1, 2, 1, 2, ['expand', 'fill'], ['expand', 'fill'], 0, 0); #$self->{_table}->attach($self->{_hruler}, 1, 2, 0, 1, ['expand', 'shrink', 'fill'], [], 0, 0); #$self->{_table}->attach($self->{_vruler}, 0, 1, 1, 2, [], ['fill', 'expand', 'shrink'], 0, 0); $self->{_bhbox} = $self->setup_bottom_hbox; $self->{_drawing_inner_vbox}->pack_start($self->{_table}, TRUE, TRUE, 0); $self->{_drawing_inner_vbox}->pack_start($self->{_bhbox}, FALSE, TRUE, 0); #CROPPING TOOL CONTAINER #------------------------------------------------- #scrolled window for the cropping tool #$self->{_scrolled_window_c} = Gtk3::ImageView::ScrollWin->new($self->{_view}); $self->{_scrolled_window_c} = Gtk3::ScrolledWindow->new; $self->{_scrolled_window_c}->add_with_viewport($self->{_view}); ($self->{_rframe_c}, $self->{_btn_ok_c}) = $self->setup_right_vbox_c; $self->{_drawing_hbox_c}->pack_start($self->{_scrolled_window_c}, TRUE, TRUE, 0); $self->{_drawing_hbox_c}->pack_start($self->{_rframe_c}, FALSE, FALSE, 3); $self->{_drawing_inner_vbox_c}->pack_start($self->{_drawing_hbox_c}, TRUE, TRUE, 0); #MAIN CONTAINER #------------------------------------------------- #pack both containers to the main hbox $self->{_drawing_hbox}->pack_start($self->{_drawing_inner_vbox}, TRUE, TRUE, 0); $self->{_drawing_hbox}->pack_start($self->{_drawing_inner_vbox_c}, TRUE, TRUE, 0); $self->{_drawing_vbox}->pack_start($self->{_uimanager}->get_widget("/ToolBar"), FALSE, FALSE, 0); $self->{_drawing_vbox}->pack_start($self->{_drawing_hbox}, TRUE, TRUE, 0); #statusbar $self->{_drawing_statusbar} = Gtk3::Statusbar->new; $self->{_drawing_statusbar_image} = Gtk3::Image->new; $self->{_drawing_statusbar}->pack_start($self->{_drawing_statusbar_image}, FALSE, FALSE, 3); $self->{_drawing_statusbar}->reorder_child($self->{_drawing_statusbar_image}, 0); $self->{_drawing_vbox}->pack_start($self->{_drawing_statusbar}, FALSE, FALSE, 6); $self->{_drawing_window}->show_all(); #STARTUP PROCEDURE #------------------------------------------------- $self->{_drawing_window}->get_window->focus(Gtk3::get_current_event_time()); $self->adjust_rulers; #save start time to show in close dialog $self->{_start_time} = time; #remember drawing colors, line width and font settings #maybe we have to restore them $self->{_last_fill_color} = $self->{_fill_color_w}->get_rgba; $self->{_last_stroke_color} = $self->{_stroke_color_w}->get_rgba; $self->{_last_line_width} = $self->{_line_spin_w}->get_value; $self->{_last_font} = $self->{_font_btn_w}->get_font_name; #init last mode $self->{_last_mode} = 0; #init current tool $self->set_drawing_action(int($self->{_current_mode} / 10)); #do show these actions because the user would be confused #to see multiple shortcuts to handle zooming #controlequal is used for english keyboard layouts for example $self->{_uimanager}->get_action("/MenuBar/View/ControlEqual")->set_visible(FALSE); $self->{_uimanager}->get_action("/MenuBar/View/ControlKpAdd")->set_visible(FALSE); $self->{_uimanager}->get_action("/MenuBar/View/ControlKpSub")->set_visible(FALSE); #start with everything deactivated $self->deactivate_all; Gtk3->main; return TRUE; } sub setup_bottom_hbox { my $self = shift; my $drawing_bottom_hbox = Gtk3::HBox->new(FALSE, 5); #fill color my $fill_color_label = Gtk3::Label->new($self->{_d}->get("Fill color") . ":"); $self->{_fill_color_w} = Gtk3::ColorButton->new(); $self->{_fill_color_w}->set_rgba($self->{_fill_color}); $self->{_fill_color_w}->set_use_alpha(TRUE); $self->{_fill_color_w}->set_title($self->{_d}->get("Choose fill color")); $fill_color_label->set_tooltip_text($self->{_d}->get("Adjust fill color and opacity")); $self->{_fill_color_w}->set_tooltip_text($self->{_d}->get("Adjust fill color and opacity")); $drawing_bottom_hbox->pack_start($fill_color_label, FALSE, FALSE, 5); $drawing_bottom_hbox->pack_start($self->{_fill_color_w}, FALSE, FALSE, 5); #stroke color my $stroke_color_label = Gtk3::Label->new($self->{_d}->get("Stroke color") . ":"); $self->{_stroke_color_w} = Gtk3::ColorButton->new(); $self->{_stroke_color_w}->set_rgba($self->{_stroke_color}); $self->{_stroke_color_w}->set_use_alpha(TRUE); $self->{_stroke_color_w}->set_title($self->{_d}->get("Choose stroke color")); $stroke_color_label->set_tooltip_text($self->{_d}->get("Adjust stroke color and opacity")); $self->{_stroke_color_w}->set_tooltip_text($self->{_d}->get("Adjust stroke color and opacity")); $drawing_bottom_hbox->pack_start($stroke_color_label, FALSE, FALSE, 5); $drawing_bottom_hbox->pack_start($self->{_stroke_color_w}, FALSE, FALSE, 5); #line_width my $linew_label = Gtk3::Label->new($self->{_d}->get("Line width") . ":"); $self->{_line_spin_w} = Gtk3::SpinButton->new_with_range(0.5, 20, 0.1); $self->{_line_spin_w}->set_value($self->{_line_width}); $linew_label->set_tooltip_text($self->{_d}->get("Adjust line width")); $self->{_line_spin_w}->set_tooltip_text($self->{_d}->get("Adjust line width")); $drawing_bottom_hbox->pack_start($linew_label, FALSE, FALSE, 5); $drawing_bottom_hbox->pack_start($self->{_line_spin_w}, FALSE, FALSE, 5); #font button my $font_label = Gtk3::Label->new($self->{_d}->get("Font") . ":"); $self->{_font_btn_w} = Gtk3::FontButton->new(); $self->{_font_btn_w}->set_font_name($self->{_font}); $font_label->set_tooltip_text($self->{_d}->get("Select font family and size")); $self->{_font_btn_w}->set_tooltip_text($self->{_d}->get("Select font family and size")); $drawing_bottom_hbox->pack_start($font_label, FALSE, FALSE, 5); $drawing_bottom_hbox->pack_start($self->{_font_btn_w}, FALSE, FALSE, 5); #image button my $image_label = Gtk3::Label->new($self->{_d}->get("Insert image") . ":"); my $image_btn = Gtk3::MenuToolButton->new(undef, undef); Glib::Idle->add( sub { $image_btn->set_menu($self->import_from_filesystem($image_btn)); return FALSE; }); #handle property changes #changes are applied directly to the current item $self->{_line_spin_wh} = $self->{_line_spin_w}->signal_connect( 'value-changed' => sub { $self->{_line_width} = $self->{_line_spin_w}->get_value; if ($self->{_current_item}) { #apply all changes directly my $item = $self->{_current_item}; if (my $child = $self->get_child_item($item)) { $item = $child; } my $parent = $self->get_parent_item($item); #determine key for item hash my $key = $self->get_item_key($item, $parent); $self->apply_properties($item, $parent, $key, $self->{_fill_color_w}, $self->{_stroke_color_w}, $self->{_line_spin_w}, $self->{_stroke_color_w}, $self->{_font_btn_w}); } }); $self->{_stroke_color_wh} = $self->{_stroke_color_w}->signal_connect( 'color-set' => sub { $self->{_stroke_color} = $self->{_stroke_color_w}->get_rgba; if ($self->{_current_item}) { #apply all changes directly my $item = $self->{_current_item}; if (my $child = $self->get_child_item($item)) { $item = $child; } my $parent = $self->get_parent_item($item); #determine key for item hash my $key = $self->get_item_key($item, $parent); $self->apply_properties($item, $parent, $key, $self->{_fill_color_w}, $self->{_stroke_color_w}, $self->{_line_spin_w}, $self->{_stroke_color_w}, $self->{_font_btn_w}); } }); $self->{_fill_color_wh} = $self->{_fill_color_w}->signal_connect( 'color-set' => sub { $self->{_fill_color} = $self->{_fill_color_w}->get_rgba; if ($self->{_current_item}) { #apply all changes directly my $item = $self->{_current_item}; if (my $child = $self->get_child_item($item)) { $item = $child; } my $parent = $self->get_parent_item($item); #determine key for item hash my $key = $self->get_item_key($item, $parent); $self->apply_properties($item, $parent, $key, $self->{_fill_color_w}, $self->{_stroke_color_w}, $self->{_line_spin_w}, $self->{_stroke_color_w}, $self->{_font_btn_w}); } }); $self->{_font_btn_wh} = $self->{_font_btn_w}->signal_connect( 'font-set' => sub { my $font_descr = Pango::FontDescription->from_string($self->{_font_btn_w}->get_font_name); $self->{_font} = $self->{_font_btn_w}->get_font_name; if ($self->{_current_item}) { #apply all changes directly my $item = $self->{_current_item}; if (my $child = $self->get_child_item($item)) { $item = $child; } my $parent = $self->get_parent_item($item); #determine key for item hash my $key = $self->get_item_key($item, $parent); $self->apply_properties($item, $parent, $key, $self->{_fill_color_w}, $self->{_stroke_color_w}, $self->{_line_spin_w}, $self->{_stroke_color_w}, $self->{_font_btn_w}); } }); $image_btn->signal_connect( 'clicked' => sub { $self->{_canvas}->get_window->set_cursor($self->change_cursor_to_current_pixbuf); }); $image_label->set_tooltip_text($self->{_d}->get("Insert an arbitrary object or file")); $image_btn->set_tooltip_text($self->{_d}->get("Insert an arbitrary object or file")); $drawing_bottom_hbox->pack_start($image_label, FALSE, FALSE, 5); $drawing_bottom_hbox->pack_start($image_btn, FALSE, FALSE, 5); return $drawing_bottom_hbox; } sub setup_right_vbox_c { my $self = shift; my $cropping_bottom_vbox = Gtk3::VBox->new(FALSE, 5); #get current pixbuf my $pixbuf = $self->{_view}->get_pixbuf || $self->{_drawing_pixbuf}; my $value_callback = sub { $self->{_selector}->set_selection({x=>$self->{_x_spin_w}->get_value, y=>$self->{_y_spin_w}->get_value, width=>$self->{_width_spin_w}->get_value, height=>$self->{_height_spin_w}->get_value}); }; #X my $xw_label = Gtk3::Label->new($self->{_d}->get("X") . ":"); $self->{_x_spin_w} = Gtk3::SpinButton->new_with_range(0, $pixbuf->get_width, 1); $self->{_x_spin_w}->set_value(0); $self->{_x_spin_w_handler} = $self->{_x_spin_w}->signal_connect( 'value-changed' => $value_callback); my $xw_hbox = Gtk3::HBox->new(FALSE, 5); $xw_hbox->pack_start($xw_label, FALSE, FALSE, 5); $xw_hbox->pack_start($self->{_x_spin_w}, FALSE, FALSE, 5); #y my $yw_label = Gtk3::Label->new($self->{_d}->get("Y") . ":"); $self->{_y_spin_w} = Gtk3::SpinButton->new_with_range(0, $pixbuf->get_height, 1); $self->{_y_spin_w}->set_value(0); $self->{_y_spin_w_handler} = $self->{_y_spin_w}->signal_connect( 'value-changed' => $value_callback); my $yw_hbox = Gtk3::HBox->new(FALSE, 5); $yw_hbox->pack_start($yw_label, FALSE, FALSE, 5); $yw_hbox->pack_start($self->{_y_spin_w}, FALSE, FALSE, 5); #width my $widthw_label = Gtk3::Label->new($self->{_d}->get("Width") . ":"); $self->{_width_spin_w} = Gtk3::SpinButton->new_with_range(0, $pixbuf->get_width, 1); $self->{_width_spin_w}->set_value(0); $self->{_width_spin_w_handler} = $self->{_width_spin_w}->signal_connect( 'value-changed' => $value_callback); my $ww_hbox = Gtk3::HBox->new(FALSE, 5); $ww_hbox->pack_start($widthw_label, FALSE, FALSE, 5); $ww_hbox->pack_start($self->{_width_spin_w}, FALSE, FALSE, 5); #height my $heightw_label = Gtk3::Label->new($self->{_d}->get("Height") . ":"); $self->{_height_spin_w} = Gtk3::SpinButton->new_with_range(0, $pixbuf->get_height, 1); $self->{_height_spin_w}->set_value(0); $self->{_height_spin_w_handler} = $self->{_height_spin_w}->signal_connect( 'value-changed' => $value_callback); my $hw_hbox = Gtk3::HBox->new(FALSE, 5); $hw_hbox->pack_start($heightw_label, FALSE, FALSE, 5); $hw_hbox->pack_start($self->{_height_spin_w}, FALSE, FALSE, 5); #the above values are changed when the selection is changed $self->{_selector_handler} = $self->{_selector}->signal_connect( 'selection-changed' => sub { $self->adjust_crop_values($pixbuf); }); #cancel button my $crop_c = Gtk3::Button->new_from_stock('gtk-cancel'); $crop_c->signal_connect('clicked' => sub { $self->abort_current_mode }); #crop button my $crop_ok = Gtk3::Button->new_with_mnemonic($self->{_d}->get("_Crop")); $crop_ok->set_image(Gtk3::Image->new_from_file($self->{_dicons} . '/transform-crop.png')); $crop_ok->signal_connect( 'clicked' => sub { my $s = $self->{_selector}->get_selection; my $p = $self->{_view}->get_pixbuf; if ($s && $p) { #add to undo stack $self->store_to_xdo_stack($self->{_canvas_bg}, 'modify', 'undo', $s); #create new pixbuf #create temp pixbuf because selected area might be bigger than #source pixbuf (screenshot) => canvas area is resizeable my $temp = Gtk3::Gdk::Pixbuf->new($self->{_drawing_pixbuf}->get_colorspace, TRUE, 8, $p->get_width, $p->get_height); #whole pixbuf is transparent $temp->fill(0x00000000); #copy source image to temp pixbuf (temp pixbuf's size == $self->{_view}->get_pixbuf) $self->{_drawing_pixbuf}->copy_area(0, 0, $self->{_drawing_pixbuf}->get_width, $self->{_drawing_pixbuf}->get_height, $temp, 0, 0); #and create a new subpixbuf from the temp pixbuf my $new_p = $temp->new_subpixbuf($s->{x}, $s->{y}, $s->{width}, $s->{height}); $self->{_drawing_pixbuf} = $new_p->copy; #update bounds and bg_rects $self->{_canvas_bg_rect}->set('width' => $s->{width}, 'height' => $s->{height}); $self->handle_bg_rects('update'); #update canvas and show the new pixbuf $self->{_canvas_bg}->set('pixbuf' => $new_p); #now move all items, #so they are in the right position #~ print $s->x ." - ".$s->y."\n"; $self->move_all($s->{x}, $s->{y}); #adjust stack order $self->{_canvas_bg}->lower; $self->{_canvas_bg_rect}->lower; $self->handle_bg_rects('raise'); } else { #nothing here right now } #finally reset mode to select tool $self->abort_current_mode; }); #put buttons in a separated box #all buttons = one size my $sg_butt = Gtk3::SizeGroup->new('vertical'); $sg_butt->add_widget($crop_c); $sg_butt->add_widget($crop_ok); my $cropping_bottom_vbox_b = Gtk3::VBox->new(FALSE, 5); $cropping_bottom_vbox_b->pack_start($crop_c, FALSE, FALSE, 0); $cropping_bottom_vbox_b->pack_start($crop_ok, FALSE, FALSE, 0); #final_packing #all labels = one size $xw_label->set_alignment(0, 0.5); $yw_label->set_alignment(0, 0.5); $widthw_label->set_alignment(0, 0.5); $heightw_label->set_alignment(0, 0.5); my $sg_main = Gtk3::SizeGroup->new('horizontal'); $sg_main->add_widget($xw_label); $sg_main->add_widget($yw_label); $sg_main->add_widget($widthw_label); $sg_main->add_widget($heightw_label); $cropping_bottom_vbox->pack_start($xw_hbox, FALSE, FALSE, 3); $cropping_bottom_vbox->pack_start($yw_hbox, FALSE, FALSE, 3); $cropping_bottom_vbox->pack_start($ww_hbox, FALSE, FALSE, 3); $cropping_bottom_vbox->pack_start($hw_hbox, FALSE, FALSE, 3); $cropping_bottom_vbox->pack_start($cropping_bottom_vbox_b, TRUE, TRUE, 3); #nice frame as well my $crop_frame_label = Gtk3::Label->new; $crop_frame_label->set_markup("" . $self->{_d}->get("Selection") . ""); my $crop_frame = Gtk3::Frame->new(); $crop_frame->set_border_width(5); $crop_frame->set_label_widget($crop_frame_label); $crop_frame->set_shadow_type('none'); $crop_frame->add($cropping_bottom_vbox); return ($crop_frame, $crop_ok); } sub adjust_crop_values { my $self = shift; my $pixbuf = shift; #block 'value-change' handlers for widgets #so we do not apply the changes twice $self->{_x_spin_w}->signal_handler_block($self->{_x_spin_w_handler}); $self->{_y_spin_w}->signal_handler_block($self->{_y_spin_w_handler}); $self->{_width_spin_w}->signal_handler_block($self->{_width_spin_w_handler}); $self->{_height_spin_w}->signal_handler_block($self->{_height_spin_w_handler}); my $s = $self->{_selector}->get_selection; if ($s) { $self->{_x_spin_w}->set_value($s->{x}); $self->{_x_spin_w}->set_range(0, $pixbuf->get_width - $s->{width}); $self->{_y_spin_w}->set_value($s->{y}); $self->{_y_spin_w}->set_range(0, $pixbuf->get_height - $s->{height}); $self->{_width_spin_w}->set_value($s->{width}); $self->{_width_spin_w}->set_range(0, $pixbuf->get_width - $s->{x}); $self->{_height_spin_w}->set_value($s->{height}); $self->{_height_spin_w}->set_range(0, $pixbuf->get_height - $s->{y}); } #unblock 'value-change' handlers for widgets $self->{_x_spin_w}->signal_handler_unblock($self->{_x_spin_w_handler}); $self->{_y_spin_w}->signal_handler_unblock($self->{_y_spin_w_handler}); $self->{_width_spin_w}->signal_handler_unblock($self->{_width_spin_w_handler}); $self->{_height_spin_w}->signal_handler_unblock($self->{_height_spin_w_handler}); return TRUE; } sub push_tool_help_to_statusbar { my ($self, $x, $y, $action) = @_; #init $action if not defined $action = 'none' unless defined $action; #current event coordinates my $status_text = int($x) . " x " . int($y); if ($self->{_current_mode} == 10) { if ($action eq 'resize') { $status_text .= " " . $self->{_d}->get("Click-Drag to scale (try Control to scale uniformly)"); } elsif ($action eq 'canvas_resize') { $status_text .= " " . $self->{_d}->get("Click-Drag to resize the canvas"); } } elsif ($self->{_current_mode} == 20 || $self->{_current_mode} == 30) { $status_text .= " " . $self->{_d}->get("Click to paint (try Control or Shift for a straight line)"); } elsif ($self->{_current_mode} == 40) { $status_text .= " " . $self->{_d}->get("Click-Drag to create a new straight line"); } elsif ($self->{_current_mode} == 50) { $status_text .= " " . $self->{_d}->get("Click-Drag to create a new arrow"); } elsif ($self->{_current_mode} == 60) { $status_text .= " " . $self->{_d}->get("Click-Drag to create a new rectangle"); } elsif ($self->{_current_mode} == 70) { $status_text .= " " . $self->{_d}->get("Click-Drag to create a new ellipse"); } elsif ($self->{_current_mode} == 80) { $status_text .= " " . $self->{_d}->get("Click-Drag to add a new text area"); } elsif ($self->{_current_mode} == 90) { $status_text .= " " . $self->{_d}->get("Click to censor (try Control or Shift for a straight line)"); } elsif ($self->{_current_mode} == 100) { $status_text .= " " . $self->{_d}->get("Click-Drag to create a pixelized region"); } elsif ($self->{_current_mode} == 110) { $status_text .= " " . $self->{_d}->get("Click to add an auto-increment shape"); } elsif ($self->{_current_mode} == 120) { #nothing to do here.... } #update statusbar $self->show_status_message(1, $status_text); return TRUE; } sub show_status_message { my $self = shift; my $index = shift; my $status_text = shift; my $status_image = shift; #this is a stock-id #~ #remove old message and timer #~ $self->{_drawing_statusbar}->pop($index); #~ Glib::Source->remove ($self->{_drawing_statusbar}->{statusbar_timer}) if defined $self->{_drawing_statusbar}->{statusbar_timer}; #new message and image if (defined $status_image) { $self->{_drawing_statusbar_image}->set_from_stock($status_image, 'menu'); } else { $self->{_drawing_statusbar_image}->clear; } $self->{_drawing_statusbar}->push($index, $status_text); #~ #...and remove it #~ $self->{_drawing_statusbar}->{statusbar_timer} = Glib::Timeout->add( #~ 3000, #~ sub { #~ $self->{_drawing_statusbar}->pop($index) if defined $self->{_drawing_statusbar}; #~ return FALSE; #~ } #~ ); return TRUE; } sub change_drawing_tool_cb { my $self = shift; my $action = shift; #~ print "change_drawing_tool_cb\n"; eval { $self->{_current_mode} = $action->get_current_value; }; if ($@) { $self->{_current_mode} = $action; } my $cursor = Gtk3::Gdk::Cursor->new('left-ptr'); #tool is switched from "highlighter" OR censor to something else (excluding select tool) if ( $self->{_current_mode} != $self->{_last_mode} && $self->{_current_mode} != 10 && $self->{_current_mode} != 30 && $self->{_current_mode} != 90 && $self->{_current_mode} != 100 && $self->{_current_mode} != 120) { $self->restore_drawing_properties; } #show drawing tool widgets if ($self->{_current_mode} != 120) { #show drawing tool widgets $self->{_table}->show_all; $self->{_bhbox}->show_all; $self->{_drawing_inner_vbox}->show_all; #hide cropping tool $self->{_drawing_inner_vbox_c}->hide; } #enable controls again $self->{_fill_color_w}->set_sensitive(TRUE); $self->{_stroke_color_w}->set_sensitive(TRUE); $self->{_line_spin_w}->set_sensitive(TRUE); $self->{_font_btn_w}->set_sensitive(TRUE); if ($self->{_current_mode} == 10) { $self->{_current_mode_descr} = "select"; } elsif ($self->{_current_mode} == 20) { $self->{_current_mode_descr} = "freehand"; #disable controls, because they are not useful $self->{_fill_color_w}->set_sensitive(FALSE); $self->{_font_btn_w}->set_sensitive(FALSE); } elsif ($self->{_current_mode} == 30) { $self->{_current_mode_descr} = "highlighter"; $cursor = Gtk3::Gdk::Cursor->new('dotbox'); #disable controls, because they are not useful $self->{_fill_color_w}->set_sensitive(FALSE); $self->{_font_btn_w}->set_sensitive(FALSE); #restore hard-coded highlighter properties $self->restore_fixed_properties($self->{_current_mode_descr}); } elsif ($self->{_current_mode} == 40) { $self->{_current_mode_descr} = "line"; #disable controls, because they are not useful $self->{_fill_color_w}->set_sensitive(FALSE); $self->{_font_btn_w}->set_sensitive(FALSE); } elsif ($self->{_current_mode} == 50) { $self->{_current_mode_descr} = "arrow"; #disable controls, because they are not useful $self->{_fill_color_w}->set_sensitive(FALSE); $self->{_font_btn_w}->set_sensitive(FALSE); } elsif ($self->{_current_mode} == 60) { $self->{_current_mode_descr} = "rect"; #disable controls, because they are not useful $self->{_font_btn_w}->set_sensitive(FALSE); } elsif ($self->{_current_mode} == 70) { $self->{_current_mode_descr} = "ellipse"; #disable controls, because they are not useful $self->{_font_btn_w}->set_sensitive(FALSE); } elsif ($self->{_current_mode} == 80) { $self->{_current_mode_descr} = "text"; #disable controls, because they are not useful $self->{_fill_color_w}->set_sensitive(FALSE); $self->{_line_spin_w}->set_sensitive(FALSE); } elsif ($self->{_current_mode} == 90) { $self->{_current_mode_descr} = "censor"; #disable controls, because they are not useful when using the #censor tool $self->{_fill_color_w}->set_sensitive(FALSE); $self->{_stroke_color_w}->set_sensitive(FALSE); $self->{_line_spin_w}->set_sensitive(FALSE); $self->{_font_btn_w}->set_sensitive(FALSE); #restore hard-coded censor properties $self->restore_fixed_properties($self->{_current_mode_descr}); } elsif ($self->{_current_mode} == 100) { $self->{_current_mode_descr} = "pixelize"; #disable controls, because they are not useful when using the #pixelize tool $self->{_fill_color_w}->set_sensitive(FALSE); $self->{_stroke_color_w}->set_sensitive(FALSE); $self->{_line_spin_w}->set_sensitive(FALSE); $self->{_font_btn_w}->set_sensitive(FALSE); } elsif ($self->{_current_mode} == 110) { $self->{_current_mode_descr} = "number"; } elsif ($self->{_current_mode} == 120) { $self->{_current_mode_descr} = "crop"; #show cropping tool $self->{_view}->set_pixbuf($self->save(TRUE)); $self->{_view}->set_zoom(1); #adjust transp color my $color_string = $self->{_canvas_bg_rect}{fill_color}->to_string; $self->{_view_css_provider_alpha}->load_from_data(" .imageview.transparent { background-color: $color_string; } "); $self->{_view}->show_all; $self->{_drawing_inner_vbox_c}->show_all; #hide drawing tool widgets $self->{_drawing_inner_vbox}->hide; #focus crop-ok-button $self->{_btn_ok_c}->grab_focus; } if ($self->{_canvas} && $self->{_canvas}->get_window) { if (exists $self->{_cursors}{$self->{_current_mode_descr}}) { $cursor = Gtk3::Gdk::Cursor->new_from_pixbuf( Gtk3::Gdk::Display::get_default(), $self->{_cursors}{$self->{_current_mode_descr}}, $self->{_cursors}{$self->{_current_mode_descr}}{'x_hot'}, $self->{_cursors}{$self->{_current_mode_descr}}{'y_hot'}, ); } $self->{_canvas}->get_window->set_cursor($cursor); } return TRUE; } sub zoom_in_cb { my $self = shift; if ($self->{_current_mode_descr} ne "crop") { $self->{_canvas}->set_scale($self->{_canvas}->get_scale + 0.2); #~ $self->adjust_rulers; } else { $self->{_view}->zoom_in; } return TRUE; } sub zoom_out_cb { my $self = shift; if ($self->{_current_mode_descr} ne "crop") { my $new_scale = $self->{_canvas}->get_scale - 0.2; if ($new_scale < 0.2) { $self->{_canvas}->set_scale(0.2); } else { $self->{_canvas}->set_scale($new_scale); } #~ $self->adjust_rulers; } else { $self->{_view}->zoom_out; } return TRUE; } sub zoom_normal_cb { my $self = shift; if ($self->{_current_mode_descr} ne "crop") { $self->{_canvas}->set_scale(1); #~ $self->adjust_rulers; } else { $self->{_view}->set_zoom(1); } return TRUE; } sub adjust_rulers { return TRUE; my ($self, $ev, $item) = @_; my $s = $self->{_canvas}->get_scale; my ($hlower, $hupper, $hposition, $hmax_size) = $self->{_hruler}->get_range; my ($vlower, $vupper, $vposition, $vmax_size) = $self->{_vruler}->get_range; if ($ev) { my $copy_event = $ev->copy; #modify event to respect scrollbars and canvas scale $copy_event->x(($copy_event->x_root - $hlower) * $s); $copy_event->y(($copy_event->y_root - $vlower) * $s); $self->{_hruler}->signal_emit('motion-notify-event', $copy_event); $self->{_vruler}->signal_emit('motion-notify-event', $copy_event); } else { #modify rulers (e.g. done when scrolling or zooming) if ($self->{_hruler} && $self->{_hruler}) { my ($x, $y, $width, $height, $depth) = $self->{_canvas}->get_window->get_geometry; my $ha = $self->{_scrolled_window}->get_hadjustment->get_value / $s; my $va = $self->{_scrolled_window}->get_vadjustment->get_value / $s; $self->{_hruler}->set_range($ha, $ha + $width / $s, 0, $hmax_size); $self->{_vruler}->set_range($va, $va + $height / $s, 0, $vmax_size); } } return TRUE; } sub quit { my ($self, $show_warning) = @_; my ($name, $folder, $type) = fileparse($self->{_filename}, qr/\.[^.]*/); #save settings to a file in the shutter folder #is there already a .shutter folder? mkdir("$ENV{ 'HOME' }/.shutter") unless (-d "$ENV{ 'HOME' }/.shutter"); if ($show_warning && (defined $self->{_undo} && scalar(@{$self->{_undo}}) > 0)) { #warn the user if there are any unsaved changes my $warn_dialog = Gtk3::MessageDialog->new($self->{_drawing_window}, [qw/modal destroy-with-parent/], 'other', 'none', undef); #set question text $warn_dialog->set('text' => sprintf($self->{_d}->get("Save the changes to image %s before closing?"), "'$name$type'")); #set text... $self->update_warning_text($warn_dialog); #...and update it my $id = Glib::Timeout->add( 1000, sub { $self->update_warning_text($warn_dialog); return TRUE; }); $warn_dialog->set('image' => Gtk3::Image->new_from_stock('gtk-save', 'dialog')); $warn_dialog->set('title' => $self->{_d}->get("Close") . " " . $name . $type); #don't save button my $dsave_btn = Gtk3::Button->new_with_mnemonic($self->{_d}->get("Do_n't save")); $dsave_btn->set_image(Gtk3::Image->new_from_stock('gtk-delete', 'button')); #cancel button my $cancel_btn = Gtk3::Button->new_from_stock('gtk-cancel'); $cancel_btn->set_can_default(TRUE); #save button my $save_btn = Gtk3::Button->new_from_stock('gtk-save'); $warn_dialog->add_action_widget($dsave_btn, 10); $warn_dialog->add_action_widget($cancel_btn, 20); $warn_dialog->add_action_widget($save_btn, 30); $warn_dialog->set_default_response(20); $warn_dialog->get_child->show_all; my $response = $warn_dialog->run; Glib::Source->remove($id); if ($response == 20) { $warn_dialog->destroy; return TRUE; } elsif ($response == 30) { $self->save(); } $self->{_drawing_window}->hide if $self->{_drawing_window}; $warn_dialog->hide; $warn_dialog->destroy; } $self->save_settings; if ($self->{_selector_handler}) { $self->{_selector}->signal_handler_disconnect($self->{_selector_handler}); } $self->{_drawing_window}->hide if $self->{_drawing_window}; $self->{_drawing_window}->destroy if $self->{_drawing_window}; #remove statusbar timer Glib::Source->remove($self->{_drawing_statusbar}->{statusbar_timer}) if defined $self->{_drawing_statusbar}->{statusbar_timer}; #delete hash entries to avoid any #possible circularity # #this would lead to a memory leak foreach (keys %{$self}) { delete $self->{$_}; } Gtk3->main_quit(); return FALSE; } sub update_warning_text { my ($self, $warn_dialog) = @_; my $minutes = int((time - $self->{_start_time}) / 60); $minutes = 1 if $minutes == 0; my $txt = $self->{_d}->nget( "If you don't save the image, changes from the last minute will be lost", "If you don't save the image, changes from the last %d minutes will be lost", $minutes ); $txt = sprintf($txt, $minutes) if $minutes > 1; $warn_dialog->set( 'secondary-text' => "$txt." ); return TRUE; } sub load_settings { my $self = shift; my $shutter_hfunct = Shutter::App::HelperFunctions->new($self->{_sc}); #settings file my $settingsfile = "$ENV{ HOME }/.shutter/drawingtool.xml"; my $settings_xml; if ($shutter_hfunct->file_exists($settingsfile)) { eval { $settings_xml = XMLin(IO::File->new($settingsfile)); #restore window state when maximized if (exists $settings_xml->{'drawing'}->{'state'} && defined $settings_xml->{'drawing'}->{'state'} && $settings_xml->{'drawing'}->{'state'} eq 'maximized') { $self->{_drawing_window}->maximize; } #window size and position if ($settings_xml->{'drawing'}->{'x'} && $settings_xml->{'drawing'}->{'y'}) { $self->{_drawing_window}->move($settings_xml->{'drawing'}->{'x'}, $settings_xml->{'drawing'}->{'y'}); } if ($settings_xml->{'drawing'}->{'width'} && $settings_xml->{'drawing'}->{'height'}) { $self->{_drawing_window}->resize($settings_xml->{'drawing'}->{'width'}, $settings_xml->{'drawing'}->{'height'}); } #current mode if ($settings_xml->{'drawing'}->{'mode'}) { $self->{_current_mode} = $settings_xml->{'drawing'}->{'mode'}; } #autoscroll my $autoscroll_toggle = $self->{_uimanager}->get_widget("/MenuBar/Edit/Autoscroll"); $autoscroll_toggle->set_active($settings_xml->{'drawing'}->{'autoscroll'}); #drawing colors $self->{_fill_color} = Gtk3::Gdk::RGBA::parse($settings_xml->{'drawing'}->{'fill_color'}) // Gtk3::Gdk::RGBA::parse('black'); $self->{_fill_color}->alpha($settings_xml->{'drawing'}->{'fill_color_alpha'}); $self->{_stroke_color} = Gtk3::Gdk::RGBA::parse($settings_xml->{'drawing'}->{'stroke_color'}) // Gtk3::Gdk::RGBA::parse('black'); $self->{_stroke_color}->alpha($settings_xml->{'drawing'}->{'stroke_color_alpha'}); #line_width $self->{_line_width} = $settings_xml->{'drawing'}->{'line_width'}; #font $self->{_font} = $settings_xml->{'drawing'}->{'font'}; }; if ($@) { warn "ERROR: Settings of DrawingTool could not be restored: $@ - ignoring\n"; } } return TRUE; } sub save_settings { my $self = shift; #to avoid saving the properties of the highlighter #this does not make any sense $self->restore_drawing_properties; #settings file my $settingsfile = "$ENV{ HOME }/.shutter/drawingtool.xml"; #hash to store settings my %settings; #window size and position if (defined $self->{_drawing_window}->get_window) { if ($self->{_drawing_window}->get_window->get_state eq 'GDK_WINDOW_STATE_MAXIMIZED') { $settings{'drawing'}->{'state'} = 'maximized'; } } my ($w, $h) = $self->{_drawing_window}->get_size; my ($x, $y) = $self->{_drawing_window}->get_position; $settings{'drawing'}->{'x'} = $x; $settings{'drawing'}->{'y'} = $y; $settings{'drawing'}->{'width'} = $w; $settings{'drawing'}->{'height'} = $h; #current action #but don't save the crop tool as last action #as it would be confusing to open the drawing tool #with crop tool enabled if ($self->{_current_mode_descr} ne "crop") { $settings{'drawing'}->{'mode'} = $self->{_current_mode}; } else { $settings{'drawing'}->{'mode'} = 10; } #autoscroll my $autoscroll_toggle = $self->{_uimanager}->get_widget("/MenuBar/Edit/Autoscroll"); $settings{'drawing'}->{'autoscroll'} = $autoscroll_toggle->get_active(); #drawing colors $settings{'drawing'}->{'fill_color'} = sprintf("#%04x%04x%04x", $self->{_fill_color}->red * 65535, $self->{_fill_color}->green * 65535, $self->{_fill_color}->blue * 65535); $settings{'drawing'}->{'fill_color_alpha'} = $self->{_fill_color}->alpha; $settings{'drawing'}->{'stroke_color'} = sprintf("#%04x%04x%04x", $self->{_stroke_color}->red * 65535, $self->{_stroke_color}->green * 65535, $self->{_stroke_color}->blue * 65535); $settings{'drawing'}->{'stroke_color_alpha'} = $self->{_stroke_color}->alpha; #line_width $settings{'drawing'}->{'line_width'} = $self->{_line_width}; #font $settings{'drawing'}->{'font'} = $self->{_font}; eval { #save to file open(SETTFILE, ">$settingsfile") or die $!; print SETTFILE XMLout(\%settings); close(SETTFILE) or die $!; }; if ($@) { warn "ERROR: Settings of DrawingTool could not be saved: $@ - ignoring\n"; } return TRUE; } sub export_to_file { my $self = shift; my $rfiletype = shift; my $fs = Gtk3::FileChooserDialog->new( $self->{_d}->get("Choose a location to save to"), $self->{_drawing_window}, 'save', 'gtk-cancel' => 'reject', 'gtk-save' => 'accept' ); my $shutter_hfunct = Shutter::App::HelperFunctions->new($self->{_sc}); #parse filename my ($short, $folder, $ext) = fileparse($self->{_filename}, qr/\.[^.]*/); #go to recently used folder if (defined $self->{_sc}->get_rusf && $shutter_hfunct->folder_exists($self->{_sc}->get_rusf)) { $fs->set_current_folder($self->{_sc}->get_rusf); $fs->set_current_name($short . $ext); } elsif (defined $self->{_is_unsaved} && $self->{_is_unsaved}) { $fs->set_current_folder(Shutter::App::Directories::get_home_dir()); $fs->set_current_name($short . $ext); } else { $fs->set_current_folder($folder); $fs->set_current_name($short . $ext); } #preview widget my $iprev = Gtk3::Image->new; $fs->set_preview_widget($iprev); $fs->signal_connect( 'selection-changed' => sub { if (my $pfilename = $fs->get_preview_filename) { my $pixbuf = $self->{_lp_ne}->load($pfilename, 200, 200, TRUE, TRUE); unless ($pixbuf) { $fs->set_preview_widget_active(FALSE); } else { $fs->get_preview_widget->set_from_pixbuf($pixbuf); $fs->set_preview_widget_active(TRUE); } } else { $fs->set_preview_widget_active(FALSE); } }); #change extension related to the requested filetype if (defined $rfiletype) { my ($short, $folder, $ext) = fileparse($self->{_filename}, qr/\.[^.]*/); $fs->set_current_name($short . "." . $rfiletype); } my $extra_hbox = Gtk3::HBox->new; my $label_save_as_type = Gtk3::Label->new($self->{_d}->get("Image format") . ":"); my $combobox_save_as_type = Gtk3::ComboBoxText->new; #add supported formats to combobox my $counter = 0; my $png_counter = undef; #add pdf support if (defined $rfiletype && $rfiletype eq 'pdf') { $combobox_save_as_type->insert_text($counter, "pdf - Portable Document Format"); $combobox_save_as_type->set_active(0); #add ps support } elsif (defined $rfiletype && $rfiletype eq 'ps') { $combobox_save_as_type->insert_text($counter, "ps - PostScript"); $combobox_save_as_type->set_active(0); #images } else { foreach my $format (Gtk3::Gdk::Pixbuf::get_formats()) { #we don't want svg here - this is a dedicated action in the DrawingTool next if !defined $rfiletype && $format->get_name =~ /svg/; #we have a requested filetype - nothing else will be offered next if defined $rfiletype && $format->get_name ne $rfiletype; #we want jpg not jpeg if ($format->get_name eq "jpeg" || $format->get_name eq "jpg") { $combobox_save_as_type->insert_text($counter, "jpg" . " - " . $format->get_description); } else { $combobox_save_as_type->insert_text($counter, $format->get_name . " - " . $format->get_description); } #set active when mime_type is matching #loop because multiple mime types are registered for fome file formats foreach my $mime (@{$format->get_mime_types}) { $combobox_save_as_type->set_active($counter) if $mime eq $self->{'_mimetype'} || defined $rfiletype; #save png_counter as well as fallback $png_counter = $counter if $mime eq 'image/png'; } $counter++; } } #something went wrong here #filetype was not detected automatically #set to png as default unless ($combobox_save_as_type->get_active_text) { if (defined $png_counter) { $combobox_save_as_type->set_active($png_counter); } } $combobox_save_as_type->signal_connect( 'changed' => sub { my $filename = $self->{_shf}->utf8_decode($fs->get_filename); my $choosen_format = $combobox_save_as_type->get_active_text; $choosen_format =~ s/ \-.*//; #get png or jpeg (jpg) for example #~ print $choosen_format . "\n"; #parse filename my ($short, $folder, $ext) = fileparse($filename, qr/\.[^.]*/); $fs->set_current_name($short . "." . $choosen_format); }); #emit the signal once in order to invoke the sub above #~ $combobox_save_as_type->signal_emit('changed'); $extra_hbox->pack_start($label_save_as_type, FALSE, FALSE, 5); $extra_hbox->pack_start($combobox_save_as_type, FALSE, FALSE, 5); my $align_save_as_type = Gtk3::Alignment->new(1, 0, 0, 0); $align_save_as_type->add($extra_hbox); $align_save_as_type->show_all; $fs->set_extra_widget($align_save_as_type); my $fs_resp = $fs->run; if ($fs_resp eq "accept") { my $filename = $self->{_shf}->utf8_decode($fs->get_filename); #parse filename my ($short, $folder, $ext) = fileparse($filename, qr/\.[^.]*/); #keep selected folder in mind $self->{_sc}->set_rusf($folder); #handle file format my $choosen_format = $combobox_save_as_type->get_active_text; $choosen_format =~ s/ \-.*//; #get png or jpeg (jpg) for example $filename = $folder . $short . "." . $choosen_format; my $shutter_hfunct = Shutter::App::HelperFunctions->new($self->{_sc}); unless ($shutter_hfunct->file_exists($filename)) { #save $self->save(FALSE, $filename, $choosen_format); } else { #ask the user to replace the image #replace button my $replace_btn = Gtk3::Button->new_with_mnemonic($self->{_d}->get("_Replace")); $replace_btn->set_image(Gtk3::Image->new_from_stock('gtk-save-as', 'button')); my $response = $self->{_dialogs}->dlg_warning_message( sprintf($self->{_d}->get("The image already exists in %s. Replacing it will overwrite its contents."), "'" . $folder . "'"), sprintf($self->{_d}->get("An image named %s already exists. Do you want to replace it?"), "'" . $short . "." . $choosen_format . "'"), undef, undef, undef, $replace_btn, undef, undef ); if ($response == 40) { #save $self->save(FALSE, $filename, $choosen_format); } } } $fs->destroy(); } sub export_to_svg { my $self = shift; #here might be some more features in future releases of Shutter #just call the dialog $self->export_to_file('svg'); return TRUE; } sub export_to_ps { my $self = shift; #here might be some more features in future releases of Shutter #just call the dialog $self->export_to_file('ps'); return TRUE; } sub export_to_pdf { my $self = shift; #here might be some more features in future releases of Shutter #just call the dialog $self->export_to_file('pdf'); return TRUE; } sub save { my $self = shift; my $save_to_mem = shift; my $filename = shift || $self->{_filename}; my $filetype = shift || $self->{_filetype}; #make sure not to save the bounding rectangles $self->deactivate_all; #hide line and change background color, e.g. for saving $self->handle_bg_rects('hide'); unless ($save_to_mem) { #image format supports transparency or not #we need to support more formats here I think if ($filetype eq 'jpeg' || $filetype eq 'jpg' || $filetype eq 'bmp') { $self->{_canvas_bg_rect}->set( 'fill-color-gdk-rgba' => $self->{_canvas_bg_rect}{fill_color}, 'line-width' => 0, ); } elsif ($self->{_canvas_bg_rect}{fill_color}->equal(Gtk3::Gdk::RGBA::parse('gray'))) { $self->{_canvas_bg_rect}->set('visibility' => 'hidden'); } else { #ask the user if he wants to save the background color my $bg_dialog = Gtk3::MessageDialog->new($self->{_drawing_window}, [qw/modal destroy-with-parent/], 'other', 'none', undef); #set attributes $bg_dialog->set('text' => $self->{_d}->get("Do you want to save the changed background color?")); $bg_dialog->set('secondary-text' => $self->{_d}->get("The background is likely to be transparent if you decide to ignore the background color.")); $bg_dialog->set('image' => Gtk3::Image->new_from_stock('gtk-save', 'dialog')); $bg_dialog->set('title' => $self->{_d}->get("Save Background Color")); #ignore bg button my $cancel_btn = Gtk3::Button->new_with_mnemonic($self->{_d}->get("_Ignore Background Color")); #save bg button my $bg_btn = Gtk3::Button->new_with_mnemonic($self->{_d}->get("_Save Background Color")); $bg_btn->set_can_default(TRUE); $bg_dialog->add_action_widget($cancel_btn, 10); $bg_dialog->add_action_widget($bg_btn, 20); $bg_dialog->set_default_response(20); $bg_dialog->get_child->show_all; my $response = $bg_dialog->run; if ($response == 10) { $self->{_canvas_bg_rect}->set('visibility' => 'hidden'); } elsif ($response == 20) { $self->{_canvas_bg_rect}->set( 'fill-color-gdk-rgba' => $self->{_canvas_bg_rect}{fill_color}, 'line-width' => 0, ); } $bg_dialog->destroy; } } else { $self->{_canvas_bg_rect}->set('visibility' => 'hidden'); } if ($filetype eq 'svg') { #0.8? => 72 / 90 dpi my $surface = Cairo::SvgSurface->create($filename, $self->{_canvas_bg_rect}->get('width') * 0.8, $self->{_canvas_bg_rect}->get('height') * 0.8); my $cr = Cairo::Context->create($surface); $cr->scale(0.8, 0.8); $self->{_canvas}->render($cr, $self->{_canvas_bg_rect}->get_bounds, 1); $cr->show_page; } elsif ($filetype eq 'ps') { #0.8? => 72 / 90 dpi my $surface = Cairo::PsSurface->create($filename, $self->{_canvas_bg_rect}->get('width') * 0.8, $self->{_canvas_bg_rect}->get('height') * 0.8); my $cr = Cairo::Context->create($surface); $cr->scale(0.8, 0.8); $self->{_canvas}->render($cr, $self->{_canvas_bg_rect}->get_bounds, 1); $cr->show_page; } elsif ($filetype eq 'pdf') { #0.8? => 72 / 90 dpi my $surface = Cairo::PdfSurface->create($filename, $self->{_canvas_bg_rect}->get('width') * 0.8, $self->{_canvas_bg_rect}->get('height') * 0.8); my $cr = Cairo::Context->create($surface); $cr->scale(0.8, 0.8); $self->{_canvas}->render($cr, $self->{_canvas_bg_rect}->get_bounds, 1); $cr->show_page; } else { my $surface = Cairo::ImageSurface->create('argb32', $self->{_canvas_bg_rect}->get('width'), $self->{_canvas_bg_rect}->get('height')); my $cr = Cairo::Context->create($surface); $self->{_canvas}->render($cr, $self->{_canvas_bg_rect}->get_bounds, 1); my $loader = Gtk3::Gdk::PixbufLoader->new; $surface->write_to_png_stream( sub { my ($closure, $data) = @_; $loader->write([map ord, split //, $data]); return TRUE; }); $loader->close; my $pixbuf = $loader->get_pixbuf; #just return pixbuf if ($save_to_mem) { #update the canvas_rect again $self->{_canvas_bg_rect}->set( 'fill-color-gdk-rgba' => $self->{_canvas_bg_rect}{fill_color}, 'line-width' => 1, 'visibility' => 'visible', ); $self->handle_bg_rects('show'); return $pixbuf; } #save pixbuf to file my $pixbuf_save = Shutter::Pixbuf::Save->new($self->{_sc}, $self->{_drawing_window}); return $pixbuf_save->save_pixbuf_to_file($pixbuf, $filename, $filetype); } } #ITEM SIGNALS sub setup_item_signals { my ($self, $item) = @_; $item->signal_connect( 'motion_notify_event', sub { my ($item, $target, $ev) = @_; $self->event_item_on_motion_notify($item, $target, $ev); }); $item->signal_connect( 'key_press_event', sub { my ($item, $target, $ev) = @_; $self->event_item_on_key_press($item, $target, $ev); }); $item->signal_connect( 'button_press_event', sub { my ($item, $target, $ev) = @_; $self->event_item_on_button_press($item, $target, $ev); }); $item->signal_connect( 'button_release_event', sub { my ($item, $target, $ev) = @_; $self->event_item_on_button_release($item, $target, $ev); }); return TRUE; } sub setup_item_signals_extra { my ($self, $item) = @_; $item->signal_connect( 'enter_notify_event', sub { my ($item, $target, $ev) = @_; $self->event_item_on_enter_notify($item, $target, $ev); }); $item->signal_connect( 'leave_notify_event', sub { my ($item, $target, $ev) = @_; $self->event_item_on_leave_notify($item, $target, $ev); }); return TRUE; } sub event_item_on_motion_notify { my ($self, $item, $target, $ev) = @_; $self->adjust_rulers($ev, $item); #autoscroll if enabled #as does not work when using the censor tool -> deactivate it if ($self->{_current_mode_descr} ne "censor" && $self->{_autoscroll} && ($ev->state >= 'button1-mask' || $ev->state >= 'button2-mask')) { my ($x, $y, $width, $height, $depth) = $self->{_canvas}->get_window->get_geometry; my $s = $self->{_canvas}->get_scale; my $ha = $self->{_scrolled_window}->get_hadjustment->get_value; my $va = $self->{_scrolled_window}->get_vadjustment->get_value; #autoscroll if ( $ev->x > ($ha / $s + $width / $s - 100 / $s) && $ev->y > ($va / $s + $height / $s - 100 / $s)) { $self->{_canvas}->scroll_to($ha / $s + 10 / $s, $va / $s + 10 / $s); } elsif ($ev->x > ($ha / $s + $width / $s - 100 / $s)) { $self->{_canvas}->scroll_to($ha / $s + 10 / $s, $va / $s); } elsif ($ev->y > ($va / $s + $height / $s - 100 / $s)) { $self->{_canvas}->scroll_to($ha / $s, $va / $s + 10 / $s); } elsif ($ev->x < ($ha / $s + 100 / $s) && $ev->y < ($va / $s + 100 / $s)) { $self->{_canvas}->scroll_to($ha / $s - 10 / $s, $va / $s - 10 / $s); } elsif ($ev->x < ($ha / $s + 100 / $s)) { $self->{_canvas}->scroll_to($ha / $s - 10 / $s, $va / $s); } elsif ($ev->y < ($va / $s + 100 / $s)) { $self->{_canvas}->scroll_to($ha / $s, $va / $s - 10 / $s); } } #move if ($item->{dragging} && ($ev->state >= 'button1-mask' || $ev->state >= 'button2-mask')) { if ($item->isa('GooCanvas2::CanvasRect')) { my $new_x = $self->{_items}{$item}->get('x') + $ev->x - $item->{drag_x}; my $new_y = $self->{_items}{$item}->get('y') + $ev->y - $item->{drag_y}; $self->{_items}{$item}->set( 'x' => $new_x, 'y' => $new_y, ); $item->{drag_x} = $ev->x; $item->{drag_y} = $ev->y; $self->handle_rects('update', $item); $self->handle_embedded('update', $item); } else { $item->translate($ev->x - $item->{drag_x}, $ev->y - $item->{drag_y}); } #add to undo stack if ($item->{dragging_start}) { $self->store_to_xdo_stack($item, 'modify', 'undo'); $item->{dragging_start} = FALSE; } #freehand line } elsif (($self->{_current_mode_descr} eq "freehand" || $self->{_current_mode_descr} eq "highlighter" || $self->{_current_mode_descr} eq "censor") && $ev->state >= 'button1-mask') { #mark as active item my $item = undef; if ($self->{_current_new_item}) { $item = $self->{_current_new_item}; $self->{_current_new_item} = undef; $self->{_current_item} = $item; #add to undo stack $self->store_to_xdo_stack($self->{_current_item}, 'create', 'undo'); } else { $item = $self->{_current_item}; } if ($ev->state >= 'control-mask') { my $last_point = pop @{$self->{_items}{$item}{'points'}}; $last_point = $ev->y unless $last_point; push @{$self->{_items}{$item}{'points'}}, $last_point, $ev->x, $last_point; } elsif ($ev->state >= 'shift-mask') { my $last_point_y = pop @{$self->{_items}{$item}{'points'}}; my $last_point_x = pop @{$self->{_items}{$item}{'points'}}; $last_point_x = $ev->x unless $last_point_x; $last_point_y = $ev->y unless $last_point_y; push @{$self->{_items}{$item}{'points'}}, $last_point_x, $last_point_y, $last_point_x, $ev->y; } else { push @{$self->{_items}{$item}{'points'}}, $ev->x, $ev->y; } $self->{_items}{$item}->set('points' => Shutter::Draw::Utils::points_to_canvas_points(@{$self->{_items}{$item}{'points'}})); #new item is already on the canvas with small initial size #drawing is like resizing, so set up for resizing } elsif (( $self->{_current_mode_descr} eq "rect" || $self->{_current_mode_descr} eq "line" || $self->{_current_mode_descr} eq "arrow" || $self->{_current_mode_descr} eq "ellipse" || $self->{_current_mode_descr} eq "text" || $self->{_current_mode_descr} eq "image" || $self->{_current_mode_descr} eq "pixelize" || $self->{_current_mode_descr} eq "number" ) && $ev->state >= 'button1-mask' && !$item->{resizing} #if item is not in resize mode already ) { #~ print "start resizing\n"; my $item = $self->{_current_new_item}; return FALSE unless $item; $self->deactivate_all($item); #mark as active item $self->{_current_item} = $item; $self->{_items}{$item}{'bottom-right-corner'}->{res_x} = $ev->x; $self->{_items}{$item}{'bottom-right-corner'}->{res_y} = $ev->y; $self->{_items}{$item}{'bottom-right-corner'}->{resizing} = TRUE; eval { $self->{_canvas}->pointer_grab($self->{_items}{$item}{'bottom-right-corner'}, ['pointer-motion-mask', 'button-release-mask'], undef, $ev->time); }; if ($@) { # workaround for https://gitlab.gnome.org/GNOME/goocanvas/-/merge_requests/8 $self->{_canvas}->pointer_grab($self->{_items}{$item}{'bottom-right-corner'}, ['pointer-motion-mask', 'button-release-mask'], Gtk3::Gdk::Cursor->new('left-ptr'), $ev->time); } #add to undo stack $self->store_to_xdo_stack($item, 'create', 'undo'); #item is resizing mode already } elsif ($item->{resizing} && $ev->state >= 'button1-mask') { #~ print "resizing\n"; $self->{_current_mode_descr} = "resize"; #canvas resizing shape if ($self->{_canvas_bg_rect}{'right-side'} == $item) { my $new_width = $self->{_canvas_bg_rect}->get('width') + ($ev->x - $item->{res_x}); unless ($new_width < 0) { $self->{_canvas_bg_rect}->set('width' => $new_width,); $self->handle_bg_rects('update'); } } elsif ($self->{_canvas_bg_rect}{'bottom-side'} == $item) { my $new_height = $self->{_canvas_bg_rect}->get('height') + ($ev->y - $item->{res_y}); unless ($new_height < 0) { $self->{_canvas_bg_rect}->set('height' => $new_height,); $self->handle_bg_rects('update'); } } elsif ($self->{_canvas_bg_rect}{'bottom-right-corner'} == $item) { my $new_width = $self->{_canvas_bg_rect}->get('width') + ($ev->x - $item->{res_x}); my $new_height = $self->{_canvas_bg_rect}->get('height') + ($ev->y - $item->{res_y}); unless ($new_width < 0 || $new_height < 0) { $self->{_canvas_bg_rect}->set( 'width' => $new_width, 'height' => $new_height, ); $self->handle_bg_rects('update'); } #item resizing shape } else { my $curr_item = $self->{_current_item}; #~ my $cursor = undef; return FALSE unless $curr_item; #calculate aspect ratio (resizing when control is pressed) my $ratio = 1; $ratio = $self->{_items}{$curr_item}->get('width') / $self->{_items}{$curr_item}->get('height') if $self->{_items}{$curr_item}->get('height') != 0; my $new_x = 0; my $new_y = 0; my $new_width = 0; my $new_height = 0; foreach (keys %{$self->{_items}{$curr_item}}) { next unless $_ =~ m/(corner|side)/; #fancy resizing using our little resize boxes if ($item == $self->{_items}{$curr_item}{$_}) { #~ $cursor = $_; if ($_ eq 'bottom-side') { $new_x = $self->{_items}{$curr_item}->get('x'); $new_y = $self->{_items}{$curr_item}->get('y'); $new_width = $self->{_items}{$curr_item}->get('width'); $new_height = $self->{_items}{$curr_item}->get('height') + ($ev->y - $item->{res_y}); last; } elsif ($_ eq 'bottom-right-corner') { $new_x = $self->{_items}{$curr_item}->get('x'); $new_y = $self->{_items}{$curr_item}->get('y'); if ($ev->state >= 'control-mask') { $new_width = $self->{_items}{$curr_item}->get('width') + ($ev->y - $item->{res_y}) * $ratio; $new_height = $self->{_items}{$curr_item}->get('height') + ($ev->y - $item->{res_y}); } else { $new_width = $self->{_items}{$curr_item}->get('width') + ($ev->x - $item->{res_x}); $new_height = $self->{_items}{$curr_item}->get('height') + ($ev->y - $item->{res_y}); } last; } elsif ($_ eq 'top-left-corner') { if ($ev->state >= 'control-mask') { $new_x = $self->{_items}{$curr_item}->get('x') + ($ev->y - $item->{res_y}) * $ratio; $new_y = $self->{_items}{$curr_item}->get('y') + ($ev->y - $item->{res_y}); $new_width = $self->{_items}{$curr_item}->get('width') + ($self->{_items}{$curr_item}->get('x') - $new_x); $new_height = $self->{_items}{$curr_item}->get('height') + ($self->{_items}{$curr_item}->get('y') - $new_y); } else { $new_x = $self->{_items}{$curr_item}->get('x') + $ev->x - $item->{res_x}; $new_y = $self->{_items}{$curr_item}->get('y') + $ev->y - $item->{res_y}; $new_width = $self->{_items}{$curr_item}->get('width') + ($self->{_items}{$curr_item}->get('x') - $new_x); $new_height = $self->{_items}{$curr_item}->get('height') + ($self->{_items}{$curr_item}->get('y') - $new_y); } last; } elsif ($_ eq 'top-side') { $new_x = $self->{_items}{$curr_item}->get('x'); $new_y = $self->{_items}{$curr_item}->get('y') + $ev->y - $item->{res_y}; $new_width = $self->{_items}{$curr_item}->get('width'); $new_height = $self->{_items}{$curr_item}->get('height') + ($self->{_items}{$curr_item}->get('y') - $new_y); last; } elsif ($_ eq 'top-right-corner') { $new_x = $self->{_items}{$curr_item}->get('x'); $new_y = $self->{_items}{$curr_item}->get('y') + $ev->y - $item->{res_y}; if ($ev->state >= 'control-mask') { $new_width = $self->{_items}{$curr_item}->get('width') - ($ev->y - $item->{res_y}) * $ratio; $new_height = $self->{_items}{$curr_item}->get('height') + ($self->{_items}{$curr_item}->get('y') - $new_y); } else { $new_width = $self->{_items}{$curr_item}->get('width') + ($ev->x - $item->{res_x}); $new_height = $self->{_items}{$curr_item}->get('height') + ($self->{_items}{$curr_item}->get('y') - $new_y); } last; } elsif ($_ eq 'left-side') { $new_x = $self->{_items}{$curr_item}->get('x') + $ev->x - $item->{res_x}; $new_y = $self->{_items}{$curr_item}->get('y'); $new_width = $self->{_items}{$curr_item}->get('width') + ($self->{_items}{$curr_item}->get('x') - $new_x); $new_height = $self->{_items}{$curr_item}->get('height'); last; } elsif ($_ eq 'right-side') { $new_x = $self->{_items}{$curr_item}->get('x'); $new_y = $self->{_items}{$curr_item}->get('y'); $new_width = $self->{_items}{$curr_item}->get('width') + ($ev->x - $item->{res_x}); $new_height = $self->{_items}{$curr_item}->get('height'); last; } elsif ($_ eq 'bottom-left-corner') { if ($ev->state >= 'control-mask') { $new_x = $self->{_items}{$curr_item}->get('x') - $ev->y + $item->{res_y}; $new_y = $self->{_items}{$curr_item}->get('y'); $new_width = $self->{_items}{$curr_item}->get('width') + ($self->{_items}{$curr_item}->get('x') - $new_x); $new_height = $self->{_items}{$curr_item}->get('height') + ($ev->y - $item->{res_y}) / $ratio; } else { $new_x = $self->{_items}{$curr_item}->get('x') + $ev->x - $item->{res_x}; $new_y = $self->{_items}{$curr_item}->get('y'); $new_width = $self->{_items}{$curr_item}->get('width') + ($self->{_items}{$curr_item}->get('x') - $new_x); $new_height = $self->{_items}{$curr_item}->get('height') + ($ev->y - $item->{res_y}); } last; } } } #set cursor #~ $self->{_canvas}->window->set_cursor( Gtk3::Gdk::Cursor->new($cursor) ); #when width or height are too small we switch to opposite rectangle and do the resizing in this way if ($ev->state >= 'control-mask' && $new_width < 1 && $new_height < 1) { $new_x = $self->{_items}{$curr_item}->get('x'); $new_y = $self->{_items}{$curr_item}->get('y'); $new_width = $self->{_items}{$curr_item}->get('width'); $new_height = $self->{_items}{$curr_item}->get('height'); } elsif ($new_width < 0 || $new_height < 0) { $self->{_canvas}->pointer_ungrab($item, $ev->time); $self->{_canvas}->keyboard_ungrab($item, $ev->time); my $oppo = $self->get_opposite_rect($item, $curr_item, $new_width, $new_height); $self->{_items}{$curr_item}{$oppo}->{res_x} = $ev->x; $self->{_items}{$curr_item}{$oppo}->{res_y} = $ev->y; $self->{_items}{$curr_item}{$oppo}->{resizing} = TRUE; #~ #don'change cursor if this item was just started #~ if($self->{_last_item} && $self->{_current_item} && $self->{_last_item} == $self->{_current_item}){ #~ $self->{_canvas}->pointer_grab( $self->{_items}{$curr_item}{$oppo}, [ 'pointer-motion-mask', 'button-release-mask' ], undef, $ev->time ); #~ }else{ #~ $self->{_canvas}->pointer_grab( $self->{_items}{$curr_item}{$oppo}, [ 'pointer-motion-mask', 'button-release-mask' ], Gtk3::Gdk::Cursor->new($oppo), $ev->time ); #~ } eval { $self->{_canvas}->pointer_grab($self->{_items}{$curr_item}{$oppo}, ['pointer-motion-mask', 'button-release-mask'], undef, $ev->time); }; if ($@) { # workaround for https://gitlab.gnome.org/GNOME/goocanvas/-/merge_requests/8 $self->{_canvas}->pointer_grab($self->{_items}{$curr_item}{$oppo}, ['pointer-motion-mask', 'button-release-mask'], Gtk3::Gdk::Cursor->new('left-ptr'), $ev->time); } $self->handle_embedded('mirror', $curr_item, $new_width, $new_height); #adjust new values if ($new_width < 0) { $new_x += $new_width; $new_width = abs($new_width); } if ($new_height < 0) { $new_y += $new_height; $new_height = abs($new_height); } } #apply new values... $self->{_items}{$curr_item}->set( 'x' => $new_x, 'y' => $new_y, 'width' => $new_width, 'height' => $new_height, ); #and update rectangles and embedded items $self->handle_rects('update', $curr_item); $self->handle_embedded('update', $curr_item); } $item->{res_x} = $ev->x; $item->{res_y} = $ev->y; } else { if ($item->isa('GooCanvas2::CanvasRect')) { #embedded item? my $parent = $self->get_parent_item($item); $item = $parent if $parent; #shape or canvas background (resizeable rectangle) if (exists $self->{_items}{$item} or $item == $self->{_canvas_bg_rect}) { $self->push_tool_help_to_statusbar(int($ev->x), int($ev->y)); #canvas resizing shape } elsif ($self->{_canvas_bg_rect}{'right-side'} == $item || $self->{_canvas_bg_rect}{'bottom-side'} == $item || $self->{_canvas_bg_rect}{'bottom-right-corner'} == $item) { $self->push_tool_help_to_statusbar(int($ev->x), int($ev->y), 'canvas_resize'); #resizing shape } else { $self->push_tool_help_to_statusbar(int($ev->x), int($ev->y), 'resize'); } } else { $self->push_tool_help_to_statusbar(int($ev->x), int($ev->y)); } } return TRUE; } sub get_opposite_rect { my $self = shift; my $rect = shift; my $item = shift; my $width = shift; my $height = shift; foreach (keys %{$self->{_items}{$item}}) { #fancy resizing using our little resize boxes if ($rect eq $self->{_items}{$item}{$_}) { if ($_ eq 'top-left-corner') { return 'bottom-right-corner' if $width < 0 && $height < 0; return 'top-right-corner' if $width < 0; return 'bottom-left-corner' if $height < 0; } elsif ($_ eq 'top-side') { return 'bottom-side'; } elsif ($_ eq 'top-right-corner') { return 'bottom-left-corner' if $width < 0 && $height < 0; return 'top-left-corner' if $width < 0; return 'bottom-right-corner' if $height < 0; } elsif ($_ eq 'left-side') { return 'right-side'; } elsif ($_ eq 'right-side') { return 'left-side'; } elsif ($_ eq 'bottom-left-corner') { return 'top-right-corner' if $width < 0 && $height < 0; return 'bottom-right-corner' if $width < 0; return 'top-left-corner' if $height < 0; } elsif ($_ eq 'bottom-side') { return 'top-side'; } elsif ($_ eq 'bottom-right-corner') { return 'top-left-corner' if $width < 0 && $height < 0; return 'bottom-left-corner' if $width < 0; return 'top-right-corner' if $height < 0; } } } return FALSE; } sub get_parent_item { my ($self, $item) = @_; return FALSE unless $item; my $parent = undef; foreach (keys %{$self->{_items}}) { $parent = $self->{_items}{$_} if exists $self->{_items}{$_}{ellipse} && $self->{_items}{$_}{ellipse} == $item; $parent = $self->{_items}{$_} if exists $self->{_items}{$_}{text} && $self->{_items}{$_}{text} == $item; $parent = $self->{_items}{$_} if exists $self->{_items}{$_}{image} && $self->{_items}{$_}{image} == $item; $parent = $self->{_items}{$_} if exists $self->{_items}{$_}{pixelize} && $self->{_items}{$_}{pixelize} == $item; $parent = $self->{_items}{$_} if exists $self->{_items}{$_}{line} && $self->{_items}{$_}{line} == $item; if (defined $parent) { last; } } #~ #debug #~ if($parent){ #~ print "parent: $parent queried for item: $item\n"; #~ }else{ #~ print "no parent found for item: $item\n"; #~ } return $parent; } sub get_highest_auto_digit { my ($self) = @_; my $number = 0; foreach (keys %{$self->{_items}}) { my $item = $self->{_items}{$_}; #numbered shape if ( exists $self->{_items}{$item} && exists $self->{_items}{$item}{type} && $self->{_items}{$item}{type} eq 'number' && $self->{_items}{$item}{text}->get('visibility') ne 'hidden') { $number = $self->{_items}{$item}{text}{digit} if $self->{_items}{$item}{text}{digit} > $number; } } return $number; } sub get_pixelated_pixbuf_from_canvas { my ($self, $item) = @_; my $bounds = $item->get_bounds; my $sw = $item->get('width'); my $sh = $item->get('height'); #create surface and cairo context my $surface = Cairo::ImageSurface->create('rgb24', $bounds->x1 + $sw, $bounds->y1 + $sh); my $cr = Cairo::Context->create($surface); #hide rects and image $self->handle_rects('hide', $item); $self->handle_embedded('hide', $item); #render the content and load it via Gtk3::Gdk::PixbufLoader $self->{_canvas}->render($cr, $bounds, 1); #show rects again $self->handle_rects('update', $item); #~ print "start loader\n"; my $loader = Gtk3::Gdk::PixbufLoader->new; $surface->write_to_png_stream( sub { my ($closure, $data) = @_; $loader->write([map ord, split //, $data]); return TRUE; }); $loader->close; #create vars my ($pixbuf, $target) = (undef, undef); #error icon my $error = Gtk3::Widget::render_icon(Gtk3::Invisible->new, "gtk-dialog-error", 'menu'); eval { $pixbuf = $loader->get_pixbuf; #create target pixbuf $target = Gtk3::Gdk::Pixbuf->new($pixbuf->get_colorspace, TRUE, 8, $sw, $sh); }; unless ($@) { #maybe rect is only partially on canvas my ($sx, $sy) = ($bounds->x1, $bounds->y1); my ($dx, $dy) = (0, 0); if ($bounds->x1 < 0) { $sx = 0; $dx = abs $bounds->x1; $sw += $bounds->x1; } if ($bounds->y1 < 0) { $sy = 0; $dy = abs $bounds->y1; $sh += $bounds->y1; } #valid pixbuf? if ($pixbuf) { #copy area $pixbuf->copy_area($sx, $sy, $sw, $sh, $target, $dx, $dy); if ($target->get_width > 10 && $target->get_height > 10) { eval { #pixelate the pixbuf - simply scale it down and scale it up afterwards $target = $target->scale_simple($target->get_width * 0.1, $target->get_height * 0.1, 'tiles'); $target = $target->scale_simple($item->get('width'), $item->get('height'), 'tiles'); }; unless ($@) { return $target; } } elsif ($target->get_width > 5 && $target->get_height > 5) { eval { #pixelate the pixbuf - simply scale it down and scale it up afterwards $target = $target->scale_simple($target->get_width * 0.2, $target->get_height * 0.2, 'tiles'); $target = $target->scale_simple($item->get('width'), $item->get('height'), 'tiles'); }; unless ($@) { return $target; } } } } return $error; } sub get_child_item { my ($self, $item) = @_; return FALSE unless $item; my $child = undef; #notice (special shapes like numbered ellipse do deliver ellipse here => NOT text!) #therefore the order matters if (defined $item && exists $self->{_items}{$item}) { $child = $self->{_items}{$item}{text} if exists $self->{_items}{$item}{text}; $child = $self->{_items}{$item}{ellipse} if exists $self->{_items}{$item}{ellipse}; $child = $self->{_items}{$item}{image} if exists $self->{_items}{$item}{image}; $child = $self->{_items}{$item}{pixelize} if exists $self->{_items}{$item}{pixelize}; $child = $self->{_items}{$item}{line} if exists $self->{_items}{$item}{line}; } #~ #debug #~ if($child){ #~ print "child: $child queried for item: $item\n"; #~ }else{ #~ print "no child found for item: $item\n"; #~ } return $child; } sub abort_current_mode { my ($self) = @_; if ($self->{_current_item}) { $self->{_canvas}->pointer_ungrab($self->{_current_item}, Gtk3::get_current_event_time()); $self->{_canvas}->keyboard_ungrab($self->{_current_item}, Gtk3::get_current_event_time()); } #~ print "abort_current_mode\n"; $self->set_drawing_action(1); return TRUE; } sub clear_item_from_canvas { my ($self, $item) = @_; #~ print "clear_item_from_canvas\n"; $self->{_current_item} = undef; $self->{_current_new_item} = undef; if ($item) { #maybe there is a parent item to delete? my $parent = $self->get_parent_item($item); $item = $parent if $parent; #get child my $child = $self->get_child_item($item); #only delete if not already deleted (hidden) return FALSE if ($child && $child->get('visibility') eq 'hidden'); #~ print "1st passed\n"; return FALSE if (!$child && $item->get('visibility') eq 'hidden'); #~ print "2nd passed\n"; $self->store_to_xdo_stack($item, 'delete', 'undo'); $item->set('visibility' => 'hidden'); $self->handle_rects('hide', $item); $self->handle_embedded('hide', $item); } return TRUE; } sub store_to_xdo_stack { #opt1 is currently only used when cropping the image #it stores the selection my ($self, $item, $action, $xdo, $opt1, $source) = @_; return FALSE unless $item; #~ print "xdo - $item\n"; my %do_info = (); #general properties for ellipse, rectangle, image, text if ($item->isa('GooCanvas2::CanvasRect') && $item != $self->{_canvas_bg_rect}) { my $stroke_color = $self->{_items}{$item}{stroke_color}; my $fill_color = $self->{_items}{$item}{fill_color}; my $line_width = $self->{_items}{$item}->get('line-width'); #line my $mirrored_w = undef; my $mirrored_h = undef; my $end_arrow = undef; my $start_arrow = undef; my $arrow_width = undef; my $arrow_length = undef; my $tip_length = undef; #text my $text = undef; #numbered ellipse my $digit = undef; if (exists $self->{_items}{$item}{ellipse}) { $line_width = $self->{_items}{$item}{ellipse}->get('line-width'); #numbered ellipse if (exists $self->{_items}{$item}{text}) { $text = $self->{_items}{$item}{text}->get('text'); $digit = $self->{_items}{$item}{text}{digit}; } } elsif (exists $self->{_items}{$item}{text}) { $text = $self->{_items}{$item}{text}->get('text'); } elsif (exists $self->{_items}{$item}{image}) { } elsif (exists $self->{_items}{$item}{line}) { #line width $line_width = $self->{_items}{$item}{line}->get('line-width'); #arrow properties $end_arrow = $self->{_items}{$item}{line}->get('end-arrow'); $start_arrow = $self->{_items}{$item}{line}->get('start-arrow'); $arrow_width = $self->{_items}{$item}{line}->get('arrow-width'); $arrow_length = $self->{_items}{$item}{line}->get('arrow-length'); $tip_length = $self->{_items}{$item}{line}->get('arrow-tip-length'); #mirror flag $mirrored_w = $self->{_items}{$item}{mirrored_w}; $mirrored_h = $self->{_items}{$item}{mirrored_h}; } #item props %do_info = ( 'item' => $self->{_items}{$item}, 'action' => $action, 'x' => $self->{_items}{$item}->get('x'), 'y' => $self->{_items}{$item}->get('y'), 'width' => $self->{_items}{$item}->get('width'), 'height' => $self->{_items}{$item}->get('height'), 'stroke_color' => $self->{_items}{$item}{stroke_color}, 'fill_color' => $self->{_items}{$item}{fill_color}, 'line-width' => $line_width, 'mirrored_w' => $mirrored_w, 'mirrored_h' => $mirrored_h, 'end-arrow' => $end_arrow, 'start-arrow' => $start_arrow, 'arrow-length' => $arrow_length, 'arrow-width' => $arrow_width, 'arrow-tip-length' => $tip_length, 'text' => $text, 'digit' => $digit, 'opt1' => $opt1, ); } elsif ($item->isa('GooCanvas2::CanvasImage') && $item == $self->{_canvas_bg}) { #canvas_bg_image and bg_rect properties %do_info = ( 'item' => $self->{_canvas_bg}, 'action' => $action, 'drawing_pixbuf' => $self->{_drawing_pixbuf}, 'x' => $self->{_canvas_bg_rect}->get('x'), 'y' => $self->{_canvas_bg_rect}->get('y'), 'width' => $self->{_canvas_bg_rect}->get('width'), 'height' => $self->{_canvas_bg_rect}->get('height'), 'opt1' => $opt1, ); } elsif ($item->isa('GooCanvas2::CanvasRect') && $item == $self->{_canvas_bg_rect}) { #canvas_bg_rect properties %do_info = ( 'item' => $self->{_canvas_bg_rect}, 'action' => $action, 'x' => $self->{_canvas_bg_rect}->get('x'), 'y' => $self->{_canvas_bg_rect}->get('y'), 'width' => $self->{_canvas_bg_rect}->get('width'), 'height' => $self->{_canvas_bg_rect}->get('height'), 'opt1' => $opt1, ); #polyline specific properties to hash } elsif ($item->isa('GooCanvas2::CanvasPolyline')) { my $transform = $self->{_items}{$item}->get('transform'); my $line_width = $self->{_items}{$item}->get('line-width'); my $points = $self->{_items}{$item}->get('points'); %do_info = ( 'item' => $self->{_items}{$item}, 'action' => $action, 'points' => $points, 'stroke_color' => $self->{_items}{$item}{stroke_color}, 'line-width' => $line_width, 'transform' => $transform, 'opt1' => $opt1, ); } #reset redo if (defined $source && $source eq 'ui') { #~ print "no clear\n"; } else { while (defined $self->{_redo} && scalar @{$self->{_redo}} > 0) { shift @{$self->{_redo}}; } } if ($xdo eq 'undo') { push @{$self->{_undo}}, \%do_info; } elsif ($xdo eq 'redo') { push @{$self->{_redo}}, \%do_info; } #disable undo/redo actions $self->{_uimanager}->get_widget("/MenuBar/Edit/Undo")->set_sensitive(scalar @{$self->{_undo}}) if defined $self->{_undo}; $self->{_uimanager}->get_widget("/MenuBar/Edit/Redo")->set_sensitive(scalar @{$self->{_redo}}) if defined $self->{_redo}; $self->{_uimanager}->get_widget("/ToolBar/Undo")->set_sensitive(scalar @{$self->{_undo}}) if defined $self->{_undo}; $self->{_uimanager}->get_widget("/ToolBar/Redo")->set_sensitive(scalar @{$self->{_redo}}) if defined $self->{_redo}; return TRUE; } sub xdo_remove { my $self = shift; my $xdo = shift; my $item = shift; my @indices; my $counter = 0; if ($xdo eq 'undo') { foreach my $do (@{$self->{_undo}}) { push @indices, $counter if $item == $do->{'item'}; $counter++; } #delete from array foreach my $index (@indices) { splice(@{$self->{_undo}}, $index, 1); } } elsif ($xdo eq 'redo') { foreach my $do (@{$self->{_redo}}) { push @indices, $counter if $item == $do->{'item'}; $counter++; } #delete from array foreach my $index (@indices) { splice(@{$self->{_redo}}, $index, 1); } } #disable undo/redo actions $self->{_uimanager}->get_widget("/MenuBar/Edit/Undo")->set_sensitive(scalar @{$self->{_undo}}) if defined $self->{_undo}; $self->{_uimanager}->get_widget("/MenuBar/Edit/Redo")->set_sensitive(scalar @{$self->{_redo}}) if defined $self->{_redo}; $self->{_uimanager}->get_widget("/ToolBar/Undo")->set_sensitive(scalar @{$self->{_undo}}) if defined $self->{_undo}; $self->{_uimanager}->get_widget("/ToolBar/Redo")->set_sensitive(scalar @{$self->{_redo}}) if defined $self->{_redo}; return TRUE; } sub xdo { my $self = shift; my $xdo = shift; my $source = shift; my $block_reverse = shift; my $do = undef; if ($xdo eq 'undo') { $do = pop @{$self->{_undo}}; } elsif ($xdo eq 'redo') { $do = pop @{$self->{_redo}}; } my $item = $do->{'item'}; my $action = $do->{'action'}; my $opt1 = $do->{'opt1'}; return FALSE unless $item; return FALSE unless $action; if ($item->isa('GooCanvas2::CanvasImage') && $item == $self->{_canvas_bg}) { $opt1->{x} = $do->{'opt1'}->{x} * -1; $opt1->{y} = $do->{'opt1'}->{y} * -1; } #create reverse action my $reverse_action = 'modify'; if ($action eq 'raise') { $reverse_action = 'lower_xdo'; } elsif ($action eq 'raise_xdo') { $reverse_action = 'lower_xdo'; } elsif ($action eq 'lower') { $reverse_action = 'raise_xdo'; } elsif ($action eq 'lower_xdo') { $reverse_action = 'raise_xdo'; } elsif ($action eq 'create') { $reverse_action = 'delete_xdo'; } elsif ($action eq 'delete') { $reverse_action = 'create_xdo'; } elsif ($action eq 'create_xdo') { $reverse_action = 'delete_xdo'; } elsif ($action eq 'delete_xdo') { $reverse_action = 'create_xdo'; } #undo or redo? unless ($block_reverse) { if ($xdo eq 'undo') { #store to redo stack $self->store_to_xdo_stack($item, $reverse_action, 'redo', $opt1, $source); } elsif ($xdo eq 'redo') { #store to undo stack $self->store_to_xdo_stack($item, $reverse_action, 'undo', $opt1, $source); } } #finally undo the last event if ($action eq 'modify') { if ($item->isa('GooCanvas2::CanvasRect') && $item != $self->{_canvas_bg_rect}) { $self->{_items}{$item}->set( 'x' => $do->{'x'}, 'y' => $do->{'y'}, 'width' => $do->{'width'}, 'height' => $do->{'height'}, ); if (exists $self->{_items}{$item}{ellipse}) { $self->{_items}{$item}{ellipse}->set( 'fill-color-gdk-rgba' => $do->{'fill_color'}, 'stroke-color-gdk-rgba' => $do->{'stroke_color'}, 'line-width' => $do->{'line-width'}, ); #numbered ellipse if (exists $self->{_items}{$item}{text}) { $self->{_items}{$item}{text}->set( 'text' => $do->{'text'}, 'fill-color-gdk-rgba' => $do->{'stroke_color'}, ); $self->{_items}{$item}{text}{digit} = $do->{'digit'}; } #restore color and opacity as well $self->{_items}{$item}{fill_color} = $do->{'fill_color'}; $self->{_items}{$item}{stroke_color} = $do->{'stroke_color'}; } elsif (exists $self->{_items}{$item}{text}) { $self->{_items}{$item}{text}->set( 'text' => $do->{'text'}, 'fill-color-gdk-rgba' => $do->{'stroke_color'}, ); #restore color and opacity as well $self->{_items}{$item}{stroke_color} = $do->{'stroke_color'}; } elsif (exists $self->{_items}{$item}{pixelize}) { $self->{_items}{$item}{pixelize}->set( 'x' => int $self->{_items}{$item}->get('x'), 'y' => int $self->{_items}{$item}->get('y'), 'width' => $self->{_items}{$item}->get('width'), 'height' => $self->{_items}{$item}->get('height'), 'pixbuf' => $self->get_pixelated_pixbuf_from_canvas($self->{_items}{$item}), ); } elsif (exists $self->{_items}{$item}{image}) { #~ print "xdo image\n"; my $copy = $self->{_lp}->load($self->{_items}{$item}{orig_pixbuf_filename}, $self->{_items}{$item}->get('width'), $self->{_items}{$item}->get('height'), FALSE, TRUE); if ($copy) { $self->{_items}{$item}{image}->set( 'x' => int $self->{_items}{$item}->get('x'), 'y' => int $self->{_items}{$item}->get('y'), 'width' => $self->{_items}{$item}->get('width'), 'height' => $self->{_items}{$item}->get('height'), 'pixbuf' => $copy ); } } elsif (exists $self->{_items}{$item}{line}) { #save arrow specific properties $self->{_items}{$item}{end_arrow} = $do->{'end-arrow'}; $self->{_items}{$item}{start_arrow} = $do->{'start-arrow'}; $self->{_items}{$item}{arrow_width} = $do->{'arrow-width'}; $self->{_items}{$item}{arrow_length} = $do->{'arrow-length'}; $self->{_items}{$item}{arrow_tip_length} = $do->{'arrow-tip-length'}; $self->{_items}{$item}{line}->set( 'fill-color-gdk-rgba' => $do->{'fill_color'}, 'stroke-color-gdk-rgba' => $do->{'stroke_color'}, 'line-width' => $do->{'line-width'}, 'end-arrow' => $self->{_items}{$item}{end_arrow}, 'start-arrow' => $self->{_items}{$item}{start_arrow}, 'arrow-length' => $self->{_items}{$item}{arrow_length}, 'arrow-width' => $self->{_items}{$item}{arrow_width}, 'arrow-tip-length' => $self->{_items}{$item}{arrow_tip_length}, ); $self->{_items}{$item}{mirrored_w} = $do->{'mirrored_w'} if exists $do->{'mirrored_w'}; $self->{_items}{$item}{mirrored_h} = $do->{'mirrored_h'} if exists $do->{'mirrored_h'}; #restore color and opacity as well $self->{_items}{$item}{stroke_color} = $do->{'stroke_color'}; } else { $self->{_items}{$item}->set( 'fill-color-gdk-rgba' => $do->{'fill_color'}, 'stroke-color-gdk-rgba' => $do->{'stroke_color'}, 'line-width' => $do->{'line-width'}, ); #restore color and opacity as well $self->{_items}{$item}{fill_color} = $do->{'fill_color'}; $self->{_items}{$item}{stroke_color} = $do->{'stroke_color'}; } } elsif ($item->isa('GooCanvas2::CanvasImage') && $item == $self->{_canvas_bg}) { #~ print "xdo canvas_bg\n"; my $new_w = $do->{'drawing_pixbuf'}->get_width; my $new_h = $do->{'drawing_pixbuf'}->get_height; #update canvas and show the new pixbuf $self->{_canvas_bg}->set('pixbuf' => $do->{'drawing_pixbuf'}); #save new pixbuf in var $self->{_drawing_pixbuf} = $do->{'drawing_pixbuf'}->copy; #update bounds and bg_rects $self->{_canvas_bg_rect}->set( 'x' => $do->{'x'}, 'y' => $do->{'y'}, 'width' => $do->{'width'}, 'height' => $do->{'height'}, ); #we need to move the shapes $self->move_all($opt1->{x}, $opt1->{y}); } elsif ($item->isa('GooCanvas2::CanvasRect') && $item == $self->{_canvas_bg_rect}) { #~ print "xdo canvas_bg_rect\n"; $self->{_canvas_bg_rect}->set( 'x' => $do->{'x'}, 'y' => $do->{'y'}, 'width' => $do->{'width'}, 'height' => $do->{'height'}, ); #polyline specific properties } elsif ($item->isa('GooCanvas2::CanvasPolyline')) { #if pattern exists #e.g. censor tool does not have a pattern if ($do->{'stroke-pattern'}) { $self->{_items}{$item}->set( 'stroke-color-gdk-rgba' => $do->{'stroke_color'}, 'line-width' => $do->{'line-width'}, 'points' => $do->{'points'}, 'transform' => $do->{'transform'}, ); $self->{_items}{$item}{stroke_color} = $do->{'stroke_color'}; } else { $self->{_items}{$item}->set( 'line-width' => $do->{'line-width'}, 'points' => $do->{'points'}, 'transform' => $do->{'transform'}, ); } } #handle resize rectangles and embedded objects if ($item == $self->{_canvas_bg}) { $self->handle_bg_rects('update', $self->{_canvas_bg_rect}); } elsif ($item == $self->{_canvas_bg_rect}) { $self->handle_bg_rects('update', $self->{_canvas_bg_rect}); } else { $self->handle_rects('update', $self->{_items}{$item}); $self->handle_embedded('update', $self->{_items}{$item}, undef, undef, TRUE); #apply item properties to widgets #line width, fill color, stroke color etc. $self->set_and_save_drawing_properties($self->{_current_item}, FALSE); } #adjust stack order $self->{_canvas_bg}->lower; $self->{_canvas_bg_rect}->lower; $self->handle_bg_rects('raise'); } elsif ($action eq 'raise' || $action eq 'raise_xdo') { my $child = $self->get_child_item($item); if ($child) { $self->handle_rects('lower', $item); $child->lower; $item->lower; } else { $self->handle_rects('lower', $item); $item->lower; } $self->{_canvas_bg}->lower; $self->{_canvas_bg_rect}->lower; } elsif ($action eq 'lower' || $action eq 'lower_xdo') { my $child = $self->get_child_item($item); if ($child) { $child->raise; $item->raise; $self->handle_rects('raise', $item); } else { $item->raise; $self->handle_rects('raise', $item); } } elsif ($action eq 'delete' || $action eq 'delete_xdo') { #mark as current $self->{_current_item} = $item; $self->{_current_new_item} = undef; $self->{_items}{$item}->set('visibility' => 'visible'); $self->handle_rects('update', $self->{_items}{$item}); $self->handle_embedded('update', $self->{_items}{$item}, undef, undef, TRUE); } elsif ($action eq 'create' || $action eq 'create_xdo') { $self->{_items}{$item}->set('visibility' => 'hidden'); $self->handle_rects('hide', $self->{_items}{$item}); $self->handle_embedded('hide', $self->{_items}{$item}); } #disable undo/redo actions $self->{_uimanager}->get_widget("/MenuBar/Edit/Undo")->set_sensitive(scalar @{$self->{_undo}}) if defined $self->{_undo}; $self->{_uimanager}->get_widget("/MenuBar/Edit/Redo")->set_sensitive(scalar @{$self->{_redo}}) if defined $self->{_redo}; $self->{_uimanager}->get_widget("/ToolBar/Undo")->set_sensitive(scalar @{$self->{_undo}}) if defined $self->{_undo}; $self->{_uimanager}->get_widget("/ToolBar/Redo")->set_sensitive(scalar @{$self->{_redo}}) if defined $self->{_redo}; $self->deactivate_all; return TRUE; } sub set_and_save_drawing_properties { my $self = shift; my $item = shift; my $save_only = shift; return FALSE unless $item; #~ print "set_and_save_drawing_properties1\n"; #determine key for item hash if (my $child = $self->get_child_item($item)) { $item = $child; } my $parent = $self->get_parent_item($item); my $key = $self->get_item_key($item, $parent); return FALSE unless $key; #~ print "set_and_save_drawing_properties2\n"; #we do not remember the properties for some tools #and don't remember them when just selecting items with the cursor if ( $self->{_items}{$key}{type} ne "highlighter" && $self->{_items}{$key}{type} ne "censor" && $self->{_items}{$key}{type} ne "image" && $self->{_items}{$key}{type} ne "pixelize" && $self->{_current_mode} != 10) { #remember drawing colors, line width and font settings #maybe we have to restore them $self->{_last_fill_color} = $self->{_fill_color_w}->get_rgba; $self->{_last_stroke_color} = $self->{_stroke_color_w}->get_rgba; $self->{_last_line_width} = $self->{_line_spin_w}->get_value; $self->{_last_font} = $self->{_font_btn_w}->get_font_name; #remember the last mode as well $self->{_last_mode} = $self->{_current_mode}; } return TRUE if $save_only; #block 'value-change' handlers for widgets #so we do not apply the changes twice $self->{_line_spin_w}->signal_handler_block($self->{_line_spin_wh}); $self->{_stroke_color_w}->signal_handler_block($self->{_stroke_color_wh}); $self->{_fill_color_w}->signal_handler_block($self->{_fill_color_wh}); $self->{_font_btn_w}->signal_handler_block($self->{_font_btn_wh}); #~ print "set_and_save_drawing_properties3\n"; if ( $item->isa('GooCanvas2::CanvasRect') || $item->isa('GooCanvas2::CanvasEllipse') || $item->isa('GooCanvas2::CanvasPolyline')) { #line width $self->{_line_spin_w}->set_value($item->get('line-width')); #stroke color #some items, e.g. censor tool, do not have a color - skip them if ($self->{_items}{$key}{stroke_color}) { #~ print $self->{_items}{$key}{stroke_color}->to_string, "\n"; $self->{_stroke_color_w}->set_rgba($self->{_items}{$key}{stroke_color}); } if ($item->isa('GooCanvas2::CanvasRect') || $item->isa('GooCanvas2::CanvasEllipse')) { #fill color $self->{_fill_color_w}->set_rgba($self->{_items}{$key}{fill_color}); #numbered shapes if (exists($self->{_items}{$key}{text})) { #determine font description from string my ($attr_list, $text_raw, $accel_char) = Pango->parse_markup($self->{_items}{$key}{text}->get('text')); my $font_desc = $attr_list->get_iterator->get_font; #apply current font settings to button $self->{_font_btn_w}->set_font_name($font_desc ? $font_desc->to_string : $self->{_font}); } } } elsif ($item->isa('GooCanvas2::CanvasText')) { #determine font description from string my ($attr_list, $text_raw, $accel_char) = Pango->parse_markup($item->get('text')); my $font_desc = $attr_list->get_iterator->get_font; #font color $self->{_stroke_color_w}->set_rgba($self->{_items}{$key}{stroke_color}); #apply current font settings to button $self->{_font_btn_w}->set_font_name($font_desc ? $font_desc->to_string : $self->{_font}); } #update global values $self->{_line_width} = $self->{_line_spin_w}->get_value; $self->{_stroke_color} = $self->{_stroke_color_w}->get_rgba; $self->{_fill_color} = $self->{_fill_color_w}->get_rgba; my $font_descr = Pango::FontDescription->from_string($self->{_font_btn_w}->get_font_name); $self->{_font} = $self->{_font_btn_w}->get_font_name; #unblock 'value-change' handlers for widgets $self->{_line_spin_w}->signal_handler_unblock($self->{_line_spin_wh}); $self->{_stroke_color_w}->signal_handler_unblock($self->{_stroke_color_wh}); $self->{_fill_color_w}->signal_handler_unblock($self->{_fill_color_wh}); $self->{_font_btn_w}->signal_handler_unblock($self->{_font_btn_wh}); } sub restore_fixed_properties { my $self = shift; my $mode = shift; #~ print "restore_highlighter_properties\n"; #block 'value-change' handlers for widgets #so we do not apply the changes twice $self->{_line_spin_w}->signal_handler_block($self->{_line_spin_wh}); $self->{_stroke_color_w}->signal_handler_block($self->{_stroke_color_wh}); $self->{_fill_color_w}->signal_handler_block($self->{_fill_color_wh}); $self->{_font_btn_w}->signal_handler_block($self->{_font_btn_wh}); if ($mode eq "highlighter") { #highlighter my $fill_color = Gtk3::Gdk::RGBA::parse('#00000000ffff'); $fill_color->alpha(0.234683756771191); $self->{_fill_color_w}->set_rgba($fill_color); my $stroke_color = Gtk3::Gdk::RGBA::parse('#ffffffff0000'); $stroke_color->alpha(0.499992370489052); $self->{_stroke_color_w}->set_rgba($stroke_color); $self->{_line_spin_w}->set_value(18); } elsif ($mode eq "censor") { #censor $self->{_line_spin_w}->set_value(14); } #update global values $self->{_line_width} = $self->{_line_spin_w}->get_value; $self->{_stroke_color} = $self->{_stroke_color_w}->get_rgba; $self->{_fill_color} = $self->{_fill_color_w}->get_rgba; #unblock 'value-change' handlers for widgets $self->{_line_spin_w}->signal_handler_unblock($self->{_line_spin_wh}); $self->{_stroke_color_w}->signal_handler_unblock($self->{_stroke_color_wh}); $self->{_fill_color_w}->signal_handler_unblock($self->{_fill_color_wh}); $self->{_font_btn_w}->signal_handler_unblock($self->{_font_btn_wh}); } sub restore_drawing_properties { my $self = shift; #saved properties available? return FALSE unless defined $self->{_last_fill_color}; #anything done until now? return FALSE unless defined $self->{_last_mode}; #~ print "restore_drawing_properties\n"; #block 'value-change' handlers for widgets #so we do not apply the changes twice $self->{_line_spin_w}->signal_handler_block($self->{_line_spin_wh}); $self->{_stroke_color_w}->signal_handler_block($self->{_stroke_color_wh}); $self->{_fill_color_w}->signal_handler_block($self->{_fill_color_wh}); $self->{_font_btn_w}->signal_handler_block($self->{_font_btn_wh}); #restore them $self->{_fill_color_w}->set_rgba($self->{_last_fill_color}); $self->{_stroke_color_w}->set_rgba($self->{_last_stroke_color}); $self->{_line_spin_w}->set_value($self->{_last_line_width}); $self->{_font_btn_w}->set_font_name($self->{_last_font}); #update global values $self->{_line_width} = $self->{_line_spin_w}->get_value; $self->{_stroke_color} = $self->{_stroke_color_w}->get_rgba; $self->{_fill_color} = $self->{_fill_color_w}->get_rgba; my $font_descr = Pango::FontDescription->from_string($self->{_font_btn_w}->get_font_name); $self->{_font} = $self->{_font_btn_w}->get_font_name; #unblock 'value-change' handlers for widgets $self->{_line_spin_w}->signal_handler_unblock($self->{_line_spin_wh}); $self->{_stroke_color_w}->signal_handler_unblock($self->{_stroke_color_wh}); $self->{_fill_color_w}->signal_handler_unblock($self->{_fill_color_wh}); $self->{_font_btn_w}->signal_handler_unblock($self->{_font_btn_wh}); } sub event_item_on_key_press { my ($self, $item, $target, $ev) = @_; if ($self->{_current_item}) { #current item my $curr_item = $self->{_current_item}; if (exists $self->{_items}{$curr_item}) { #construct an motion-notify event my $mevent = Gtk3::Gdk::Event->new('motion-notify'); $mevent->state('button2-mask'); $mevent->time(Gtk3::get_current_event_time()); $mevent->window($self->{_drawing_window}->get_window); #get current x, y values my $old_x = $self->{_items}{$curr_item}->get('x'); my $old_y = $self->{_items}{$curr_item}->get('y'); #set item flags $curr_item->{drag_x} = $old_x; $curr_item->{drag_y} = $old_y; $curr_item->{dragging} = TRUE; $curr_item->{dragging_start} = TRUE; #move with arrow keys if ($ev->keyval == Gtk3::Gdk::keyval_from_name('Up')) { #~ print $ev->keyval," $old_x,$old_y-up\n"; $mevent->x($old_x); $mevent->y($old_y - 1); } elsif ($ev->keyval == Gtk3::Gdk::keyval_from_name('Down')) { #~ print $ev->keyval," $old_x,$old_y-down\n"; $mevent->x($old_x); $mevent->y($old_y + 1); } elsif ($ev->keyval == Gtk3::Gdk::keyval_from_name('Left')) { #~ print $ev->keyval," $old_x,$old_y-left\n"; $mevent->x($old_x - 1); $mevent->y($old_y); } elsif ($ev->keyval == Gtk3::Gdk::keyval_from_name('Right')) { #~ print $ev->keyval," $old_x,$old_y-right\n"; $mevent->x($old_x + 1); $mevent->y($old_y); } else { return FALSE; } #finally call motion-notify handler $self->event_item_on_motion_notify($curr_item, $target, $mevent); } } return TRUE; } sub event_item_on_button_press { my ($self, $item, $target, $ev, $select) = @_; #~ print "button-press\n"; #canvas is busy now... $self->{_busy} = TRUE; my $cursor = Gtk3::Gdk::Cursor->new('left-ptr'); #activate item #if it is not activated yet # => single click if ($ev->type eq 'button-press' && ($self->{_current_mode_descr} eq "select" || $select || $ev->button == 2 || $ev->button == 3)) { #embedded item? my $parent = $self->get_parent_item($item); $item = $parent if $parent; #real shape if (exists $self->{_items}{$item}) { unless (defined $self->{_current_item} && $item == $self->{_current_item}) { unless ($self->{_current_mode_descr} eq "number" || $self->{_current_mode_descr} eq "text") { unless ($self->{_items}{$item}{locked}) { #deactivate last item my $last_item = $self->{_current_item}; if (defined $last_item) { #~ print "deactivated item: $last_item\n"; $self->{_canvas}->pointer_ungrab($last_item, $ev->time); $self->{_canvas}->keyboard_ungrab($last_item, $ev->time); $self->handle_rects('hide', $last_item); } #mark as active item $self->{_current_item} = $item; $self->{_current_new_item} = undef; $self->handle_rects('update', $self->{_current_item}); #apply item properties to widgets #line width, fill color, stroke color etc. $self->set_and_save_drawing_properties($self->{_current_item}, FALSE); #~ print "activated item: $item\n"; } else { $self->deactivate_all; #~ print "deactivate because $item is locked\n"; } } else { $self->deactivate_all($self->{_current_item}); #~ print "deactivate because $item is text or number\n"; } } else { #~ print "no activate because $item is already current item\n"; } #no item selected, deactivate all items } elsif ($item == $self->{_canvas_bg_rect}) { $self->deactivate_all; #~ print "deactivate because $item is background rectangle\n"; } else { #~ print "no activate because $item does not exist\n"; } } else { #~ print "no activate action\n"; } #left mouse click to drag, resize, create or delelte items if ($ev->type eq 'button-press' && ($ev->button == 1 || $ev->button == 2)) { #MOVE if ($self->{_current_mode_descr} eq "select" || $ev->button == 2) { #don't_move the bounding rectangle or the bg_image return TRUE if $item == $self->{_canvas_bg_rect}; #don't move locked item return TRUE if (exists $self->{_items}{$item} && $self->{_items}{$item}{locked}); if ($item->isa('GooCanvas2::CanvasRect')) { #real shape => move if (exists $self->{_items}{$item}) { $item->{drag_x} = $ev->x; $item->{drag_y} = $ev->y; $item->{dragging} = TRUE; $item->{dragging_start} = TRUE; $cursor = Gtk3::Gdk::Cursor->new('fleur'); #resizing shape => resize } else { $item->{res_x} = $ev->x; $item->{res_y} = $ev->y; $item->{resizing} = TRUE; $cursor = undef; #resizing the canvas_bg_rect if ( $self->{_canvas_bg_rect}{'right-side'} == $item || $self->{_canvas_bg_rect}{'bottom-side'} == $item || $self->{_canvas_bg_rect}{'bottom-right-corner'} == $item) { #add to undo stack $self->store_to_xdo_stack($self->{_canvas_bg_rect}, 'modify', 'undo'); #other resizing rectangles } else { #add to undo stack $self->store_to_xdo_stack($self->{_current_item}, 'modify', 'undo'); } #restore style pattern $item->set('fill-color-gdk-rgba' => $self->{_style_bg}); } #no rectangle, e.g. polyline } else { #no rect, just move it ... $item->{drag_x} = $ev->x; $item->{drag_y} = $ev->y; $item->{dragging} = TRUE; $item->{dragging_start} = TRUE; #add to undo stack #~ $self->store_to_xdo_stack($self->{_current_item} , 'modify', 'undo'); $cursor = undef; } #~ print "grab keyboard and pointer focus for $item\n"; #grab keyboard and pointer focus eval { $self->{_canvas}->pointer_grab($item, ['pointer-motion-mask', 'button-release-mask'], $cursor, $ev->time); }; if ($@) { # workaround for https://gitlab.gnome.org/GNOME/goocanvas/-/merge_requests/8 $self->{_canvas}->pointer_grab($item, ['pointer-motion-mask', 'button-release-mask'], Gtk3::Gdk::Cursor->new('left-ptr'), $ev->time); } $self->{_canvas}->grab_focus($item); #current mode not equal 'select' and no polyline } elsif ($ev->button == 1) { #resizing shape => resize (no real shape) #no polyline modes if ( $item->isa('GooCanvas2::CanvasRect') && !exists $self->{_items}{$item} && $item != $self->{_canvas_bg_rect} && $self->{_current_mode_descr} ne "freehand" && $self->{_current_mode_descr} ne "highlighter" && $self->{_current_mode_descr} ne "censor") { $item->{res_x} = $ev->x; $item->{res_y} = $ev->y; $item->{resizing} = TRUE; $cursor = undef; #resizing the canvas_bg_rect if ( $self->{_canvas_bg_rect}{'right-side'} == $item || $self->{_canvas_bg_rect}{'bottom-side'} == $item || $self->{_canvas_bg_rect}{'bottom-right-corner'} == $item) { #add to undo stack $self->store_to_xdo_stack($self->{_canvas_bg_rect}, 'modify', 'undo'); #other resizing rectangles } else { #add to undo stack $self->store_to_xdo_stack($self->{_current_item}, 'modify', 'undo'); } #restore style pattern $item->set('fill-color-gdk-rgba' => $self->{_style_bg}); #~ print "grab keyboard and pointer focus for $item\n"; #grab keyboard and pointer focus eval { $self->{_canvas}->pointer_grab($item, ['pointer-motion-mask', 'button-release-mask'], $cursor, $ev->time); }; if ($@) { # workaround for https://gitlab.gnome.org/GNOME/goocanvas/-/merge_requests/8 $self->{_canvas}->pointer_grab($item, ['pointer-motion-mask', 'button-release-mask'], Gtk3::Gdk::Cursor->new('left-ptr'), $ev->time); } $self->{_canvas}->grab_focus($item); #create new item } else { #freehand if ($self->{_current_mode_descr} eq "freehand") { $self->deactivate_all; $self->create_polyline($ev, undef, FALSE); #highlighter } elsif ($self->{_current_mode_descr} eq "highlighter") { $self->deactivate_all; $self->create_polyline($ev, undef, TRUE); #Line } elsif ($self->{_current_mode_descr} eq "line") { $self->create_line($ev, undef); #Arrow } elsif ($self->{_current_mode_descr} eq "arrow") { $self->create_line($ev, undef, TRUE, FALSE); #Censor } elsif ($self->{_current_mode_descr} eq "censor") { $self->deactivate_all; $self->create_censor($ev, undef); #Number } elsif ($self->{_current_mode_descr} eq "number") { $self->create_ellipse($ev, undef, TRUE); #RECTANGLES } elsif ($self->{_current_mode_descr} eq "rect") { $self->create_rectangle($ev, undef); #ELLIPSE } elsif ($self->{_current_mode_descr} eq "ellipse") { $self->create_ellipse($ev, undef); #TEXT } elsif ($self->{_current_mode_descr} eq "text") { $self->create_text($ev, undef); #IMAGE } elsif ($self->{_current_mode_descr} eq "image") { $self->create_image($ev, undef); #PIXELIZE } elsif ($self->{_current_mode_descr} eq "pixelize") { $self->create_pixel_image($ev, undef); } #grab keyboard focus if (my $nitem = $self->{_current_new_item}) { #~ print "grab keyboard focus for new item $nitem\n"; $self->{_canvas}->grab_focus($nitem); } } } #right click => show context menu, double-click => show properties directly } elsif ($ev->type eq '2button-press' || $ev->button == 3) { $self->{_canvas}->pointer_ungrab($item, $ev->time); $self->{_canvas}->keyboard_ungrab($item, $ev->time); #determine key for item hash if (my $child = $self->get_child_item($item)) { $item = $child; } my $parent = $self->get_parent_item($item); my $key = $self->get_item_key($item, $parent); #real shape if (defined $key && exists $self->{_items}{$key}) { if ( $ev->type eq '2button-press' && $ev->button == 1 && $self->{_current_mode_descr} ne "text" && $self->{_current_mode_descr} ne "number" && $self->{_current_mode_descr} ne "freehand" && $self->{_current_mode_descr} ne "highlighter" && $self->{_current_mode_descr} ne "censor") { #some items do not have properties, e.g. images or censor return FALSE if $item->isa('GooCanvas2::CanvasImage') || !exists($self->{_items}{$key}{stroke_color}); #~ print $item, $parent, $key, "\n"; $self->show_item_properties($item, $parent, $key); } elsif ($ev->type eq 'button-press' && $ev->button == 3) { my $item_menu = $self->ret_item_menu($item, $parent, $key); $item_menu->popup( undef, # parent menu shell undef, # parent menu item undef, # menu pos func undef, # data $ev->button, $ev->time ); } } else { #background rectangle if ($item == $self->{_canvas_bg_rect}) { my $bg_menu = $self->ret_background_menu($item); $bg_menu->popup( undef, # parent menu shell undef, # parent menu item undef, # menu pos func undef, # data $ev->button, $ev->time ); } } #canvas idle now $self->{_busy} = FALSE; } return TRUE; } sub ret_background_menu { my $self = shift; my $item = shift; my $menu_bg = Gtk3::Menu->new; #properties my $prop_item = Gtk3::ImageMenuItem->new($self->{_d}->get("Change Background Color...")); $prop_item->set_image(Gtk3::Image->new_from_stock('gtk-select-color', 'menu')); $prop_item->signal_connect( 'activate' => sub { my $color_dialog = Gtk3::ColorChooserDialog->new($self->{_d}->get("Choose fill color")); #add reset button my $reset_btn = Gtk3::Button->new_with_mnemonic($self->{_d}->get("_Reset to Default")); $color_dialog->add_action_widget($reset_btn, 'reject'); $color_dialog->set_rgba($self->{_canvas_bg_rect}{fill_color}); $color_dialog->show_all; #run dialog my $response = 'reject'; while ($response eq 'reject') { $response = $color_dialog->run; if ($response eq 'ok') { #apply new color $self->{_canvas_bg_rect}{fill_color} = $color_dialog->get_rgba; $self->{_canvas_bg_rect}{fill_color}->alpha(1); $self->{_canvas_bg_rect}->set('fill-color-gdk-rgba', $self->{_canvas_bg_rect}{fill_color}); last; } elsif ($response eq 'reject') { $color_dialog->set_rgba(Gtk3::Gdk::RGBA::parse('gray')); } else { last; } } $color_dialog->destroy; }); $menu_bg->append($prop_item); $menu_bg->show_all; return $menu_bg; } sub ret_item_menu { my $self = shift; my $item = shift; my $parent = shift; my $key = shift; #~ print "ret_item_menu\n"; my $menu_item = Gtk3::Menu->new; #raise my $raise_item = Gtk3::ImageMenuItem->new($self->{_d}->get("Raise")); $raise_item->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size($self->{_dicons} . '/draw-raise.png', Gtk3::IconSize->lookup('menu')))); $raise_item->signal_connect( 'activate' => sub { if ($parent) { #add to undo stack $self->store_to_xdo_stack($parent, 'raise', 'undo'); $parent->raise; $item->raise; $self->handle_rects('raise', $parent); } else { #add to undo stack $self->store_to_xdo_stack($item, 'raise', 'undo'); $item->raise; $self->handle_rects('raise', $item); } }); $menu_item->append($raise_item); #lower my $lower_item = Gtk3::ImageMenuItem->new($self->{_d}->get("Lower")); $lower_item->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size($self->{_dicons} . '/draw-lower.png', Gtk3::IconSize->lookup('menu')))); $lower_item->signal_connect( 'activate' => sub { if ($parent) { #add to undo stack $self->store_to_xdo_stack($parent, 'lower', 'undo'); $self->handle_rects('lower', $parent); $item->lower; $parent->lower; } else { #add to undo stack $self->store_to_xdo_stack($item, 'lower', 'undo'); $self->handle_rects('lower', $item); $item->lower; } $self->{_canvas_bg}->lower; $self->{_canvas_bg_rect}->lower; }); $menu_item->append($lower_item); $menu_item->append(Gtk3::SeparatorMenuItem->new); #copy item my $copy_item = Gtk3::ImageMenuItem->new_from_stock('gtk-copy'); $copy_item->signal_connect( 'activate' => sub { #clear clipboard $self->{_clipboard}->set_text(""); $self->{_cut} = FALSE; $self->{_current_copy_item} = $self->{_current_item}; }); $menu_item->append($copy_item); #cut item my $cut_item = Gtk3::ImageMenuItem->new_from_stock('gtk-cut'); $cut_item->signal_connect( 'activate' => sub { #clear clipboard $self->{_clipboard}->set_text(""); $self->{_cut} = TRUE; $self->{_current_copy_item} = $self->{_current_item}; $self->clear_item_from_canvas($self->{_current_copy_item}); }); $menu_item->append($cut_item); #paste item my $paste_item = Gtk3::ImageMenuItem->new_from_stock('gtk-paste'); $paste_item->signal_connect( 'activate' => sub { $self->paste_item($self->{_current_copy_item}, $self->{_cut}); $self->{_cut} = FALSE; }); $menu_item->append($paste_item); #delete item my $remove_item = Gtk3::ImageMenuItem->new_from_stock('gtk-delete'); $remove_item->signal_connect( 'activate' => sub { $self->clear_item_from_canvas($item); }); $menu_item->append($remove_item); $menu_item->append(Gtk3::SeparatorMenuItem->new); #add lock/unlock entry if item == background image if ($item == $self->{_canvas_bg}) { my $lock_item = undef; if (exists $self->{_items}{$key} && $self->{_items}{$key}{locked} == TRUE) { $lock_item = Gtk3::ImageMenuItem->new_with_label($self->{_d}->get("Unlock")); $lock_item->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size($self->{_dicons} . '/draw-unlocked.png', Gtk3::IconSize->lookup('menu')))); } elsif (exists $self->{_items}{$key} && $self->{_items}{$key}{locked} == FALSE) { $lock_item = Gtk3::ImageMenuItem->new_with_label($self->{_d}->get("Lock")); $lock_item->set_image(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size($self->{_dicons} . '/draw-locked.png', Gtk3::IconSize->lookup('menu')))); } #handler $lock_item->signal_connect( 'activate' => sub { if (exists $self->{_items}{$key} && $self->{_items}{$key}{locked} == FALSE) { $self->{_items}{$key}{locked} = TRUE; $self->deactivate_all; } elsif (exists $self->{_items}{$key} && $self->{_items}{$key}{locked} == TRUE) { $self->{_items}{$key}{locked} = FALSE; } }); $menu_item->append($lock_item); $menu_item->append(Gtk3::SeparatorMenuItem->new); } #properties my $prop_item = Gtk3::ImageMenuItem->new($self->{_d}->get("Edit Preferences...")); $prop_item->set_image(Gtk3::Image->new_from_stock('gtk-properties', 'menu')); #some items do not have properties, e.g. images or censor $prop_item->set_sensitive(FALSE) if $item->isa('GooCanvas2::CanvasImage') || !exists($self->{_items}{$key}{stroke_color}); $prop_item->signal_connect( 'activate' => sub { $self->show_item_properties($item, $parent, $key); }); $menu_item->append($prop_item); $menu_item->show_all; return $menu_item; } sub get_item_key { my ($self, $item, $parent) = @_; if (exists $self->{_items}{$item}) { return $item; } else { return $parent; } } sub show_item_properties { my ($self, $item, $parent, $key) = @_; #~ print "show_item_properties\n"; #create dialog my $prop_dialog = Gtk3::Dialog->new( $self->{_d}->get("Preferences"), $self->{_drawing_window}, [qw/modal destroy-with-parent/], 'gtk-cancel' => 'cancel', 'gtk-ok' => 'ok' ); $prop_dialog->set_default_response('ok'); #RECT OR ELLIPSE OR POLYLINE my $line_spin = undef; my $fill_color = undef; my $stroke_color = undef; #NUMBERED ELLIPSE my $number_spin = undef; #ARROW my $end_arrow = undef; my $start_arrow = undef; my $arrow_spin = undef; my $arrowl_spin = undef; my $arrowt_spin = undef; #TEXT my $font_btn; my $text; my $textview; my $font_color; #RECT OR ELLIPSE OR NUMBER OR POLYLINE #GENERAL SETTINGS if ( $item->isa('GooCanvas2::CanvasRect') || $item->isa('GooCanvas2::CanvasEllipse') || $item->isa('GooCanvas2::CanvasPolyline') || ($item->isa('GooCanvas2::CanvasText') && defined $self->{_items}{$key}{ellipse})) { my $general_vbox = Gtk3::VBox->new(FALSE, 5); my $label_general = Gtk3::Label->new; $label_general->set_markup("" . $self->{_d}->get("Main") . ""); my $frame_general = Gtk3::Frame->new(); $frame_general->set_label_widget($label_general); $frame_general->set_shadow_type('none'); $frame_general->set_border_width(5); $prop_dialog->get_child->add($frame_general); #line_width my $line_hbox = Gtk3::HBox->new(FALSE, 5); $line_hbox->set_border_width(5); my $linew_label = Gtk3::Label->new($self->{_d}->get("Line width") . ":"); $line_spin = Gtk3::SpinButton->new_with_range(0.5, 20, 0.1); $line_spin->set_value($item->get('line-width')); $line_hbox->pack_start($linew_label, FALSE, TRUE, 12); $line_hbox->pack_start($line_spin, TRUE, TRUE, 0); $general_vbox->pack_start($line_hbox, FALSE, FALSE, 0); if ($item->isa('GooCanvas2::CanvasRect') || $item->isa('GooCanvas2::CanvasEllipse')) { #fill color my $fill_color_hbox = Gtk3::HBox->new(FALSE, 5); $fill_color_hbox->set_border_width(5); my $fill_color_label = Gtk3::Label->new($self->{_d}->get("Fill color") . ":"); $fill_color = Gtk3::ColorButton->new(); $fill_color->set_rgba($self->{_items}{$key}{fill_color}); $fill_color->set_use_alpha(TRUE); $fill_color->set_title($self->{_d}->get("Choose fill color")); $fill_color_hbox->pack_start($fill_color_label, FALSE, TRUE, 12); $fill_color_hbox->pack_start($fill_color, TRUE, TRUE, 0); $general_vbox->pack_start($fill_color_hbox, FALSE, FALSE, 0); } #some items, e.g. censor tool, do not have a color - skip them if ($self->{_items}{$key}{stroke_color}) { #stroke color my $stroke_color_hbox = Gtk3::HBox->new(FALSE, 5); $stroke_color_hbox->set_border_width(5); my $stroke_color_label = Gtk3::Label->new($self->{_d}->get("Stroke color") . ":"); $stroke_color = Gtk3::ColorButton->new(); $stroke_color->set_rgba($self->{_items}{$key}{stroke_color}); $stroke_color->set_use_alpha(TRUE); $stroke_color->set_title($self->{_d}->get("Choose stroke color")); $stroke_color_hbox->pack_start($stroke_color_label, FALSE, TRUE, 12); $stroke_color_hbox->pack_start($stroke_color, TRUE, TRUE, 0); $general_vbox->pack_start($stroke_color_hbox, FALSE, FALSE, 0); } $frame_general->add($general_vbox); #special shapes like numbered ellipse if (defined $self->{_items}{$key}{text}) { my $numbered_vbox = Gtk3::VBox->new(FALSE, 5); my $label_numbered = Gtk3::Label->new; $label_numbered->set_markup("" . $self->{_d}->get("Numbering") . ""); my $frame_numbered = Gtk3::Frame->new(); $frame_numbered->set_label_widget($label_numbered); $frame_numbered->set_shadow_type('none'); $frame_numbered->set_border_width(5); $prop_dialog->get_child->add($frame_numbered); #current digit my $number_hbox = Gtk3::HBox->new(FALSE, 5); $number_hbox->set_border_width(5); my $numberw_label = Gtk3::Label->new($self->{_d}->get("Current value") . ":"); $number_spin = Gtk3::SpinButton->new_with_range(0, 999, 1); $number_spin->set_value($self->{_items}{$key}{text}{digit}); $number_hbox->pack_start($numberw_label, FALSE, TRUE, 12); $number_hbox->pack_start($number_spin, TRUE, TRUE, 0); $numbered_vbox->pack_start($number_hbox, FALSE, FALSE, 0); #font button my $font_hbox = Gtk3::HBox->new(FALSE, 5); $font_hbox->set_border_width(5); my $font_label = Gtk3::Label->new($self->{_d}->get("Font") . ":"); $font_btn = Gtk3::FontButton->new(); #determine font description from string my ($attr_list, $text_raw, $accel_char) = Pango->parse_markup($self->{_items}{$key}{text}->get('text')); my ($font_desc) = $attr_list->get_iterator->get_font; #apply current font settings to button $font_btn->set_font_name($font_desc ? $font_desc->to_string : $self->{_font}); $font_hbox->pack_start($font_label, FALSE, TRUE, 12); $font_hbox->pack_start($font_btn, TRUE, TRUE, 0); $numbered_vbox->pack_start($font_hbox, FALSE, FALSE, 0); $frame_numbered->add($numbered_vbox); } } #ARROW item if ( $item->isa('GooCanvas2::CanvasPolyline') && defined $self->{_items}{$key}{end_arrow} && defined $self->{_items}{$key}{start_arrow}) { my $arrow_vbox = Gtk3::VBox->new(FALSE, 5); my $label_arrow = Gtk3::Label->new; $label_arrow->set_markup("" . $self->{_d}->get("Arrow") . ""); my $frame_arrow = Gtk3::Frame->new(); $frame_arrow->set_label_widget($label_arrow); $frame_arrow->set_shadow_type('none'); $frame_arrow->set_border_width(5); $prop_dialog->get_child->add($frame_arrow); #arrow_width my $arrow_hbox = Gtk3::HBox->new(FALSE, 5); $arrow_hbox->set_border_width(5); my $arroww_label = Gtk3::Label->new($self->{_d}->get("Width") . ":"); $arrow_spin = Gtk3::SpinButton->new_with_range(0.5, 10, 0.1); $arrow_spin->set_value($item->get('arrow-width')); $arrow_hbox->pack_start($arroww_label, FALSE, TRUE, 12); $arrow_hbox->pack_start($arrow_spin, TRUE, TRUE, 0); $arrow_vbox->pack_start($arrow_hbox, FALSE, FALSE, 0); #arrow_length my $arrowl_hbox = Gtk3::HBox->new(FALSE, 5); $arrowl_hbox->set_border_width(5); my $arrowl_label = Gtk3::Label->new($self->{_d}->get("Length") . ":"); $arrowl_spin = Gtk3::SpinButton->new_with_range(0.5, 10, 0.1); $arrowl_spin->set_value($item->get('arrow-length')); $arrowl_hbox->pack_start($arrowl_label, FALSE, TRUE, 12); $arrowl_hbox->pack_start($arrowl_spin, TRUE, TRUE, 0); $arrow_vbox->pack_start($arrowl_hbox, FALSE, FALSE, 0); #arrow_tip_length my $arrowt_hbox = Gtk3::HBox->new(FALSE, 5); $arrowt_hbox->set_border_width(5); my $arrowt_label = Gtk3::Label->new($self->{_d}->get("Tip length") . ":"); $arrowt_spin = Gtk3::SpinButton->new_with_range(0.5, 10, 0.1); $arrowt_spin->set_value($item->get('arrow-tip-length')); $arrowt_hbox->pack_start($arrowt_label, FALSE, TRUE, 12); $arrowt_hbox->pack_start($arrowt_spin, TRUE, TRUE, 0); $arrow_vbox->pack_start($arrowt_hbox, FALSE, FALSE, 0); #checkboxes for start and end arrows $end_arrow = Gtk3::CheckButton->new($self->{_d}->get("Display an arrow at the end of the line")); $end_arrow->set_active($self->{_items}{$key}{end_arrow}); $start_arrow = Gtk3::CheckButton->new($self->{_d}->get("Display an arrow at the start of the line")); $start_arrow->set_active($self->{_items}{$key}{start_arrow}); my $end_arrow_hbox = Gtk3::HBox->new(FALSE, 5); $end_arrow_hbox->set_border_width(5); my $start_arrow_hbox = Gtk3::HBox->new(FALSE, 5); $start_arrow_hbox->set_border_width(5); $end_arrow_hbox->pack_start($end_arrow, FALSE, TRUE, 12); $start_arrow_hbox->pack_start($start_arrow, FALSE, TRUE, 12); $arrow_vbox->pack_start($start_arrow_hbox, FALSE, FALSE, 0); $arrow_vbox->pack_start($end_arrow_hbox, FALSE, FALSE, 0); #final packing $frame_arrow->add($arrow_vbox); #simple TEXT item (no numbered ellipse) } elsif ($item->isa('GooCanvas2::CanvasText') && !defined $self->{_items}{$key}{ellipse}) { my $text_vbox = Gtk3::VBox->new(FALSE, 5); my $label_text = Gtk3::Label->new; $label_text->set_markup("" . $self->{_d}->get("Text") . ""); my $frame_text = Gtk3::Frame->new(); $frame_text->set_label_widget($label_text); $frame_text->set_shadow_type('none'); $frame_text->set_border_width(5); $prop_dialog->get_child->add($frame_text); #font button my $font_hbox = Gtk3::HBox->new(FALSE, 5); $font_hbox->set_border_width(5); my $font_label = Gtk3::Label->new($self->{_d}->get("Font") . ":"); $font_btn = Gtk3::FontButton->new(); #determine font description from string my ($attr_list, $text_raw, $accel_char) = Pango->parse_markup($item->get('text')); my ($font_desc) = Pango::FontDescription->from_string($self->{_font}); $font_hbox->pack_start($font_label, FALSE, TRUE, 12); $font_hbox->pack_start($font_btn, TRUE, TRUE, 0); $text_vbox->pack_start($font_hbox, FALSE, FALSE, 0); #font color my $font_color_hbox = Gtk3::HBox->new(FALSE, 5); $font_color_hbox->set_border_width(5); my $font_color_label = Gtk3::Label->new($self->{_d}->get("Font color") . ":"); $font_color = Gtk3::ColorButton->new(); $font_color->set_use_alpha(TRUE); $font_color->set_rgba($self->{_items}{$key}{stroke_color}); $font_color->set_title($self->{_d}->get("Choose font color")); $font_color_hbox->pack_start($font_color_label, FALSE, TRUE, 12); $font_color_hbox->pack_start($font_color, TRUE, TRUE, 0); $text_vbox->pack_start($font_color_hbox, FALSE, FALSE, 0); #initial buffer my $text = Gtk3::TextBuffer->new; $text->set_text($text_raw); #textview my $textview_hbox = Gtk3::HBox->new(FALSE, 5); $textview_hbox->set_border_width(5); $textview = Gtk3::TextView->new_with_buffer($text); $textview->set_can_focus(TRUE); $textview->set_size_request(150, 200); $textview_hbox->pack_start($textview, TRUE, TRUE, 0); $text_vbox->pack_start($textview_hbox, TRUE, TRUE, 0); #use font checkbox my $use_font = Gtk3::CheckButton->new_with_label($self->{_d}->get("Use selected font")); $use_font->set_active(FALSE); $text_vbox->pack_start($use_font, TRUE, TRUE, 0); #use font color checkbox my $use_font_color = Gtk3::CheckButton->new_with_label($self->{_d}->get("Use selected font color")); $use_font_color->set_active(FALSE); $text_vbox->pack_start($use_font_color, TRUE, TRUE, 0); #apply changes directly $use_font->signal_connect( 'toggled' => sub { $self->modify_text_in_properties($font_btn, $textview, $font_color, $item, $use_font, $use_font_color); }); $use_font_color->signal_connect( 'toggled' => sub { $self->modify_text_in_properties($font_btn, $textview, $font_color, $item, $use_font, $use_font_color); }); $font_btn->signal_connect( 'font-set' => sub { $self->modify_text_in_properties($font_btn, $textview, $font_color, $item, $use_font, $use_font_color); }); $font_color->signal_connect( 'color-set' => sub { $self->modify_text_in_properties($font_btn, $textview, $font_color, $item, $use_font, $use_font_color); }); #apply current font settings to button $font_btn->set_font_name($font_desc ? $font_desc->to_string : $self->{_font}); #FIXME >> why do we have to invoke this manually?? $font_btn->signal_emit('font-set'); $frame_text->add($text_vbox); } #instant changes my $store_count = 0; if (defined $line_spin) { $line_spin->signal_connect( 'value-changed' => sub { $self->apply_properties( $item, $parent, $key, $fill_color, $stroke_color, $line_spin, $font_color, $font_btn, $textview, $end_arrow, $start_arrow, $arrow_spin, $arrowl_spin, $arrowt_spin, $number_spin, $store_count ); $store_count++; }); } if (defined $fill_color) { $fill_color->signal_connect( 'color-set' => sub { $self->apply_properties( $item, $parent, $key, $fill_color, $stroke_color, $line_spin, $font_color, $font_btn, $textview, $end_arrow, $start_arrow, $arrow_spin, $arrowl_spin, $arrowt_spin, $number_spin, $store_count ); $store_count++; }); } if (defined $stroke_color) { $stroke_color->signal_connect( 'color-set' => sub { $self->apply_properties( $item, $parent, $key, $fill_color, $stroke_color, $line_spin, $font_color, $font_btn, $textview, $end_arrow, $start_arrow, $arrow_spin, $arrowl_spin, $arrowt_spin, $number_spin, $store_count ); $store_count++; }); } if (defined $number_spin) { $number_spin->signal_connect( 'value-changed' => sub { $self->apply_properties( $item, $parent, $key, $fill_color, $stroke_color, $line_spin, $font_color, $font_btn, $textview, $end_arrow, $start_arrow, $arrow_spin, $arrowl_spin, $arrowt_spin, $number_spin, $store_count ); $store_count++; }); } if (defined $end_arrow) { $end_arrow->signal_connect( 'toggled' => sub { $self->apply_properties( $item, $parent, $key, $fill_color, $stroke_color, $line_spin, $font_color, $font_btn, $textview, $end_arrow, $start_arrow, $arrow_spin, $arrowl_spin, $arrowt_spin, $number_spin, $store_count ); $store_count++; }); } if (defined $start_arrow) { $start_arrow->signal_connect( 'toggled' => sub { $self->apply_properties( $item, $parent, $key, $fill_color, $stroke_color, $line_spin, $font_color, $font_btn, $textview, $end_arrow, $start_arrow, $arrow_spin, $arrowl_spin, $arrowt_spin, $number_spin, $store_count ); $store_count++; }); } if (defined $arrow_spin) { $arrow_spin->signal_connect( 'value-changed' => sub { $self->apply_properties( $item, $parent, $key, $fill_color, $stroke_color, $line_spin, $font_color, $font_btn, $textview, $end_arrow, $start_arrow, $arrow_spin, $arrowl_spin, $arrowt_spin, $number_spin, $store_count ); $store_count++; }); } if (defined $arrowl_spin) { $arrowl_spin->signal_connect( 'value-changed' => sub { $self->apply_properties( $item, $parent, $key, $fill_color, $stroke_color, $line_spin, $font_color, $font_btn, $textview, $end_arrow, $start_arrow, $arrow_spin, $arrowl_spin, $arrowt_spin, $number_spin, $store_count ); $store_count++; }); } if (defined $arrowt_spin) { $arrowt_spin->signal_connect( 'value-changed' => sub { $self->apply_properties( $item, $parent, $key, $fill_color, $stroke_color, $line_spin, $font_color, $font_btn, $textview, $end_arrow, $start_arrow, $arrow_spin, $arrowl_spin, $arrowt_spin, $number_spin, $store_count ); $store_count++; }); } if (defined $font_btn) { $font_btn->signal_connect( 'font-set' => sub { $self->apply_properties( $item, $parent, $key, $fill_color, $stroke_color, $line_spin, $font_color, $font_btn, $textview, $end_arrow, $start_arrow, $arrow_spin, $arrowl_spin, $arrowt_spin, $number_spin, $store_count ); $store_count++; }); } if (defined $font_color) { $font_color->signal_connect( 'color-set' => sub { $self->apply_properties( $item, $parent, $key, $fill_color, $stroke_color, $line_spin, $font_color, $font_btn, $textview, $end_arrow, $start_arrow, $arrow_spin, $arrowl_spin, $arrowt_spin, $number_spin, $store_count ); $store_count++; }); } if (defined $textview) { $textview->signal_connect( 'key-release-event' => sub { $self->apply_properties( $item, $parent, $key, $fill_color, $stroke_color, $line_spin, $font_color, $font_btn, $textview, $end_arrow, $start_arrow, $arrow_spin, $arrowl_spin, $arrowt_spin, $number_spin, $store_count ); $store_count++; }); } #layout adjustments my $sg_prop = Gtk3::SizeGroup->new('horizontal'); foreach ($prop_dialog->get_children->get_children) { if ($_->can('get_children')) { foreach ($_->get_children) { if ($_->can('get_children')) { foreach ($_->get_children) { if ($_->can('get_children')) { foreach ($_->get_children) { if ($_ =~ /Gtk3::Label/) { #~ print $_->get_text, "\n"; $_->set_alignment(0, 0.5); $sg_prop->add_widget($_); } } } } } } } } #run dialog $prop_dialog->show_all; #textview grab focus to be able to edit #immediately if (defined $textview) { $textview->grab_focus; } my $prop_dialog_res = $prop_dialog->run; if ($prop_dialog_res eq 'ok') { $self->apply_properties( $item, $parent, $key, $fill_color, $stroke_color, $line_spin, $font_color, $font_btn, $textview, $end_arrow, $start_arrow, $arrow_spin, $arrowl_spin, $arrowt_spin, $number_spin, $store_count ); #apply item properties to widgets #line width, fill color, stroke color etc. $self->set_and_save_drawing_properties($self->{_current_item}, FALSE); #FIXME - we need to save the changed values in this case $self->set_and_save_drawing_properties($self->{_current_item}, TRUE); $prop_dialog->destroy; return TRUE; } else { if ($store_count) { $self->xdo('undo', undef, TRUE); } $prop_dialog->destroy; return FALSE; } } sub apply_properties { my ( $self, #item related infos $item, $parent, $key, #general properties $fill_color, $stroke_color, $line_spin, #only text $font_color, $font_btn, $textview, #only arrow $end_arrow, $start_arrow, $arrow_spin, $arrowl_spin, $arrowt_spin, #only numbered shapes $number_spin, #DO NOT STORE THE CHANGES (UNDO/REDO) $dont_store ) = @_; #~ print "apply_properties\n"; #remember drawing colors, line width and font settings #maybe we have to restore them if ( $self->{_items}{$key}{type} ne "highlighter" && $self->{_items}{$key}{type} ne "censor") { $self->{_last_fill_color} = $self->{_fill_color_w}->get_rgba; $self->{_last_stroke_color} = $self->{_stroke_color_w}->get_rgba; $self->{_last_line_width} = $self->{_line_spin_w}->get_value; $self->{_last_font} = $self->{_font_btn_w}->get_font_name; #remember the last mode as well $self->{_last_mode} = $self->{_current_mode}; } #add to undo stack unless ($dont_store) { $self->store_to_xdo_stack($self->{_current_item}, 'modify', 'undo'); } #apply rect or ellipse options if ($item->isa('GooCanvas2::CanvasRect') || $item->isa('GooCanvas2::CanvasEllipse')) { $item->set( 'line-width' => $line_spin->get_value, 'fill-color-gdk-rgba' => $fill_color->get_rgba, 'stroke-color-gdk-rgba' => $stroke_color->get_rgba, ); #special shapes like numbered ellipse (digit changed) if (defined $self->{_items}{$key}{text}) { #determine new or current digit my $digit = undef; if (defined $number_spin) { $digit = $number_spin->get_value; } else { $digit = $self->{_items}{$key}{text}{digit}; } my $fill_color = undef; if (defined $font_color) { $fill_color = $font_color->get_rgba; } elsif (defined $stroke_color) { $fill_color = $stroke_color->get_rgba; } my $font_descr = Pango::FontDescription->from_string($font_btn->get_font_name); $self->{_items}{$key}{text}->set( 'text' => "" . $digit . "", 'fill-color-gdk-rgba' => $fill_color, ); #adjust parent rectangle my $tb = $self->{_items}{$key}{text}->get_bounds; #keep ratio = 1 my $qs = abs($tb->x1 - $tb->x2); $qs = abs($tb->y1 - $tb->y2) if abs($tb->y1 - $tb->y2) > abs($tb->x1 - $tb->x2); #add line width of parent ellipse $qs += $self->{_items}{$key}{ellipse}->get('line-width') + 5; $parent->set( 'width' => $qs, 'height' => $qs, ); #save digit in hash as well (only item properties dialog) if (defined $number_spin) { $self->{_items}{$key}{text}{digit} = $digit; } $self->handle_rects('update', $parent); $self->handle_embedded('update', $parent); } #save color and opacity as well $self->{_items}{$key}{fill_color} = $fill_color->get_rgba; $self->{_items}{$key}{stroke_color} = $stroke_color->get_rgba; } #apply polyline options (arrow) if ( $item->isa('GooCanvas2::CanvasPolyline') && defined $self->{_items}{$key}{end_arrow} && defined $self->{_items}{$key}{start_arrow}) { #these values are only available in the item menu if ( defined $arrowl_spin && defined $arrow_spin && defined $arrowt_spin && defined $end_arrow && defined $start_arrow) { $item->set( 'line-width' => $line_spin->get_value, 'stroke-color-gdk-rgba' => $stroke_color->get_rgba, 'end-arrow' => $end_arrow->get_active, 'start-arrow' => $start_arrow->get_active, 'arrow-length' => $arrowl_spin->get_value, 'arrow-width' => $arrow_spin->get_value, 'arrow-tip-length' => $arrowt_spin->get_value, ); } else { $item->set( 'line-width' => $line_spin->get_value, 'stroke-color-gdk-rgba' => $stroke_color->get_rgba, 'end-arrow' => $self->{_items}{$key}{line}->get('end-arrow'), 'start-arrow' => $self->{_items}{$key}{line}->get('start-arrow'), ); } #save color and opacity as well $self->{_items}{$key}{stroke_color} = $stroke_color->get_rgba; #save arrow specific properties $self->{_items}{$key}{end_arrow} = $self->{_items}{$key}{line}->get('end-arrow'); $self->{_items}{$key}{start_arrow} = $self->{_items}{$key}{line}->get('start-arrow'); $self->{_items}{$key}{arrow_width} = $self->{_items}{$key}{line}->get('arrow-width'); $self->{_items}{$key}{arrow_length} = $self->{_items}{$key}{line}->get('arrow-length'); $self->{_items}{$key}{arrow_tip_length} = $self->{_items}{$key}{line}->get('arrow-tip-length'); #apply polyline options (freehand, highlighter) } elsif ($item->isa('GooCanvas2::CanvasPolyline') && defined $self->{_items}{$key}{stroke_color}) { $item->set( 'line-width' => $line_spin->get_value, 'stroke-color-gdk-rgba' => $stroke_color->get_rgba, ); #save color and opacity as well $self->{_items}{$key}{stroke_color} = $stroke_color->get_rgba; } #apply text options if ($item->isa('GooCanvas2::CanvasText')) { my $font_descr = Pango::FontDescription->from_string($font_btn->get_font_name); my $new_text = undef; if ($textview) { $new_text = $textview->get_buffer->get_text($textview->get_buffer->get_start_iter, $textview->get_buffer->get_end_iter, FALSE) || " "; } else { #determine font description and text from string my ($attr_list, $text_raw, $accel_char) = Pango->parse_markup($item->get('text')); $new_text = $text_raw; } $item->set( 'text' => "" . Glib::Markup::escape_text($new_text) . "", 'width' => -1, 'use-markup' => TRUE, 'fill-color-gdk-rgba' => $font_color->get_rgba, ); #adjust parent rectangle my $tb = $item->get_bounds; $parent->set( 'width' => abs($tb->x1 - $tb->x2), 'height' => abs($tb->y1 - $tb->y2), ); $self->handle_rects('update', $parent); $self->handle_embedded('update', $parent); #save color and opacity as well $self->{_items}{$key}{stroke_color} = $font_color->get_rgba; } } sub modify_text_in_properties { my $self = shift; my $font_btn = shift; my $textview = shift; my $font_color = shift; my $item = shift; my $use_font = shift; my $use_font_color = shift; my $font_descr = Pango::FontDescription->from_string($font_btn->get_font_name); my $texttag = Gtk3::TextTag->new; if ($use_font->get_active && $use_font_color->get_active) { $texttag->set('font-desc' => $font_descr, 'foreground-rgba' => $font_color->get_rgba); } elsif ($use_font->get_active) { $texttag->set('font-desc' => $font_descr); } elsif ($use_font_color->get_active) { $texttag->set('foreground-rgba' => $font_color->get_rgba); } my $texttagtable = Gtk3::TextTagTable->new; $texttagtable->add($texttag); my $text = Gtk3::TextBuffer->new($texttagtable); $text->signal_connect( 'changed' => sub { $text->apply_tag($texttag, $text->get_start_iter, $text->get_end_iter); }); $text->set_text($textview->get_buffer->get_text($textview->get_buffer->get_start_iter, $textview->get_buffer->get_end_iter, FALSE)); $text->apply_tag($texttag, $text->get_start_iter, $text->get_end_iter); $textview->set_buffer($text); return TRUE; } sub move_all { my ($self, $x, $y) = @_; foreach (keys %{$self->{_items}}) { my $item = $self->{_items}{$_}; #embedded item? my $parent = $self->get_parent_item($item); $item = $parent if $parent; #real shape if (exists $self->{_items}{$item}) { if ($item->isa('GooCanvas2::CanvasRect')) { $item->set( 'x' => $item->get('x') - $x, 'y' => $item->get('y') - $y, ); my $child = $self->get_child_item($item); $child = $item unless $child; #it item is hidden, keep the status if ($child->get('visibility') eq 'hidden') { $self->handle_rects('hide', $item); $self->handle_embedded('hide', $item); } else { $self->handle_rects('update', $item); #pixelizer is treated differently if ($child && $child->isa('GooCanvas2::CanvasImage')) { my $parent = $self->get_parent_item($child); if (exists $self->{_items}{$parent}{pixelize}) { Glib::Idle->add( sub { $self->{_items}{$parent}{pixelize}->set( 'x' => int $self->{_items}{$parent}->get('x'), 'y' => int $self->{_items}{$parent}->get('y'), 'width' => $self->{_items}{$parent}->get('width'), 'height' => $self->{_items}{$parent}->get('height'), 'pixbuf' => $self->get_pixelated_pixbuf_from_canvas($self->{_items}{$parent}), ); $self->handle_embedded('update', $parent, undef, undef, TRUE); #deactivate all after move $self->deactivate_all; return FALSE; }); } else { $self->handle_embedded('update', $item); } } else { $self->handle_embedded('update', $item); } } #freehand line for example } else { $item->translate(-$x, -$y); } } } #deactivate all after move $self->deactivate_all; return TRUE; } sub deactivate_all { my $self = shift; my $exclude = shift || 0; #~ print "deactivate_all\n"; foreach (keys %{$self->{_items}}) { my $item = $self->{_items}{$_}; next if $item == $exclude; #embedded item? my $parent = $self->get_parent_item($item); $item = $parent if $parent; #real shape if (exists $self->{_items}{$item}) { $self->handle_rects('hide', $item); } } $self->{_current_item} = undef; $self->{_current_new_item} = undef; return TRUE; } sub handle_embedded { my ($self, $action, $item, $new_width, $new_height, $force_show) = @_; return FALSE unless ($item && exists $self->{_items}{$item}); if ($action eq 'update') { my $visibility = 'visible'; #embedded ellipse if (exists $self->{_items}{$item}{ellipse}) { $self->{_items}{$item}{ellipse}->set( 'center-x' => $self->{_items}{$item}->get('x') + $self->{_items}{$item}->get('width') / 2, 'center-y' => $self->{_items}{$item}->get('y') + $self->{_items}{$item}->get('height') / 2, ); $self->{_items}{$item}{ellipse}->set( 'radius-x' => $self->{_items}{$item}->get('x') + $self->{_items}{$item}->get('width') - $self->{_items}{$item}{ellipse}->get('center-x'), 'radius-y' => $item->get('y') + $self->{_items}{$item}->get('height') - $self->{_items}{$item}{ellipse}->get('center-y'), 'visibility' => $visibility, ); #numbered ellipse if (exists $self->{_items}{$item}{text}) { $self->{_items}{$item}{text}->set( 'x' => $self->{_items}{$item}{ellipse}->get('center-x'), 'y' => $self->{_items}{$item}{ellipse}->get('center-y'), 'visibility' => $visibility, ); } } elsif (exists $self->{_items}{$item}{text}) { $self->{_items}{$item}{text}->set( 'x' => $self->{_items}{$item}->get('x'), 'y' => $self->{_items}{$item}->get('y'), 'width' => $self->{_items}{$item}->get('width'), 'visibility' => $visibility, ); } elsif (exists $self->{_items}{$item}{line}) { #handle possible arrows properly #arrow is always and end-arrow if ($self->{_items}{$item}{mirrored_w} < 0 && $self->{_items}{$item}{mirrored_h} < 0) { $self->{_items}{$item}{line}->set( 'points' => Shutter::Draw::Utils::points_to_canvas_points( $self->{_items}{$item}->get('x') + $self->{_items}{$item}->get('width'), $self->{_items}{$item}->get('y') + $self->{_items}{$item}->get('height'), $self->{_items}{$item}->get('x'), $self->{_items}{$item}->get('y') ), 'visibility' => $visibility ); } elsif ($self->{_items}{$item}{mirrored_w} < 0) { $self->{_items}{$item}{line}->set( 'points' => Shutter::Draw::Utils::points_to_canvas_points( $self->{_items}{$item}->get('x') + $self->{_items}{$item}->get('width'), $self->{_items}{$item}->get('y'), $self->{_items}{$item}->get('x'), $self->{_items}{$item}->get('y') + $self->{_items}{$item}->get('height') ), 'visibility' => $visibility ); } elsif ($self->{_items}{$item}{mirrored_h} < 0) { $self->{_items}{$item}{line}->set( 'points' => Shutter::Draw::Utils::points_to_canvas_points( $self->{_items}{$item}->get('x'), $self->{_items}{$item}->get('y') + $self->{_items}{$item}->get('height'), $self->{_items}{$item}->get('x') + $self->{_items}{$item}->get('width'), $self->{_items}{$item}->get('y') ), 'visibility' => $visibility ); } else { $self->{_items}{$item}{line}->set( 'points' => Shutter::Draw::Utils::points_to_canvas_points( $self->{_items}{$item}->get('x'), $self->{_items}{$item}->get('y'), $self->{_items}{$item}->get('x') + $self->{_items}{$item}->get('width'), $self->{_items}{$item}->get('y') + $self->{_items}{$item}->get('height') ), 'visibility' => $visibility ); } } elsif (exists $self->{_items}{$item}{pixelize}) { if ($force_show) { $self->{_items}{$item}{pixelize}->set('visibility' => $visibility,); } else { $self->{_items}{$item}{pixelize}->set('visibility' => 'hidden',); } } elsif (exists $self->{_items}{$item}{image}) { if ($self->{_items}{$item}->get('width') == $self->{_items}{$item}{image}->get('width') && $self->{_items}{$item}->get('height') == $self->{_items}{$item}{image}->get('height')) { $self->{_items}{$item}{image}->set( 'x' => int $self->{_items}{$item}->get('x'), 'y' => int $self->{_items}{$item}->get('y'), 'visibility' => $visibility, ); } else { #be careful when resizing images #don't do anything when width or height are too small if ($self->{_items}{$item}->get('width') > 5 && $self->{_items}{$item}->get('height') > 5) { $self->{_items}{$item}{image}->set( 'x' => int $self->{_items}{$item}->get('x'), 'y' => int $self->{_items}{$item}->get('y'), 'width' => $self->{_items}{$item}->get('width'), 'height' => $self->{_items}{$item}->get('height'), 'pixbuf' => $self->{_items}{$item}{orig_pixbuf}->scale_simple($self->{_items}{$item}->get('width'), $self->{_items}{$item}->get('height'), 'nearest'), 'visibility' => $visibility, ); } else { $self->{_items}{$item}{image}->set( 'x' => int $self->{_items}{$item}->get('x'), 'y' => int $self->{_items}{$item}->get('y'), 'width' => $self->{_items}{$item}->get('width'), 'height' => $self->{_items}{$item}->get('height'), 'visibility' => $visibility, ); } } } } elsif ($action eq 'delete') { #ellipse if (exists $self->{_items}{$item}{ellipse}) { if (my $nint = $self->{_canvas}->get_root_item->find_child($self->{_items}{$item}{ellipse})) { $self->{_canvas}->get_root_item->remove_child($nint); } } #text if (exists $self->{_items}{$item}{text}) { if (my $nint = $self->{_canvas}->get_root_item->find_child($self->{_items}{$item}{text})) { $self->{_canvas}->get_root_item->remove_child($nint); } } #pixelize if (exists $self->{_items}{$item}{pixelize}) { if (my $nint = $self->{_canvas}->get_root_item->find_child($self->{_items}{$item}{pixelize})) { $self->{_canvas}->get_root_item->remove_child($nint); } } #image if (exists $self->{_items}{$item}{image}) { if (my $nint = $self->{_canvas}->get_root_item->find_child($self->{_items}{$item}{image})) { $self->{_canvas}->get_root_item->remove_child($nint); } } #line if (exists $self->{_items}{$item}{line}) { if (my $nint = $self->{_canvas}->get_root_item->find_child($self->{_items}{$item}{line})) { $self->{_canvas}->get_root_item->remove_child($nint); } } } elsif ($action eq 'hide') { my $visibility = 'hidden'; #ellipse => hide rectangle as well if (exists $self->{_items}{$item}{ellipse}) { $self->{_items}{$item}{ellipse}->set('visibility' => $visibility); } #text => hide rectangle as well if (exists $self->{_items}{$item}{text}) { $self->{_items}{$item}{text}->set('visibility' => $visibility); } #pixelize => hide rectangle as well if (exists $self->{_items}{$item}{pixelize}) { $self->{_items}{$item}{pixelize}->set('visibility' => $visibility); } #image => hide rectangle as well if (exists $self->{_items}{$item}{image}) { $self->{_items}{$item}{image}->set('visibility' => $visibility); } #line => hide rectangle as well if (exists $self->{_items}{$item}{line}) { $self->{_items}{$item}{line}->set('visibility' => $visibility); } } elsif ($action eq 'mirror') { if (exists $self->{_items}{$item}{line}) { #width if ($new_width < 0 && $self->{_items}{$item}{mirrored_w} >= 0) { $self->{_items}{$item}{mirrored_w} = $new_width; } elsif ($new_width < 0 && $self->{_items}{$item}{mirrored_w} < 0) { $self->{_items}{$item}{mirrored_w} = 0; } #height if ($new_height < 0 && $self->{_items}{$item}{mirrored_h} >= 0) { $self->{_items}{$item}{mirrored_h} = $new_height; } elsif ($new_height < 0 && $self->{_items}{$item}{mirrored_h} < 0) { $self->{_items}{$item}{mirrored_h} = 0; } } } return TRUE; } sub handle_bg_rects { my ($self, $action) = @_; my $x = $self->{_canvas_bg_rect}->get('x'); my $y = $self->{_canvas_bg_rect}->get('y'); my $width = $self->{_canvas_bg_rect}->get('width'); my $height = $self->{_canvas_bg_rect}->get('height'); my $middle_h = $x + $width / 2; my $middle_v = $y + $height / 2; my $bottom = $y + $height; my $top = $y; my $left = $x; my $right = $x + $width; if ($action eq 'create') { $self->{_canvas_bg_rect}{'bottom-side'} = GooCanvas2::CanvasRect->new( parent=>$self->{_canvas}->get_root_item, x=>$middle_h, y=>$bottom, width=>8, height=>8, 'fill-color-gdk-rgba' => $self->{_style_bg}, 'line-width' => 1, ); $self->{_canvas_bg_rect}{'bottom-right-corner'} = GooCanvas2::CanvasRect->new( parent=>$self->{_canvas}->get_root_item, x=>$right, y=>$bottom, width=>8, height=>8, 'fill-color-gdk-rgba' => $self->{_style_bg}, 'line-width' => 1, ); $self->{_canvas_bg_rect}{'right-side'} = GooCanvas2::CanvasRect->new( parent=>$self->{_canvas}->get_root_item, x=>$right, y=>$middle_v, width=>8, height=>8, 'fill-color-gdk-rgba' => $self->{_style_bg}, 'line-width' => 1, ); $self->setup_item_signals($self->{_canvas_bg_rect}{'bottom-side'}); $self->setup_item_signals($self->{_canvas_bg_rect}{'bottom-right-corner'}); $self->setup_item_signals($self->{_canvas_bg_rect}{'right-side'}); $self->setup_item_signals_extra($self->{_canvas_bg_rect}{'bottom-side'}); $self->setup_item_signals_extra($self->{_canvas_bg_rect}{'bottom-right-corner'}); $self->setup_item_signals_extra($self->{_canvas_bg_rect}{'right-side'}); } elsif ($action eq 'hide' || $action eq 'show') { my $visibility = undef; if ($action eq 'hide') { $visibility = 'hidden'; } elsif ($action eq 'show') { $visibility = 'visible'; } foreach (keys %{$self->{_canvas_bg_rect}}) { if ($self->{_canvas_bg_rect}{$_}->can('set')) { $self->{_canvas_bg_rect}{$_}->set('visibility' => $visibility,); } } #end determine rect } elsif ($action eq 'update') { #update the canvas bounds as well $self->{_canvas}->set_bounds(0, 0, $self->{_canvas_bg_rect}->get('width'), $self->{_canvas_bg_rect}->get('height')); $self->{_canvas_bg_rect}{'bottom-side'}->set( 'x' => $middle_h - 8, 'y' => $bottom - 8, ); $self->{_canvas_bg_rect}{'bottom-right-corner'}->set( 'x' => $right - 8, 'y' => $bottom - 8, ); $self->{_canvas_bg_rect}{'right-side'}->set( 'x' => $right - 8, 'y' => $middle_v - 8, ); $self->handle_bg_rects('raise'); } elsif ($action eq 'raise') { $self->{_canvas_bg_rect}{'bottom-side'}->raise; $self->{_canvas_bg_rect}{'bottom-right-corner'}->raise; $self->{_canvas_bg_rect}{'right-side'}->raise; } } sub handle_rects { my ($self, $action, $item) = @_; #~ print "entering handle_rects1\n"; return FALSE unless $item; return FALSE unless exists $self->{_items}{$item}; #~ print "entering handle_rects2\n"; #get root item my $root = $self->{_canvas}->get_root_item; if ($self->{_items}{$item}->isa('GooCanvas2::CanvasRect')) { my $x = $self->{_items}{$item}->get('x'); my $y = $self->{_items}{$item}->get('y'); my $width = $self->{_items}{$item}->get('width'); my $height = $self->{_items}{$item}->get('height'); my $middle_h = $x + $width / 2; my $middle_v = $y + $height / 2; my $bottom = $y + $height; my $top = $y; my $left = $x; my $right = $x + $width; if ($action eq 'create') { $self->{_items}{$item}{'top-side'} = GooCanvas2::CanvasRect->new( parent=>$root, x=>$middle_h, y=>$top, width=>8, height=>8, 'fill-color-gdk-rgba' => $self->{_style_bg}, 'visibility' => 'hidden', 'line-width' => 0.5, ); $self->{_items}{$item}{'top-left-corner'} = GooCanvas2::CanvasRect->new( parent=>$root, x=>$left, y=>$top, width=>8, height=>8, 'fill-color-gdk-rgba' => $self->{_style_bg}, 'visibility' => 'hidden', 'line-width' => 0.5, 'radius-x' => 8, 'radius-y' => 8, ); $self->{_items}{$item}{'top-right-corner'} = GooCanvas2::CanvasRect->new( parent=>$root, x=>$right, y=>$top, width=>8, height=>8, 'fill-color-gdk-rgba' => $self->{_style_bg}, 'visibility' => 'hidden', 'line-width' => 0.5, 'radius-x' => 8, 'radius-y' => 8, ); $self->{_items}{$item}{'bottom-side'} = GooCanvas2::CanvasRect->new( parent=>$root, x=>$middle_h, y=>$bottom, width=>8, height=>8, 'fill-color-gdk-rgba' => $self->{_style_bg}, 'visibility' => 'hidden', 'line-width' => 0.5, ); $self->{_items}{$item}{'bottom-left-corner'} = GooCanvas2::CanvasRect->new( parent=>$root, x=>$left, y=>$bottom, width=>8, height=>8, 'fill-color-gdk-rgba' => $self->{_style_bg}, 'visibility' => 'hidden', 'line-width' => 0.5, 'radius-x' => 8, 'radius-y' => 8, ); $self->{_items}{$item}{'bottom-right-corner'} = GooCanvas2::CanvasRect->new( parent=>$root, x=>$right, y=>$bottom, width=>8, height=>8, 'fill-color-gdk-rgba' => $self->{_style_bg}, 'visibility' => 'hidden', 'line-width' => 0.5, 'radius-x' => 8, 'radius-y' => 8, ); $self->{_items}{$item}{'left-side'} = GooCanvas2::CanvasRect->new( parent=>$root, x=>$left - 8, y=>$middle_v, width=>8, height=>8, 'fill-color-gdk-rgba' => $self->{_style_bg}, 'visibility' => 'hidden', 'line-width' => 0.5, ); $self->{_items}{$item}{'right-side'} = GooCanvas2::CanvasRect->new( parent=>$root, x=>$right, y=>$middle_v, width=>8, height=>8, 'fill-color-gdk-rgba' => $self->{_style_bg}, 'visibility' => 'hidden', 'line-width' => 0.5, ); $self->setup_item_signals($self->{_items}{$item}{'top-side'}); $self->setup_item_signals($self->{_items}{$item}{'top-left-corner'}); $self->setup_item_signals($self->{_items}{$item}{'top-right-corner'}); $self->setup_item_signals($self->{_items}{$item}{'bottom-side'}); $self->setup_item_signals($self->{_items}{$item}{'bottom-left-corner'}); $self->setup_item_signals($self->{_items}{$item}{'bottom-right-corner'}); $self->setup_item_signals($self->{_items}{$item}{'left-side'}); $self->setup_item_signals($self->{_items}{$item}{'right-side'}); $self->setup_item_signals_extra($self->{_items}{$item}{'top-side'}); $self->setup_item_signals_extra($self->{_items}{$item}{'top-left-corner'}); $self->setup_item_signals_extra($self->{_items}{$item}{'top-right-corner'}); $self->setup_item_signals_extra($self->{_items}{$item}{'bottom-side'}); $self->setup_item_signals_extra($self->{_items}{$item}{'bottom-left-corner'}); $self->setup_item_signals_extra($self->{_items}{$item}{'bottom-right-corner'}); $self->setup_item_signals_extra($self->{_items}{$item}{'left-side'}); $self->setup_item_signals_extra($self->{_items}{$item}{'right-side'}); } elsif ($action eq 'delete') { if (my $nint = $self->{_canvas}->get_root_item->find_child($self->{_items}{$item}{'top-side'})) { $self->{_canvas}->get_root_item->remove_child($nint); } if (my $nint = $self->{_canvas}->get_root_item->find_child($self->{_items}{$item}{'top-left-corner'})) { $self->{_canvas}->get_root_item->remove_child($nint); } if (my $nint = $self->{_canvas}->get_root_item->find_child($self->{_items}{$item}{'top-right-corner'})) { $self->{_canvas}->get_root_item->remove_child($nint); } if (my $nint = $self->{_canvas}->get_root_item->find_child($self->{_items}{$item}{'bottom-side'})) { $self->{_canvas}->get_root_item->remove_child($nint); } if (my $nint = $self->{_canvas}->get_root_item->find_child($self->{_items}{$item}{'bottom-left-corner'})) { $self->{_canvas}->get_root_item->remove_child($nint); } if (my $nint = $self->{_canvas}->get_root_item->find_child($self->{_items}{$item}{'bottom-right-corner'})) { $self->{_canvas}->get_root_item->remove_child($nint); } if (my $nint = $self->{_canvas}->get_root_item->find_child($self->{_items}{$item}{'left-side'})) { $self->{_canvas}->get_root_item->remove_child($nint); } if (my $nint = $self->{_canvas}->get_root_item->find_child($self->{_items}{$item}{'right-side'})) { $self->{_canvas}->get_root_item->remove_child($nint); } } elsif ($action eq 'update' || $action eq 'hide') { my $visibility = 'visible'; $visibility = 'hidden' if $action eq 'hide'; my $lw = $item->get('line-width'); #ellipse => hide rectangle as well if (exists $self->{_items}{$item}{ellipse}) { $self->{_items}{$item}->set('visibility' => $visibility); } #text => hide rectangle as well if (exists $self->{_items}{$item}{text}) { $self->{_items}{$item}->set('visibility' => $visibility); } #pixelize => hide rectangle as well if (exists $self->{_items}{$item}{pixelize}) { $self->{_items}{$item}->set('visibility' => $visibility); } #image => hide rectangle as well if (exists $self->{_items}{$item}{image}) { $self->{_items}{$item}->set('visibility' => $visibility); } #line => hide rectangle as well if (exists $self->{_items}{$item}{line}) { $self->{_items}{$item}->set('visibility' => $visibility); } #just to make sure the update routines are not #called in wrong order #we test the first value, if this is ok #we believe all other resize rects are ok as well return FALSE unless defined $self->{_items}{$item}{'top-side'}; $self->{_items}{$item}{'top-side'}->set( 'x' => $middle_h - 4, 'y' => $top - 8, 'visibility' => $visibility, ); $self->{_items}{$item}{'top-left-corner'}->set( 'x' => $left - 8, 'y' => $top - 8, 'visibility' => $visibility, ); $self->{_items}{$item}{'top-right-corner'}->set( 'x' => $right, 'y' => $top - 8, 'visibility' => $visibility, ); $self->{_items}{$item}{'bottom-side'}->set( 'x' => $middle_h - 4, 'y' => $bottom, 'visibility' => $visibility, ); $self->{_items}{$item}{'bottom-left-corner'}->set( 'x' => $left - 8, 'y' => $bottom, 'visibility' => $visibility, ); $self->{_items}{$item}{'bottom-right-corner'}->set( 'x' => $right, 'y' => $bottom, 'visibility' => $visibility, ); $self->{_items}{$item}{'left-side'}->set( 'x' => $left - 8, 'y' => $middle_v - 4, 'visibility' => $visibility, ); $self->{_items}{$item}{'right-side'}->set( 'x' => $right, 'y' => $middle_v - 4, 'visibility' => $visibility, ); #~ $self->handle_bg_rects('raise'); } elsif ($action eq 'raise') { $self->{_items}{$item}{'top-side'}->raise; $self->{_items}{$item}{'top-left-corner'}->raise; $self->{_items}{$item}{'top-right-corner'}->raise; $self->{_items}{$item}{'bottom-side'}->raise; $self->{_items}{$item}{'bottom-left-corner'}->raise; $self->{_items}{$item}{'bottom-right-corner'}->raise; $self->{_items}{$item}{'left-side'}->raise; $self->{_items}{$item}{'right-side'}->raise; } elsif ($action eq 'lower') { $self->{_items}{$item}{'top-side'}->lower; $self->{_items}{$item}{'top-left-corner'}->lower; $self->{_items}{$item}{'top-right-corner'}->lower; $self->{_items}{$item}{'bottom-side'}->lower; $self->{_items}{$item}{'bottom-left-corner'}->lower; $self->{_items}{$item}{'bottom-right-corner'}->lower; $self->{_items}{$item}{'left-side'}->lower; $self->{_items}{$item}{'right-side'}->lower; } } return TRUE; } sub event_item_on_button_release { my ($self, $item, $target, $ev) = @_; $self->{_canvas}->pointer_ungrab($item, $ev->time); $self->{_canvas}->keyboard_ungrab($item, $ev->time); #canvas is idle now... $self->{_busy} = FALSE; #we handle some minimum sizes here if the new items are too small #maybe the user just wanted to place an rect or an object on the canvas #and clicked on it without describing an rectangular area my $nitem = $self->{_current_new_item}; if ($nitem) { #apply item properties to widgets #line width, fill color, stroke color etc. $self->set_and_save_drawing_properties($nitem, FALSE); #flag if item has to be deleted directly my $deleted = FALSE; #set minimum sizes if ($nitem->isa('GooCanvas2::CanvasRect')) { #real shape if (exists $self->{_items}{$nitem}) { #images if (exists $self->{_items}{$nitem}{image}) { $self->{_items}{$nitem}->set( 'x' => $ev->x - int($self->{_items}{$nitem}{orig_pixbuf}->get_width / 2), 'y' => $ev->y - int($self->{_items}{$nitem}{orig_pixbuf}->get_height / 2), 'width' => $self->{_items}{$nitem}{orig_pixbuf}->get_width, 'height' => $self->{_items}{$nitem}{orig_pixbuf}->get_height, ); #texts } elsif (exists $self->{_items}{$nitem}{text}) { if ($self->{_items}{$nitem}{type} eq 'text') { #clear text $self->{_items}{$nitem}{text}->set('text' => ""); #adjust parent rectangle my $tb = $self->{_items}{$nitem}{text}->get_bounds; $nitem->set( 'x' => $ev->x, 'y' => $ev->y - int(abs($tb->y1 - $tb->y2) / 2), 'width' => abs($tb->x1 - $tb->x2), 'height' => abs($tb->y1 - $tb->y2), ); #show property dialog directly Glib::Idle->add( sub { unless ($self->show_item_properties($self->{_items}{$nitem}{text}, $nitem, $nitem)) { if (my $nint = $self->{_canvas}->get_root_item->find_child($nitem)) { #delete canvas objects $self->{_canvas}->get_root_item->remove_child($nint); $self->handle_rects('delete', $nitem); $self->handle_embedded('delete', $nitem); #delete from hash delete $self->{_items}{$nitem}; #delete all xdo emtries for this object $self->xdo_remove('undo', $nitem); $self->xdo_remove('redo', $nitem); $self->deactivate_all; } } return FALSE; }); } elsif ($self->{_items}{$nitem}{type} eq 'number') { $self->{_items}{$nitem}->set( 'x' => $ev->x - int($self->{_items}{$nitem}->get('width') / 2), 'y' => $ev->y - int($self->{_items}{$nitem}->get('height') / 2), 'width' => $self->{_items}{$nitem}->get('width'), 'height' => $self->{_items}{$nitem}->get('height'), ); } #all other objects } else { #delete if (my $nint = $self->{_canvas}->get_root_item->find_child($nitem)) { #delete from canvas $self->{_canvas}->get_root_item->remove_child($nint); #mark as deleted $deleted = TRUE; #~ print "item $nitem marked as deleted at ",$ev->x,", ",$ev->y,"\n"; } } #~ print "new item created: $item\n"; } } if ($deleted) { #delete child objects and resizing rectangles $self->handle_rects('delete', $nitem); $self->handle_embedded('delete', $nitem); #delete from hash delete $self->{_items}{$nitem}; #~ print "item $nitem deleted at ",$ev->x,", ",$ev->y,"\n"; #deactivate all $self->deactivate_all; if (my $oitem = $self->{_canvas}->get_item_at($ev->x_root, $ev->y_root, TRUE)) { #~ print "item $oitem found at ",$ev->x,", ",$ev->y,"\n"; #turn into a button-press-event my $initevent = Gtk3::Gdk::Event->new('button-press'); $initevent->time(Gtk3::get_current_event_time()); $initevent->window($self->{_drawing_window}->get_window); $initevent->x($ev->x); $initevent->y($ev->y); $self->event_item_on_button_press($oitem, undef, $initevent, TRUE); $self->event_item_on_button_release($oitem, undef, $initevent); return FALSE; } } else { $self->deactivate_all($nitem); #mark as active item $self->{_current_item} = $nitem; $self->handle_rects('update', $nitem); $self->handle_embedded('update', $nitem); #add to undo stack $self->store_to_xdo_stack($nitem, 'create', 'undo'); } #no new item #existing item selected } else { #cleanup #it may happen that items are created #but resize mode is not activated immediately #those items would not be visible on the canvas #we delete them here my $citem = $self->{_current_item}; if ($citem && $citem->isa('GooCanvas2::CanvasRect')) { if (exists $self->{_items}{$citem}) { if ($self->{_items}{$citem}->get('visibility') eq 'hidden') { if (my $nint = $self->{_canvas}->get_root_item->find_child($citem)) { $self->xdo('undo', undef, TRUE); #delete from canvas $self->{_canvas}->get_root_item->remove_child($nint); #delete child objects and resizing rectangles $self->handle_rects('delete', $citem); $self->handle_embedded('delete', $citem); #delete from hash delete $self->{_items}{$citem}; } } } } #apply item properties to widgets #line width, fill color, stroke color etc. $self->set_and_save_drawing_properties($citem, FALSE); } #uncheck previous active item $self->{_current_new_item} = undef; #unset action flags $item->{dragging} = FALSE if exists $item->{dragging}; $item->{dragging_start} = FALSE if exists $item->{dragging_start}; $item->{resizing} = FALSE if exists $item->{resizing}; #because of performance reason we load the current image new from file when #the current action is over => button-release #when resizing or moving the image we just scale the current image with low quality settings #see handle_embedded my $child = $self->get_child_item($self->{_current_item}); if ($child && $child->isa('GooCanvas2::CanvasImage')) { my $parent = $self->get_parent_item($child); if (exists $self->{_items}{$parent}{pixelize}) { $self->{_items}{$parent}{pixelize}->set( 'x' => int $self->{_items}{$parent}->get('x'), 'y' => int $self->{_items}{$parent}->get('y'), 'width' => $self->{_items}{$parent}->get('width'), 'height' => $self->{_items}{$parent}->get('height'), 'pixbuf' => $self->get_pixelated_pixbuf_from_canvas($self->{_items}{$parent}), ); $self->handle_embedded('update', $parent, undef, undef, TRUE); } else { my $copy = $self->{_lp}->load($self->{_items}{$parent}{orig_pixbuf_filename}, $self->{_items}{$parent}->get('width'), $self->{_items}{$parent}->get('height'), FALSE, TRUE); if ($copy) { $self->{_items}{$parent}{image}->set( 'x' => int $self->{_items}{$parent}->get('x'), 'y' => int $self->{_items}{$parent}->get('y'), 'width' => $self->{_items}{$parent}->get('width'), 'height' => $self->{_items}{$parent}->get('height'), 'pixbuf' => $copy, ); $self->handle_embedded('update', $parent, undef, undef, TRUE); } else { #Try to load it with default width and height (Bug #975247) $self->{_items}{$parent}->set( 'x' => $ev->x - int($self->{_items}{$parent}{orig_pixbuf}->get_width / 2), 'y' => $ev->y - int($self->{_items}{$parent}{orig_pixbuf}->get_height / 2), 'width' => $self->{_items}{$parent}{orig_pixbuf}->get_width, 'height' => $self->{_items}{$parent}{orig_pixbuf}->get_height, ); #mark as active item $self->{_current_item} = $parent; $self->handle_rects('update', $parent); $self->handle_embedded('update', $parent, undef, undef, TRUE); #~ $self->abort_current_mode; } } } $self->set_drawing_action(int($self->{_current_mode} / 10)); return TRUE; } sub event_item_on_enter_notify { my ($self, $item, $target, $ev) = @_; return TRUE if $self->{_busy}; if ( ($item->isa('GooCanvas2::CanvasRect') || $item->isa('GooCanvas2::CanvasEllipse') || $item->isa('GooCanvas2::CanvasText') || $item->isa('GooCanvas2::CanvasImage') || $item->isa('GooCanvas2::CanvasPolyline')) && ( $self->{_current_mode_descr} ne "freehand" && $self->{_current_mode_descr} ne "highlighter" && $self->{_current_mode_descr} ne "censor") ) { #embedded item? my $parent = $self->get_parent_item($item); $item = $parent if $parent; #real shape if (exists $self->{_items}{$item}) { #nothing here yet #canvas resizing shape } elsif ($self->{_canvas_bg_rect}{'right-side'} == $item || $self->{_canvas_bg_rect}{'bottom-side'} == $item || $self->{_canvas_bg_rect}{'bottom-right-corner'} == $item) { $item->set('fill-color' => 'red'); #resizing shape } else { $item->set('fill-color' => 'red'); } } return TRUE; } sub event_item_on_leave_notify { my ($self, $item, $target, $ev) = @_; return TRUE if $self->{_busy}; if ( ($item->isa('GooCanvas2::CanvasRect') || $item->isa('GooCanvas2::CanvasEllipse') || $item->isa('GooCanvas2::CanvasText') || $item->isa('GooCanvas2::CanvasImage') || $item->isa('GooCanvas2::CanvasPolyline')) && ( $self->{_current_mode_descr} ne "freehand" && $self->{_current_mode_descr} ne "highlighter" && $self->{_current_mode_descr} ne "censor") ) { #embedded item? my $parent = $self->get_parent_item($item); $item = $parent if $parent; #real shape if (exists $self->{_items}{$item}) { #nothing here yet #canvas resizing shape } elsif ($self->{_canvas_bg_rect}{'right-side'} == $item || $self->{_canvas_bg_rect}{'bottom-side'} == $item || $self->{_canvas_bg_rect}{'bottom-right-corner'} == $item) { $item->set('fill-color-gdk-rgba' => $self->{_style_bg}); #resizing shape } else { $item->set('fill-color-gdk-rgba' => $self->{_style_bg}); } } return TRUE; } #ui related stuff sub setup_uimanager { my $self = shift; return Shutter::Draw::UIManager->new( app => $self )->setup; } sub import_from_dnd { my ($self, $widget, $context, $x, $y, $selection, $info, $time) = @_; my $type = $selection->get_target->name; return unless $type eq 'text/uri-list'; my $data = $selection->get_data; $data = join('', map { chr } @$data); my @files = grep defined($_), split /[\r\n]+/, $data; my @valid_files; foreach my $file (@files) { my $giofile = Glib::IO::File::new_for_uri($file); my ($mime_type) = Glib::Object::Introspection->invoke('Gio', undef, 'content_type_guess', $giofile->get_path); $mime_type =~ s/image\/x\-apple\-ios\-png/image\/png/; #FIXME if ($mime_type && $self->check_valid_mime_type($mime_type)) { push @valid_files, $file; } } #open all valid files if (@valid_files) { #backup current pixbuf and filename my $old_current = $self->{_current_pixbuf}; my $old_filename = $self->{_current_pixbuf_filename}; foreach (@valid_files) { #transform uri to path my $new_uri = Glib::IO::File::new_for_uri($_); my $new_file = $new_uri->get_path; $self->{_current_pixbuf} = $self->{_lp}->load($new_file, undef, undef, undef, TRUE); if ($self->{_current_pixbuf}) { $self->{_current_pixbuf_filename} = $new_file; #construct an event and create a new image object my $initevent = Gtk3::Gdk::Event->new('motion-notify'); $initevent->time(Gtk3::get_current_event_time()); $initevent->window($self->{_drawing_window}->get_window); $initevent->x($x); $initevent->y($y); #new item my $nitem = $self->create_image($initevent, undef, TRUE); #add to undo stack $self->store_to_xdo_stack($nitem, 'create', 'undo'); } else { $self->abort_current_mode; } } #restore saved values $self->{_current_pixbuf} = $old_current; $self->{_current_pixbuf_filename} = $old_filename; #uncheck previous active item $self->{_current_new_item} = undef; } else { Gtk3::drag_finish($context, 0, 0, $time); return FALSE; } Gtk3::drag_finish($context, 1, 0, $time); return TRUE; } sub utf8_decode { my $self = shift; my $string = shift; #see https://bugs.launchpad.net/shutter/+bug/347821 utf8::decode $string; return $string; } sub check_valid_mime_type { my $self = shift; my $mime_type = shift; foreach my $format (Gtk3::Gdk::Pixbuf::get_formats()) { foreach my $mime (@{$format->get_mime_types}) { return TRUE if $mime_type eq $mime_type; last; } } return FALSE; } sub import_from_filesystem { my $self = shift; my $button = shift; #used when called recursively my $parent = shift; my $directory = shift; my $menu_objects = Gtk3::Menu->new; my $dobjects = $directory || $self->{_sc}->get_root . "/share/shutter/resources/icons/drawing_tool/objects"; #first directory flag (see description above) my $fd = TRUE; my $ff = FALSE; my @objects = bsd_glob("$dobjects/*"); foreach my $name (sort { -d $a <=> -d $b } @objects) { #parse filename my ($short, $folder, $type) = fileparse($name, qr/\.[^.]*/); #if current object is a directory we call the current sub #recursively if (-d $name) { #objects from each directory are sorted (files first) #we display a separator when the first directory is listed if ($fd && $ff) { $menu_objects->append(Gtk3::SeparatorMenuItem->new); $fd = FALSE; } #objects from directory $name my $subdir_item = Gtk3::ImageMenuItem->new_with_label($short); $subdir_item->set('always_show_image' => TRUE); $subdir_item->set_image(Gtk3::Image->new_from_stock('gtk-directory', 'menu')); #add empty menu first my $menu_empty = Gtk3::Menu->new; my $empty_item = Gtk3::MenuItem->new_with_label($self->{_d}->get("No icon was found")); $empty_item->set_sensitive(FALSE); $menu_empty->append($empty_item); $subdir_item->set_submenu($menu_empty); #and populate later (performance) $subdir_item->{'nid'} = $subdir_item->signal_connect( 'activate' => sub { $subdir_item->set_image(Gtk3::Image->new_from_file($self->{_icons} . "/throbber_16x16.gif")); my $submenu = $self->import_from_filesystem($button, $subdir_item, $dobjects . "/$short"); if ($submenu->get_children) { $subdir_item->set_submenu($submenu); } else { $subdir_item->set_image(Gtk3::Image->new_from_stock('gtk-directory', 'menu')); } return TRUE; }); #diconnect handler when this event occurs $subdir_item->signal_connect( 'leave-notify-event' => sub { if ($subdir_item->signal_handler_is_connected($subdir_item->{'nid'})) { $subdir_item->signal_handler_disconnect($subdir_item->{'nid'}); } }); $menu_objects->append($subdir_item); next; } #there is at least one single file #set the flag $ff = TRUE; #init item with filename first my $new_item = Gtk3::ImageMenuItem->new_with_label($short); $new_item->set('always_show_image' => TRUE); $menu_objects->append($new_item); #sfsdc $new_item->{'name'} = $name; } #do not do that when called recursively #top level call unless ($directory) { $menu_objects->append(Gtk3::SeparatorMenuItem->new); #~ #objects from icontheme #~ if ( Gtk3->CHECK_VERSION( 2, 12, 0 ) ) { #~ my $icontheme = Gtk3::IconTheme::get_default(); #~ #~ my $utheme_item = Gtk3::ImageMenuItem->new_with_label( $self->{_d}->get("Import from current theme...") ); #~ $utheme_item->set( 'always_show_image' => TRUE ) if Gtk3->CHECK_VERSION( 2, 16, 0 ); #~ if ( $icontheme->has_icon('preferences-desktop-theme') ) { #~ $utheme_item->set_image( Gtk3::Image->new_from_icon_name( 'preferences-desktop-theme', 'menu' ) ); #~ } #~ #~ $utheme_item->set_submenu( $self->import_from_utheme( $icontheme, $button ) ); #~ #~ $menu_objects->append($utheme_item); #~ #~ $menu_objects->append( Gtk3::SeparatorMenuItem->new ); #~ } #objects from session my $session_menu_item = Gtk3::ImageMenuItem->new_with_label($self->{_d}->get("Import from session...")); $session_menu_item->set('always_show_image' => TRUE); $session_menu_item->set_image(Gtk3::Image->new_from_stock('gtk-index', 'menu')); $session_menu_item->set_submenu($self->import_from_session($button)); #gen thumbnails in an idle callback $self->gen_thumbnail_on_idle('gtk-index', $session_menu_item, $button, TRUE, $session_menu_item->get_submenu->get_children); $menu_objects->append($session_menu_item); #objects from filesystem my $filesystem_menu_item = Gtk3::ImageMenuItem->new_with_label($self->{_d}->get("Import from filesystem...")); $filesystem_menu_item->set('always_show_image' => TRUE); $filesystem_menu_item->set_image(Gtk3::Image->new_from_stock('gtk-open', 'menu')); $filesystem_menu_item->signal_connect( 'activate' => sub { my $fs = Gtk3::FileChooserDialog->new( $self->{_d}->get("Choose file to open"), $self->{_drawing_window}, 'open', 'gtk-cancel' => 'reject', 'gtk-open' => 'accept' ); $fs->set_select_multiple(FALSE); #preview widget my $iprev = Gtk3::Image->new; $fs->set_preview_widget($iprev); $fs->signal_connect( 'selection-changed' => sub { if (my $pfilename = $fs->get_preview_filename) { my $pixbuf = $self->{_lp_ne}->load($pfilename, 200, 200, TRUE, TRUE); unless ($pixbuf) { $fs->set_preview_widget_active(FALSE); } else { $fs->get_preview_widget->set_from_pixbuf($pixbuf); $fs->set_preview_widget_active(TRUE); } } else { $fs->set_preview_widget_active(FALSE); } }); my $filter_all = Gtk3::FileFilter->new; $filter_all->set_name($self->{_d}->get("All compatible image formats")); $fs->add_filter($filter_all); foreach my $format (Gtk3::Gdk::Pixbuf::get_formats()) { my $filter = Gtk3::FileFilter->new; $filter->set_name($format->get_name . " - " . $format->get_description); foreach my $ext (@{$format->get_extensions}) { $filter->add_pattern("*." . uc $ext); $filter_all->add_pattern("*." . uc $ext); $filter->add_pattern("*." . $ext); $filter_all->add_pattern("*." . $ext); } $fs->add_filter($filter); } if ($ENV{'HOME'}) { $fs->set_current_folder($ENV{'HOME'}); } my $fs_resp = $fs->run; my $new_file; if ($fs_resp eq "accept") { $new_file = $fs->get_filenames; $self->{_current_pixbuf} = $self->{_lp}->load($new_file, undef, undef, undef, TRUE); if ($self->{_current_pixbuf}) { $self->{_current_pixbuf_filename} = $new_file; $button->set_icon_widget(Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size($self->{_dicons} . '/draw-image.svg', Gtk3::IconSize->lookup('menu')))); $button->show_all; $self->{_canvas}->get_window->set_cursor($self->change_cursor_to_current_pixbuf); } else { $self->abort_current_mode; } $fs->destroy(); } else { $fs->destroy(); } }); $menu_objects->append($filesystem_menu_item); } $button->show_all; $menu_objects->show_all; #generate thumbnails in an idle callback $self->gen_thumbnail_on_idle('gtk-directory', $parent, $button, FALSE, $menu_objects->get_children); return $menu_objects; } sub import_from_utheme { my $self = shift; my $icontheme = shift; my $button = shift; my $menu_ctxt = Gtk3::Menu->new; foreach my $context (sort $icontheme->list_contexts) { #objects from current theme (contexts) my $utheme_ctxt = Gtk3::ImageMenuItem->new_with_label($context); $utheme_ctxt->set('always_show_image' => TRUE); $utheme_ctxt->set_image(Gtk3::Image->new_from_stock('gtk-directory', 'menu')); #add empty menu first my $menu_empty = Gtk3::Menu->new; my $empty_item = Gtk3::MenuItem->new_with_label($self->{_d}->get("No icon was found")); $empty_item->set_sensitive(FALSE); $menu_empty->append($empty_item); $utheme_ctxt->set_submenu($menu_empty); #and populate later (performance) my @menu_items; $utheme_ctxt->{'nid'} = $utheme_ctxt->signal_connect( 'activate' => sub { $utheme_ctxt->set_image(Gtk3::Image->new_from_file($self->{_icons} . "/throbber_16x16.gif")); my $context_submenu = $self->import_from_utheme_ctxt($icontheme, $context, $button); if ($context_submenu->get_children) { $utheme_ctxt->set_submenu($context_submenu); #gen thumbnails in an idle callback $self->gen_thumbnail_on_idle('gtk-directory', $utheme_ctxt, $button, TRUE, $utheme_ctxt->get_submenu->get_children); } else { $utheme_ctxt->set_image(Gtk3::Image->new_from_stock('gtk-directory', 'menu')); } return TRUE; }); #disconnect handler when this event occurs $utheme_ctxt->signal_connect( 'leave-notify-event' => sub { if ($utheme_ctxt->signal_handler_is_connected($utheme_ctxt->{'nid'})) { $utheme_ctxt->signal_handler_disconnect($utheme_ctxt->{'nid'}); } }); $menu_ctxt->append($utheme_ctxt); } $menu_ctxt->show_all; return $menu_ctxt; } sub import_from_utheme_ctxt { my $self = shift; my $icontheme = shift; my $context = shift; my $button = shift; my $menu_ctxt_items = Gtk3::Menu->new; my $size = Gtk3::IconSize->lookup('dialog'); foreach my $icon (sort $icontheme->list_icons($context)) { #objects from current theme (icons for specific contexts) my $utheme_ctxt_item = Gtk3::ImageMenuItem->new_with_label($icon); $utheme_ctxt_item->set('always_show_image' => TRUE); my $iconinfo = $icontheme->lookup_icon($icon, $size, 'generic-fallback'); #save filename and generate thumbnail later #idle callback $utheme_ctxt_item->{'name'} = $iconinfo->get_filename; $menu_ctxt_items->append($utheme_ctxt_item); } $menu_ctxt_items->show_all; return $menu_ctxt_items; } sub import_from_session { my $self = shift; my $button = shift; my $menu_session_objects = Gtk3::Menu->new; my %import_hash = %{$self->{_import_hash}}; foreach my $key (Sort::Naturally::nsort(keys %import_hash)) { next unless exists $import_hash{$key}->{'short'}; next unless defined $import_hash{$key}->{'short'}; #init item with filename my $screen_menu_item = Gtk3::ImageMenuItem->new_with_label($import_hash{$key}->{'short'}); $screen_menu_item->set('always_show_image' => TRUE); #set sensitive == FALSE if image eq current file $screen_menu_item->set_sensitive(FALSE) if $import_hash{$key}->{'long'} eq $self->{_filename}; #save filename and attributes $screen_menu_item->{'name'} = $import_hash{$key}->{'long'}; $screen_menu_item->{'mime_type'} = $import_hash{$key}->{'mime_type'}; $screen_menu_item->{'mtime'} = $import_hash{$key}->{'mtime'}; $screen_menu_item->{'giofile'} = $import_hash{$key}->{'giofile'}; $screen_menu_item->{'no_thumbnail'} = $import_hash{$key}->{'no_thumbnail'}; $menu_session_objects->append($screen_menu_item); } $menu_session_objects->show_all; return $menu_session_objects; } sub gen_thumbnail_on_idle { my $self = shift; my $stock = shift; my $parent = shift; my $button = shift; my $no_init = shift; my @menu_items = @_; my $shutter_hfunct = Shutter::App::HelperFunctions->new($self->{_sc}); #generate thumbnails in an idle callback my $next_item = 0; Glib::Idle->add( sub { #get next item my $child = $menu_items[$next_item]; #no valid item - stop the idle handler unless ($child) { $parent->set_image(Gtk3::Image->new_from_stock($stock, 'menu')) if $parent; return FALSE; } my $name = $child->{'name'}; #no valid item - stop the idle handler unless ($name) { $parent->set_image(Gtk3::Image->new_from_stock($stock, 'menu')) if $parent; return FALSE; } #increment counter $next_item++; #create thumbnail my $small_image; eval { #if uri exists we generate a thumbnail #with Shutter::Pixbuf::Thumbnail if (exists $child->{'giofile'}) { my $thumb; unless ($child->{'no_thumbnail'}) { $thumb = $self->{_lp_ne}->load($shutter_hfunct->utf8_decode($child->{'giofile'}->get_path), Gtk3::IconSize->lookup('small-toolbar')); } else { $thumb = Gtk3::Gdk::Pixbuf->new('rgb', TRUE, 8, 5, 5); $thumb->fill(0x00000000); } $small_image = Gtk3::Image->new_from_pixbuf($thumb); } else { my $pixbuf = $self->{_lp_ne}->load($name, undef, undef, undef, TRUE); #16x16 is minimum size if ($pixbuf->get_width >= 16 && $pixbuf->get_height >= 16) { $small_image = Gtk3::Image->new_from_pixbuf($pixbuf->scale_simple(Gtk3::IconSize->lookup('menu'), 'bilinear')); } } }; unless ($@) { if ($small_image) { $child->set_image($small_image); #init when toplevel unless ($no_init) { unless ($button->get_icon_widget) { $button->set_icon_widget(Gtk3::Image->new_from_pixbuf($small_image->get_pixbuf)); $self->{_current_pixbuf_filename} = $name; $button->show_all; } } $child->signal_connect( 'activate' => sub { $self->{_current_pixbuf_filename} = $name; $button->set_icon_widget(Gtk3::Image->new_from_pixbuf($small_image->get_pixbuf)); $button->show_all; $self->{_canvas}->get_window->set_cursor($self->change_cursor_to_current_pixbuf); }); } else { $child->destroy; } } else { $child->destroy; } return TRUE; }); #end idle callback } sub set_drawing_action { my $self = shift; my $index = shift; #~ print "set_drawing_action\n"; my $item_index = 0; my $toolbar = $self->{_uimanager}->get_widget("/ToolBarDrawing"); for (my $i = 0 ; $i < $toolbar->get_n_items ; $i++) { my $item = $toolbar->get_nth_item($i); #skip separators #we only want to activate tools next if $item->isa('Gtk3::SeparatorToolItem'); #add 1 to item index $item_index++; if ($item_index == $index) { if ($item->get_active) { $self->change_drawing_tool_cb($item_index * 10); } else { $item->set_active(TRUE); } last; } } } sub change_cursor_to_current_pixbuf { my $self = shift; #~ print "change_cursor_to_current_pixbuf\n"; $self->{_current_mode_descr} = "image"; my $cursor = undef; #load file $self->{_current_pixbuf} = $self->{_lp}->load($self->{_current_pixbuf_filename}, undef, undef, undef, TRUE); unless ($self->{_current_pixbuf}) { $cursor = Gtk3::Gdk::Cursor->new_from_pixbuf(Gtk3::Gdk::Display::get_default(), Gtk3::Gdk::Pixbuf->new_from_file($self->{_dicons} . '/draw-image.svg'), Gtk3::IconSize->lookup('menu')); } #very big images usually don't work as a cursor (no error though??) my $pb_w = $self->{_current_pixbuf}->get_width; my $pb_h = $self->{_current_pixbuf}->get_height; if ($pb_w < 800 && $pb_h < 800) { eval { #maximum cursor size my ($cw, $ch) = Gtk3::Gdk::Display::get_default->get_maximal_cursor_size; #images smaller than max cursor size? # => don't scale to a bigger size if ($cw > $pb_w || $ch > $pb_w) { $cursor = Gtk3::Gdk::Cursor->new_from_pixbuf(Gtk3::Gdk::Display::get_default(), $self->{_current_pixbuf}, int($pb_w / 2), int($pb_h / 2)); } else { my $cpixbuf = $self->{_lp}->load($self->{_current_pixbuf_filename}, $cw, $ch, TRUE, TRUE); $cursor = Gtk3::Gdk::Cursor->new_from_pixbuf(Gtk3::Gdk::Display::get_default(), $cpixbuf, int($cpixbuf->get_width / 2), int($cpixbuf->get_height / 2)); } }; if ($@) { my $response = $self->{_dialogs}->dlg_error_message( sprintf($self->{_d}->get("Error while opening image %s."), "'" . $self->{_current_pixbuf_filename} . "'"), $self->{_d}->get("There was an error opening the image."), undef, undef, undef, undef, undef, undef, $@ ); $self->abort_current_mode; } } else { $cursor = Gtk3::Gdk::Cursor->new_from_pixbuf(Gtk3::Gdk::Display::get_default(), Gtk3::Gdk::Pixbuf->new_from_file($self->{_dicons} . '/draw-image.svg'), Gtk3::IconSize->lookup('menu')); } return $cursor; } sub paste_item { my $self = shift; my $item = shift; #cut instead of copy my $delete_after = shift; #import from system's clipboard if (my $image = $self->{_clipboard}->wait_for_image) { #backup current pixbuf and filename my $old_current = $self->{_current_pixbuf}; my $old_filename = $self->{_current_pixbuf_filename}; #create tempfile my ($tmpfh, $tmpfilename) = tempfile(UNLINK => 1); #save pixbuf to tempfile and integrate it my $pixbuf_save = Shutter::Pixbuf::Save->new($self->{_sc}, $self->{_drawing_window}); if ($pixbuf_save->save_pixbuf_to_file($image, $tmpfilename, 'png')) { #set pixbuf vars $self->{_current_pixbuf} = $image; $self->{_current_pixbuf_filename} = $tmpfilename; #construct an event and create a new image object my $initevent = Gtk3::Gdk::Event->new('motion-notify'); $initevent->time(Gtk3::get_current_event_time()); $initevent->window($self->{_drawing_window}->get_window); #calculate coordinates $initevent->x(int($self->{_canvas_bg_rect}->get('width') / 2)); $initevent->y(int($self->{_canvas_bg_rect}->get('height') / 2)); #new item my $nitem = $self->create_image($initevent, undef, TRUE); #add to undo stack $self->store_to_xdo_stack($nitem, 'create', 'undo'); #restore saved values $self->{_current_pixbuf} = $old_current; $self->{_current_pixbuf_filename} = $old_filename; #uncheck $self->{_current_new_item} = undef; $self->{_current_item} = undef; $self->{_current_copy_item} = undef; } #import from DrawingTool's clipboard } elsif (defined $item) { my $child = $self->get_child_item($item); my $new_item = undef; if ($item->isa('GooCanvas2::CanvasRect') && !$child) { #~ print "Creating Rectangle...\n"; $new_item = $self->create_rectangle(undef, $item); } elsif ($item->isa('GooCanvas2::CanvasPolyline') && !$child) { #~ print "Creating Polyline...\n"; $new_item = $self->create_polyline(undef, $item); } elsif ($child->isa('GooCanvas2::CanvasPolyline') && exists $self->{_items}{$item}{stroke_color}) { #~ print "Creating Line...\n"; $new_item = $self->create_line(undef, $item); } elsif ($child->isa('GooCanvas2::CanvasPolyline')) { #~ print "Creating Censor...\n"; $new_item = $self->create_censor(undef, $item); } elsif ($child->isa('GooCanvas2::CanvasEllipse')) { #~ print "Creating Ellipse...\n"; $new_item = $self->create_ellipse(undef, $item); } elsif ($child->isa('GooCanvas2::CanvasText')) { #~ print "Creating Text...\n"; $new_item = $self->create_text(undef, $item); } elsif ($child->isa('GooCanvas2::CanvasImage') && exists $self->{_items}{$item}{pixelize}) { #~ print "Creating Pixelize...\n"; $new_item = $self->create_pixel_image(undef, $item); } elsif ($child->isa('GooCanvas2::CanvasImage')) { #~ print "Creating Image...\n"; $new_item = $self->create_image(undef, $item); } #cut instead of copy if ($delete_after) { $self->clear_item_from_canvas($item); $self->{_current_item} = undef; $self->{_current_copy_item} = undef; } #add to undo stack $self->store_to_xdo_stack($new_item, 'create', 'undo'); } return TRUE; } sub create_polyline { my $self = shift; my $ev = shift; my $copy_item = shift; #this is a highlighter? #we need different default values in this case my $highlighter = shift; my @points = (); my $stroke_color = $self->{_stroke_color}; my $transform; my $line_width = $self->{_line_width}; #use event coordinates if ($ev) { @points = ($ev->x, $ev->y, $ev->x, $ev->y); #use source item coordinates } elsif ($copy_item) { foreach (@{$self->{_items}{$copy_item}{points}}) { push @points, $_ + 20; } $stroke_color = $self->{_items}{$copy_item}{stroke_color}; $transform = $self->{_items}{$copy_item}->get('transform'); $line_width = $self->{_items}{$copy_item}->get('line_width'); } my $item = undef; if ($highlighter) { $stroke_color = Gtk3::Gdk::RGBA::parse('#FFFF00'); $stroke_color->alpha(0.5); $item = GooCanvas2::CanvasPolyline->new( parent=>$self->{_canvas}->get_root_item, close_path=>FALSE, 'stroke-color-gdk-rgba' => $stroke_color, 'line-width' => 18, 'fill-rule' => 'CAIRO_FILL_RULE_EVEN_ODD', 'line-cap' => 'CAIRO_LINE_CAP_SQUARE', 'line-join' => 'CAIRO_LINE_JOIN_BEVEL', ); } else { $item = GooCanvas2::CanvasPolyline->new( parent=>$self->{_canvas}->get_root_item, close_path=>FALSE, 'stroke-color-gdk-rgba' => $stroke_color, 'line-width' => $line_width, 'line-cap' => 'CAIRO_LINE_CAP_ROUND', 'line-join' => 'CAIRO_LINE_JOIN_ROUND', ); } $self->{_current_new_item} = $item unless ($copy_item); $self->{_items}{$item} = $item; #need at least 2 points push @{$self->{_items}{$item}{'points'}}, @points; $self->{_items}{$item}->set(points => Shutter::Draw::Utils::points_to_canvas_points(@{$self->{_items}{$item}{'points'}})); $self->{_items}{$item}->set(transform => $transform) if $transform; if ($highlighter) { #set type flag $self->{_items}{$item}{type} = 'highlighter'; $self->{_items}{$item}{uid} = $self->{_uid}++; $self->{_items}{$item}{stroke_color} = Gtk3::Gdk::RGBA::parse('#FFFF00'); $self->{_items}{$item}{stroke_color}->alpha(0.5); } else { #set type flag $self->{_items}{$item}{type} = 'freehand'; $self->{_items}{$item}{uid} = $self->{_uid}++; $self->{_items}{$item}{stroke_color} = $self->{_stroke_color}; } $self->setup_item_signals($self->{_items}{$item}); $self->setup_item_signals_extra($self->{_items}{$item}); return $item; } sub create_censor { my $self = shift; my $ev = shift; my $copy_item = shift; my @points = (); my $transform; #use event coordinates if ($ev) { @points = ($ev->x, $ev->y, $ev->x, $ev->y); #use source item coordinates } elsif ($copy_item) { foreach (@{$self->{_items}{$copy_item}{points}}) { push @points, $_ + 20; } $transform = $self->{_items}{$copy_item}->get('transform'); } my $item = GooCanvas2::CanvasPolyline->new( parent=>$self->{_canvas}->get_root_item, close_path=>FALSE, 'stroke-pixbuf' => $self->{_stipple_pixbuf}, 'line-width' => 14, 'line-cap' => 'CAIRO_LINE_CAP_ROUND', 'line-join' => 'CAIRO_LINE_JOIN_ROUND', ); $self->{_current_new_item} = $item unless ($copy_item); $self->{_items}{$item} = $item; #set type flag $self->{_items}{$item}{type} = 'censor'; $self->{_items}{$item}{uid} = $self->{_uid}++; #need at least 2 points push @{$self->{_items}{$item}{'points'}}, @points; $self->{_items}{$item}->set(points => Shutter::Draw::Utils::points_to_canvas_points(@{$self->{_items}{$item}{'points'}})); $self->{_items}{$item}->set(transform => $transform) if $transform; $self->setup_item_signals($self->{_items}{$item}); $self->setup_item_signals_extra($self->{_items}{$item}); return $item; } sub create_pixel_image { my $self = shift; my $ev = shift; my $copy_item = shift; my ($x, $y, $width, $height) = (0, 0, 0, 0); #use event coordinates and selected color if ($ev) { $x = $ev->x; $y = $ev->y; #use source item coordinates and item color } elsif ($copy_item) { $x = $copy_item->get('x') + 20; $y = $copy_item->get('y') + 20; $width = $copy_item->get('width'); $height = $copy_item->get('height'); } my $item = GooCanvas2::CanvasRect->new( parent=>$self->{_canvas}->get_root_item, x=>$x, y=>$y, width=>$width, height=>$height, 'fill-color-rgba' => 0, 'line-dash' => GooCanvas2::CanvasLineDash->newv([5, 5]), 'line-width' => 1, 'stroke-color' => 'gray', ); $self->{_current_new_item} = $item unless ($copy_item); $self->{_items}{$item} = $item; #blank pixbuf my $blank = Gtk3::Gdk::Pixbuf->new('rgb', TRUE, 8, 2, 2); #whole pixbuf is transparent $blank->fill(0x00000000); $self->{_items}{$item}{pixelize} = GooCanvas2::CanvasImage->new( parent=>$self->{_canvas}->get_root_item, pixbuf=>$blank, x=>$item->get('x'), y=>$item->get('y'), 'width' => 2, 'height' => 2, ); #set type flag $self->{_items}{$item}{type} = 'pixelize'; $self->{_items}{$item}{uid} = $self->{_uid}++; #create rectangles $self->handle_rects('create', $item); if ($copy_item) { $self->{_items}{$item}{pixelize}->set( 'x' => int $self->{_items}{$item}->get('x'), 'y' => int $self->{_items}{$item}->get('y'), 'width' => $self->{_items}{$item}->get('width'), 'height' => $self->{_items}{$item}->get('height'), 'pixbuf' => $self->get_pixelated_pixbuf_from_canvas($self->{_items}{$item}), ); $self->handle_embedded('update', $item, undef, undef, TRUE); } $self->setup_item_signals($self->{_items}{$item}{pixelize}); $self->setup_item_signals_extra($self->{_items}{$item}{pixelize}); $self->setup_item_signals($self->{_items}{$item}); $self->setup_item_signals_extra($self->{_items}{$item}); return $item; } sub create_image { my $self = shift; my $ev = shift; my $copy_item = shift; my $force_orig_size_init = shift; my ($x, $y, $width, $height) = (0, 0, 0, 0); #use event coordinates if ($ev) { #we create the new image item #and use the original image size #dnd for example if ($force_orig_size_init) { $x = $ev->x - int($self->{_current_pixbuf}->get_width / 2); $y = $ev->y - int($self->{_current_pixbuf}->get_height / 2); $width = $self->{_current_pixbuf}->get_width; $height = $self->{_current_pixbuf}->get_height; } else { $x = $ev->x; $y = $ev->y; } #use source item coordinates } elsif ($copy_item) { $x = $copy_item->get('x') + 20; $y = $copy_item->get('y') + 20; $width = $self->{_items}{$copy_item}->get('width'); $height = $self->{_items}{$copy_item}->get('height'); } my $item = GooCanvas2::CanvasRect->new( parent=>$self->{_canvas}->get_root_item, x=>$x, y=>$y, width=>$width, height=>$height, 'fill-color-rgba' => 0, 'line-dash' => GooCanvas2::CanvasLineDash->newv([5, 5]), 'line-width' => 1, 'stroke-color' => 'gray', ); $self->{_current_new_item} = $item unless ($copy_item); $self->{_items}{$item} = $item; if ($ev) { $self->{_items}{$item}{orig_pixbuf} = $self->{_current_pixbuf}->copy; $self->{_items}{$item}{orig_pixbuf_filename} = $self->{_current_pixbuf_filename}; } elsif ($copy_item) { $self->{_items}{$item}{orig_pixbuf} = $self->{_items}{$copy_item}{orig_pixbuf}->copy; $self->{_items}{$item}{orig_pixbuf_filename} = $self->{_items}{$copy_item}{orig_pixbuf_filename}; } $self->{_items}{$item}{image} = GooCanvas2::CanvasImage->new( parent=>$self->{_canvas}->get_root_item, pixbuf=>$self->{_items}{$item}{orig_pixbuf}, x=>$item->get('x'), y=>$item->get('y'), 'width' => 2, 'height' => 2, ); #set type flag $self->{_items}{$item}{type} = 'image'; $self->{_items}{$item}{uid} = $self->{_uid}++; #create rectangles $self->handle_rects('create', $item); #show image directly when copy or dnd if ($copy_item || $force_orig_size_init) { $self->handle_embedded('update', $item); } $self->setup_item_signals($self->{_items}{$item}{image}); $self->setup_item_signals_extra($self->{_items}{$item}{image}); $self->setup_item_signals($self->{_items}{$item}); $self->setup_item_signals_extra($self->{_items}{$item}); if ($copy_item) { my $copy = $self->{_lp}->load($self->{_items}{$item}{orig_pixbuf_filename}, $self->{_items}{$item}->get('width'), $self->{_items}{$item}->get('height'), FALSE, TRUE); $self->{_items}{$item}{image}->set( 'x' => int $self->{_items}{$item}->get('x'), 'y' => int $self->{_items}{$item}->get('y'), 'pixbuf' => $copy ); $self->handle_rects('hide', $item); } return $item; } sub create_text { my $self = shift; my $ev = shift; my $copy_item = shift; my ($x, $y, $width, $height) = (0, 0, 0, 0); my $stroke_color = $self->{_stroke_color}; my $text = $self->{_d}->get('New text...'); my $line_width = $self->{_line_width}; #use event coordinates and selected color if ($ev) { $x = $ev->x; $y = $ev->y; #use source item coordinates and item color } elsif ($copy_item) { $x = $copy_item->get('x') + 20; $y = $copy_item->get('y') + 20; $width = $copy_item->get('width'); $height = $copy_item->get('height'); $stroke_color = $self->{_items}{$copy_item}{stroke_color}; $text = $self->{_items}{$copy_item}{text}->get('text'); $line_width = $self->{_items}{$copy_item}{text}->get('line-width'); } my $item = GooCanvas2::CanvasRect->new( parent=>$self->{_canvas}->get_root_item, x=>$x, y=>$y, width=>$width, height=>$height, 'fill-color-rgba' => 0, 'line-dash' => GooCanvas2::CanvasLineDash->newv([5, 5]), 'line-width' => 1, 'stroke-color' => 'gray', ); $self->{_current_new_item} = $item unless ($copy_item); $self->{_items}{$item} = $item; $self->{_items}{$item}{text} = GooCanvas2::CanvasText->new( parent=>$self->{_canvas}->get_root_item, text=>"" . $text . "", x=>$item->get('x'), y=>$item->get('y'), width=>-1, anchor=>'nw', 'use-markup' => TRUE, 'fill-color-gdk-rgba' => $stroke_color, 'line-width' => $line_width, ); #adjust parent rectangle my $tb = $self->{_items}{$item}{text}->get_bounds; my $w = abs($tb->x1 - $tb->x2); my $h = abs($tb->y1 - $tb->y2); if ($copy_item) { $self->{_items}{$item}->set( 'x' => $self->{_items}{$item}->get('x') + 20, 'y' => $self->{_items}{$item}->get('y') + 20, 'width' => $w, 'height' => $h, 'visibility' => 'hidden', ); } else { $self->{_items}{$item}->set( 'x' => $ev->x - $w, 'y' => $ev->y - $h, 'width' => $w, 'height' => $h, 'visibility' => 'hidden', ); } #update text $self->handle_embedded('hide', $item); #set type flag $self->{_items}{$item}{type} = 'text'; $self->{_items}{$item}{uid} = $self->{_uid}++; $self->{_items}{$item}{stroke_color} = $self->{_stroke_color}; #create rectangles $self->handle_rects('create', $item); if ($copy_item) { $self->handle_embedded('update', $item); $self->handle_rects('hide', $item); } $self->setup_item_signals($self->{_items}{$item}{text}); $self->setup_item_signals_extra($self->{_items}{$item}{text}); $self->setup_item_signals($self->{_items}{$item}); $self->setup_item_signals_extra($self->{_items}{$item}); return $item; } sub create_line { my $self = shift; my $ev = shift; my $copy_item = shift; my $end_arrow = shift; my $start_arrow = shift; my ($x, $y, $width, $height) = (0, 0, 0, 0); my $stroke_color = $self->{_stroke_color}; my $line_width = $self->{_line_width}; my $mirrored_w = 0; my $mirrored_h = 0; #default values my $arrow_width = 4; my $arrow_length = 5; my $arrow_tip_length = 4; #use event coordinates and selected color if ($ev) { $x = $ev->x; $y = $ev->y; #use source item coordinates and item color } elsif ($copy_item) { $x = $copy_item->get('x') + 20; $y = $copy_item->get('y') + 20; $width = $copy_item->get('width'); $height = $copy_item->get('height'); $stroke_color = $self->{_items}{$copy_item}{stroke_color}; $line_width = $self->{_items}{$copy_item}{line}->get('line-width'); $mirrored_w = $self->{_items}{$copy_item}{mirrored_w}; $mirrored_h = $self->{_items}{$copy_item}{mirrored_h}; #arrow specific properties $end_arrow = $self->{_items}{$copy_item}{end_arrow}; $start_arrow = $self->{_items}{$copy_item}{start_arrow}; $arrow_width = $self->{_items}{$copy_item}{arrow_width}; $arrow_length = $self->{_items}{$copy_item}{arrow_length}; $arrow_tip_length = $self->{_items}{$copy_item}{arrow_tip_length}; } my $item = GooCanvas2::CanvasRect->new( parent=>$self->{_canvas}->get_root_item, x=>$x, y=>$y, width=>$width, height=>$height, 'fill-color-rgba' => 0, 'line-dash' => GooCanvas2::CanvasLineDash->newv([5, 5]), 'line-width' => 1, 'stroke-color' => 'gray', ); $self->{_current_new_item} = $item unless ($copy_item); $self->{_items}{$item} = $item; $self->{_items}{$item}{line} = GooCanvas2::CanvasPolyline->new( parent=>$self->{_canvas}->get_root_item, close_path=>FALSE, points => Shutter::Draw::Utils::points_to_canvas_points( $item->get('x'), $item->get('y'), $item->get('x') + $item->get('width'), $item->get('y') + $item->get('height'), ), 'stroke-color-gdk-rgba' => $stroke_color, 'line-width' => $line_width, 'line-cap' => 'CAIRO_LINE_CAP_ROUND', 'line-join' => 'CAIRO_LINE_JOIN_ROUND', 'end-arrow' => $end_arrow, 'start-arrow' => $start_arrow, 'arrow-length' => $arrow_length, 'arrow-width' => $arrow_width, 'arrow-tip-length' => $arrow_tip_length, 'visibility' => 'hidden', ); if (defined $end_arrow || defined $start_arrow) { #save arrow specific properties $self->{_items}{$item}{end_arrow} = $self->{_items}{$item}{line}->get('end-arrow'); $self->{_items}{$item}{start_arrow} = $self->{_items}{$item}{line}->get('start-arrow'); $self->{_items}{$item}{arrow_width} = $self->{_items}{$item}{line}->get('arrow-width'); $self->{_items}{$item}{arrow_length} = $self->{_items}{$item}{line}->get('arrow-length'); $self->{_items}{$item}{arrow_tip_length} = $self->{_items}{$item}{line}->get('arrow-tip-length'); } #set type flag $self->{_items}{$item}{type} = 'line'; $self->{_items}{$item}{uid} = $self->{_uid}++; $self->{_items}{$item}{mirrored_w} = $mirrored_w; $self->{_items}{$item}{mirrored_h} = $mirrored_h; $self->{_items}{$item}{stroke_color} = $self->{_stroke_color}; #create rectangles $self->handle_rects('create', $item); if ($copy_item) { $self->handle_embedded('update', $item); $self->handle_rects('hide', $item); } $self->setup_item_signals($self->{_items}{$item}{line}); $self->setup_item_signals_extra($self->{_items}{$item}{line}); $self->setup_item_signals($self->{_items}{$item}); $self->setup_item_signals_extra($self->{_items}{$item}); return $item; } sub create_ellipse { my $self = shift; my $ev = shift; my $copy_item = shift; my $numbered = shift; my ($x, $y, $width, $height) = (0, 0, 0, 0); my $stroke_color = $self->{_stroke_color}; my $fill_color = $self->{_fill_color}; my $line_width = $self->{_line_width}; #use event coordinates and selected color if ($ev) { $x = $ev->x; $y = $ev->y; #use source item coordinates and item color } elsif ($copy_item) { $x = $copy_item->get('x') + 20; $y = $copy_item->get('y') + 20; $width = $copy_item->get('width'); $height = $copy_item->get('height'); $stroke_color = $self->{_items}{$copy_item}{stroke_color}; $fill_color = $self->{_items}{$copy_item}{fill_color}; $line_width = $self->{_items}{$copy_item}{ellipse}->get('line-width'); $numbered = TRUE if exists $self->{_items}{$copy_item}{text}; } my $item = GooCanvas2::CanvasRect->new( parent=>$self->{_canvas}->get_root_item, x=>$x, y=>$y, width=>$width, height=>$height, 'fill-color-rgba' => 0, 'line-dash' => GooCanvas2::CanvasLineDash->newv([5, 5]), 'line-width' => 1, 'stroke-color' => 'gray', ); $self->{_current_new_item} = $item unless ($copy_item); $self->{_items}{$item} = $item; $self->{_items}{$item}{ellipse} = GooCanvas2::CanvasEllipse->new( parent=>$self->{_canvas}->get_root_item, x=>$item->get('x'), y=>$item->get('y'), width=>$item->get('width'), height=>$item->get('height'), 'fill-color-gdk-rgba' => $fill_color, 'stroke-color-gdk-rgba' => $stroke_color, 'line-width' => $line_width, ); #numbered ellipse if ($numbered) { my $number = $self->get_highest_auto_digit(); $number++; $self->{_items}{$item}{text} = GooCanvas2::CanvasText->new( parent=>$self->{_canvas}->get_root_item, text=>"" . $number . "", x=>$self->{_items}{$item}{ellipse}->get('center-x'), y=>$self->{_items}{$item}{ellipse}->get('center-y'), width=>-1, anchor=> 'center', 'use-markup' => TRUE, 'fill-color-gdk-rgba' => $stroke_color, 'line-width' => $line_width, ); #save used number $self->{_items}{$item}{text}{digit} = $number; #set type flag $self->{_items}{$item}{type} = 'number'; $self->{_items}{$item}{uid} = $self->{_uid}++; #adjust parent rectangle if numbered ellipse my $tb = $self->{_items}{$item}{text}->get_bounds; #keep ratio = 1 my $qs = abs($tb->x1 - $tb->x2); $qs = abs($tb->y1 - $tb->y2) if abs($tb->y1 - $tb->y2) > abs($tb->x1 - $tb->x2); #add line width of parent ellipse $qs += $self->{_items}{$item}{ellipse}->get('line-width') + 5; if ($copy_item) { $self->{_items}{$item}->set( 'x' => $self->{_items}{$item}->get('x') + 20, 'y' => $self->{_items}{$item}->get('y') + 20, 'width' => $qs, 'height' => $qs, 'visibility' => 'hidden', ); } else { $self->{_items}{$item}->set( 'x' => $self->{_items}{$item}->get('x') - $qs, 'y' => $self->{_items}{$item}->get('y') - $qs, 'width' => $qs, 'height' => $qs, 'visibility' => 'hidden', ); } $self->handle_embedded('hide', $item); } else { #set type flag $self->{_items}{$item}{type} = 'ellipse'; $self->{_items}{$item}{uid} = $self->{_uid}++; } #save color and opacity as well $self->{_items}{$item}{fill_color} = $self->{_fill_color}; $self->{_items}{$item}{stroke_color} = $self->{_stroke_color}; #create rectangles $self->handle_rects('create', $item); if ($copy_item) { $self->handle_embedded('update', $item); $self->handle_rects('hide', $item); } if ($numbered) { $self->setup_item_signals($self->{_items}{$item}{text}); $self->setup_item_signals_extra($self->{_items}{$item}{text}); } $self->setup_item_signals($self->{_items}{$item}{ellipse}); $self->setup_item_signals_extra($self->{_items}{$item}{ellipse}); $self->setup_item_signals($self->{_items}{$item}); $self->setup_item_signals_extra($self->{_items}{$item}); return $item; } sub create_rectangle { my $self = shift; my $ev = shift; my $copy_item = shift; my ($x, $y, $width, $height) = (0, 0, 0, 0); my $stroke_color = $self->{_stroke_color}; my $fill_color = $self->{_fill_color}; my $line_width = $self->{_line_width}; #use event coordinates and selected color if ($ev) { $x = $ev->x; $y = $ev->y; #use source item coordinates and item color } elsif ($copy_item) { $x = $copy_item->get('x') + 20; $y = $copy_item->get('y') + 20; $width = $copy_item->get('width'); $height = $copy_item->get('height'); $stroke_color = $self->{_items}{$copy_item}{stroke_color}; $fill_color = $self->{_items}{$copy_item}{fill_color}; $line_width = $self->{_items}{$copy_item}->get('line-width'); } my $item = GooCanvas2::CanvasRect->new( parent=>$self->{_canvas}->get_root_item, x=>$x, y=>$y, width=>$width, height=>$height, 'fill-color-gdk-rgba' => $fill_color, 'stroke-color-gdk-rgba' => $stroke_color, 'line-width' => $line_width, ); $self->{_current_new_item} = $item unless ($copy_item); $self->{_items}{$item} = $item; #set type flag $self->{_items}{$item}{type} = 'rectangle'; $self->{_items}{$item}{uid} = $self->{_uid}++; $self->{_items}{$item}{fill_color} = $self->{_fill_color}; $self->{_items}{$item}{stroke_color} = $self->{_stroke_color}; #create rectangles $self->handle_rects('create', $item); $self->setup_item_signals($self->{_items}{$item}); $self->setup_item_signals_extra($self->{_items}{$item}); return $item; } # getters and setters sub gettext { shift->{_d} } sub dicons { shift->{_dicons} } sub icons { shift->{_icons} } sub clipboard { shift->{_clipboard} } sub items { shift->{_items} } sub drawing_window { shift->{_drawing_window} } sub canvas { shift->{_canvas} } sub cut { my $self = shift; $self->{_cut} = shift if scalar @_; return $self->{_cut}; } sub current_copy_item { my $self = shift; $self->{_current_copy_item} = shift if scalar @_; return $self->{_current_copy_item}; } sub current_item { my $self = shift; $self->{_current_item} = shift if scalar @_; return $self->{_current_item}; } sub current_new_item { my $self = shift; $self->{_current_new_item} = shift if scalar @_; return $self->{_current_new_item}; } sub canvas_bg { my $self = shift; $self->{_canvas_bg} = shift if scalar @_; return $self->{_canvas_bg}; } sub factory { my $self = shift; $self->{_factory} = shift if scalar @_; return $self->{_factory}; } sub autoscroll { my $self = shift; $self->{_autoscroll} = shift if scalar @_; return $self->{_autoscroll}; } sub stroke_color { my $self = shift; $self->{_stroke_color} = shift if scalar @_; return $self->{_stroke_color}; } sub fill_color { my $self = shift; $self->{_fill_color} = shift if scalar @_; return $self->{_fill_color}; } sub line_width { my $self = shift; $self->{_line_width} = shift if scalar @_; return $self->{_line_width}; } sub font { my $self = shift; $self->{_font} = shift if scalar @_; return $self->{_font}; } sub uid { shift->{_uid} } sub increase_uid { shift->{_uid}++ } sub uimanager { shift->{_uimanager} } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Draw/Ellipse.pm000066400000000000000000000145611476102223600260770ustar00rootroot00000000000000################################################### # # Copyright (C) 2021 Alexander Ruzhnikov # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Draw::Ellipse; use 5.010; use Moo; use GooCanvas2; use Glib qw/ TRUE FALSE /; use constant POSITION_INDENT => 20; has app => ( is => "ro", required => 1 ); has event => ( is => "rw", lazy => 1 ); has copy_item => ( is => "rw", lazy => 1 ); has numbered => ( is => "rw", lazy => 1 ); has X => ( is => "rw", default => sub {0} ); has Y => ( is => "rw", default => sub {0} ); has width => ( is => "rw", default => sub {0} ); has height => ( is => "rw", default => sub {0} ); has stroke_color => ( is => "rw", lazy => 1, default => sub { shift->app->stroke_color } ); has fill_color => ( is => "rw", lazy => 1, default => sub { shift->app->fill_color } ); has line_width => ( is => "rw", lazy => 1, default => sub { shift->app->line_width } ); sub setup { my ( $self, $event, $copy_item, $numbered ) = @_; $self->event($event); $self->copy_item($copy_item); $self->numbered($numbered); $self->_check_event_and_copy_item; my $item = $self->_create_item; $self->app->current_new_item($item) unless $self->copy_item; $self->app->items->{$item} = $item; $self->_setup_item_ellipse($item); if ( $self->numbered ) { $self->_setup_ellipse_numbered($item); } else { # set type flag $item->{type} = 'ellipse'; $item->{uid} = $self->app->uid; $self->app->increase_uid; } # save color and opacity as well $item->{fill_color} = $self->app->fill_color; $item->{stroke_color} = $self->app->stroke_color; # create rectangles $self->app->handle_rects( 'create', $item ); if ( $self->copy_item ) { $self->app->handle_embedded( 'update', $item ); $self->app->handle_rects( 'hide', $item ); } if ( $self->numbered ) { $self->app->setup_item_signals( $item->{text} ); $self->app->setup_item_signals_extra( $item->{text} ); } $self->app->setup_item_signals( $item->{ellipse} ); $self->app->setup_item_signals_extra( $item->{ellipse} ); $self->app->setup_item_signals($item); $self->app->setup_item_signals_extra($item); return $item; } sub _setup_item_ellipse { my ( $self, $item ) = @_; $item->{ellipse} = GooCanvas2::CanvasEllipse->new( 'parent' => $self->app->canvas->get_root_item, 'x' => $self->X, 'y' => $self->Y, 'width' => $self->width, 'height' => $self->height, 'fill-color-gdk-rgba' => $self->fill_color, 'stroke-color-gdk-rgba' => $self->stroke_color, 'line-width' => $self->line_width, ); } sub _setup_ellipse_numbered { my ( $self, $item ) = @_; my $number = $self->app->get_highest_auto_digit + 1; my $txt = GooCanvas2::CanvasText->new( 'parent' => $self->app->canvas->get_root_item, 'text' => "" . $number . "", 'x' => $item->{ellipse}->get('center-x'), 'y' => $item->{ellipse}->get('center-y'), 'width' => -1, 'anchor' => 'center', 'use-markup' => TRUE, 'fill-color-gdk-rgba' => $self->stroke_color, 'line-width' => $self->line_width, ); $txt->{digit} = $number; $item->{text} = $txt; $item->{type} = 'number'; $item->{uid} = $self->app->uid; $self->app->increase_uid; #adjust parent rectangle if numbered ellipse my $tb = $txt->get_bounds; #keep ratio = 1 my $qs = abs( $tb->x1 - $tb->x2 ); $qs = abs( $tb->y1 - $tb->y2 ) if abs( $tb->y1 - $tb->y2 ) > abs( $tb->x1 - $tb->x2 ); #add line width of parent ellipse $qs += $item->{ellipse}->get('line-width') + 5; $item->set( 'x' => $self->copy_item ? ( $self->X + POSITION_INDENT ) : ( $self->X - $qs ), 'y' => $self->copy_item ? ( $self->Y + POSITION_INDENT ) : ( $self->Y - $qs ), 'width' => $qs, 'height' => $qs, 'visibility' => 'hidden', ); $self->app->handle_embedded( 'hide', $item ); } sub _check_event_and_copy_item { my $self = shift; if ( $self->event ) { $self->X( $self->event->x ); $self->Y( $self->event->y ); } elsif ( $self->copy_item ) { $self->X( $self->copy_item->get('x') + POSITION_INDENT ); $self->Y( $self->copy_item->get('y') + POSITION_INDENT ); $self->width( $self->copy_item->get('width') ); $self->height( $self->copy_item->get('height') ); $self->stroke_color( $self->app->items->{ $self->copy_item }->{stroke_color} ); $self->fill_color( $self->app->items->{ $self->copy_item }->{fill_color} ); $self->line_width( $self->app->items->{ $self->copy_item }->{ellipse}->get('line-width') ); $self->numbered(TRUE) if exists $self->app->items->{ $self->copy_item }->{text}; } } sub _create_item { my $self = shift; my $item = GooCanvas2::CanvasRect->new( 'parent' => $self->app->canvas->get_root_item, 'x' => $self->X, 'y' => $self->Y, 'width' => $self->width, 'height' => $self->height, 'fill-color-rgba' => 0, 'line-dash' => GooCanvas2::CanvasLineDash->newv( [ 5, 5 ] ), 'line-width' => 1, 'stroke-color' => 'gray', ); return $item; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Draw/UIManager.pm000066400000000000000000000422231476102223600263060ustar00rootroot00000000000000################################################### # # Copyright (C) 2021 Alexander Ruzhnikov # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Draw::UIManager; use Moo; use Gtk3; use Glib qw/ TRUE FALSE /; has app => ( is => "ro", required => 1 ); has dicons => ( is => "ro", lazy => 1, default => sub { shift->app->dicons } ); has gettext => ( is => "ro", lazy => 1, default => sub { shift->app->gettext } ); sub setup { my $self = shift; $self->app->factory( $self->_create_factory ); my $uimanager = Gtk3::UIManager->new; # keyboard accel_group my $accelgroup = $uimanager->get_accel_group; $self->app->drawing_window->add_accel_group($accelgroup); $uimanager->insert_action_group( $self->_create_main_group, 0 ); $uimanager->insert_action_group( $self->_create_toggle_group, 0 ); $uimanager->insert_action_group( $self->_create_drawing_group, 0 ); eval { $uimanager->add_ui_from_string( $self->_get_ui_info ); 1; } or do { die "Unable to create menus: $@\n"; }; return $uimanager; } sub _create_factory { my $self = shift; my $factory = Gtk3::IconFactory->new; $factory->add( 'shutter-ellipse', Gtk3::IconSet->new_from_pixbuf( Gtk3::Gdk::Pixbuf->new_from_file( $self->dicons . '/draw-ellipse.png' ) ) ); $factory->add( 'shutter-eraser', Gtk3::IconSet->new_from_pixbuf( Gtk3::Gdk::Pixbuf->new_from_file( $self->dicons . '/draw-eraser.png' ) ) ); $factory->add( 'shutter-freehand', Gtk3::IconSet->new_from_pixbuf( Gtk3::Gdk::Pixbuf->new_from_file( $self->dicons . '/draw-freehand.png' ) ) ); $factory->add( 'shutter-highlighter', Gtk3::IconSet->new_from_pixbuf( Gtk3::Gdk::Pixbuf->new_from_file( $self->dicons . '/draw-highlighter.png' ) ) ); $factory->add( 'shutter-pointer', Gtk3::IconSet->new_from_pixbuf( Gtk3::Gdk::Pixbuf->new_from_file( $self->dicons . '/draw-pointer.png' ) ) ); $factory->add( 'shutter-rectangle', Gtk3::IconSet->new_from_pixbuf( Gtk3::Gdk::Pixbuf->new_from_file( $self->dicons . '/draw-rectangle.png' ) ) ); $factory->add( 'shutter-line', Gtk3::IconSet->new_from_pixbuf( Gtk3::Gdk::Pixbuf->new_from_file( $self->dicons . '/draw-line.png' ) ) ); $factory->add( 'shutter-arrow', Gtk3::IconSet->new_from_pixbuf( Gtk3::Gdk::Pixbuf->new_from_file( $self->dicons . '/draw-arrow.png' ) ) ); $factory->add( 'shutter-text', Gtk3::IconSet->new_from_pixbuf( Gtk3::Gdk::Pixbuf->new_from_file( $self->dicons . '/draw-text.png' ) ) ); $factory->add( 'shutter-censor', Gtk3::IconSet->new_from_pixbuf( Gtk3::Gdk::Pixbuf->new_from_file( $self->dicons . '/draw-censor.png' ) ) ); $factory->add( 'shutter-pixelize', Gtk3::IconSet->new_from_pixbuf( Gtk3::Gdk::Pixbuf->new_from_file( $self->dicons . '/draw-pixelize.png' ) ) ); $factory->add( 'shutter-number', Gtk3::IconSet->new_from_pixbuf( Gtk3::Gdk::Pixbuf->new_from_file( $self->dicons . '/draw-number.png' ) ) ); $factory->add( 'shutter-crop', Gtk3::IconSet->new_from_pixbuf( Gtk3::Gdk::Pixbuf->new_from_file( $self->dicons . '/transform-crop.png' ) ) ); $factory->add_default(); return $factory; } sub _create_main_group { my $self = shift; # Setup the main group. my $main_group = Gtk3::ActionGroup->new("main"); $main_group->add_actions( $self->_create_main_actions ); return $main_group; } sub _create_main_actions { my $self = shift; my @main_actions = ( [ "File", undef, $self->gettext->get("_File") ], [ "Edit", undef, $self->gettext->get("_Edit") ], [ "Tools", undef, $self->gettext->get("_Tools") ], [ "View", undef, $self->gettext->get("_View") ], [ "Undo", 'gtk-undo', undef, "Z", $self->gettext->get("Undo last action"), sub { $self->app->abort_current_mode; $self->app->xdo( 'undo', 'ui' ); } ], [ "Redo", 'gtk-redo', undef, "Y", $self->gettext->get("Do again the last undone action"), sub { $self->abort_current_mode; $self->xdo( 'redo', 'ui' ); } ], [ "Copy", 'gtk-copy', undef, "C", $self->gettext->get("Copy selection to clipboard"), sub { #clear clipboard $self->app->clipboard->set_text(""); $self->app->cut(FALSE); $self->app->current_copy_item( $self->app->current_item ); } ], [ "Cut", 'gtk-cut', undef, "X", $self->gettext->get("Cut selection to clipboard"), sub { #clear clipboard $self->app->clipboard->set_text(""); $self->app->cut(TRUE); $self->app->current_copy_item( $self->app->current_item ); $self->app->clear_item_from_canvas( $self->app->current_copy_item ); } ], [ "Paste", 'gtk-paste', undef, "V", $self->gettext->get("Paste objects from clipboard"), sub { $self->app->paste_item( $self->app->current_copy_item, $self->app->cut ); $self->app->cut(FALSE); } ], [ "Delete", 'gtk-delete', undef, "Delete", $self->gettext->get("Delete current object"), sub { $self->app->clear_item_from_canvas( $self->app->current_item ) } ], [ "Clear", 'gtk-clear', undef, "Delete", $self->gettext->get("Clear canvas"), sub { #store items to delete in temporary hash #sort them uid my %time_hash; for my $item ( values %{ $self->app->items } ) { next if exists $item->{image} && $item->{image} == $self->app->canvas_bg; $time_hash{ $item->{uid} } = $item; } #delete items for my $key ( sort keys %time_hash ) { $self->app->clear_item_from_canvas( $time_hash{$key} ); } } ], [ "Stop", 'gtk-stop', undef, "Escape", $self->gettext->get("Abort current mode"), sub { $self->app->abort_current_mode } ], [ "Close", 'gtk-close', undef, "Q", $self->gettext->get("Close this window"), sub { $self->app->quit(TRUE) } ], [ "Save", 'gtk-save', undef, "S", $self->gettext->get("Save image"), sub { $self->app->save(); $self->app->quit(FALSE); } ], [ "ExportTo", 'gtk-save-as', $self->gettext->get("Export to _File..."), "E", $self->gettext->get("Export to File..."), sub { $self->app->export_to_file(); } ], [ "ExportToSvg", undef, $self->gettext->get("_Export to SVG..."), "V", $self->gettext->get("Export to SVG..."), sub { $self->app->export_to_svg(); } ], [ "ExportToPdf", undef, $self->gettext->get("E_xport to PDF..."), "P", $self->gettext->get("Export to PDF..."), sub { $self->app->export_to_pdf(); } ], [ "ExportToPS", undef, $self->gettext->get("Export to Post_Script..."), "S", $self->gettext->get("Export to PostScript..."), sub { $self->app->export_to_ps(); } ], [ "ZoomIn", 'gtk-zoom-in', undef, "plus", undef, sub { $self->app->zoom_in_cb( $self->app ) } ], [ "ControlEqual", 'gtk-zoom-in', undef, "equal", undef, sub { $self->app->zoom_in_cb( $self->app ) } ], [ "ControlKpAdd", 'gtk-zoom-in', undef, "KP_Add", undef, sub { $self->app->zoom_in_cb( $self->app ); } ], [ "ZoomOut", 'gtk-zoom-out', undef, "minus", undef, sub { $self->app->zoom_out_cb( $self->app ) } ], [ "ControlKpSub", 'gtk-zoom-out', undef, "KP_Subtract", undef, sub { $self->app->zoom_out_cb( $self->app ); } ], [ "ZoomNormal", 'gtk-zoom-100', undef, "0", undef, sub { $self->app->zoom_normal_cb( $self->app ); } ], ); return \@main_actions; } sub _create_toggle_group { my $self = shift; #setup the menu toggle group my $toggle_group = Gtk3::ActionGroup->new("toggle"); $toggle_group->add_toggle_actions( $self->_create_toggle_actions ); return $toggle_group; } sub _create_toggle_actions { my $self = shift; my @toggle_actions = ( [ "Autoscroll", undef, $self->gettext->get("Automatic scrolling"), undef, undef, sub { my $widget = shift; if ( $widget->get_active ) { $self->app->autoscroll(TRUE); } else { $self->app->autoscroll(FALSE); } #'redraw-when-scrolled' to reduce the flicker of static items # #this property is not available in older versions #it was added to goocanvas on Mon Nov 17 10:28:07 2008 UTC #http://svn.gnome.org/viewvc/goocanvas?view=revision&revision=28 if ( $self->app->canvas && $self->app->canvas->find_property('redraw-when-scrolled') ) { $self->app->canvas->set( 'redraw-when-scrolled' => !$self->app->autoscroll ); } } ], [ "Fullscreen", 'gtk-fullscreen', undef, "F11", undef, sub { my $action = shift; if ( $action->get_active ) { $self->app->drawing_window->fullscreen; } else { $self->app->drawing_window->unfullscreen; } } ], ); return \@toggle_actions; } sub _create_drawing_group { my $self = shift; # Setup the drawing group. my $drawing_actions = $self->_create_drawing_actions; my $drawing_group = Gtk3::ActionGroup->new("drawing"); $drawing_group->add_radio_actions( $drawing_actions, 10, sub { my $action = shift; $self->app->change_drawing_tool_cb($action); } ); return $drawing_group; } sub _create_drawing_actions { my $self = shift; my @drawing_actions = ( [ "Select", 'shutter-pointer', $self->gettext->get("Select"), "0", $self->gettext->get("Select item to move or resize it"), 10 ], [ "Freehand", 'shutter-freehand', $self->gettext->get("Freehand"), "1", $self->gettext->get("Draw a freehand line"), 20 ], [ "Highlighter", 'shutter-highlighter', $self->gettext->get("Highlighter"), "2", $self->gettext->get("Highlighter"), 30 ], [ "Line", 'shutter-line', $self->gettext->get("Line"), "3", $self->gettext->get("Draw a straight line"), 40 ], [ "Arrow", 'shutter-arrow', $self->gettext->get("Arrow"), "4", $self->gettext->get("Draw an arrow"), 50 ], [ "Rect", 'shutter-rectangle', $self->gettext->get("Rectangle"), "5", $self->gettext->get("Draw a rectangle"), 60 ], [ "Ellipse", 'shutter-ellipse', $self->gettext->get("Ellipse"), "6", $self->gettext->get("Draw a ellipse"), 70 ], [ "Text", 'shutter-text', $self->gettext->get("Text"), "7", $self->gettext->get("Add some text to the screenshot"), 80 ], [ "Censor", 'shutter-censor', $self->gettext->get("Censor"), "8", $self->gettext->get("Censor portions of your screenshot to hide private data"), 90 ], [ "Pixelize", 'shutter-pixelize', $self->gettext->get("Pixelize"), "8", $self->gettext->get("Pixelize selected areas of your screenshot to hide private data"), 100 ], [ "Number", 'shutter-number', $self->gettext->get("Number"), "9", $self->gettext->get("Add an auto-increment shape to the screenshot"), 110 ], [ "Crop", 'shutter-crop', $self->gettext->get("Crop"), "c", $self->gettext->get("Crop your screenshot"), 120 ], ); return \@drawing_actions; } sub _get_ui_info { my $self = shift; return " "; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Draw/Utils.pm000066400000000000000000000024671476102223600256040ustar00rootroot00000000000000################################################### # # Copyright (C) 2021 Alexander Ruzhnikov # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Draw::Utils; use 5.010; use strict; use warnings; use Gtk3; use GooCanvas2; sub points_to_canvas_points { my @points = @_; my $num_points = scalar(@points) / 2; my $result = GooCanvas2::CanvasPoints::new( num_points => $num_points ); for ( my $i = 0; $i < @points; $i += 2 ) { $result->set_point( $i / 2, $points[$i], $points[ $i + 1 ] ); } return $result; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Geometry/000077500000000000000000000000001476102223600250335ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/modules/Shutter/Geometry/Region.pm000066400000000000000000000041061476102223600266150ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Geometry::Region; #modules #-------------------------------------- use utf8; use strict; use warnings; use Gtk3; #Glib use Glib qw/TRUE FALSE/; sub new { my $class = shift; #constructor my $self = {}; bless $self, $class; return $self; } sub get_clipbox { my $self = shift; my $region = shift; #store clipbox here my $clip = undef; #calculate clipbox my $len = $region->num_rectangles-1; for my $i (0..$len) { my $rect = $region->get_rectangle($i); unless (defined $clip) { $clip = $rect; } else { if ($rect->{x} < $clip->{x}) { $clip->{width} = $clip->{width} + $clip->{x}; $clip->{x} = $rect->{x}; } if ($rect->{y} < $clip->{y}) { $clip->{height} = $clip->{height} + $clip->{y}; $clip->{y} = $rect->{y}; } if ($rect->{x} + $rect->{width} > $clip->{x} + $clip->{width}) { $clip->{width} = $rect->{x} + $rect->{width} - $clip->{x}; } if ($rect->{y} + $rect->{height} > $clip->{y} + $clip->{height}) { $clip->{height} = $rect->{y} + $rect->{height} - $clip->{y}; } } } #return clip or empty rectangle if (defined $clip) { return $clip; } else { return {x=>0, y=>0, width=>0, height=>0}; } } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Pixbuf/000077500000000000000000000000001476102223600244755ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/modules/Shutter/Pixbuf/Border.pm000066400000000000000000000040001476102223600262420ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Pixbuf::Border; #modules #-------------------------------------- use utf8; use strict; use warnings; use Gtk3; #Glib use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; #constructor my $self = {_common => shift}; bless $self, $class; return $self; } #~ sub DESTROY { #~ my $self = shift; #~ print "$self dying at\n"; #~ } sub create_border { my $self = shift; my $pixbuf = shift; my $width = shift; my $color = shift; #create new pixbuf my $tmp_pbuf = Gtk3::Gdk::Pixbuf->new('rgb', TRUE, 8, $pixbuf->get_width + 2 * $width, $pixbuf->get_height + 2 * $width); #Create a pixel specification my $pixel = 0; $pixel += ($color->red / 257) << 24; $pixel += ($color->green / 257) << 16; $pixel += ($color->blue / 257) << 8; $pixel += 255; #fill tmp pixbuf $tmp_pbuf->fill($pixel); #copy source pixbuf to new pixbuf eval { $pixbuf->copy_area(0, 0, $pixbuf->get_width, $pixbuf->get_height, $tmp_pbuf, $width, $width); }; if ($@) { print "create border failed: $@\n" if $self->{_common}->get_debug; return $pixbuf; } return $tmp_pbuf; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Pixbuf/Load.pm000066400000000000000000000072521476102223600257200ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Pixbuf::Load; #modules #-------------------------------------- use utf8; use strict; use warnings; use Gtk3; #fileparse and tempfile use File::Basename qw/ fileparse dirname basename /; use File::Temp qw/ tempfile tempdir /; #Glib use Glib qw/TRUE FALSE/; #-------------------------------------- ##################public subs################## sub new { my $class = shift; #constructor my $self = {_common => shift, _window => shift, _no_error_dialog => shift}; bless $self, $class; return $self; } sub load { my $self = shift; my $filename = shift; my $width = shift; my $height = shift; my $sratio = shift; my $rotate = shift; my $pixbuf = undef; eval { if (defined $width && defined $height && defined $sratio) { $pixbuf = Gtk3::Gdk::Pixbuf->new_from_file_at_scale($filename, $width, $height, $sratio); } elsif (defined $width && defined $height) { $pixbuf = Gtk3::Gdk::Pixbuf->new_from_file_at_size($filename, $width, $height); } else { $pixbuf = Gtk3::Gdk::Pixbuf->new_from_file($filename); } }; #handle possible error messages if ($@) { unless (defined $self->{_no_error_dialog} && $self->{_no_error_dialog}) { #import shutter dialogs my $current_window = $self->{_window} || $self->{_common}->get_mainwindow; my $sd = Shutter::App::SimpleDialogs->new($current_window); #gettext variable my $d = $self->{_common}->get_gettext; #parse filename my ($name, $folder, $type) = fileparse($filename, qr/\.[^.]*/); #nice error dialog, more detailed messages are shown with a gtk2 expander my $response = $sd->dlg_error_message( sprintf($d->get("Error while opening image %s."), "'" . $name . $type . "'"), $d->get("There was an error opening the image."), undef, undef, undef, undef, undef, undef, $@->message ); } } #read exif and rotate accordingly if ($rotate && $pixbuf) { $pixbuf = $self->auto_rotate($pixbuf); } return $pixbuf; } sub get_option { my $self = shift; my $pixbuf = shift; my $option = shift; return FALSE unless (defined $pixbuf && defined $option); return $pixbuf->get_option($option); } sub auto_rotate { my $self = shift; my $pixbuf = shift; my %orientation_flags = ( 1 => 'none,-1', 2 => 'none,1', 3 => 'upsidedown,-1', 4 => 'none,0', 5 => 'clockwise,1', 6 => 'clockwise,-1', 7 => 'clockwise,0', 8 => 'counterclockwise,-1', ); my $option = $self->get_option($pixbuf, 'orientation'); if (defined $option && exists $orientation_flags{$option}) { my ($rotate, $flip_horiz) = split ",", $orientation_flags{$option}; #~ print $option, "\n"; if (defined $rotate) { $pixbuf = $pixbuf->rotate_simple($rotate); } if (defined $flip_horiz && $flip_horiz > -1) { $pixbuf = $pixbuf->flip($flip_horiz); } } return $pixbuf; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Pixbuf/Save.pm000066400000000000000000000156561476102223600257460ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Pixbuf::Save; #modules #-------------------------------------- use utf8; use strict; use warnings; use Gtk3; #fileparse and tempfile use File::Basename qw/ fileparse dirname basename /; use File::Temp qw/ tempfile tempdir /; #Glib use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; #constructor my $self = {_common => shift, _window => shift}; #import shutter dialogs my $current_window = $self->{_window} || $self->{_common}->get_mainwindow; $self->{_dialogs} = Shutter::App::SimpleDialogs->new($current_window); $self->{_lp} = Shutter::Pixbuf::Load->new($self->{_common}, $current_window); $self->{_quality} = undef; bless $self, $class; return $self; } sub set_quality_setting { my $self = shift; my $filetype = shift; my $default_image_quality = { "png" => 9, "jpg" => 90, "webp" => 98, "avif" => 68 }; #get quality value from settings if not set if (my $settings = $self->{_common}->get_globalsettings_object) { if (defined $settings->get_image_quality($filetype)) { $self->{_quality} = $settings->get_image_quality($filetype); } else { $self->{_quality} = $default_image_quality->{$filetype}; } } else { $self->{_quality} = $default_image_quality->{$filetype}; } } sub save_pdf_ps_svg { my $self = shift; my $filename = shift; my $pixbuf = shift; #0.8? => 72 / 90 dpi my $surface = Cairo::SvgSurface->create($filename, $pixbuf->get_width * 0.8, $pixbuf->get_height * 0.8); my $cr = Cairo::Context->create($surface); $cr->scale(0.8, 0.8); Gtk3::Gdk::cairo_set_source_pixbuf($cr, $pixbuf, 0, 0); $cr->paint; $cr->show_page; undef $surface; undef $cr; } sub save_pixbuf_to_file { my $self = shift; my $pixbuf = shift; my $filename = shift; my $filetype = shift; my $quality = shift; $self->{_quality} = $quality; #gettext variable my $d = $self->{_common}->get_gettext; #check if we need to rotate the image or set the exif data accordingly my $option = $self->{_lp}->get_option($pixbuf, 'orientation'); $option = 1 unless defined $option; #FIXME: NOT COVERED BY BINDINGS YET (we use Image::ExifTool instead) #we rotate the pixbuf when saving to any other format than jpeg (jpg) unless ($filetype eq 'jpeg' || $filetype eq 'jpg') { if ($option != 1) { $pixbuf = $self->{_lp}->auto_rotate($pixbuf); } } #we have two main ways of saving file #when possible we try to use all supported formats of the gdk-pixbuf libs #currently this is bmp, jpeg (jpg), png and ico (ico is not useful here) my $imagemagick_result = undef; if ($filetype eq 'jpeg' || $filetype eq 'jpg') { $self->set_quality_setting($filetype); print "Saving file $filename, $filetype, " . $self->{_quality} . "\n" if $self->{_common}->get_debug; eval { $pixbuf->save($filename, 'jpeg', quality => $self->{_quality}); #FIXME: NOT COVERED BY BINDINGS YET (we use Image::ExifTool instead) #~ $pixbuf->set_option( 'orientation' => $option ); if (my $exif = Shutter::App::Optional::Exif->new()) { #new Image::ExifTool instance my $exiftool = $exif->get_exiftool; if ($exiftool) { #Set a new value for a tag $exiftool->SetNewValue('Orientation' => $option, Type => 'ValueConv'); #Write new meta information to a file my $success = $exiftool->WriteInfo($filename); } } }; } elsif ($filetype eq 'png') { $self->set_quality_setting($filetype); print "Saving file $filename, $filetype, " . $self->{_quality} . "\n" if $self->{_common}->get_debug; eval { $pixbuf->save($filename, $filetype, "tEXt::Software" => "Shutter", compression => $self->{_quality}); }; } elsif ($filetype eq 'bmp') { eval { $pixbuf->save($filename, $filetype); }; } elsif ($filetype eq 'webp') { $self->set_quality_setting($filetype); print "Saving file $filename, $filetype, " . $self->{_quality} . "\n" if $self->{_common}->get_debug; eval { $pixbuf->save($filename, $filetype, "tEXt::Software" => "Shutter", quality => $self->{_quality}); }; } elsif ($filetype eq 'avif') { $self->set_quality_setting($filetype); print "Saving file $filename, $filetype, " . $self->{_quality} . "\n" if $self->{_common}->get_debug; eval { $pixbuf->save($filename, $filetype, quality => $self->{_quality}); }; } elsif ($filetype eq 'pdf' || $filetype eq 'ps' || $filetype eq 'svg') { $self->save_pdf_ps_svg($filename, $pixbuf); print "Saving file $filename, $filetype\n" if $self->{_common}->get_debug; } else { print "Saving file $filename, $filetype, $self->{_quality} (using fallback-mode)\n" if $self->{_common}->get_debug; #save pixbuf to tempfile my ($tmpfh, $tmpfilename) = tempfile(); $tmpfilename .= '.png'; if ($pixbuf) { $pixbuf->save($tmpfilename, 'png', compression => '9'); } #and convert filetype with imagemagick $imagemagick_result = $self->use_imagemagick_to_save($tmpfilename, $filename); unlink $tmpfilename; } #handle possible error messages #we use eval to test the pixbuf methods #and error messages provided #by the imagemagick libs if ($@ || $imagemagick_result) { #parse filename my ($name, $folder, $type) = fileparse($filename, qr/\.[^.]*/); my $detailed_message = 'Unknown error'; if ($@) { $detailed_message = $@->message; } elsif ($imagemagick_result) { $detailed_message = $imagemagick_result; } #nice error dialog, more detailed messages are shown with a gtk2 expander my $response = $self->{_dialogs}->dlg_error_message( sprintf($d->get("Error while saving the image %s."), "'" . $name . $type . "'"), sprintf($d->get("There was an error saving the image to %s."), "'" . $folder . "'"), undef, undef, undef, undef, undef, undef, $detailed_message ); return FALSE; } return TRUE; } #use imagemagick for all filetypes that are not #supported by the gdk-pixbuf libs #e.g. gif sub use_imagemagick_to_save { my $self = shift; my $file = shift; my $new_file = shift; #escape filename first $file = quotemeta $file; $new_file = quotemeta $new_file; my $result = `convert $file $new_file 2>&1`; return $result; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Screenshot/000077500000000000000000000000001476102223600253555ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/modules/Shutter/Screenshot/Error.pm000066400000000000000000000123521476102223600270070ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Screenshot::Error; #modules #-------------------------------------- use utf8; use strict; use warnings; #Glib use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; my $self = {_sc => shift, _code => shift, _data => shift, _extra => shift}; ############# # code = 0 - pointer could not be grabbed - or invalid region # code = 1 - keyboard could not be grabbed # code = 2 - no window with type xy detected # code = 3 - no history object stored # code = 4 - window no longer available # code = 5 - user aborted # code = 6 - gnome-web-photo failed # code = 7 - no window with name xy detected # code = 8 - invalid pattern # code = 9 - other error ############# bless $self, $class; return $self; } sub get_error { my $self = shift; return ($self->{_code}, $self->{_data}, $self->{_extra}); } sub is_aborted_by_user { my $self = shift; if (defined $self->{_code} && $self->{_code} == 5) { return TRUE; } else { return FALSE; } } sub is_error { my $self = shift; if (defined $self->{_code} && $self->{_code} =~ /^\d+$/) { return TRUE; } else { return FALSE; } } sub set_error { my $self = shift; if (@_) { $self->{_code} = shift; $self->{_data} = shift; $self->{_extra} = shift; } return ($self->{_code}, $self->{_data}, $self->{_extra}); } sub show_dialog { my $self = shift; my $detailed_error_text = shift || ''; #load modules at custom path #-------------------------------------- require lib; import lib $self->{_sc}->get_root . "/share/shutter/resources/modules"; require Shutter::App::SimpleDialogs; my $sd = Shutter::App::SimpleDialogs->new($self->{_sc}->get_mainwindow); #gettext my $d = $self->{_sc}->get_gettext; my $response; my $status_text = $d->get("Error while taking the screenshot."); #handle error codes if ($self->{_code} == 0) { #show error dialog my $response = $sd->dlg_error_message($d->get("Maybe mouse pointer could not be grabbed or the selected area is invalid."), $d->get("Error while taking the screenshot.")); #keyboard could not be grabbed } elsif ($self->{_code} == 1) { $response = $sd->dlg_error_message($d->get("Keyboard could not be grabbed."), $d->get("Error while taking the screenshot.")); #no window with type xy detected } elsif ($self->{_code} == 2) { my $type = undef; if ($self->{_data} eq "menu" || $self->{_data} eq "tray_menu") { $type = $d->get("menu"); } elsif ($self->{_data} eq "tooltip" || $self->{_data} eq "tray_tooltip") { $type = $d->get("tooltip"); } $response = $sd->dlg_error_message(sprintf($d->get("No window with type %s detected."), "'" . $type . "'"), $d->get("Error while taking the screenshot.")); #no history object stored } elsif ($self->{_code} == 3) { $response = $sd->dlg_error_message($d->get("There is no last capture that can be redone."), $d->get("Error while taking the screenshot.")); #window no longer available } elsif ($self->{_code} == 4) { $response = $sd->dlg_error_message($d->get("The window is no longer available."), $d->get("Error while taking the screenshot.")); #user aborted screenshot } elsif ($self->{_code} == 5) { $status_text = $d->get("Capture aborted by user"); #gnome-web-photo failed } elsif ($self->{_code} == 6) { $response = $sd->dlg_error_message($d->get("Unable to capture website"), $d->get("Error while taking the screenshot."), undef, undef, undef, undef, undef, undef, $detailed_error_text); $status_text = $d->get("Unable to capture website"); #no window with name $pattern detected } elsif ($self->{_code} == 7) { my $name_pattern = $self->{_extra}; $response = $sd->dlg_error_message(sprintf($d->get("No window with name pattern %s detected."), "'" . $name_pattern . "'"), $d->get("Error while taking the screenshot.")); #invalid pattern } elsif ($self->{_code} == 8) { my $name_pattern = $self->{_extra}; $response = $sd->dlg_error_message( sprintf($d->get("Invalid pattern %s detected."), "'" . $name_pattern . "'"), $d->get("Error while taking the screenshot."), undef, undef, undef, undef, undef, undef, $detailed_error_text ); } elsif ($self->{_code} == 9) { $response = $sd->dlg_error_message($d->get("Unable to capture"), $d->get("Error while taking the screenshot."), undef, undef, undef, undef, undef, undef, $detailed_error_text); } return ($response, $status_text); } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Screenshot/History.pm000066400000000000000000000042141476102223600273550ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Screenshot::History; #modules #-------------------------------------- use utf8; use strict; use warnings; #Glib use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; my $self = {_sc => shift}; #last capture $self->{_drawable} = shift; $self->{_x} = shift; $self->{_y} = shift; $self->{_w} = shift; $self->{_h} = shift; $self->{_region} = shift; $self->{_wxid} = shift; $self->{_gxid} = shift; bless $self, $class; return $self; } sub get_last_capture { my $self = shift; return ($self->{_drawable}, $self->{_x}, $self->{_y}, $self->{_w}, $self->{_h}, $self->{_region}, $self->{_wxid}, $self->{_gxid}); } sub set_last_capture { my $self = shift; if (scalar @_ >= 5) { $self->{_drawable} = shift; $self->{_x} = shift; $self->{_y} = shift; $self->{_w} = shift; $self->{_h} = shift; $self->{_region} = shift; $self->{_wxid} = shift; $self->{_gxid} = shift; } else { warn "WARNING: Wrong number of arguments in Shutter::Screenshot::History::set_last_capture\n"; } return ($self->{_drawable}, $self->{_x}, $self->{_y}, $self->{_w}, $self->{_h}, $self->{_region}, $self->{_wxid}, $self->{_gxid}); } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Screenshot/Main.pm000066400000000000000000000335111476102223600266020ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Screenshot::Main; #modules #-------------------------------------- use utf8; use strict; use warnings; use File::Temp qw/ tempfile tempdir /; #Glib use Glib qw/TRUE FALSE/; #stringified perl data structures, suitable for both printing and eval use Data::Dumper; #-------------------------------------- sub new { my $class = shift; my $self = { _sc => shift, _include_cursor => shift, _delay => shift, _notify_timeout => shift, }; #gdk screen $self->{_gdk_screen} = Gtk3::Gdk::Screen::get_default(); #gdk display $self->{_gdk_display} = $self->{_gdk_screen}->get_display; my $window = Gtk3::Window->new('toplevel'); #root window eval { $self->{_root} = Gtk3::GdkX11::X11Window::lookup_for_display( $window->get_display, Gtk3::GdkX11::x11_get_default_root_xwindow()); ($self->{_root}->{x}, $self->{_root}->{y}, $self->{_root}->{w}, $self->{_root}->{h}) = $self->{_root}->get_geometry; ($self->{_root}->{x}, $self->{_root}->{y}) = $self->{_root}->get_origin; #wnck screen $self->{_wnck_screen} = Wnck::Screen::get_default(); $self->{_wnck_screen}->force_update(); #we determine the wm name but on older #version of libwnck (or the bindings) #the needed method is not available #in this case we use gdk to do it # #this leads to a known problem when switching #the wm => wm_name will still remain the old one $self->{_wm_manager_name} = $self->{_gdk_screen}->get_window_manager_name; if ($self->{_wnck_screen}->can('get_window_manager_name')) { $self->{_wm_manager_name} = $self->{_wnck_screen}->get_window_manager_name; } #workspaces $self->{_workspaces} = (); for (my $wcount = 0 ; $wcount < $self->{_wnck_screen}->get_workspace_count ; $wcount++) { push(@{$self->{_workspaces}}, $self->{_wnck_screen}->get_workspace($wcount)); } }; if ($@) { # it's wayland } bless $self, $class; return $self; } sub get_clipbox { my $self = shift; my $region = shift; #create shutter region object my $sr = Shutter::Geometry::Region->new(); return $sr->get_clipbox($region); } sub update_workspaces { my $self = shift; for (my $wcount = 0 ; $wcount < $self->{_wnck_screen}->get_workspace_count ; $wcount++) { push(@{$self->{_workspaces}}, $self->{_wnck_screen}->get_workspace($wcount)); } return $self->{_wnck_screen}->get_workspace_count; } sub get_root_and_geometry { my $self = shift; return ($self->{_root}, $self->{_root}->{x}, $self->{_root}->{y}, $self->{_root}->{w}, $self->{_root}->{h}); } sub get_root_and_current_monitor_geometry { my $self = shift; my $mainwindow = $self->{_root}; my $mon1 = $self->{_gdk_screen}->get_monitor_geometry($self->{_gdk_screen}->get_monitor_at_window($mainwindow)); return ($self->{_root}, $mon1->{x}, $mon1->{y}, $mon1->{width}, $mon1->{height}); } sub get_current_monitor { my $self = shift; my ($window_at_pointer, $x, $y, $mask) = $self->{_root}->get_pointer; my $mon = $self->{_gdk_screen}->get_monitor_geometry($self->{_gdk_screen}->get_monitor_at_point($x, $y)); return ($mon); } sub get_monitor_region { my $self = shift; my $region = Cairo::Region->create; for (my $i = 0 ; $i < $self->{_gdk_screen}->get_n_monitors ; $i++) { $region->union_rectangle($self->{_gdk_screen}->get_monitor_geometry($i)); } return $region; } sub ungrab_pointer_and_keyboard { my ($self, $ungrab_server, $quit_event_handler, $quit_main) = @_; #ungrab pointer and keyboard Gtk3::Gdk::X11->ungrab_server if $ungrab_server; Gtk3::Gdk::pointer_ungrab(Gtk3::get_current_event_time()); Gtk3::Gdk::keyboard_ungrab(Gtk3::get_current_event_time()); Gtk3::Gdk::Event::handler_set(sub { my $event = shift; Gtk3::main_do_event($event); }) if $quit_event_handler; Gtk3->main_quit if $quit_main; return TRUE unless Gtk3::Gdk::pointer_is_grabbed(); return FALSE; } #~ sub get_scrollable_from_drawable { #~ my ( $self, $drawable, $x, $y, $width, $height, $cursor, $sleep ) = @_; #~ #~ #save pixbuf to file #~ my $pixbuf_save = Shutter::Pixbuf::Save->new( $self->{_sc}, $self->{_sc}->get_mainwindow ); #~ #~ my @steps; #~ while(1){ #~ #~ #create tempfile #~ my ( $tmpfh, $tmpfilename ) = tempfile(UNLINK => 1); #~ #~ my ($pixbuf, $l_cropped, $r_cropped, $t_cropped, $b_cropped) = $self->get_pixbuf_from_drawable($drawable, $x, $y, $width, $height, FALSE, 1); #~ $pixbuf_save->save_pixbuf_to_file($pixbuf, $tmpfilename, 'miff'); #~ #~ push @steps, $tmpfilename; #~ #~ my $curr_index = scalar @steps; #~ if($curr_index > 1){ #~ #~ my $compare = `compare -metric PSNR $steps[$curr_index-2] $steps[$curr_index-1] null: 2>&1`; #~ if ($compare =~ /inf/){ #~ print "Finish\n"; #~ last; #~ } #~ }else{ #~ my $line_size = 67; #~ $y += $height - $line_size; #~ $height = $line_size; #~ } #~ #~ #cursor can only be on the first page #~ $self->{_include_cursor} = FALSE; #~ #~ #next scroll step #~ my $xdo = `xdotool click 5`; #~ #~ } #~ #~ my $append_cmd = 'convert'; #~ foreach(@steps){ #~ $append_cmd .= " $_"; #~ } #~ #~ #create tempfile #~ my ( $tmpfh_fin, $tmpfilename_fin ) = tempfile(UNLINK => 1); #~ $append_cmd .= " -append $tmpfilename_fin"; #~ #~ print $append_cmd."\n"; #~ #~ my $append_res = `$append_cmd`; #~ #~ my $app_pixbuf = Gtk3::Gdk::Pixbuf->new_from_file($tmpfilename_fin); #~ print $app_pixbuf."\n"; #~ return ($app_pixbuf, 0, 0, 0, 0); #~ #~ } sub get_pixbuf_from_drawable { my ($self, $drawable, $x, $y, $width, $height, $region) = @_; my ($pixbuf, $l_cropped, $r_cropped, $t_cropped, $b_cropped) = (0, 0, 0, 0, 0); #show notification messages displaying the countdown if ($self->{_delay} && $self->{_notify_timeout}) { my $notify = $self->{_sc}->get_notification_object; my $ttw = $self->{_delay}; #gettext my $d = $self->{_sc}->get_gettext; #first notification immediately $notify->show(sprintf($d->nget("Screenshot will be taken in %s second", "Screenshot will be taken in %s seconds", $ttw), $ttw), ""); $ttw--; #delay is only 1 second #do not show any further messages if ($ttw >= 1) { #then controlled via timeout Glib::Timeout->add( 1000, sub { $notify->show(sprintf($d->nget("Screenshot will be taken in %s second", "Screenshot will be taken in %s seconds", $ttw), $ttw), ""); $ttw--; if ($ttw == 0) { #close last message with a short delay (less than a second) Glib::Timeout->add( 500, sub { $notify->close; return FALSE; }); return FALSE; } else { return TRUE; } }); } else { #close last message with a short delay (less than a second) Glib::Timeout->add( 500, sub { $notify->close; return FALSE; }); } } #Add a timeout if there is any delay Glib::Timeout->add( $self->{_delay} * 1000, sub { #get the pixbuf from drawable and save the file # #maybe window is partially not on the screen #right if ($x + $width > $self->{_root}->{w}) { $r_cropped = $x + $width - $self->{_root}->{w}; $width -= $x + $width - $self->{_root}->{w}; } #bottom if ($y + $height > $self->{_root}->{h}) { $b_cropped = $y + $height - $self->{_root}->{h}; $height -= $y + $height - $self->{_root}->{h}; } #left if ($x < $self->{_root}->{x}) { $l_cropped = $self->{_root}->{x} - $x; $width = $width + $x; $x = 0; } #top if ($y < $self->{_root}->{y}) { $t_cropped = $self->{_root}->{y} - $y; $height = $height + $y; $y = 0; } #get the pixbuf from drawable and save the file eval { if ($width > 0 && $height > 0) { $pixbuf = Gtk3::Gdk::pixbuf_get_from_window($drawable, $x, $y, $width, $height); } }; if ($@) { $pixbuf = 5; Gtk3->main_quit; return FALSE; } #include cursor if ($self->{_include_cursor}) { $pixbuf = $self->include_cursor($x, $y, $width, $height, $drawable, $pixbuf); } #region is optional #it is used to handle multiple monitors (root window may not be rectangular) #or to cut out the screen contents when capturing menus if ($region) { #get clipbox #~ my $clipbox = $region->get_clipbox; my $clipbox = $self->get_clipbox($region); #print "Clipbox: ", Dumper($region, $clipbox); #create target pixbuf with dimension of clipbox my $target = Gtk3::Gdk::Pixbuf->new($pixbuf->get_colorspace, TRUE, 8, $clipbox->{width}, $clipbox->{height}); #whole pixbuf is transparent $target->fill(0x00000000); #determine low x and y my $small_x = $self->{_root}->{w}; my $small_y = $self->{_root}->{h}; my $len = $region->num_rectangles-1; for my $i (0..$len) { my $r = $region->get_rectangle($i); $small_x = $r->{x} if $r->{x} < $small_x; $small_y = $r->{y} if $r->{y} < $small_y; } #copy each rectangle for my $i (0..$len) { my $r = $region->get_rectangle($i); #~ print $r->x, " - ", $r->y, " - ", $r->width, " - ", $r->height, "\n"; $pixbuf->copy_area($r->{x} - $small_x, $r->{y} - $small_y, $r->{width}, $r->{height}, $target, $r->{x} - $small_x, $r->{y} - $small_y); } $pixbuf = $target->copy; } Gtk3->main_quit; return FALSE; }); Gtk3->main(); return ($pixbuf, $l_cropped, $r_cropped, $t_cropped, $b_cropped); } #code ported and partially borrowed from gnome-screenshot and Gimp sub include_cursor { my ($self, $xp, $yp, $widthp, $heightp, $gdk_window, $pixbuf) = @_; require lib; import lib $self->{_sc}->get_root . "/share/shutter/resources/modules"; require X11::Protocol; #X11 protocol and XFIXES ext $self->{_x11} = X11::Protocol->new($ENV{'DISPLAY'}); $self->{_x11}{ext_xfixes} = $self->{_x11}->init_extension('XFIXES'); #pixbuf my $cursor_pixbuf = undef; #Cursor position (root window coordinates) my $cursor_pixbuf_xroot = undef; my $cursor_pixbuf_yroot = undef; #The "hotspot" position my $cursor_pixbuf_xhot = undef; my $cursor_pixbuf_yhot = undef; if ($self->{_x11}{ext_xfixes}) { my ($root_x, $root_y, $width, $height, $xhot, $yhot, $serial, $pixels) = $self->{_x11}->XFixesGetCursorImage; #packed data string my $data; my $pos = 0; foreach my $y (0 .. $height - 1) { foreach my $x (0 .. $width - 1) { my $argb = unpack 'L', substr($pixels, $pos, 4); my $a = ($argb >> 24) & 0xFF; my $r = ($argb >> 16) & 0xFF; my $g = ($argb >> 8) & 0xFF; my $b = ($argb >> 0) & 0xFF; $pos += 4; #~ print "r:$r,g:$g,b:$b,a:$a\n"; $r = ($r * 255) / $a if ($a); $g = ($g * 255) / $a if ($a); $b = ($b * 255) / $a if ($a); $data .= pack('C*', $r, $g, $b, $a); } } if ($width > 1 && $height > 1) { $cursor_pixbuf = Gtk3::Gdk::Pixbuf->new_from_data($data, 'rgb', 1, 8, $width, $height - 1, 4 * $width); $cursor_pixbuf_xhot = $xhot; $cursor_pixbuf_yhot = $yhot; $cursor_pixbuf_xroot = $root_x; $cursor_pixbuf_yroot = $root_y; } else { warn "WARNING: There was an error while getting the cursor image (XFIXESGetCursorImage)\n"; } } else { warn "WARNING: XFIXES extension not found - using a default cursor image\n"; my ($window_at_pointer, $root_x, $root_y, $mask) = $gdk_window->get_pointer; my $cursor = Gtk3::Gdk::Cursor->new('GDK_LEFT_PTR'); $cursor_pixbuf = $cursor->get_image; #try to use default cursor if there was an error unless ($cursor_pixbuf) { warn "WARNING: There was an error while getting the default cursor image - using one of our image files\n"; my $icons_path = $self->{_sc}->get_root . "/share/shutter/resources/icons"; eval { $cursor_pixbuf = Gtk3::Gdk::Pixbuf->new_from_file($icons_path . "/Normal.cur"); }; if ($@) { warn "ERROR: There was an error while loading the image file: $@\n"; } } if ($cursor_pixbuf) { $cursor_pixbuf_xhot = $cursor_pixbuf->get_option('x_hot'); $cursor_pixbuf_yhot = $cursor_pixbuf->get_option('y_hot'); $cursor_pixbuf_xroot = $root_x; $cursor_pixbuf_yroot = $root_y; } } if ($cursor_pixbuf) { #x,y pos (cursor) my $x = $cursor_pixbuf_xroot; my $y = $cursor_pixbuf_yroot; #screenshot dimensions saved in a rect (global x, y) my $scshot = Cairo::Region->create({x=>$xp, y=>$yp, width=>$widthp, height=>$heightp}); #see 'man xcursor' for a detailed description #of these values my $xhot = $cursor_pixbuf_xhot; my $yhot = $cursor_pixbuf_yhot; #cursor dimensions (global x, y and width and height of the pixbuf) my $cursor = {x=>$x, y=>$y, width=>$cursor_pixbuf->get_width, height=>$cursor_pixbuf->get_height}; #is the cursor visible in the current screenshot? #(do the rects intersect?) if ($scshot->intersect_rectangle($cursor) eq 'success') { #calculate dest_x, dest_y #be careful here when subtracting xhot and yhot, #because negative values are not allowed when #using composite # #example: moving the cursor to the coords 0, 0 #would lead to an error my $dest_x = $x - $xp - $xhot; my $dest_y = $y - $yp - $yhot; $dest_x = 0 if $dest_x < 0; $dest_y = 0 if $dest_y < 0; $cursor_pixbuf->composite($pixbuf, $dest_x, $dest_y, $cursor->{width}, $cursor->{height}, $x - $xp - $xhot, $y - $yp - $yhot, 1.0, 1.0, 'bilinear', 255); } } return $pixbuf; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Screenshot/SelectorAdvanced.pm000066400000000000000000001024601476102223600311240ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### #perl -x -S perltidy -l=0 -b "%f" package Shutter::Screenshot::SelectorAdvanced; #modules #-------------------------------------- use utf8; use strict; use warnings; use Gtk3::ImageView; use GooCanvas2; use GooCanvas2::CairoTypes; use Shutter::Screenshot::Main; use Shutter::Screenshot::History; use Data::Dumper; our @ISA = qw(Shutter::Screenshot::Main); #Glib use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; #call constructor of super class (shutter_common, include_cursor, delay, notify_timeout) my $self = $class->SUPER::new(shift, shift, shift, shift); $self->{_zoom_active} = shift; $self->{_hide_time} = shift; #a short timeout to give the server a chance to redraw the area that was obscured $self->{_show_help} = shift; #hide help text? #initial selection size $self->{_init_x} = shift; $self->{_init_y} = shift; $self->{_init_w} = shift; $self->{_init_h} = shift; $self->{_confirmation_necessary} = shift; $self->{_dpi_scale} = Gtk3::Window->new('toplevel')->get('scale-factor'); #view, selector, dragger $self->{_view} = Gtk3::ImageView->new; $self->{_selector} = Gtk3::ImageView::Tool::Selector->new($self->{_view}); #$self->{_dragger} = Gtk3::ImageView::Tool::Dragger->new($self->{_view}); $self->{_view}->set_interpolation('nearest'); $self->{_view}->set_tool($self->{_selector}); $self->{_view}->set('zoom-step', 1.2); #WORKAROUND #upstream bug #http://trac.bjourne.webfactional.com/ticket/21 #left => zoom in #right => zoom out $self->{_view}->signal_connect( 'scroll-event', sub { my ($view, $ev) = @_; if ($ev->direction eq 'left') { $ev->direction('up'); } elsif ($ev->direction eq 'right') { $ev->direction('down'); } return FALSE; }); bless $self, $class; return $self; } #~ sub DESTROY { #~ my $self = shift; #~ print "$self dying at\n"; #~ } sub select_advanced { my $self = shift; #return value my $output = 5; my $d = $self->{_sc}->get_gettext; #create pixbuf (root window) my $clean_pixbuf = Gtk3::Gdk::pixbuf_get_from_window($self->{_root}, 0, 0, $self->{_root}->{w}, $self->{_root}->{h}); $self->{_view}->set_pixbuf($clean_pixbuf); #show help text (do not show help text if predefined selection area is enabled)? if ($self->{_init_w} < 1 || $self->{_init_h} < 1) { if ($self->{_show_help}) { Glib::Idle->add( sub { #we display the tip only on the current monitor #if we would use the root window we would display the next #right in the middle of both screens, this is pretty ugly my $mon1 = $self->get_current_monitor; print "Using monitor: " . $mon1->{x} . " - " . $mon1->{y} . " - " . $mon1->{width} . " - " . $mon1->{height} . "\n" if $self->{_sc}->get_debug; #obtain current colors and font_desc from the main window my $style = $self->{_sc}->get_mainwindow->get_style_context; my $sel_bg = Gtk3::Gdk::RGBA::parse('#131313'); my $font_fam = $style->get_font('normal')->get_family; my $font_size = $style->get_font('normal')->get_size * $self->{_dpi_scale} / Pango->scale; #create cairo context und layout my $surface = Cairo::ImageSurface->create('argb32', $self->{_root}->{w}*$self->{_dpi_scale}, $self->{_root}->{h}*$self->{_dpi_scale}); my $cr = Cairo::Context->create($surface); #set_source_pixbuf Gtk3::Gdk::cairo_set_source_pixbuf($cr, $clean_pixbuf, 0, 0); $cr->paint; my $layout = Pango::Cairo::create_layout($cr); $layout->set_width(int($mon1->{width} * $self->{_dpi_scale} / 2) * Pango->scale); $layout->set_alignment('left'); $layout->set_wrap('word'); #determine font-size my $size1 = int($font_size * 2.0); my $size2 = int($font_size * 1.5); my $size3 = int($font_size * 1.0); my $text1 = $d->get("Draw a rectangular area using the mouse."); my $text2 = $d->get("To take a screenshot, double-click or press the Enter key.\nPress Esc to abort."); my $text3 = $d->get("shift/right-click → selection dialog on/off") . "\n" . $d->get("scrollwheel → zoom in/out") . "\n" . $d->get("space → zoom window on/off") . "\n" . $d->get("cursor keys → move cursor") . "\n" . $d->get("cursor keys + alt → move selection") . "\n" . $d->get("cursor keys + ctrl → resize selection"); #use this one for white font-color $layout->set_markup( "$text1\n$text2\n\n$text3" ); #draw the rectangle $cr->set_source_rgba($sel_bg->red, $sel_bg->green, $sel_bg->blue, 0.85); my ($lw, $lh) = $layout->get_pixel_size; my $w = $lw + $size1 * 2; my $h = $lh + $size1 * 2; my $x = int(($mon1->{width}*$self->{_dpi_scale} - $w) / 2) + $mon1->{x}; my $y = int(($mon1->{height}*$self->{_dpi_scale} - $h) / 2) + $mon1->{y}; my $r = 20*$self->{_dpi_scale}; $cr->move_to($x + $r, $y); $cr->line_to($x + $w - $r, $y); $cr->curve_to($x + $w, $y, $x + $w, $y, $x + $w, $y + $r); $cr->line_to($x + $w, $y + $h - $r); $cr->curve_to($x + $w, $y + $h, $x + $w, $y + $h, $x + $w - $r, $y + $h); $cr->line_to($x + $r, $y + $h); $cr->curve_to($x, $y + $h, $x, $y + $h, $x, $y + $h - $r); $cr->line_to($x, $y + $r); $cr->curve_to($x, $y, $x, $y, $x + $r, $y); $cr->fill; $cr->move_to($x + $size1, $y + $size1); #draw the pango layout Pango::Cairo::show_layout($cr, $layout); #write surface to pixbuf my $loader = Gtk3::Gdk::PixbufLoader->new; $surface->write_to_png_stream( sub { my ($closure, $data) = @_; $loader->write([map ord, split //, $data]); return TRUE; }); $loader->close; #set pixbuf $self->{_view}->set_pixbuf($loader->get_pixbuf); return FALSE; }); } } #define zoom window $self->{_zoom_window} = Gtk3::Window->new('popup'); $self->{_zoom_window}->set_decorated(FALSE); $self->{_zoom_window}->set_skip_taskbar_hint(TRUE); $self->{_zoom_window}->set_skip_pager_hint(TRUE); $self->{_zoom_window}->set_keep_above(TRUE); $self->{_zoom_window}->set_accept_focus(FALSE); #pack canvas to a scrolled window my $scwin = Gtk3::ScrolledWindow->new(); $scwin->set_policy('never', 'never'); #define and setup the canvas my $canvas = GooCanvas2::Canvas->new(); $canvas->set_size_request(105, 105); $canvas->modify_bg('normal', Gtk3::Gdk::RGBA::parse('#00000000')); $canvas->set_bounds(-10*$self->{_dpi_scale}, -10*$self->{_dpi_scale}, ($self->{_root}->{w}+10)*$self->{_dpi_scale}, ($self->{_root}->{h}+10)*$self->{_dpi_scale}); $canvas->set_scale(5); my $canvas_root = $canvas->get_root_item(); $scwin->add($canvas); my $xlabel = Gtk3::Label->new("X: "); my $ylabel = Gtk3::Label->new("Y: "); my $rlabel = Gtk3::Label->new("0 x 0"); $ylabel->set_max_width_chars(10); $xlabel->set_max_width_chars(10); $rlabel->set_max_width_chars(10); my $zoom_vbox = Gtk3::VBox->new; $zoom_vbox->pack_start($scwin, TRUE, TRUE, 0); $zoom_vbox->pack_start($xlabel, TRUE, TRUE, 0); $zoom_vbox->pack_start($ylabel, TRUE, TRUE, 0); $zoom_vbox->pack_start($rlabel, TRUE, TRUE, 0); #do some packing $self->{_zoom_window}->add($zoom_vbox); $self->{_zoom_window}->move($self->{_root}->{x}, $self->{_root}->{y}); #define shutter cursor (frame) my $shutter_cursor_pixbuf_frame = Gtk3::Gdk::Pixbuf->new_from_file($self->{_sc}->get_root . "/share/shutter/resources/icons/shutter_cursor_frame.png"); #create root... my $root_item = GooCanvas2::CanvasImage->new( parent => $canvas_root, x => 0, y => 0, pixbuf => $clean_pixbuf ); GooCanvas2::CairoTypes::cairoize_pattern($root_item->get('pattern'))->set_filter('nearest'); #...and cursor icon my $cursor_item = GooCanvas2::CanvasImage->new( parent => $canvas_root, x => 0, y => 0, pixbuf => $shutter_cursor_pixbuf_frame, ); GooCanvas2::CairoTypes::cairoize_pattern($cursor_item->get('pattern'))->set_filter('nearest'); #starting point my ($window_at_pointer, $xinit, $yinit, $mask) = $self->{_root}->get_pointer; #move cursor on the canvas... $cursor_item->set( x => $xinit - 10, y => $yinit - 10, ); #scroll region #$canvas->set_scroll_region($xinit - 9, $yinit - 9, $xinit + 10, $yinit + 10); $canvas->scroll_to($xinit - 10, $yinit - 10); #window to manipulate the selection $self->{_prop_window} = $self->select_dialog(); $self->{_prop_active} = FALSE; #window that contains the imageview widget $self->{_select_window} = Gtk3::Window->new('popup'); $self->{_select_window}->set_type_hint('splashscreen'); $self->{_select_window}->set_can_focus(TRUE); $self->{_select_window}->set_accept_focus(TRUE); $self->{_select_window}->set_modal(TRUE); $self->{_select_window}->set_decorated(FALSE); $self->{_select_window}->set_skip_taskbar_hint(TRUE); $self->{_select_window}->set_skip_pager_hint(TRUE); $self->{_select_window}->set_keep_above(TRUE); $self->{_select_window}->add($self->{_view}); $self->{_select_window}->set_default_size($self->{_root}->{w}, $self->{_root}->{h}); $self->{_select_window}->resize($self->{_root}->{w}, $self->{_root}->{h}); $self->{_select_window}->move($self->{_root}->{x}, $self->{_root}->{y}); $self->{_select_window}->show_all; $self->{_select_window}->present; #init state flags if ($self->{_show_help}) { $self->{_selector_init} = TRUE; } else { $self->{_selector_init} = FALSE; } $self->{_selector_init_zoom} = 0; #hide help text when selector is invoked $self->{_selector_handler} = $self->{_selector}->signal_connect( 'selection-changed' => sub { #hide initial text if ($self->{_selector_init}) { $self->{_view}->set_pixbuf($clean_pixbuf, FALSE); $self->{_selector_init} = FALSE; $self->{_selector_init_zoom}++; } #update prop dialog values $self->adjust_prop_values(); }); #handle zoom events #ignore zoom values smaller 1 $self->{_view_zoom_handler} = $self->{_view}->signal_connect( 'zoom-changed' => sub { my ($view, $zoom) = @_; if ($zoom >= 1) { $view->set_interpolation('nearest'); $view->set_zoom(10) if $zoom > 10; } else { $view->set_interpolation('bilinear'); $view->set_zoom(1); } if ($self->{_zoom_active}) { if ($zoom > 1) { $self->{_zoom_window}->hide; } else { $self->{_zoom_window}->show_all; $self->zoom_check_pos(); } } #hide help text when zoomed if ($self->{_selector_init_zoom} == 1) { $view->set_pixbuf($clean_pixbuf, FALSE); $self->{_selector_init} = FALSE; } else { $self->{_selector_init_zoom}++; } }); #set initial size Glib::Idle->add( sub { if ($self->{_init_w} && $self->{_init_h}) { $self->{_selector}->set_selection({x=>$self->{_init_x}, y=>$self->{_init_y}, width=>$self->{_init_w}, height=>$self->{_init_h}}); } return FALSE; }); #event-handling #we simulate a 2button-press here $self->{_view_button_handler} = $self->{_view}->signal_connect( 'button-press-event' => sub { my ($view, $event) = @_; return FALSE unless defined $event; my $s = $self->{_selector}->get_selection; if ($event->button == 1) { unless (defined $self->{_dclick}) { $self->{_dclick} = $event->time; return FALSE; } else { if ($event->time - $self->{_dclick} <= 500) { $self->{_select_window}->hide; $self->{_zoom_window}->hide; $self->{_prop_window}->hide; #A short timeout to give the server a chance to #redraw the area Glib::Timeout->add( $self->{_hide_time}, sub { Gtk3->main_quit; return FALSE; }); Gtk3->main(); $output = $self->take_screenshot($s, $clean_pixbuf); $self->quit; } else { $self->{_dclick} = $event->time; return FALSE; } } } }); #event-handling #all other events $self->{_view_event_handler} = $self->{_view}->signal_connect( 'event' => sub { my ($window, $event) = @_; return FALSE unless defined $event; my $s = $self->{_selector}->get_selection; #~ print $event->type, "\n"; #handle button-release event if ($event->type eq 'button-release') { if ($event->button == 3) { if ($self->{_prop_active}) { Gtk3::Gdk::keyboard_ungrab(Gtk3::get_current_event_time()); $self->{_prop_window}->hide; $self->{_prop_active} = FALSE; Gtk3::Gdk::keyboard_grab($self->{_select_window}->get_window, 0, Gtk3::get_current_event_time()); } else { Gtk3::Gdk::keyboard_ungrab(Gtk3::get_current_event_time()); my ($window_at_pointer, $x, $y, $mask) = $self->{_root}->get_pointer; $self->{_prop_window}->move($x, $y); $self->{_prop_window}->show_all; $self->{_prop_active} = TRUE; Gtk3::Gdk::keyboard_grab($self->{_prop_window}->get_window, 0, Gtk3::get_current_event_time()); } } elsif ($event->button == 1) { if (not $self->{_confirmation_necessary}) { $self->{_select_window}->hide; $self->{_zoom_window}->hide; $self->{_prop_window}->hide; #A short timeout to give the server a chance to #redraw the area Glib::Timeout->add( $self->{_hide_time}, sub { Gtk3->main_quit; return FALSE; }); Gtk3->main(); $output = $self->take_screenshot($s, $clean_pixbuf); $self->quit; } } #handle motion-notify } elsif ($event->type eq 'motion-notify') { #update zoom window if ($self->{_zoom_active} && $self->{_view}->get_zoom == 1) { my $s = $self->{_selector}->get_selection; my $v = $self->{_view}->get_viewport; my ($window_at_pointer, $x, $y, $mask) = $self->{_root}->get_pointer; #event coordinates my $zoom = $self->{_view}->get_zoom; my $ev_x = int($v->{x} / $zoom + $x * $self->{_dpi_scale} / $zoom); my $ev_y = int($v->{y} / $zoom + $y * $self->{_dpi_scale} / $zoom); #sync cursor with selection if (0 && defined $s) { my $cursor = $self->{_selector}->cursor_at_point($x, $y)->get_cursor_type; print Dumper($cursor); my $sx = $s->{x}; my $sy = $s->{y}; my $sw = $s->{width}; my $sh = $s->{height}; if ($cursor eq 'bottom-right-corner') { $ev_x = $sx + $sw - 1; $ev_y = $sy + $sh - 1; } elsif ($cursor eq 'right-side') { $ev_x = $sx + $sw - 1; } elsif ($cursor eq 'top-right-corner') { $ev_x = $sx + $sw - 1; $ev_y = $sy; } elsif ($cursor eq 'top-side') { $ev_y = $sy; } elsif ($cursor eq 'top-left-corner') { $ev_x = $sx; $ev_y = $sy; } elsif ($cursor eq 'left-side') { $ev_x = $sx; } elsif ($cursor eq 'bottom-left-corner') { $ev_x = $sx; $ev_y = $sy + $sh - 1; } elsif ($cursor eq 'bottom-side') { $ev_y = $sy + $sh - 1; } } #update label in zoom_window $xlabel->set_text("X: " . ($ev_x + 1)); $ylabel->set_text("Y: " . ($ev_y + 1)); #check pos and geometry of the zoom window and move it if needed $self->zoom_check_pos(); #move cursor on the canvas... $cursor_item->set( x => $ev_x - 10, y => $ev_y - 10, ); #update scroll region #this is significantly faster than #scroll_to #$canvas->set_scroll_region($ev_x - 9, $ev_y - 9, $ev_x + 10, $ev_y + 10); $canvas->scroll_to($ev_x - 10, $ev_y - 10); #update zoom_window text if (defined $s) { $rlabel->set_text($s->{width} . " x " . $s->{height}); } else { $rlabel->set_text("0 x 0"); } } #zoom active #handle key-press } }); $self->{_key_handler} = $self->{_select_window}->signal_connect( 'key-press-event' => sub { my ($window, $event) = @_; return FALSE unless defined $event; my $s = $self->{_selector}->get_selection; #where is the pointer currently? my ($window_at_pointer, $x, $y, $mask) = $self->{_root}->get_pointer; #toggle zoom window if ($event->keyval == Gtk3::Gdk::keyval_from_name('space')) { if ($self->{_zoom_active}) { $self->{_zoom_window}->hide; $self->{_zoom_active} = FALSE; } elsif ($self->{_view}->get_zoom == 1) { $self->zoom_check_pos(); $self->{_zoom_active} = TRUE; } #toggle prop dialog } elsif ($event->keyval == Gtk3::Gdk::keyval_from_name('Shift_L') || $event->keyval == Gtk3::Gdk::keyval_from_name('Shift_R')) { if ($self->{_prop_active}) { Gtk3::Gdk::keyboard_ungrab(Gtk3::get_current_event_time()); $self->{_prop_window}->hide; $self->{_prop_active} = FALSE; Gtk3::Gdk::keyboard_grab($self->{_select_window}->get_window, 0, Gtk3::get_current_event_time()); } else { Gtk3::Gdk::keyboard_ungrab(Gtk3::get_current_event_time()); my ($window_at_pointer, $x, $y, $mask) = $self->{_root}->get_pointer; $self->{_prop_window}->move($x, $y); $self->{_prop_window}->show_all; $self->{_prop_active} = TRUE; Gtk3::Gdk::keyboard_grab($self->{_prop_window}->get_window, 0, Gtk3::get_current_event_time()); } #abort screenshot } elsif ($event->keyval == Gtk3::Gdk::keyval_from_name('Escape')) { $self->quit; #move / resize selector } elsif ($event->keyval == Gtk3::Gdk::keyval_from_name('Up')) { if ($event->state >= 'control-mask' && $s) { $s->{height} -= 1; $self->{_selector}->set_selection($s); $self->{_gdk_display}->warp_pointer($self->{_gdk_screen}, $s->{width} + $s->{x}, $s->{height} + $s->{y}); } elsif ($event->state >= 'mod1-mask' && $s) { $s->{y} -= 1; $self->{_selector}->set_selection($s); $self->{_gdk_display}->warp_pointer($self->{_gdk_screen}, $s->{x}, $s->{y}); } else { $self->{_gdk_display}->warp_pointer($self->{_gdk_screen}, $x, $y - 1); } } elsif ($event->keyval == Gtk3::Gdk::keyval_from_name('Down')) { if ($event->state >= 'control-mask' && $s) { $s->{height} += 1; $self->{_selector}->set_selection($s); $self->{_gdk_display}->warp_pointer($self->{_gdk_screen}, $s->{width} + $s->{x}, $s->{height} + $s->{y}); } elsif ($event->state >= 'control-mask') { $self->{_selector}->set_selection({x=>$x, y=>$y, width=>1, height=>2}); $self->{_gdk_display}->warp_pointer($self->{_gdk_screen}, $x + 1, $y + 2); } elsif ($event->state >= 'mod1-mask' && $s) { $s->{y} += 1; $self->{_selector}->set_selection($s); $self->{_gdk_display}->warp_pointer($self->{_gdk_screen}, $s->{x}, $s->{y}); } else { $self->{_gdk_display}->warp_pointer($self->{_gdk_screen}, $x, $y + 1); } } elsif ($event->keyval == Gtk3::Gdk::keyval_from_name('Left')) { if ($event->state >= 'control-mask' && $s) { $s->{width} -= 1; $self->{_selector}->set_selection($s); $self->{_gdk_display}->warp_pointer($self->{_gdk_screen}, $s->{width} + $s->{x}, $s->{height} + $s->{y}); } elsif ($event->state >= 'mod1-mask' && $s) { $s->{x} -= 1; $self->{_selector}->set_selection($s); $self->{_gdk_display}->warp_pointer($self->{_gdk_screen}, $s->{x}, $s->{y}); } else { $self->{_gdk_display}->warp_pointer($self->{_gdk_screen}, $x - 1, $y); } } elsif ($event->keyval == Gtk3::Gdk::keyval_from_name('Right')) { if ($event->state >= 'control-mask' && $s) { $s->{width} += 1; $self->{_selector}->set_selection($s); $self->{_gdk_display}->warp_pointer($self->{_gdk_screen}, $s->{width} + $s->{x}, $s->{height} + $s->{y}); } elsif ($event->state >= 'control-mask') { $self->{_selector}->set_selection({x=>$x, y=>$y, width=>2, height=>1}); $self->{_gdk_display}->warp_pointer($self->{_gdk_screen}, $x + 2, $y + 1); } elsif ($event->state >= 'mod1-mask' && $s) { $s->{x} += 1; $self->{_selector}->set_selection($s); $self->{_gdk_display}->warp_pointer($self->{_gdk_screen}, $s->{x}, $s->{y}); } else { $self->{_gdk_display}->warp_pointer($self->{_gdk_screen}, $x + 1, $y); } #zoom in } elsif ($event->keyval == Gtk3::Gdk::keyval_from_name('KP_Add') || $event->keyval == Gtk3::Gdk::keyval_from_name('plus') || $event->keyval == Gtk3::Gdk::keyval_from_name('equal')) { if ($event->state >= 'control-mask') { $self->{_view}->zoom_in; } #zoom out } elsif ($event->keyval == Gtk3::Gdk::keyval_from_name('KP_Subtract') || $event->keyval == Gtk3::Gdk::keyval_from_name('minus')) { if ($event->state >= 'control-mask') { $self->{_view}->zoom_out; } #zoom normal } elsif ($event->keyval == Gtk3::Gdk::keyval_from_name('0')) { if ($event->state >= 'control-mask') { $self->{_view}->set_zoom(1); } #take screenshot } elsif ($event->keyval == Gtk3::Gdk::keyval_from_name('Return') || $event->keyval == Gtk3::Gdk::keyval_from_name('KP_Enter')) { $self->{_select_window}->hide; $self->{_zoom_window}->hide; $self->{_prop_window}->hide; #A short timeout to give the server a chance to #redraw the area Glib::Timeout->add( $self->{_hide_time}, sub { Gtk3->main_quit; return FALSE; }); Gtk3->main(); $output = $self->take_screenshot($s, $clean_pixbuf); $self->quit; } }); my $status = Gtk3::Gdk::keyboard_grab($self->{_select_window}->get_window, 0, Gtk3::get_current_event_time()); #~ if($status eq 'success'){ if ($self->{_zoom_active}) { $self->{_zoom_window}->show_all; $self->{_zoom_window}->get_window->set_override_redirect(TRUE); $self->zoom_check_pos(); $self->{_zoom_window}->get_window->raise; } Gtk3->main(); #~ }else{ #~ $output = 1; #~ $self->clean; #~ } return $output; } sub zoom_check_pos { my $self = shift; my $s = $self->{_selector}->get_selection; my $v = $self->{_view}->get_viewport; return FALSE unless defined $v; my ($window_at_pointer, $x, $y, $mask) = $self->{_root}->get_pointer; #event coordinates my $zoom = $self->{_view}->get_zoom; my $ev_x = int($v->{x} / $zoom + $x * $self->{_dpi_scale} / $zoom); my $ev_y = int($v->{y} / $zoom + $y * $self->{_dpi_scale} / $zoom); my ($zw, $zh) = $self->{_zoom_window}->get_size; my ($zx, $zy) = $self->{_zoom_window}->get_position; my $distance = 50 * $self->{_dpi_scale}; my $zzw = $zw * $self->{_dpi_scale} + $distance; my $zzh = $zh * $self->{_dpi_scale} + $distance; my $sregion = undef; if (defined $s) { $sregion = Cairo::Region->create({x=>$s->{x}, y=>$s->{y}, width=>$s->{width} + $distance, height=>$s->{height} + $distance}); } else { $sregion = Cairo::Region->create({x=>$ev_x, y=>$ev_y, width=>$distance, height=>$distance}); } my $otype = $sregion->contains_rectangle({x=>$zx, y=>$zy, width=>$zzw, height=>$zzh}); if ($otype eq 'in' || $otype eq 'part' || !$self->{_zoom_window}->get_visible) { my $moved = FALSE; #possible positions if we need to move the zoom window my @pos = ( {x=>$self->{_root}->{x}, y=>$self->{_root}->{y}, }, {x=>$self->{_root}->{x}, y=>$self->{_root}->{h} - $zh}, {x=>$self->{_root}->{w} - $zw, y=>$self->{_root}->{y}, }, {x=>$self->{_root}->{w} - $zw, y=>$self->{_root}->{h} - $zh}); foreach (@pos) { my $otypet = $sregion->contains_rectangle({x=>$_->{x}*$self->{_dpi_scale}, y=>$_->{y}*$self->{_dpi_scale}, width=>$zzw, height=>$zzh}); if ($otypet eq 'out') { $self->{_zoom_window}->move($_->{x}, $_->{y}); $self->{_zoom_window}->show_all; $moved = TRUE; last; } } #if window could not be moved without covering the selection area unless ($moved) { $moved = FALSE; $self->{_zoom_window}->hide; } } } sub adjust_prop_values { my $self = shift; #block 'value-change' handlers for widgets #so we do not apply the changes twice $self->{_x_spin_w}->signal_handler_block($self->{_x_spin_w_handler}); $self->{_y_spin_w}->signal_handler_block($self->{_y_spin_w_handler}); $self->{_width_spin_w}->signal_handler_block($self->{_width_spin_w_handler}); $self->{_height_spin_w}->signal_handler_block($self->{_height_spin_w_handler}); my $s = $self->{_selector}->get_selection; if ($s) { $self->{_x_spin_w}->set_value($s->{x}); $self->{_x_spin_w}->set_range(0, $self->{_root}->{w} - $s->{width}); $self->{_y_spin_w}->set_value($s->{y}); $self->{_y_spin_w}->set_range(0, $self->{_root}->{h} - $s->{height}); $self->{_width_spin_w}->set_value($s->{width}); $self->{_width_spin_w}->set_range(0, $self->{_root}->{w} - $s->{x}); $self->{_height_spin_w}->set_value($s->{height}); $self->{_height_spin_w}->set_range(0, $self->{_root}->{h} - $s->{y}); } #unblock 'value-change' handlers for widgets $self->{_x_spin_w}->signal_handler_unblock($self->{_x_spin_w_handler}); $self->{_y_spin_w}->signal_handler_unblock($self->{_y_spin_w_handler}); $self->{_width_spin_w}->signal_handler_unblock($self->{_width_spin_w_handler}); $self->{_height_spin_w}->signal_handler_unblock($self->{_height_spin_w_handler}); return TRUE; } sub select_dialog { my $self = shift; my $d = $self->{_sc}->get_gettext; #current selection my $s = $self->{_selector}->get_selection; my $sx = 0; my $sy = 0; my $sw = 0; my $sh = 0; if (defined $s) { $sx = $s->{x}; $sy = $s->{y}; $sw = $s->{width}; $sh = $s->{height}; } sub value_callback { $self->{_selector} ->set_selection({x=>$self->{_x_spin_w}->get_value, y=>$self->{_y_spin_w}->get_value, width=>$self->{_width_spin_w}->get_value, height=>$self->{_height_spin_w}->get_value}); } #X my $xw_label = Gtk3::Label->new($d->get("X") . ":"); $self->{_x_spin_w} = Gtk3::SpinButton->new_with_range(0, $self->{_root}->{w}, 1); $self->{_x_spin_w}->set_value($sx); $self->{_x_spin_w_handler} = $self->{_x_spin_w}->signal_connect( 'value-changed' => \&value_callback); my $xw_hbox = Gtk3::HBox->new(FALSE, 5); $xw_hbox->pack_start($xw_label, FALSE, FALSE, 5); $xw_hbox->pack_start($self->{_x_spin_w}, FALSE, FALSE, 5); #y my $yw_label = Gtk3::Label->new($d->get("Y") . ":"); $self->{_y_spin_w} = Gtk3::SpinButton->new_with_range(0, $self->{_root}->{h}, 1); $self->{_y_spin_w}->set_value($sy); $self->{_y_spin_w_handler} = $self->{_y_spin_w}->signal_connect( 'value-changed' => \&value_callback); my $yw_hbox = Gtk3::HBox->new(FALSE, 5); $yw_hbox->pack_start($yw_label, FALSE, FALSE, 5); $yw_hbox->pack_start($self->{_y_spin_w}, FALSE, FALSE, 5); #width my $widthw_label = Gtk3::Label->new($d->get("Width") . ":"); $self->{_width_spin_w} = Gtk3::SpinButton->new_with_range(0, $self->{_root}->{w}, 1); $self->{_width_spin_w}->set_value($sw); $self->{_width_spin_w_handler} = $self->{_width_spin_w}->signal_connect( 'value-changed' => \&value_callback); my $ww_hbox = Gtk3::HBox->new(FALSE, 5); $ww_hbox->pack_start($widthw_label, FALSE, FALSE, 5); $ww_hbox->pack_start($self->{_width_spin_w}, FALSE, FALSE, 5); #height my $heightw_label = Gtk3::Label->new($d->get("Height") . ":"); $self->{_height_spin_w} = Gtk3::SpinButton->new_with_range(0, $self->{_root}->{h}, 1); $self->{_height_spin_w}->set_value($sh); $self->{_height_spin_w_handler} = $self->{_height_spin_w}->signal_connect( 'value-changed' => \&value_callback); my $hw_hbox = Gtk3::HBox->new(FALSE, 5); $hw_hbox->pack_start($heightw_label, FALSE, FALSE, 5); $hw_hbox->pack_start($self->{_height_spin_w}, FALSE, FALSE, 5); my $prop_dialog = Gtk3::Window->new('toplevel'); $prop_dialog->set_modal(TRUE); $prop_dialog->set_decorated(FALSE); $prop_dialog->set_skip_taskbar_hint(TRUE); $prop_dialog->set_skip_pager_hint(TRUE); $prop_dialog->set_keep_above(TRUE); $prop_dialog->set_accept_focus(TRUE); $prop_dialog->set_resizable(FALSE); $prop_dialog->signal_connect( 'key-press-event' => sub { my $window = shift; my $event = shift; #toggle zoom window if ($event->keyval == Gtk3::Gdk::keyval_from_name('Space')) { if ($self->{_zoom_active}) { $self->{_zoom_window}->hide; $self->{_zoom_active} = FALSE; } elsif ($self->{_view}->get_zoom == 1) { $self->zoom_check_pos(); $self->{_zoom_active} = TRUE; } #toggle prop dialog } elsif ($event->keyval == Gtk3::Gdk::keyval_from_name('Shift_L') || $event->keyval == Gtk3::Gdk::keyval_from_name('Shift_R')) { if ($self->{_prop_active}) { Gtk3::Gdk::keyboard_ungrab(Gtk3::get_current_event_time()); $self->{_prop_window}->hide; $self->{_prop_active} = FALSE; Gtk3::Gdk::keyboard_grab($self->{_select_window}->get_window, 0, Gtk3::get_current_event_time()); } else { Gtk3::Gdk::keyboard_ungrab(Gtk3::get_current_event_time()); my ($window_at_pointer, $x, $y, $mask) = $self->{_root}->get_pointer; $self->{_prop_window}->move($x, $y); $self->{_prop_window}->show_all; $self->{_prop_active} = TRUE; Gtk3::Gdk::keyboard_grab($self->{_prop_window}->get_window, 0, Gtk3::get_current_event_time()); } #abort screenshot } elsif ($event->keyval == Gtk3::Gdk::keyval_from_name('Escape')) { $self->quit; } }); my $hide_btn = Gtk3::Button->new_with_mnemonic($d->get("_Hide")); $hide_btn->set_image(Gtk3::Image->new_from_stock('gtk-close', 'button')); $hide_btn->set_can_default(TRUE); $hide_btn->signal_connect( 'clicked' => sub { Gtk3::Gdk::keyboard_ungrab(Gtk3::get_current_event_time()); $prop_dialog->hide; $self->{_prop_active} = FALSE; Gtk3::Gdk::keyboard_grab($self->{_select_window}->get_window, 0, Gtk3::get_current_event_time()); }); #final_packing #all labels = one size $xw_label->set_alignment(0, 0.5); $yw_label->set_alignment(0, 0.5); $widthw_label->set_alignment(0, 0.5); $heightw_label->set_alignment(0, 0.5); my $sg_main = Gtk3::SizeGroup->new('horizontal'); $sg_main->add_widget($xw_label); $sg_main->add_widget($yw_label); $sg_main->add_widget($widthw_label); $sg_main->add_widget($heightw_label); my $vbox = Gtk3::VBox->new(FALSE, 5); $vbox->pack_start($xw_hbox, FALSE, FALSE, 3); $vbox->pack_start($yw_hbox, FALSE, FALSE, 3); $vbox->pack_start($ww_hbox, FALSE, FALSE, 3); $vbox->pack_start($hw_hbox, FALSE, FALSE, 3); $vbox->pack_start($hide_btn, FALSE, FALSE, 3); #nice frame as well my $frame_label = Gtk3::Label->new; $frame_label->set_markup("" . $d->get("Selection") . ""); my $frame = Gtk3::Frame->new(); $frame->set_border_width(5); $frame->set_label_widget($frame_label); $frame->set_shadow_type('none'); $frame->add($vbox); $prop_dialog->add($frame); $prop_dialog->realize; $prop_dialog->set_transient_for($self->{_select_window}); $prop_dialog->get_window->set_override_redirect(TRUE); return $prop_dialog; } sub take_screenshot { my $self = shift; my $s = shift; my $clean_pixbuf = shift; my $d = $self->{_sc}->get_gettext; my $output; #no delay? then we take a subsection of the pixbuf in memory if ($s && $clean_pixbuf && $self->{_delay} == 0) { $output = $clean_pixbuf->new_subpixbuf($s->{x}, $s->{y}, $s->{width}, $s->{height}); #include cursor if ($self->{_include_cursor}) { $output = $self->include_cursor($s->{x}, $s->{y}, $s->{width}, $s->{height}, $self->{_root}, $output); } #if there is a delay != 0 set, we have to wait and get a new pixbuf from the root window } elsif ($s && $self->{_delay} != 0) { ($output) = $self->get_pixbuf_from_drawable($self->{_root}, $s->{x}, $s->{y}, $s->{width}, $s->{height}); #section not valid } else { $output = 0; } #we don't have a useful string for wildcards (e.g. $name) if ($output =~ /Gtk3/) { $self->{_action_name} = $d->get("Selection"); } #set history object if ($s) { $self->{_history} = Shutter::Screenshot::History->new($self->{_sc}, $self->{_root}, $s->{x}, $s->{y}, $s->{width}, $s->{height}); } return $output; } sub redo_capture { my $self = shift; my $output = 3; if (defined $self->{_history}) { ($output) = $self->get_pixbuf_from_drawable($self->{_history}->get_last_capture); } return $output; } sub get_history { my $self = shift; return $self->{_history}; } sub get_error_text { my $self = shift; return $self->{_error_text}; } sub get_action_name { my $self = shift; return $self->{_action_name}; } sub quit { my $self = shift; $self->ungrab_pointer_and_keyboard(FALSE, FALSE, TRUE); $self->clean; } sub clean { my $self = shift; $self->{_selector}->signal_handler_disconnect($self->{_selector_handler}); $self->{_view}->signal_handler_disconnect($self->{_view_zoom_handler}); $self->{_view}->signal_handler_disconnect($self->{_view_button_handler}); $self->{_view}->signal_handler_disconnect($self->{_view_event_handler}); $self->{_select_window}->signal_handler_disconnect($self->{_key_handler}); $self->{_select_window}->destroy; $self->{_zoom_window}->destroy; $self->{_prop_window}->destroy; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Screenshot/SelectorAuto.pm000066400000000000000000000047631476102223600303360ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Screenshot::SelectorAuto; #modules #-------------------------------------- use utf8; use strict; use warnings; use Shutter::Screenshot::Main; use Shutter::Screenshot::History; use Data::Dumper; our @ISA = qw(Shutter::Screenshot::Main); #Glib use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; #call constructor of super class (shutter_common, include_cursor, delay, notify_timeout) my $self = $class->SUPER::new(shift, shift, shift, shift); bless $self, $class; return $self; } sub select_auto { my $self = shift; my $x = shift; my $y = shift; my $width = shift; my $height = shift; my $d = $self->{_sc}->get_gettext; my $output; if ($x>=0 && $y>=0 && $width && $height) { ($output) = $self->get_pixbuf_from_drawable($self->{_root}, $x, $y, $width, $height); #section not valid } else { $output = 0; } #we don't have a useful string for wildcards (e.g. $name) if ($output =~ /Gtk3/) { $self->{_action_name} = $d->get("Selection"); } #set history object if ($output) { $self->{_history} = Shutter::Screenshot::History->new($self->{_sc}, $self->{_root}, $x, $y, $width, $height); } return $output; } sub redo_capture { my $self = shift; my $output = 3; if (defined $self->{_history}) { ($output) = $self->get_pixbuf_from_drawable($self->{_history}->get_last_capture); } return $output; } sub get_history { my $self = shift; return $self->{_history}; } sub get_error_text { my $self = shift; return $self->{_error_text}; } sub get_action_name { my $self = shift; return $self->{_action_name}; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Screenshot/Wayland.pm000066400000000000000000000031721476102223600273150ustar00rootroot00000000000000use utf8; use strict; use warnings; use Net::DBus; use Net::DBus::Reactor; package Shutter::Screenshot::Wayland; sub xdg_portal { my $screenshooter = shift; my $reactor = Net::DBus::Reactor->main; my $bus = Net::DBus->find; my $me = $bus->get_unique_name; $me =~ s/\./_/g; $me =~ s/^://g; my $pixbuf; eval { my $portal_service = $bus->get_service('org.freedesktop.portal.Desktop'); my $portal = $portal_service->get_object('/org/freedesktop/portal/desktop', 'org.freedesktop.portal.Screenshot'); my $num; my $output; my $cb = sub { ($num, $output) = @_; $reactor->shutdown; }; my $token = 'shutter' . rand; $token =~ s/\.//g; my $request = $portal_service->get_object("/org/freedesktop/portal/desktop/request/$me/$token", 'org.freedesktop.portal.Request'); my $conn = $request->connect_to_signal(Response => $cb); my $request_path = $portal->Screenshot('', {handle_token=>$token}); if ($request->get_object_path ne $request_path) { $request->disconnect_from_signal(Response => $conn); $request = $portal_service->get_object($request_path, 'org.freedesktop.portal.Request'); $conn = $request->connect_to_signal(Response => $cb); } $reactor->run; $request->disconnect_from_signal(Response => $conn); if ($num != 0) { $screenshooter->{_error_text} = "Response $num from XDG portal"; return 9; } my $giofile = Glib::IO::File::new_for_uri($output->{uri}); print "xdg portal: got file ".$giofile->get_path."\n"; $pixbuf = Gtk3::Gdk::Pixbuf->new_from_file($giofile->get_path); $giofile->delete; }; if ($@) { $screenshooter->{_error_text} = $@; return 9; }; return $pixbuf; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Screenshot/Web.pm000066400000000000000000000206331476102223600264340ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Screenshot::Web; #modules #-------------------------------------- use utf8; use strict; use warnings; use Proc::Killfam; use File::Temp qw/ tempfile tempdir /; #timing issues use Time::HiRes qw/ time usleep /; use Shutter::Screenshot::History; #Glib and Gtk3 use Gtk3; use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; my $sc = shift; my $self = { _sc => $sc, _timeout => shift, _width => shift, _shf => Shutter::App::HelperFunctions->new($sc), }; bless $self, $class; return $self; } #~ sub DESTROY { #~ my $self = shift; #~ print "$self dying at\n"; #~ } sub web { my $self = shift; #use http:// when nothing provided unless ($self->{_url} =~ /^(http\:\/\/|https\:\/\/|file\:\/\/)/i) { $self->{_url} = "http://" . $self->{_url}; } system('gnome-web-photo', '--timeout=' . $self->{_timeout}, '--mode=photo', '--width=' . $self->{_width}, $self->{_url}, $self->{_dest_filename}); return TRUE; } sub dlg_website { my $self = shift; my $url = shift; #gettext my $d = $self->{_sc}->get_gettext; #load modules at custom path #-------------------------------------- require lib; import lib $self->{_sc}->get_root . "/share/shutter/resources/modules"; require Proc::Simple; my $output = 6; my $web_process = Proc::Simple->new; #gwp result will be saved to tempfile my ($tmpfh, $tmpfilename) = tempfile(UNLINK => 1); #redirect outputs my ($tmpfh_stdout, $tmpfilename_stdout) = tempfile(UNLINK => 1); my ($tmpfh_stderr, $tmpfilename_sterr) = tempfile(UNLINK => 1); #~ $web_process->redirect_output ("$ENV{'HOME'}/shutter-debug-stdout.log", "$ENV{'HOME'}/shutter-debug-err.log"); $web_process->redirect_output($tmpfilename_stdout, $tmpfilename_sterr); my $website_dialog = Gtk3::MessageDialog->new($self->{_sc}->get_mainwindow, [qw/modal destroy-with-parent/], 'other', 'none', undef); $website_dialog->set_title("Shutter"); $website_dialog->set('text' => $d->get("Take a screenshot of a website")); $website_dialog->set('secondary-text' => $d->get("URL to capture") . ": "); if ($self->{_sc}->get_theme->has_icon('web-browser')) { $website_dialog->set('image' => Gtk3::Image->new_from_icon_name('web-browser', 'dialog')); } else { $website_dialog->set('image' => Gtk3::Image->new_from_pixbuf(Gtk3::Gdk::Pixbuf->new_from_file_at_size($self->{_sc}->get_root . "/share/shutter/resources/icons/web_image.svg", $self->{_shf}->icon_size('dialog')))); } #cancel button my $cancel_btn = Gtk3::Button->new_from_stock('gtk-cancel'); #capture button my $execute_btn = Gtk3::Button->new_with_mnemonic($d->get("C_apture")); $execute_btn->set_image(Gtk3::Image->new_from_stock('gtk-execute', 'button')); $execute_btn->set_sensitive(FALSE); $execute_btn->set_can_default(TRUE); $website_dialog->add_action_widget($cancel_btn, 'cancel'); $website_dialog->add_action_widget($execute_btn, 'accept'); $website_dialog->set_default_response('accept'); my $website_hbox = Gtk3::HBox->new(); my $website_hbox2 = Gtk3::HBox->new(); my $website = Gtk3::Entry->new; $website->set_activates_default(TRUE); #check if url is valid $website->signal_connect( 'changed' => sub { unless ($website->get_text) { $execute_btn->set_sensitive(FALSE); } else { $execute_btn->set_sensitive(TRUE); } return FALSE; }); my $clipboard = Gtk3::Clipboard::get($Gtk3::Gdk::SELECTION_CLIPBOARD); my $clipboard_string = $clipboard->wait_for_text; print "Content of clipboard is: $clipboard_string\n" if $self->{_sc}->get_debug and defined $clipboard_string; #set textbox to url if (defined $url) { $website->set_text($url); #or paste clipboard content } else { if (defined $clipboard_string) { if ( $clipboard_string =~ /^http/ || $clipboard_string =~ /^file/ || $clipboard_string =~ /^www\./) { $website->set_text($clipboard_string); } } } $website_hbox->pack_start($website, TRUE, TRUE, 12); $website_dialog->get_child->add($website_hbox); my $website_progress = Gtk3::ProgressBar->new; $website_progress->set_no_show_all(TRUE); $website_progress->set_ellipsize('middle'); $website_progress->set_orientation('horizontal'); $website_progress->set_fraction(0); $website_hbox2->pack_start($website_progress, TRUE, TRUE, 12); $website_dialog->get_child->add($website_hbox2); $website_dialog->show_all; my $website_response = "accept"; if ($url) { $website_dialog->response("accept"); } else { $website_response = $website_dialog->run; } if ($website_response eq "accept") { $execute_btn->set_sensitive(FALSE); #show progress bar while executing gnome-web-photo $website_progress->show; $self->update_gui(); #set url and filename $self->{_url} = $website->get_text; $self->{_dest_filename} = $tmpfilename; print "gnome-web-photo --timeout=$self->{_timeout} --mode=photo --width=$self->{_width} '$self->{_url}' '$self->{_dest_filename}'\n" if $self->{_sc}->get_debug; Proc::Simple::debug(1) if $self->{_sc}->get_debug; $web_process->start( sub { #cleanup when catching TERM $SIG{TERM} = sub { killfam 'TERM', $$; }; #start gnome-web-photo $self->web(); POSIX::_exit(0); }); $website_dialog->signal_connect( 'delete-event' => sub { #kill process $web_process->kill; $output = 5; }); $cancel_btn->signal_connect( 'clicked' => sub { #kill process $web_process->kill; $output = 5; }); while ($web_process->poll) { $website_progress->pulse; $self->update_gui(); usleep 100000; } #we cannot kill the process anymore #closing the dialog will confuse the user #because the image will appear in the session later on $cancel_btn->set_sensitive(FALSE); $self->update_gui(); #exit status == OK if ($web_process->exit_status() == 0) { $website_progress->set_fraction(2 / 3); $self->update_gui(); eval { $output = Gtk3::Gdk::Pixbuf->new_from_file($tmpfilename) }; if ($@) { #reading stdout from file while (<$tmpfh_stdout>) { $self->{_error_text} .= $_; } #reading stderr from file while (<$tmpfh_stderr>) { $self->{_error_text} .= $_; } unlink $tmpfilename, $tmpfilename_stdout, $tmpfilename_sterr; $website_dialog->destroy(); } else { #set name of the captured window #e.g. for use in wildcards $self->{_action_name} = $self->{_url}; $self->{_action_name} =~ s/(http:\/\/|https:\/\/|file:\/\/)//g; #set history object $self->{_history} = Shutter::Screenshot::History->new($self->{_sc}); } $website_progress->set_fraction(3 / 3); $self->update_gui(); #exit status == FAIL } else { #reading stdout from file while (<$tmpfh_stdout>) { $self->{_error_text} .= $_; } #reading stderr from file while (<$tmpfh_stderr>) { $self->{_error_text} .= $_; } } #kill process, destroy dialog $web_process->kill('SIGKILL'); $website_dialog->destroy(); return $output; } else { #kill process, destroy dialog $web_process->kill('SIGKILL'); $website_dialog->destroy(); return 5; } } sub update_gui { my $self = shift; while (Gtk3::events_pending()) { Gtk3::main_iteration(); } Gtk3::Gdk::flush(); return TRUE; } sub redo_capture { my $self = shift; my $output = 3; if (defined $self->{_history}) { $output = $self->dlg_website($self->{_url}); } return $output; } sub get_history { my $self = shift; return $self->{_history}; } sub get_error_text { my $self = shift; return $self->{_error_text}; } sub get_action_name { my $self = shift; return $self->{_action_name}; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Screenshot/Window.pm000066400000000000000000001163301476102223600271660ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Screenshot::Window; #modules #-------------------------------------- use utf8; use strict; use warnings; #File operations use IO::File(); use Shutter::Screenshot::Main; use Shutter::Screenshot::History; use Data::Dumper; our @ISA = qw(Shutter::Screenshot::Main); #Glib use Gtk3; use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; #call constructor of super class (shutter_common, include_cursor, delay, notify_timeout) my $self = $class->SUPER::new(shift, shift, shift, shift); #get params $self->{_include_border} = shift; $self->{_windowresize} = shift; $self->{_windowresize_w} = shift; $self->{_windowresize_h} = shift; $self->{_hide_time} = shift; #a short timeout to give the server a chance to redraw the area that was obscured $self->{_mode} = shift; $self->{_auto_shape} = shift; #shape the window without XShape support $self->{_is_hidden} = shift; $self->{_show_visible} = shift; #show user-visible windows only when selecting a window $self->{_ignore_type} = shift; #Ignore possibly wrong type hints #X11 protocol and XSHAPE ext require X11::Protocol; $self->{_x11} = X11::Protocol->new($ENV{'DISPLAY'}); $self->{_x11}{ext_shape} = $self->{_x11}->init_extension('SHAPE'); #main window $self->{_main_gtk_window} = $self->{_sc}->get_mainwindow; $self->{_dpi_scale} = $self->{_main_gtk_window}->get('scale-factor'); #only used when selecting a window if (defined $self->{_mode} && $self->{_mode} =~ m/(window|section)/ig) { #check if compositing is available my $compos = $self->{_main_gtk_window}->get_screen->is_composited; #higlighter (borderless gtk window) $self->{_highlighter} = Gtk3::Window->new('popup'); if ($compos) { my $screen = $self->{_main_gtk_window}->get_screen; # Glib::Object::Introspection doesn't support method call via # cross-package inheritance, call it as a free function instead # (X11Screen inherits from Screen) $self->{_highlighter}->set_visual(Gtk3::Gdk::Screen::get_rgba_visual($screen) || Gtk3::Gdb::Screen::get_system_visual($screen)); } $self->{_highlighter}->set_app_paintable(TRUE); $self->{_highlighter}->set_decorated(FALSE); $self->{_highlighter}->set_skip_taskbar_hint(TRUE); $self->{_highlighter}->set_skip_pager_hint(TRUE); $self->{_highlighter}->set_keep_above(TRUE); $self->{_highlighter}->set_accept_focus(FALSE); #obtain current colors and font_desc from the main window my $style = $self->{_main_gtk_window}->get_style_context; my $sel_bg = $style->get_background_color('selected'); my $font_fam = $style->get_font('normal')->get_family; my $font_size = $style->get_font('normal')->get_size / Pango->scale; #get current monitor my $mon = $self->get_current_monitor; $self->{_highlighter_expose} = $self->{_highlighter}->signal_connect( 'draw' => sub { return FALSE unless $self->{_highlighter}->get_window; #Place window and resize it $self->{_highlighter}->get_window->move_resize($self->{_c}{'cw'}{'x'} / $self->{_dpi_scale} - 3, $self->{_c}{'cw'}{'y'} / $self->{_dpi_scale} - 3, $self->{_c}{'cw'}{'width'} / $self->{_dpi_scale} + 6, $self->{_c}{'cw'}{'height'} / $self->{_dpi_scale} + 6); print $self->{_c}{'cw'}{'window'}->get_name, "\n" if $self->{_sc}->get_debug; my $text = Glib::Markup::escape_text($self->{_c}{'cw'}{'window'}->get_name); utf8::decode $text; my $sec_text = "\n" . $self->{_c}{'cw'}{'width'} . "x" . $self->{_c}{'cw'}{'height'}; #window size and position my ($w, $h) = $self->{_highlighter}->get_size; my ($x, $y) = $self->{_highlighter}->get_position; #app icon my $icon = $self->{_c}{'cw'}{'window'}->get_icon; #create cairo context my $cr = $_[1]; #pango layout my $layout = Pango::Cairo::create_layout($cr); $layout->set_width(($w - $icon->get_width - $font_size * 3) * Pango->scale); $layout->set_alignment('left'); $layout->set_wrap('char'); #warning if there are no subwindows #when we are in section mode and #a toplevel window was already selected if ($self->{_c}{'ws'}) { my $xwindow = $self->{_c}{'ws'}->get_xid; if (scalar @{$self->{_c}{'cw'}{$xwindow}} <= 1) { #error icon $icon = Gtk3::Widget::render_icon(Gtk3::Invisible->new, "gtk-dialog-error", 'dialog'); #error message my $d = $self->{_sc}->get_gettext; $text = $d->get("No subwindow detected"); $sec_text = "\n" . $d->get("Maybe this window is using client-side windows (or similar).\nShutter is not yet able to query the tree information of such windows."); #wrap nicely $layout->set_wrap('word-char'); } } #set text $layout->set_markup( "$text$sec_text"); #get layout size my ($lw, $lh) = $layout->get_pixel_size; #adjust values $lw += $icon->get_width; $lh = $icon->get_height if $icon->get_height > $lh; #calculate values for rounded/shaped rectangle my $wi = $lw + $font_size * 3; my $hi = $lh + $font_size * 2; my $xi = int(($w - $wi) / 2); my $yi = int(($h - $hi) / 2); my $ri = 20; #two different ways - compositing or not if ($compos) { #fill window $cr->set_operator('source'); $cr->set_source_rgba($sel_bg->red, $sel_bg->green, $sel_bg->blue, 0.3); $cr->paint; #Parent window with text and icon if ($self->{_c}{'cw'}{'is_parent'}) { $cr->set_operator('over'); #create small frame (window outlines) $cr->set_source_rgba($sel_bg->red, $sel_bg->green, $sel_bg->blue, 0.75); $cr->set_line_width(6); $cr->rectangle(0, 0, $w, $h); $cr->stroke; if ($lw <= $w && $lh <= $h) { #rounded rectangle to display the window name $cr->move_to($xi + $ri, $yi); $cr->line_to($xi + $wi - $ri, $yi); $cr->curve_to($xi + $wi, $yi, $xi + $wi, $yi, $xi + $wi, $yi + $ri); $cr->line_to($xi + $wi, $yi + $hi - $ri); $cr->curve_to($xi + $wi, $yi + $hi, $xi + $wi, $yi + $hi, $xi + $wi - $ri, $yi + $hi); $cr->line_to($xi + $ri, $yi + $hi); $cr->curve_to($xi, $yi + $hi, $xi, $yi + $hi, $xi, $yi + $hi - $ri); $cr->line_to($xi, $yi + $ri); $cr->curve_to($xi, $yi, $xi, $yi, $xi + $ri, $yi); $cr->fill; #app icon Gtk3::Gdk::cairo_set_source_pixbuf($cr, $icon, $xi + $font_size, $yi + $font_size); $cr->paint; #draw the pango layout $cr->move_to($xi + $font_size * 2 + $icon->get_width, $yi + $font_size); Pango::Cairo::show_layout($cr, $layout); } } else { #create small frame $cr->set_source_rgba($sel_bg->red, $sel_bg->green, $sel_bg->blue, 0.75); $cr->set_line_width(6); $cr->rectangle(0, 0, $w, $h); $cr->stroke; } #no compositing } else { #fill window $cr->set_operator('over'); $cr->set_source_rgba($sel_bg->red, $sel_bg->green, $sel_bg->blue, 0.75); $cr->paint; #Parent window with text and icon if ($self->{_c}{'cw'}{'is_parent'}) { if ($lw <= $w && $lh <= $h) { #app icon Gtk3::Gdk::cairo_set_source_pixbuf($cr, $icon, $xi + $font_size, $yi + $font_size); $cr->paint; #draw the pango layout $cr->move_to($xi + $font_size * 2 + $icon->get_width, $yi + $font_size); Pango::Cairo::show_layout($cr, $layout); } } my $shape_region1 = Cairo::Region->create({ x=>0, y=>0, width=>$w, height=>$h, }); my $shape_region2 = Cairo::Region->create({ x=>3, y=>3, width=>$w - 6, height=>$h - 6, }); my $shape_region3 = Cairo::Region->create({ x=>$xi, y=>$yi, width=>$wi, height=>$hi, }); #Parent window with text and icon if ($self->{_c}{'cw'}{'is_parent'}) { if ($lw <= $w && $lh <= $h) { $shape_region2->subtract($shape_region3); } } $shape_region1->subtract($shape_region2); $self->{_highlighter}->get_window->shape_combine_region($shape_region1, 0, 0); } return TRUE; }); } bless $self, $class; return $self; } #~ sub DESTROY { #~ my $self = shift; #~ print "$self dying at\n"; #~ } #~ sub find_wm_window { my $self = shift; my $xid = shift; do { my ($qroot, $qparent, @qkids) = $self->{_x11}->QueryTree($xid); return undef unless ($qroot || $qparent); return $xid if ($qroot == $qparent); $xid = $qparent; } while (TRUE); } sub get_shape { my $self = shift; my $xid = shift; my $orig = shift; my $l_cropped = shift; my $r_cropped = shift; my $t_cropped = shift; my $b_cropped = shift; print "$l_cropped, $r_cropped, $t_cropped, $b_cropped cropped\n" if $self->{_sc}->get_debug; print "Calculating window shape\n" if $self->{_sc}->get_debug; #check if extenstion is available and use it my ($ordering, @r) = (undef, undef); if ($self->{_x11}{ext_shape}) { ($ordering, @r) = $self->{_x11}->ShapeGetRectangles($self->find_wm_window($xid), 'Bounding'); } my $manually_shaped = FALSE; #create shape manually when option is set and the shape was not detected automatically if (scalar @r <= 1 && defined $self->{_auto_shape} && $self->{_auto_shape}) { my $shf = Shutter::App::HelperFunctions->new($self->{_sc}); my $shape_path = undef; $shape_path = $self->{_sc}->get_root . "/share/shutter/resources/conf/shape.conf" if $shf->file_exists($self->{_sc}->get_root . "/share/shutter/resources/conf/shape.conf"); $shape_path = "$ENV{'HOME'}/.shutter/shape.conf" if $shf->file_exists("$ENV{'HOME'}/.shutter/shape.conf"); if (defined $shape_path && $shape_path) { my @fregion; my $fh = new IO::File; if ($fh->open("< $shape_path")) { while (my $line = <$fh>) { #skip on comments next if $line =~ /^#/; chomp($line); push @fregion, $line; } $fh->close; } else { print "Unable to open file $shape_path" if $self->{_sc}->get_debug; return $orig; } print "Window shape not detected - using $shape_path\n" if $self->{_sc}->get_debug; #remove current entry pop @r; my $width = $orig->get_width; my $height = $orig->get_height; foreach my $line (@fregion) { $line =~ s/width/$width/; $line =~ s/height/$height/; $line =~ s/(\d+)-(\d+)/$1-$2/eg; my @temp = split(' ', $line); push @r, \@temp; } $manually_shaped = TRUE; } else { print "Unable to locate shape.conf\n" if $self->{_sc}->get_debug; } #do nothing if there are no #shape rectangles (or only one) } elsif (scalar @r <= 1) { return $orig; } #create a region from the bounding rectangles my $bregion = Cairo::Region->create; foreach my $r (@r) { my @rect = @{$r}; next unless defined $rect[0]; next unless defined $rect[1]; next unless defined $rect[2]; next unless defined $rect[3]; unless ($manually_shaped) { #adjust rectangle if window is only partially visible if ($l_cropped) { $rect[2] -= $l_cropped - $rect[0]; $rect[0] = 0; } if ($t_cropped) { $rect[3] -= $t_cropped - $rect[1]; $rect[1] = 0; } } print "Current $rect[0],$rect[1],$rect[2],$rect[3]\n" if $self->{_sc}->get_debug; $bregion->union_rectangle({x=>$rect[0], y=>$rect[1], width=>$rect[2], height=>$rect[3]}); } if (defined $orig) { #create target pixbuf with dimensions if selected/current window my $target = Gtk3::Gdk::Pixbuf->new($orig->get_colorspace, TRUE, 8, $orig->get_width, $orig->get_height); #whole pixbuf is transparent $target->fill(0x00000000); #copy all rectangles of bounding region to the target pixbuf my $len = $bregion->num_rectangles-1; for my $i (0..$len) { my $r = $bregion->get_rectangle($i); print $r->{x} . " " . $r->{y} . " " . $r->{width} . " " . $r->{height} . "\n" if $self->{_sc}->get_debug; next if ($r->{x} > $orig->get_width); next if ($r->{y} > $orig->get_height); $r->{width} = $orig->get_width - $r->{x} if ($r->{x} + $r->{width} > $orig->get_width); $r->{height} = $orig->get_height - $r->{y} if ($r->{y} + $r->{height} > $orig->get_height); if ($r->{x} >= 0 && $r->{x} + $r->{width} <= $orig->get_width && $r->{y} >= 0 && $r->{y} + $r->{height} <= $orig->get_height) { $orig->copy_area($r->{x}, $r->{y}, $r->{width}, $r->{height}, $target, $r->{x}, $r->{y}); } else { warn "WARNING: There was an error while calculating the window shape\n"; return $orig; } } return $target; } else { return $bregion; } } sub get_window_size { my ($self, $wnck_window, $gdk_window, $border, $no_resize) = @_; #windowresize is active if ($self->{_mode} eq "window" || $self->{_mode} eq "tray_window" || $self->{_mode} eq "awindow" || $self->{_mode} eq "tray_awindow") { unless ($no_resize) { if (defined $self->{_windowresize} && $self->{_windowresize}) { #windows can usually not be resized when maximized if ($wnck_window->is_maximized) { $wnck_window->unmaximize; } $self->quit_eventh_only; Glib::Timeout->add( $self->{_hide_time}, sub { Gtk3->main_quit; return FALSE; }); Gtk3->main(); my ($xc, $yc, $wc, $hc) = $self->get_window_size($wnck_window, $gdk_window, $border, TRUE); if (defined $self->{_windowresize_w} && $self->{_windowresize} > 0) { $wc = $self->{_windowresize_w}; } if (defined $self->{_windowresize_h} && $self->{_windowresize_h} > 0) { $hc = $self->{_windowresize_h}; } if ($border) { $wnck_window->set_geometry('current', [qw/width height/], $xc, $yc, $wc, $hc); } else { $gdk_window->resize($wc, $hc); } Glib::Timeout->add( $self->{_hide_time}, sub { Gtk3->main_quit; return FALSE; }); Gtk3->main(); } } } #calculate size of the window my ($xp, $yp, $wp, $hp) = (0, 0, 0, 0); if ($border) { ($xp, $yp, $wp, $hp) = $wnck_window->get_geometry; } else { ($xp, $yp, $wp, $hp) = $gdk_window->get_geometry; ($xp, $yp) = $gdk_window->get_origin; } return ($xp, $yp, $wp, $hp); } sub update_highlighter { my $self = shift; if (defined $self->{_c}{'cw'}{'gdk_window'} && defined $self->{_c}{'cw'}{'window'}) { #and show highlighter window at current cursor position $self->{_highlighter}->show_all; $self->{_highlighter}->queue_draw; Gtk3::Gdk::keyboard_grab($self->{_highlighter}->get_window, 0, Gtk3::get_current_event_time()); #save last window objects $self->{_c}{'lw'}{'window'} = $self->{_c}{'cw'}{'window'}; $self->{_c}{'lw'}{'gdk_window'} = $self->{_c}{'cw'}{'gdk_window'}; } } sub find_current_parent_window { my $self = shift; my $event = shift; my $active_workspace = shift; #get all toplevel windows my @wnck_windows = @{$self->{_wnck_screen}->get_windows_stacked}; #show user-visible windows only when selecting a window if (defined $self->{_show_visible} && $self->{_show_visible}) { @wnck_windows = reverse @wnck_windows; } foreach my $cwdow (@wnck_windows) { my $drawable = Gtk3::GdkX11::X11Window->foreign_new_for_display(Gtk3::Gdk::Display::get_default(), $cwdow->get_xid); if (defined $drawable) { #do not detect shutter window when it is hidden if ($self->{_main_gtk_window}->get_window && $self->{_is_hidden}) { next if ($cwdow->get_xid == $self->{_main_gtk_window}->get_window->get_xid); } my ($xp, $yp, $wp, $hp) = $self->get_window_size($cwdow, $drawable, $self->{_include_border}, TRUE); my $wr = Cairo::Region->create({ x=>$xp, y=>$yp, width=>$wp, height=>$hp, }); if ( $cwdow->is_visible_on_workspace($active_workspace) && $wr->contains_point($event->x * $self->{_dpi_scale}, $event->y * $self->{_dpi_scale}) && $wp * $hp <= $self->{_min_size}) { $self->{_c}{'cw'}{'window'} = $cwdow; $self->{_c}{'cw'}{'gdk_window'} = $drawable; $self->{_c}{'cw'}{'x'} = $xp; $self->{_c}{'cw'}{'y'} = $yp; $self->{_c}{'cw'}{'width'} = $wp; $self->{_c}{'cw'}{'height'} = $hp; $self->{_c}{'cw'}{'is_parent'} = TRUE; $self->{_min_size} = $wp * $hp; #show user-visible windows only when selecting a window if (defined $self->{_show_visible} && $self->{_show_visible}) { last; } } #size and geometry check } #not defined gdk::window } #end if toplevel window loop return TRUE; } sub find_current_child_window { my ($self, $event, $xwindow, $xparent, $depth, $limit, $type_hint) = @_; #reparenting depth and recursion limit $depth = 0 unless defined $depth; $limit = 0 unless defined $limit; if ($depth > $limit) { return TRUE; } my ($qroot, $qparent, @qkids); unless (defined $self->{_c}{'cw'}{$xwindow} && scalar @{$self->{_c}{'cw'}{$xwindow}}) { #query all child windows of xwindow ($qroot, $qparent, @qkids) = $self->{_x11}->QueryTree($xwindow); #and save them, so we don't have to query them again @{$self->{_c}{'cw'}{$xwindow}} = @qkids; } else { #we can use the cached children information @qkids = @{$self->{_c}{'cw'}{$xwindow}}; } foreach my $kid (reverse @qkids) { my $gdk_window = Gtk3::GdkX11::X11Window->foreign_new_for_display(Gtk3::Gdk::Display::get_default(), $kid); if (defined $gdk_window) { #window needs to be viewable and visible next unless $gdk_window->is_visible; next unless $gdk_window->is_viewable; #check type_hint if (defined $type_hint) { my $curr_type_hint = $gdk_window->get_type_hint; next unless $curr_type_hint =~ /$type_hint/; } #~ print $curr_type_hint, " - passed \n"; #min size my ($xp, $yp, $wp, $hp, $depthp) = $gdk_window->get_geometry; ($xp, $yp) = $gdk_window->get_origin; next if ($wp * $hp < 4); my $sr = Cairo::Region->create({x=>$xp, y=>$yp, width=>$wp, height=>$hp}); if ($sr->contains_point($event->x, $event->y) && $wp * $hp <= $self->{_min_size}) { $self->{_c}{'cw'}{'gdk_window'} = $gdk_window; $self->{_c}{'cw'}{'x'} = $xp; $self->{_c}{'cw'}{'y'} = $yp; $self->{_c}{'cw'}{'width'} = $wp; $self->{_c}{'cw'}{'height'} = $hp; $self->{_c}{'cw'}{'is_parent'} = FALSE; $self->{_min_size} = $wp * $hp; #~ print $self->{_c}{'cw'}{'x'}, " - ", #~ $self->{_c}{'cw'}{'y'}, " - ", #~ $self->{_c}{'cw'}{'width'}, " - ", #~ $self->{_c}{'cw'}{'height'}, " \n " if $self->{_sc}->get_debug; #check next depth unless ($gdk_window->get_xid == $xwindow) { $self->find_current_child_window($event, $gdk_window->get_xid, $xparent, $depth++, $limit, $type_hint); } else { last; } #~ last; } } } return TRUE; } sub find_active_window { my $self = shift; my $gdk_window = $self->{_gdk_screen}->get_active_window; if (defined $gdk_window) { my $wnck_window = Wnck::Window::get($gdk_window->get_xid); if (defined $wnck_window) { return ($wnck_window, $gdk_window); } } return FALSE; } sub find_region_for_window_type { my ($self, $xwindow, $type_hint) = @_; #XQueryTree - query window tree information my ($qroot, $qparent, @qkids) = $self->{_x11}->QueryTree($xwindow); foreach my $kid (reverse @qkids) { my $gdk_window = Gtk3::GdkX11::X11Window->foreign_new_for_display(Gtk3::Gdk::Display::get_default(), $kid); if (defined $gdk_window) { #check type_hint my $curr_type_hint = $gdk_window->get_type_hint; if (defined $type_hint) { next unless $curr_type_hint =~ /$type_hint/; } #XGetWindowAttributes, XGetGeometry, XWindowAttributes - get current #window attribute or geometry and current window attributes structure my @atts = $self->{_x11}->GetWindowAttributes($kid); return unless @atts; #window needs to be viewable return FALSE unless $atts[19] eq 'Viewable'; #min size my ($xp, $yp, $wp, $hp, $depthp) = $gdk_window->get_geometry; ($xp, $yp) = $gdk_window->get_origin; #~ print $xp, " - ", $yp, " - ", $wp, " - ", $hp, "\n"; #create region my $sr = Cairo::Region->create({x=>$xp, y=>$yp, width=>$wp * $self->{_dpi_scale}, height=>$hp * $self->{_dpi_scale}}); #init region unless (defined $self->{_c}{'cw'}{'window_region'}) { $self->{_c}{'cw'}{'window_region'} = Cairo::Region->create; } $self->{_c}{'cw'}{'window_region'}->union($sr); #store clipbox geometry #~ my $cbox = $self->{_c}{'cw'}{'window_region'}->get_clipbox; my $cbox = $self->get_clipbox($self->{_c}{'cw'}{'window_region'}); $self->{_c}{'cw'}{'gdk_window'} = $gdk_window; $self->{_c}{'cw'}{'x'} = $cbox->{x}; $self->{_c}{'cw'}{'y'} = $cbox->{y}; $self->{_c}{'cw'}{'width'} = $cbox->{width}; $self->{_c}{'cw'}{'height'} = $cbox->{height}; $self->{_c}{'cw'}{'is_parent'} = FALSE; #~ print $self->{_c}{'cw'}{'x'}, " - ", #~ $self->{_c}{'cw'}{'y'}, " - ", #~ $self->{_c}{'cw'}{'width'}, " - ", #~ $self->{_c}{'cw'}{'height'}, " \n "; } } return TRUE; } sub select_window { my $self = shift; my $event = shift; my $active_workspace = shift; #select child window my $depth = shift; my $limit = shift; my $type_hint = shift; #root window size is minimum at startup $self->{_min_size} = $self->{_root}->{w} * $self->{_root}->{h} * $self->{_dpi_scale} * $self->{_dpi_scale}; #if there is no window already selected unless ($self->{_c}{'ws'}) { $self->find_current_parent_window($event, $active_workspace); #parent window selected/no grab, search for children now } elsif (($self->{_mode} eq "section" || $self->{_mode} eq "tray_section") && $self->{_c}{'ws'}) { $self->find_current_child_window($event, $self->{_c}{'ws'}->get_xid, $self->{_c}{'ws'}->get_xid, $depth, $limit, $type_hint); } #draw highlighter if needed if ( (Gtk3::Gdk::pointer_is_grabbed() && ($self->{_c}{'lw'}{'gdk_window'} ne $self->{_c}{'cw'}{'gdk_window'})) || (Gtk3::Gdk::pointer_is_grabbed() && $self->{_c}{'ws_init'})) { $self->update_highlighter(); #reset flag $self->{_c}{'ws_init'} = FALSE; } return TRUE; } sub window { my $self = shift; #return value my $output = 5; #current workspace my $active_workspace = $self->{_wnck_screen}->get_active_workspace; #something went wrong here, no active workspace detected unless ($active_workspace) { $output = 0; return $output; } #grab pointer and keyboard #when mode is section or window unless ($self->{_mode} eq "menu" || $self->{_mode} eq "tray_menu" || $self->{_mode} eq "tooltip" || $self->{_mode} eq "tray_tooltip" || $self->{_mode} eq "awindow" || $self->{_mode} eq "tray_awindow") { $self->{_highlighter}->realize; my $grab_counter = 0; while (!Gtk3::Gdk::pointer_is_grabbed() && $grab_counter < 100) { Gtk3::Gdk::pointer_grab($self->{_root}, FALSE, [qw/pointer-motion-mask button-press-mask button-release-mask/], undef, Gtk3::Gdk::Cursor->new('GDK_HAND2'), Gtk3::get_current_event_time()); Gtk3::Gdk::keyboard_grab($self->{_highlighter}->get_window, 0, Gtk3::get_current_event_time()); $grab_counter++; } } #init $self->{_c} = (); $self->{_c}{'ws'} = undef; $self->{_c}{'ws_init'} = FALSE; $self->{_c}{'lw'}{'gdk_window'} = 0; #root window size is minimum at startup $self->{_min_size} = $self->{_root}->{w} * $self->{_root}->{h} * $self->{_dpi_scale} * $self->{_dpi_scale}; $self->{_c}{'cw'}{'gdk_window'} = $self->{_root}; $self->{_c}{'cw'}{'x'} = $self->{_root}->{x}; $self->{_c}{'cw'}{'y'} = $self->{_root}->{y}; $self->{_c}{'cw'}{'width'} = $self->{_root}->{w}; $self->{_c}{'cw'}{'height'} = $self->{_root}->{h}; #get initial window under cursor my ($window_at_pointer, $initx, $inity, $mask) = $self->{_root}->get_pointer; #create event for current coordinates my $initevent = Gtk3::Gdk::Event->new('motion-notify'); $initevent->time(Gtk3::get_current_event_time()); $initevent->window($self->{_root}); $initevent->x($initx); $initevent->y($inity); if ( Gtk3::Gdk::pointer_is_grabbed() && !( $self->{_mode} eq "menu" || $self->{_mode} eq "tray_menu" || $self->{_mode} eq "tooltip" || $self->{_mode} eq "tray_tooltip" || $self->{_mode} eq "awindow" || $self->{_mode} eq "tray_awindow" )) { #simulate mouse movement $self->select_window($initevent, $active_workspace); Gtk3::Gdk::Event::handler_set( sub { my ($event, $data) = @_; return FALSE unless defined $event; #KEY-PRESS if ($event->type eq 'key-press') { next unless defined $event->keyval; if ($event->keyval == Gtk3::Gdk::keyval_from_name('Escape')) { #destroy highlighter window $self->{_highlighter}->destroy; $self->quit; $output = 5; } #BUTTON-PRESS } elsif ($event->type eq 'button-press') { print "Type: " . $event->type . "\n" if (defined $event && $self->{_sc}->get_debug); #user selects window or section $self->select_window($event, $active_workspace); #BUTTON-RELEASE } elsif ($event->type eq 'button-release') { print "Type: " . $event->type . "\n" if (defined $event && $self->{_sc}->get_debug); my ($xp, $yp, $wp, $hp, $xc, $yc, $wc, $hc) = (0, 0, 0, 0, 0, 0, 0, 0); if (defined $self->{_c}{'lw'} && $self->{_c}{'lw'}{'gdk_window'}) { #size (we need to do this again because of autoresizing) if (($self->{_mode} eq "window" || $self->{_mode} eq "tray_window" || $self->{_mode} eq "awindow" || $self->{_mode} eq "tray_awindow")) { ($xc, $yc, $wc, $hc) = $self->get_window_size($self->{_c}{'lw'}{'window'}, $self->{_c}{'lw'}{'gdk_window'}, $self->{_include_border}, TRUE); ($xp, $yp, $wp, $hp) = $self->get_window_size($self->{_c}{'lw'}{'window'}, $self->{_c}{'lw'}{'gdk_window'}, $self->{_include_border}); $self->{_c}{'cw'}{'x'} = $xp; $self->{_c}{'cw'}{'y'} = $yp; $self->{_c}{'cw'}{'width'} = $wp; $self->{_c}{'cw'}{'height'} = $hp; } #focus selected window (maybe it is hidden) $self->{_c}{'lw'}{'gdk_window'}->focus($event->time); Gtk3::Gdk::flush(); #something went wrong here, no window on screen detected } else { $output = 0; $self->quit; return $output; } #looking for a section of a window? #keep current window in mind and search for children if (($self->{_mode} eq "section" || $self->{_mode} eq "tray_section") && !$self->{_c}{'ws'}) { #mark as selected parent window $self->{_c}{'ws'} = $self->{_c}{'cw'}{'gdk_window'}; $self->{_c}{'ws_init'} = TRUE; #and select current subwindow $self->select_window($event); #we don't take the screenshot yet return TRUE; } #stop event handler $self->quit_eventh_only; #destroy highlighter window $self->{_highlighter}->destroy; #A short timeout to give the server a chance to #redraw the area Glib::Timeout->add( $self->{_hide_time}, sub { Gtk3->main_quit; return FALSE; }); Gtk3->main(); my ($output_new, $l_cropped, $r_cropped, $t_cropped, $b_cropped) = $self->get_pixbuf_from_drawable($self->{_root}, $self->{_c}{'cw'}{'x'} / $self->{_dpi_scale}, $self->{_c}{'cw'}{'y'} / $self->{_dpi_scale}, $self->{_c}{'cw'}{'width'}/$self->{_dpi_scale}, $self->{_c}{'cw'}{'height'}/$self->{_dpi_scale}); #save return value to current $output variable #-> ugly but fastest and safest solution now $output = $output_new; #respect rounded corners of wm decorations (metacity for example - does not work with compiz currently) if ($self->{_include_border}) { my $xid = $self->{_c}{'cw'}{'gdk_window'}->get_xid; #do not try this for child windows foreach my $win (@{$self->{_wnck_screen}->get_windows}) { if ($win->get_xid == $xid) { $output = $self->get_shape($xid, $output, $l_cropped, $r_cropped, $t_cropped, $b_cropped); last; } } } #restore window size when autoresizing was used if ($self->{_mode} eq "window" || $self->{_mode} eq "tray_window" || $self->{_mode} eq "awindow" || $self->{_mode} eq "tray_awindow") { if (defined $self->{_windowresize} && $self->{_windowresize}) { if ($wc != $wp || $hc != $hp) { if ($self->{_include_border}) { $self->{_c}{'lw'}{'window'}->set_geometry('current', [qw/width height/], $xc, $yc, $wc, $hc); } else { $self->{_c}{'lw'}{'gdk_window'}->resize($wc, $hc); } } } } #set name of the captured window #e.g. for use in wildcards if ($output =~ /Gtk3/ && defined $self->{_c}{'cw'}{'window'}) { $self->{_action_name} = $self->{_c}{'cw'}{'window'}->get_name; } #set history object $self->{_history} = Shutter::Screenshot::History->new( $self->{_sc}, $self->{_root}, $self->{_c}{'cw'}{'x'}, $self->{_c}{'cw'}{'y'}, $self->{_c}{'cw'}{'width'}, $self->{_c}{'cw'}{'height'}, undef, $self->{_c}{'cw'}{'window'}->get_xid, $self->{_c}{'cw'}{'gdk_window'}->get_xid ); $self->quit; #MOTION-NOTIFY } elsif ($event->type eq 'motion-notify') { print "Type: " . $event->type . "\n" if (defined $event && $self->{_sc}->get_debug); #user selects window or section $self->select_window($event, $active_workspace); } else { Gtk3::main_do_event($event); } }); Gtk3->main; #pointer not grabbed } else { $output = 0; my ($xp, $yp, $wp, $hp, $xc, $yc, $wc, $hc) = (0, 0, 0, 0, 0, 0, 0, 0); if (($self->{_mode} eq "window" || $self->{_mode} eq "tray_window" || $self->{_mode} eq "awindow" || $self->{_mode} eq "tray_awindow")) { #and select current parent window my ($wnck_window, $gdk_window) = $self->find_active_window; if (defined $wnck_window && $wnck_window && defined $gdk_window && $gdk_window) { #get_size of it ($xc, $yc, $wc, $hc) = $self->get_window_size($wnck_window, $gdk_window, $self->{_include_border}, TRUE); ($xp, $yp, $wp, $hp) = $self->get_window_size($wnck_window, $gdk_window, $self->{_include_border}); $self->{_c}{'cw'}{'window'} = $wnck_window; $self->{_c}{'cw'}{'gdk_window'} = $gdk_window; $self->{_c}{'cw'}{'x'} = $xp; $self->{_c}{'cw'}{'y'} = $yp; $self->{_c}{'cw'}{'width'} = $wp; $self->{_c}{'cw'}{'height'} = $hp; $self->{_c}{'cw'}{'is_parent'} = TRUE; } } elsif (($self->{_mode} eq "menu" || $self->{_mode} eq "tray_menu")) { #and select current menu $self->find_region_for_window_type($self->{_root}->get_xid, 'menu'); #no window with type_hint eq 'menu' detected unless (defined $self->{_c}{'cw'}{'window_region'}) { if ($self->{_ignore_type}) { warn "WARNING: No window with type hint 'menu' detected -> window type hint will be ignored, because workaround is enabled\n"; $self->find_region_for_window_type($self->{_root}->get_xid); } else { return 2; } } } elsif (($self->{_mode} eq "tooltip" || $self->{_mode} eq "tray_tooltip")) { #and select current tooltip $self->find_region_for_window_type($self->{_root}->get_xid, 'tooltip'); #no window with type_hint eq 'tooltip' detected unless (defined $self->{_c}{'cw'}{'window_region'}) { if ($self->{_ignore_type}) { warn "WARNING: No window with type hint 'tooltip' detected -> window type hint will be ignored, because workaround is enabled\n"; $self->find_region_for_window_type($self->{_root}->get_xid); } else { return 2; } } #looking for a section of a window? #keep current window in mind and search for children } elsif (($self->{_mode} eq "section" || $self->{_mode} eq "tray_section")) { #mark as selected parent window $self->{_c}{'ws'} = $self->{_root}; #and select current subwindow $self->select_window($initevent); } my ($output_new, $l_cropped, $r_cropped, $t_cropped, $b_cropped) = $self->get_pixbuf_from_drawable($self->{_root}, $self->{_c}{'cw'}{'x'}, $self->{_c}{'cw'}{'y'}, $self->{_c}{'cw'}{'width'}, $self->{_c}{'cw'}{'height'}, $self->{_c}{'cw'}{'window_region'}); #save return value to current $output variable #-> ugly but fastest and safest solution now $output = $output_new; #respect rounded corners of wm decorations #(metacity for example - does not work with compiz currently) #only if toplevel window was selected if (($self->{_mode} eq "window" || $self->{_mode} eq "tray_window" || $self->{_mode} eq "awindow" || $self->{_mode} eq "tray_awindow")) { if ($self->{_include_border}) { my $xid = $self->{_c}{'cw'}{'gdk_window'}->get_xid; #do not try this for child windows foreach my $win (@{$self->{_wnck_screen}->get_windows}) { if ($win->get_xid == $xid) { $output = $self->get_shape($xid, $output, $l_cropped, $r_cropped, $t_cropped, $b_cropped); last; } } } } #restore window size when autoresizing was used if ($self->{_mode} eq "window" || $self->{_mode} eq "tray_window" || $self->{_mode} eq "awindow" || $self->{_mode} eq "tray_awindow") { if (defined $self->{_windowresize} && $self->{_windowresize}) { if ($wc != $wp || $hc != $hp) { if ($self->{_include_border}) { $self->{_c}{'cw'}{'window'}->set_geometry('current', [qw/width height/], $xc, $yc, $wc, $hc); } else { $self->{_c}{'cw'}{'gdk_window'}->resize($wc, $hc); } } } } #set name of the captured window #e.g. for use in wildcards my $d = $self->{_sc}->get_gettext; if (($self->{_mode} eq "window" || $self->{_mode} eq "tray_window" || $self->{_mode} eq "awindow" || $self->{_mode} eq "tray_awindow")) { if ($output =~ /Gtk3/ && defined $self->{_c}{'cw'}{'window'}) { $self->{_action_name} = $self->{_c}{'cw'}{'window'}->get_name; } } elsif (($self->{_mode} eq "section" || $self->{_mode} eq "tray_section")) { if ($output =~ /Gtk3/ && defined $self->{_c}{'cw'}{'window'}) { $self->{_action_name} = $self->{_action_name} = $self->{_c}{'cw'}{'window'}->get_name; } } elsif (($self->{_mode} eq "menu" || $self->{_mode} eq "tray_menu")) { if ($output =~ /Gtk3/) { $self->{_action_name} = $d->get("Menu"); } } elsif (($self->{_mode} eq "tooltip" || $self->{_mode} eq "tray_tooltip")) { if ($output =~ /Gtk3/) { $self->{_action_name} = $d->get("Tooltip"); } } if (defined $self->{_c}{'cw'}{'window'} && $self->{_c}{'cw'}{'gdk_window'}) { #set history object $self->{_history} = Shutter::Screenshot::History->new( $self->{_sc}, $self->{_root}, $self->{_c}{'cw'}{'x'}, $self->{_c}{'cw'}{'y'}, $self->{_c}{'cw'}{'width'}, $self->{_c}{'cw'}{'height'}, $self->{_c}{'cw'}{'window_region'}, $self->{_c}{'cw'}{'window'}->get_xid, $self->{_c}{'cw'}{'gdk_window'}->get_xid ); } else { #set history object $self->{_history} = Shutter::Screenshot::History->new( $self->{_sc}, $self->{_root}, $self->{_c}{'cw'}{'x'}, $self->{_c}{'cw'}{'y'}, $self->{_c}{'cw'}{'width'}, $self->{_c}{'cw'}{'height'}, $self->{_c}{'cw'}{'window_region'}, ); } } return $output; } sub get_mode { my $self = shift; return $self->{_mode}; } sub redo_capture { my $self = shift; my $output = 3; if (defined $self->{_history}) { my ($last_drawable, $lxp, $lyp, $lwp, $lhp, $lregion, $wxid, $gxid) = $self->{_history}->get_last_capture; if (defined $gxid && defined $wxid) { #create windows my $gdk_window = Gtk3::GdkX11::X11Window->foreign_new_for_display(Gtk3::Gdk::Display::get_default(), $gxid); my $wnck_window = Wnck::Window::get($wxid); if (defined $gdk_window && defined $wnck_window) { #store size my ($xp, $yp, $wp, $hp, $xc, $yc, $wc, $hc) = (0, 0, 0, 0, 0, 0, 0, 0); if ($self->{_mode} eq "section" || $self->{_mode} eq "tray_section") { ($xp, $yp, $wp, $hp) = $gdk_window->get_geometry; ($xp, $yp) = $gdk_window->get_origin; #find parent window my $pxid = $self->find_wm_window($gxid); my $parent = Gtk3::GdkX11::X11Window->foreign_new_for_display(Gtk3::Gdk::Display::get_default(), $pxid); if (defined $parent && $parent) { #and focus parent window (maybe it is hidden) $parent->focus(Gtk3::get_current_event_time()); Gtk3::Gdk::flush(); } } elsif ($self->{_mode} eq "window" || $self->{_mode} eq "tray_window" || $self->{_mode} eq "awindow" || $self->{_mode} eq "tray_awindow") { #get_size of it ($xc, $yc, $wc, $hc) = $self->get_window_size($wnck_window, $gdk_window, $self->{_include_border}, TRUE); ($xp, $yp, $wp, $hp) = $self->get_window_size($wnck_window, $gdk_window, $self->{_include_border}); } #focus selected window (maybe it is hidden) $gdk_window->focus(Gtk3::get_current_event_time()); Gtk3::Gdk::flush(); #A short timeout to give the server a chance to #redraw the area Glib::Timeout->add( $self->{_hide_time}, sub { Gtk3->main_quit; return FALSE; }); Gtk3->main(); my ($output_new, $l_cropped, $r_cropped, $t_cropped, $b_cropped) = $self->get_pixbuf_from_drawable($self->{_root}, $xp, $yp, $wp, $hp); #save return value to current $output variable #-> ugly but fastest and safest solution now $output = $output_new; if ($self->{_mode} eq "window" || $self->{_mode} eq "tray_window" || $self->{_mode} eq "awindow" || $self->{_mode} eq "tray_awindow") { if ($self->{_include_border}) { $output = $self->get_shape($gxid, $output, $l_cropped, $r_cropped, $t_cropped, $b_cropped); } } #restore window size when autoresizing was used if ($self->{_mode} eq "window" || $self->{_mode} eq "tray_window" || $self->{_mode} eq "awindow" || $self->{_mode} eq "tray_awindow") { if (defined $self->{_windowresize} && $self->{_windowresize}) { if ($wc != $wp || $hc != $hp) { if ($self->{_include_border}) { $wnck_window->set_geometry('current', [qw/width height/], $xc, $yc, $wc, $hc); } else { $gdk_window->resize($wc, $hc); } } } } $self->quit_eventh_only; } else { warn "WARNING: Could not get window with id $gxid\n"; $output = 4; } #no xid } else { ($output) = $self->get_pixbuf_from_drawable($self->{_history}->get_last_capture); } } return $output; } sub get_history { my $self = shift; return $self->{_history}; } sub get_error_text { my $self = shift; return $self->{_error_text}; } sub get_action_name { my $self = shift; return $self->{_action_name}; } sub quit { my $self = shift; $self->ungrab_pointer_and_keyboard(FALSE, TRUE, TRUE); Gtk3::Gdk::flush(); } sub quit_eventh_only { my $self = shift; $self->ungrab_pointer_and_keyboard(FALSE, TRUE, FALSE); Gtk3::Gdk::flush(); } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Screenshot/WindowName.pm000066400000000000000000000046151476102223600277710ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Screenshot::WindowName; #modules #-------------------------------------- use utf8; use strict; use warnings; use Shutter::Screenshot::WindowXid; use Data::Dumper; our @ISA = qw(Shutter::Screenshot::WindowXid); #Glib and Gtk3 use Gtk3; use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; #call constructor of super class (shutter_common, include_cursor, delay, notify_timeout, include_border, windowresize_active, windowresize_w, windowresize_h, hide_time, mode, autoshape) my $self = $class->SUPER::new(shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift); bless $self, $class; return $self; } #~ sub DESTROY { #~ my $self = shift; #~ print "$self dying at\n"; #~ } #~ sub window_find_by_name { my $self = shift; my $name_pattern = shift; my $active_workspace = $self->{_wnck_screen}->get_active_workspace; #cycle through all windows my $output = 7; foreach my $win (@{$self->{_wnck_screen}->get_windows_stacked}) { #ignore shutter window if ($self->{_sc}->get_mainwindow->get_window) { next if ($win->get_xid == $self->{_sc}->get_mainwindow->get_window->get_xid); } #check if window is on active workspace if ($active_workspace && $win->is_on_workspace($active_workspace)) { eval { if ($win->get_name =~ m/$name_pattern/i) { $output = $self->window_by_xid($win->get_xid); last; } }; if ($@) { $output = 8; $self->{_error_text} = $@; } } } return $output; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Screenshot/WindowXid.pm000066400000000000000000000106671476102223600276410ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Screenshot::WindowXid; #modules #-------------------------------------- use utf8; use strict; use warnings; use Shutter::Screenshot::Window; use Data::Dumper; our @ISA = qw(Shutter::Screenshot::Window); #Glib and Gtk3 use Gtk3; use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; #call constructor of super class (shutter_common, include_cursor, delay, notify_timeout, include_border, windowresize_active, windowresize_w, windowresize_h, hide_time, mode, autoshape) my $self = $class->SUPER::new(shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift); bless $self, $class; return $self; } #~ sub DESTROY { #~ my $self = shift; #~ print "$self dying at\n"; #~ } #~ sub window_by_xid { my $self = shift; my $xid = shift; my $dummy_window = Gtk3::Window->new('toplevel'); my $gdk_window = Gtk3::GdkX11::X11Window->foreign_new_for_display( $dummy_window->get_display, $xid); my $wnck_window = Wnck::Window::get($xid); print $xid, " - ", $gdk_window, " - ", $wnck_window, "\n"; my $output = 0; if (defined $gdk_window && defined $wnck_window) { my ($xc, $yc, $wc, $hc) = $self->get_window_size($wnck_window, $gdk_window, $self->{_include_border}, TRUE); my ($xp, $yp, $wp, $hp) = $self->get_window_size($wnck_window, $gdk_window, $self->{_include_border}); #focus selected window (maybe it is hidden) $gdk_window->focus(Gtk3::get_current_event_time()); Gtk3::Gdk::flush(); #A short timeout to give the server a chance to #redraw the area Glib::Timeout->add( $self->{_hide_time}, sub { Gtk3->main_quit; return FALSE; }); Gtk3->main(); my ($output_new, $l_cropped, $r_cropped, $t_cropped, $b_cropped) = $self->get_pixbuf_from_drawable($self->{_root}, $xp, $yp, $wp, $hp); #save return value to current $output variable #-> ugly but fastest and safest solution now $output = $output_new; #respect rounded corners of wm decorations (metacity for example - does not work with compiz currently) if ($self->{_include_border}) { $output = $self->get_shape($xid, $output, $l_cropped, $r_cropped, $t_cropped, $b_cropped); } #restore window size when autoresizing was used if ($self->{_mode} eq "window" || $self->{_mode} eq "tray_window" || $self->{_mode} eq "awindow" || $self->{_mode} eq "tray_awindow") { if (defined $self->{_windowresize} && $self->{_windowresize}) { if ($wc != $wp || $hc != $hp) { if ($self->{_include_border}) { $wnck_window->set_geometry('current', [qw/width height/], $xc, $yc, $wc, $hc); } else { $gdk_window->resize($wc, $hc); } } } } #set name of the captured window #e.g. for use in wildcards if ($output =~ /Gtk3/) { $self->{_action_name} = $wnck_window->get_name; } #set history object $self->{_history} = Shutter::Screenshot::History->new($self->{_sc}, $self->{_root}, $xp, $yp, $wp, $hp, undef, $xid, $xid); $self->quit; } else { $output = 4; } return $output; } sub redo_capture { my $self = shift; my $output = 3; if (defined $self->{_history}) { my ($last_drawable, $lxp, $lyp, $lwp, $lhp, $lregion, $wxid, $gxid) = $self->{_history}->get_last_capture; ($output) = $self->window_by_xid($wxid); } return $output; } sub get_history { my $self = shift; return $self->{_history}; } sub get_error_text { my $self = shift; return $self->{_error_text}; } sub get_action_name { my $self = shift; return $self->{_action_name}; } sub quit { my $self = shift; $self->ungrab_pointer_and_keyboard(FALSE, TRUE, FALSE); Gtk3::Gdk::flush(); } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Screenshot/Workspace.pm000066400000000000000000000205701476102223600276550ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Screenshot::Workspace; #modules #-------------------------------------- use utf8; use strict; use warnings; use Shutter::Screenshot::Main; use Shutter::Screenshot::History; use Data::Dumper; our @ISA = qw(Shutter::Screenshot::Main); #Glib use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; #call constructor of super class (shutter_common, include_cursor, delay, notify_timeout) my $self = $class->SUPER::new(shift, shift, shift, shift); $self->{_selected_workspace} = shift; $self->{_vpx} = shift; $self->{_vpy} = shift; $self->{_current_monitor_only} = shift; bless $self, $class; return $self; } #~ sub DESTROY { #~ my $self = shift; #~ print "$self dying at\n"; #~ } sub workspaces { my $self = shift; my $d = $self->{_sc}->get_gettext; my $active_workspace = $self->{_wnck_screen}->get_active_workspace; #valid workspace? return TRUE unless $active_workspace; my $active_vpx = $active_workspace->get_viewport_x; my $active_vpy = $active_workspace->get_viewport_y; #create shutter region object my $sr = Shutter::Geometry::Region->new(); #variables to save the pixbuf my $output = undef; my $pixbuf = undef; my $wspaces_region = Cairo::Region->create; my @pixbuf_array; my @rects_array; my $row = 0; my $column = 0; my $height = 0; my $width = 0; foreach my $space (@{$self->{_workspaces}}) { next unless defined $space; #compiz if ($self->{_wm_manager_name} =~ /compiz/i) { #calculate viewports with size of workspace my $vpx = $space->get_viewport_x; my $vpy = $space->get_viewport_y; my $n_viewports_column = int($space->get_width / $self->{_wnck_screen}->get_width); my $n_viewports_rows = int($space->get_height / $self->{_wnck_screen}->get_height); #rows for (my $j = 0 ; $j < $n_viewports_rows ; $j++) { #columns for (my $i = 0 ; $i < $n_viewports_column ; $i++) { my @vp = ($i * $self->{_wnck_screen}->get_width, $j * $self->{_wnck_screen}->get_height); #set coordinates $self->{_vpx} = $vp[0]; $self->{_vpy} = $vp[1]; #and disable workspace $self->{_selected_workspace} = undef; #capture viewport $pixbuf = $self->workspace(TRUE, TRUE); my $rect = {x=>$width, y=>$height, width=>$pixbuf->get_width, height=>$pixbuf->get_height}; $wspaces_region->union_rectangle($rect); push @pixbuf_array, $pixbuf; push @rects_array, $rect; #increase width according to current column $width += $pixbuf->get_width; } #next row # > set height to clipbox-height # > set width to 0, because we start in column 0 again $height = $sr->get_clipbox($wspaces_region)->{height}; $width = 0; } #all other wm manager like metacity etc. } else { #capture next workspace $self->{_selected_workspace} = $space->get_number; #~ print "Capturing Workspace: ".$space->get_number." Layout-Row:". $space->get_layout_row ." Layout-Column:". $space->get_layout_column ."\n"; $pixbuf = $self->workspace(TRUE, TRUE); if ($column < $space->get_layout_column) { $width += $pixbuf->get_width; } elsif ($column > $space->get_layout_column) { $width = 0; } $column = $space->get_layout_column; $height = $sr->get_clipbox($wspaces_region)->{height} if ($row != $space->get_layout_row); $row = $space->get_layout_row; my $rect = {x=>$width, y=>$height, width=>$pixbuf->get_width, height=>$pixbuf->get_height}; $wspaces_region->union_rectangle($rect); push @pixbuf_array, $pixbuf; push @rects_array, $rect; } } if ($wspaces_region->num_rectangles) { $output = Gtk3::Gdk::Pixbuf->new('rgb', TRUE, 8, $sr->get_clipbox($wspaces_region)->{width}, $sr->get_clipbox($wspaces_region)->{height}); $output->fill(0x00000000); #copy images to the blank pixbuf my $rect_counter = 0; foreach my $pixbuf (@pixbuf_array) { $pixbuf->copy_area(0, 0, $pixbuf->get_width, $pixbuf->get_height, $output, $rects_array[$rect_counter]->{x}, $rects_array[$rect_counter]->{y}); $rect_counter++; } } #this value will be overwritten - restore for history $self->{_selected_workspace} = 'all'; #set history object $self->{_history} = Shutter::Screenshot::History->new($self->{_sc}); #set name of the captured workspace #e.g. for use in wildcards if ($output =~ /Gtk3/) { $self->{_action_name} = $d->get("Workspaces"); } #compiz if ($self->{_wm_manager_name} =~ /compiz/i) { $self->{_wnck_screen}->move_viewport($active_vpx, $active_vpy); #metacity etc. } else { $active_workspace->activate(Gtk3::get_current_event_time()); } return $output; } sub workspace { my $self = shift; my $no_active_check = shift || FALSE; my $no_finishing = shift || FALSE; my $wrksp_changed = FALSE; my $active_workspace = $self->{_wnck_screen}->get_active_workspace; #valid workspace? return TRUE unless $active_workspace; my $active_vpx = $active_workspace->get_viewport_x; my $active_vpy = $active_workspace->get_viewport_y; #metacity etc if (defined $self->{_selected_workspace}) { foreach my $space (@{$self->{_workspaces}}) { next unless defined $space; if ($self->{_selected_workspace} == $space->get_number && ($no_active_check || $self->{_selected_workspace} != $active_workspace->get_number)) { $space->activate(Gtk3::get_current_event_time()); $wrksp_changed = TRUE; } } #compiz } else { $self->{_wnck_screen}->move_viewport($self->{_vpx}, $self->{_vpy}); $wrksp_changed = TRUE; } #we need a minimum delay of 1 second #to give the server a chance to #redraw after switching workspaces if ($self->{_delay} < 2 && $wrksp_changed) { $self->{_delay} = 1; } my $output = undef; if ($self->{_current_monitor_only} || $self->{_gdk_screen}->get_n_monitors <= 1) { ($output) = $self->get_pixbuf_from_drawable($self->get_root_and_current_monitor_geometry); #When there are multiple monitors with different resolutions, the visible area #within the root window may not be rectangular (it may have an L-shape, for #example). In that case, mask out the areas of the root window which would #not be visible in the monitors, so that screenshot do not end up with content #that the user won't ever see. # #comment copied from gnome-screenshot #http://svn.gnome.org/viewvc/gnome-utils/trunk/gnome-screenshot/screenshot-utils.c?view=markup } elsif ($self->{_gdk_screen}->get_n_monitors > 1) { ($output) = $self->get_pixbuf_from_drawable($self->get_root_and_geometry, $self->get_monitor_region); } unless ($no_finishing) { #set history object $self->{_history} = Shutter::Screenshot::History->new($self->{_sc}); #set name of the captured workspace #e.g. for use in wildcards if ($output =~ /Gtk3/) { $self->{_action_name} = $self->{_wnck_screen}->get_active_workspace->get_name; } #metacity etc if ($self->{_selected_workspace}) { $active_workspace->activate(Gtk3::get_current_event_time()) if $wrksp_changed; #compiz } else { $self->{_wnck_screen}->move_viewport($active_vpx, $active_vpy); } } return $output; } sub redo_capture { my $self = shift; my $output = 3; if (defined $self->{_history} && $self->{_selected_workspace} eq 'all') { $output = $self->workspaces(); } elsif (defined $self->{_history}) { $output = $self->workspace(); } return $output; } sub get_history { my $self = shift; return $self->{_history}; } sub get_error_text { my $self = shift; return $self->{_error_text}; } sub get_action_name { my $self = shift; return $self->{_action_name}; } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Upload/000077500000000000000000000000001476102223600244645ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/modules/Shutter/Upload/FTP.pm000066400000000000000000000077341476102223600254660ustar00rootroot00000000000000################################################### # # Copyright (C) 2008-2013 Mario Kemper # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Upload::FTP; use utf8; use strict; use warnings; use Net::FTP; use URI; use URI::Split qw(uri_split); #Glib use Glib qw/TRUE FALSE/; #-------------------------------------- sub new { my $class = shift; my $self = { _debug_cparam => shift, _shutter_root => shift, _gettext_object => shift, _main_gtk_window => shift, _mode => shift #active or passive }; #connection settings $self->{_prot} = ""; $self->{_host} = ""; $self->{_port} = ""; $self->{_path} = ""; $self->{_auth} = ""; $self->{_query} = ""; $self->{_frag} = ""; #credentials and filename $self->{_filename} = undef; $self->{_username} = undef; $self->{_password} = undef; bless $self, $class; return $self; } sub login { my ($self, $uri, $username, $password) = @_; #uri should start with ftp:// to parse it correctly $uri = "ftp://" . $uri unless ($uri =~ /^ftp:\/\//); #split uri my $u = URI->new($uri); ($self->{_prot}, $self->{_auth}, $self->{_path}, $self->{_query}, $self->{_frage}) = uri_split($u); #get port and host $self->{_auth} =~ /(.*):?([0-9]?)/; $self->{_host} = $1 || "undefined.host"; $self->{_port} = $2 || 21; #check uri and return if anything is missing unless ($self->{_host} && $self->{_port}) { return ($self->{_gettext_object}->get("Illegal URI."), "<>", undef); } #store parms as object vars $self->{_username} = $username; $self->{_password} = $password; utf8::encode $self->{_host}; utf8::encode $self->{_username} if $self->{_username}; utf8::encode $self->{_password} if $self->{_password}; #CONNECT TO FTP SERVER $self->{_ftp} = Net::FTP->new( $self->{_host}, Passive => $self->{_mode}, Port => $self->{_port}, Timeout => 10 ) or return ($self->{_gettext_object}->get("Connection error."), $self->{_gettext_object}->get("Please check your connectivity and try again."), $@); #TRY TO LOGIN WITH GIVEN CREDENTIALS $self->{_ftp}->login($self->{_username}, $self->{_password}) or return ( sprintf($self->{_gettext_object}->get("Login with username %s failed."), "'" . $self->{_username} . "'"), $self->{_gettext_object}->get("Please check your credentials and try again."), $self->{_ftp}->message ); #THERE ARE NO ERRORS WHEN ROUTINE RETURNS AT THIS POINT return (FALSE); } sub upload { my ($self, $upload_filename) = @_; #store parms as object vars $self->{_filename} = $upload_filename; utf8::encode $self->{_filename}; #CHANGE WORKING DIRECTORY USING CWD COMMAND $self->{_ftp}->cwd($self->{_path}) or return ($self->{_gettext_object}->get("Failed"), $self->{_gettext_object}->get("Cannot change working directory."), $self->{_ftp}->message); $self->{_ftp}->binary; #UPLOAD FILE $self->{_ftp}->put($self->{_filename}) or return ($self->{_gettext_object}->get("Failed"), $self->{_gettext_object}->get("Command 'put' failed."), $self->{_ftp}->message); #THERE ARE NO ERRORS WHEN ROUTINE RETURNS AT THIS POINT return (FALSE); } sub quit { my $self = shift; #QUIT CONNECTION $self->{_ftp}->quit; #THERE ARE NO ERRORS WHEN ROUTINE RETURNS AT THIS POINT return (FALSE); } 1; shutter-0.99.6/share/shutter/resources/modules/Shutter/Upload/Shared.pm000066400000000000000000000103361476102223600262330ustar00rootroot00000000000000#! /usr/bin/env perl ################################################### # # Copyright (C) 2008, 2009, 2010 Mario Kemper and Shutter Team # # This file is part of Shutter. # # Shutter is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Shutter is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Shutter; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # ################################################### package Shutter::Upload::Shared; use utf8; use strict; use warnings; use POSIX qw/setlocale/; use Locale::gettext; use Glib qw/TRUE FALSE/; use Data::Dumper; sub new { my $class = shift; my $self = { _host => shift, _debug_cparam => shift, _shutter_root => shift, _gettext_object => shift, _main_gtk_window => shift, _ua => shift }; #received links are stored here $self->{_links} = undef; #credentials and filename $self->{_filename} = undef; $self->{_username} = undef; $self->{_password} = undef; $self->{_notebook} = Gtk3::Notebook->new; $self->{_notebook}->set_scrollable(TRUE); bless $self, $class; return $self; } sub create_tab { my $self = shift; my $upload_vbox = Gtk3::VBox->new(FALSE, 0); #sizegroup for all labels my $sg = Gtk3::SizeGroup->new('horizontal'); #create entry for each link foreach (sort keys %{$self->{_links}}) { next if $_ eq 'status'; my $box = $self->create_entry_for_notebook($_, $self->{_links}->{$_}, $sg); $upload_vbox->pack_start($box, FALSE, FALSE, 3); } return $upload_vbox; } sub create_entry_for_notebook { my ($self, $field, $value, $sg) = @_; #Clipboard my $clipboard = Gtk3::Clipboard::get($Gtk3::Gdk::SELECTION_CLIPBOARD); my $upload_hbox1 = Gtk3::HBox->new(FALSE, 10); my $upload_hbox2 = Gtk3::HBox->new(FALSE, 10); #prepare $field $field =~ s/_/ /ig; $field = ucfirst $field; my $label = Gtk3::Label->new($field); $label->set_alignment(0, 0.5); $sg->add_widget($label); my $entry = Gtk3::Entry->new(); $entry->set_text($value); $entry->signal_connect( 'button-release-event' => sub { my ($widget, $event) = @_; $widget->select_region(0, -1); return FALSE; }); my $upload_copy = Gtk3::Button->new; $upload_copy->set_tooltip_text($self->{_gettext_object}->get("Copy this code to clipboard")); $upload_copy->set_image(Gtk3::Image->new_from_stock('gtk-copy', 'menu')); $upload_copy->signal_connect( 'clicked' => sub { my ($widget, $entry) = @_; $clipboard->set_text($entry->get_text); }, $entry ); $upload_hbox1->pack_start($label, FALSE, FALSE, 10); $upload_hbox1->pack_start($entry, TRUE, TRUE, 3); $upload_hbox2->pack_start($upload_hbox1, TRUE, TRUE, 0); $upload_hbox2->pack_start($upload_copy, FALSE, TRUE, 3); return $upload_hbox2; } sub show_all { my $self = shift; #are there any uploaded files? return FALSE if $self->{_notebook}->get_n_pages < 1; my $dlg_header = sprintf($self->{_gettext_object}->get("Upload - %s - %s"), $self->{_host}, $self->{_username}); my $upload_dialog = Gtk3::Dialog->new($dlg_header, $self->{_main_gtk_window}, [qw/modal destroy-with-parent/], 'gtk-ok' => 'accept'); $upload_dialog->set_default_response('accept'); $upload_dialog->get_child->add($self->{_notebook}); $upload_dialog->show_all; my $upload_response = $upload_dialog->run; if ($upload_response eq "accept") { $upload_dialog->destroy(); return TRUE; } else { $upload_dialog->destroy(); return FALSE; } } sub show { my $self = shift; #Create label for each notebook page my $fnlabel = Gtk3::Label->new($self->{_filename}); $fnlabel->set_ellipsize('middle'); $fnlabel->set_width_chars(20); $fnlabel->set_tooltip_text($self->{_filename}); $self->{_notebook}->append_page($self->create_tab(), $fnlabel); return TRUE; } 1; shutter-0.99.6/share/shutter/resources/modules/X11/000077500000000000000000000000001476102223600221535ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/modules/X11/Protocol/000077500000000000000000000000001476102223600237545ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/modules/X11/Protocol/Ext/000077500000000000000000000000001476102223600245145ustar00rootroot00000000000000shutter-0.99.6/share/shutter/resources/modules/X11/Protocol/Ext/XFIXES.pm000066400000000000000000001022221476102223600260570ustar00rootroot00000000000000# Copyright 2011, 2012, 2013, 2014 Kevin Ryde # This file is part of X11-Protocol-Other. # # X11-Protocol-Other is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as published # by the Free Software Foundation; either version 3, or (at your option) any # later version. # # X11-Protocol-Other is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with X11-Protocol-Other. If not, see . BEGIN { require 5 } package X11::Protocol::Ext::XFIXES; use X11::Protocol 'padded'; use strict; use warnings; use Carp; use vars '$VERSION', '@CARP_NOT'; $VERSION = 29; @CARP_NOT = ('X11::Protocol'); # uncomment this to run the ### lines # use Smart::Comments; # /usr/share/doc/x11proto-fixes-dev/fixesproto.txt.gz # http://cgit.freedesktop.org/xorg/proto/fixesproto/tree/fixesproto.txt # /usr/include/X11/extensions/xfixesproto.h # /usr/include/X11/extensions/xfixeswire.h # # /usr/share/doc/x11proto-xext-dev/shape.txt.gz # # /usr/include/X11/extensions/Xfixes.h # Xlib. # # /usr/share/doc/x11proto-core-dev/x11protocol.txt.gz # these not documented yet ... use constant CLIENT_MAJOR_VERSION => 5; use constant CLIENT_MINOR_VERSION => 0; #------------------------------------------------------------------------------ # symbolic constants use constant constants_list => ( XFixesWindowRegionKind => ['Bounding', 'Clip'], XFixesSaveSetMode => ['Insert', 'Delete'], XFixesSaveSetTarget => ['Nearest', 'Root'], XFixesSaveSetMap => ['Map', 'Unmap'], XFixesSelectionNotifySubtype => ['SetSelectionOwner', 'SelectionWindowDestroy', 'SelectionClientClose'], XFixesCursorNotifySubtype => ['DisplayCursor'], # Not sure about these two ... # XFixesSelectionEventMask => [ 'SetSelectionOwner', # 'SelectionWindowDestroy', # 'SelectionClientClose' ], # XFixesCursorEventMask => [ 'DisplayCursor' ], ); sub _ext_constants_install { my ($X, $constants_arrayref) = @_; foreach (my $i = 0 ; $i <= $#$constants_arrayref ; $i += 2) { my $name = $constants_arrayref->[$i]; my $aref = $constants_arrayref->[$i + 1]; $X->{'ext_const'}->{$name} = $aref; $X->{'ext_const_num'}->{$name} = {X11::Protocol::make_num_hash($aref)}; } } #------------------------------------------------------------------------------ # events my $events_arrayref = [ XFixesSelectionNotify => [ 'xCxxL5', ['subtype', 'XFixesSelectionNotifySubtype'], 'window', ['owner', ['None']], # window 'selection', # atom 'time', 'selection_time', ], XFixesCursorNotify => [ sub { my $X = shift; my $data = shift; ### XFixesCursorNotify unpack: @_ my ($subtype, $window, $cursor_serial, $time, $cursor_name) = unpack 'xCxxL4', $data; return ( @_, # base fields subtype => $X->interp('XFixesCursorNotifySubtype', $subtype), window => _interp_none($X, $window), # probably not None though cursor_serial => $cursor_serial, time => _interp_time($time), # "name" field only in XFIXES 2.0 up, probably pad garbage # in 1.0, so omit there. Give it as "cursor_name" since # plain "name" is the event name. ( $X->{'ext'}->{'XFIXES'}->[3]->{'major'} >= 2 ? (cursor_name => $cursor_name) : ())); }, sub { my ($X, %h) = @_; # "cursor_name" can be omitted as for a 1.0 event return (pack('xCxxL4x12', $X->num('XFixesCursorNotifySubtype', $h{'subtype'}), _num_none($h{'window'}), $h{'cursor_serial'}, _num_time($h{'time'}), _num_none($h{'cursor_name'} || 0)), 1) ; # "do_seq" put in sequence number } ], ]; sub _ext_events_install { my ($X, $event_num, $events_arrayref) = @_; foreach (my $i = 0 ; $i <= $#$events_arrayref ; $i += 2) { my $name = $events_arrayref->[$i]; if (defined(my $already = $X->{'ext_const'}->{'Events'}->[$event_num])) { carp "Event $event_num $already overwritten with $name"; } $X->{'ext_const'}->{'Events'}->[$event_num] = $name; $X->{'ext_events'}->[$event_num] = $events_arrayref->[$i + 1]; # pack/unpack $event_num++; } } #------------------------------------------------------------------------------ # requests my $requests_arrayref = [[ 'XFixesQueryVersion', # 0 sub { my ($X, $major, $minor) = @_; ### XFixesQueryVersion request return pack 'LL', $major, $minor; }, sub { my ($X, $data) = @_; ### XFixesQueryVersion reply: "$X" my @ret = unpack 'x8SS', $data; my $self; if ($self = $X->{'ext'}->{'XFIXES'}->[3]) { ($self->{'major'}, $self->{'minor'}) = @ret; } return @ret; } ], [ 'XFixesChangeSaveSet', # 1 sub { my ($X, $window, $mode, $target, $map) = @_; return pack('CCCxL', $X->num('XFixesSaveSetMode', $mode), $X->num('XFixesSaveSetTarget', $target), $X->num('XFixesSaveSetMap', $map), $window); } ], [ 'XFixesSelectSelectionInput', # 2 # ($X, $window, $selection, $event_mask) # nothing special for $event_mask yet \&_request_card32s ], [ 'XFixesSelectCursorInput', # 3 # ($X, $window, $event_mask) nothing special for $event_mask yet \&_request_card32s ], [ 'XFixesGetCursorImage', # 4 \&_request_empty, sub { my ($X, $data) = @_; # (rootx,rooty, width,height, xhot,yhot, serial, ... then pixels) my @ret = unpack 'x8ssSSSSL', $data; return (@ret, substr($data, 32, 4 * $ret[2] * $ret[3])); # width*height } ], #--------------------------------------------------------------------------- # version 2.0 [ 'XFixesCreateRegion', # 5 \&_request_region_and_rectangles ], [ 'XFixesCreateRegionFromBitmap', # 6 \&_request_xids ], [ 'XFixesCreateRegionFromWindow', # 7 sub { my ($X, $region, $window, $kind) = @_; ### XFixesCreateRegionFromWindow: $region, $window, $kind return pack('LLCxxx', $region, $window, $X->num('XFixesWindowRegionKind', $kind)); } ], [ 'XFixesCreateRegionFromGC', # 8 \&_request_xids ], [ 'XFixesCreateRegionFromPicture', # 9 \&_request_xids ], [ 'XFixesDestroyRegion', # 10 \&_request_xids ], [ 'XFixesSetRegion', # 11 \&_request_region_and_rectangles ], [ 'XFixesCopyRegion', # 12 \&_request_xids ], [ 'XFixesUnionRegion', # 13 \&_request_xids ], [ 'XFixesIntersectRegion', # 14 \&_request_xids ], [ 'XFixesSubtractRegion', # 15 \&_request_xids ], [ 'XFixesInvertRegion', # 16 sub { my ($X, $src, $rect, $dst) = @_; return pack 'LssSSL', $src, @$rect, $dst; } ], [ 'XFixesTranslateRegion', # 17 sub { shift; # ($X, $region, $dx, $dy) return pack 'Lss', @_; } ], [ 'XFixesRegionExtents', # 18 \&_request_card32s ], # ($X, $src, $dst) [ 'XFixesFetchRegion', # 19 \&_request_card32s, # ($X, $region) sub { my ($X, $data) = @_; ### XFixesFetchRegion reply: length($data) my @ret = ([unpack 'x8ssSS', $data]); # bounding for (my $pos = 32 ; $pos < length($data) ; $pos += 8) { push @ret, [unpack 'ssSS', substr($data, $pos, 8)]; } return @ret; } ], [ 'XFixesSetGCClipRegion', # 20 \&_request_xid_xy_region ], # ($gc, $x, $y, $region) [ 'XFixesSetWindowShapeRegion', # 21 sub { my ($X, $window, $shape_kind, $x, $y, $region) = @_; # use ShapeKind if SHAPE initialized, otherwise same Bounding and # Clip from XFixesWindowRegionKind my $kind_type = ($X->{'ext_const'}->{'ShapeKind'} ? 'ShapeKind' : 'XFixesWindowRegionKind'); return pack('LCxxxssL', $window, $X->num($kind_type, $shape_kind), $x, $y, _num_none($region)); } ], [ 'XFixesSetPictureClipRegion', # 22 \&_request_xid_xy_region ], # ($pict, $x, $y, $region) [ 'XFixesSetCursorName', # 23 sub { my ($X, $cursor, $str) = @_; ### XFixesSetCursorName request ### $cursor ### $str return pack('LSxx' . padded($str), $cursor, length($str), $str); } ], [ 'XFixesGetCursorName', # 24 \&_request_xids, sub { my ($X, $data) = @_; ### XFixesGetCursorName reply my ($atom, $len) = unpack 'x8LS', $data; return (_interp_none($X, $atom), substr($data, 32, $len)); } ], [ 'XFixesGetCursorImageAndName', # 25 \&_request_empty, sub { my ($X, $data) = @_; # (x,y, w,h, xhot,yhot, serial, atom, $namelen, ... then pixels+name) my @ret = unpack 'x8ssSSSSLLSxx', $data; my $namelen = pop @ret; my $atom = pop @ret; my $pixelsize = 4 * $ret[2] * $ret[3]; return ( @ret, substr($data, 32, $pixelsize), # pixels _interp_none($X, $atom), substr($data, 32 + $pixelsize, $namelen)); # name } ], [ 'XFixesChangeCursor', # 26 sub { my ($X, $src, $dst) = @_; return pack 'LL', $src, $dst; } ], [ 'XFixesChangeCursorByName', # 27 sub { my ($X, $src, $str) = @_; return pack('LSxx' . padded($str), $src, length($str), $str); } ], #--------------------------------------------------------------------------- # version 3.0 [ 'XFixesExpandRegion', # 28 sub { shift; # $X return pack 'LLSSSS', @_; # $src, $dst, $left,$right, $top,$bottom } ], #--------------------------------------------------------------------------- # version 4.0 [ 'XFixesHideCursor', # 29 \&_request_xids ], [ 'XFixesShowCursor', # 30 \&_request_xids ], #--------------------------------------------------------------------------- # version 5.0 [ 'XFixesCreatePointerBarrier', # 31 sub { my ($X, $barrier, $drawable, $x1, $y1, $x2, $y2, $directions, @devices) = @_; my $devices = pack 'S*', map { _num_xinputdevice($_) } @devices; ### @devices ### $devices ### format: 'LLssssLxxS'.padded($devices) return pack( 'LLssssLxxS' . padded($devices), $barrier, # CARD32 $drawable, # CARD32 $x1, $y1, $x2, $y2, # INT16 x 4 $directions, # CARD32 scalar(@devices), # CARD16 num_devices $devices ); # packed CARD16s } ], [ 'XFixesDestroyPointerBarrier', # 32 \&_request_xids ], # ($X, $barrier) single barrier to destroy ]; sub _ext_requests_install { my ($X, $request_num, $requests_arrayref) = @_; $X->{'ext_request'}->{$request_num} = $requests_arrayref; my $href = $X->{'ext_request_num'}; my $i; foreach $i (0 .. $#$requests_arrayref) { $href->{$requests_arrayref->[$i]->[0]} = [$request_num, $i]; } } #------------------------------------------------------------------------------ sub new { my ($class, $X, $request_num, $event_num, $error_num) = @_; ### XFIXES new() my $self = bless {}, $class; _ext_constants_install($X, [$self->constants_list]); _ext_requests_install($X, $request_num, $requests_arrayref); _ext_events_install($X, $event_num, $events_arrayref); # the protocol spec says must query version with what we support # need it to know which error types are defined too, as otherwise oughtn't # touch anything at $event_num my ($server_major, $server_minor) = $X->req('XFixesQueryVersion', CLIENT_MAJOR_VERSION, CLIENT_MINOR_VERSION); $self->{'major'} = $server_major; $self->{'minor'} = $server_minor; # Errors _ext_error_install( $X, $error_num, # version 2.0 ($server_major >= 2 ? ('Region') : ()), # version 5.0 ($server_major >= 5 ? ('Barrier') : ())); return $self; } sub _request_empty { if (@_ > 1) { croak "No parameters in this request"; } return ''; } sub _request_xids { my $X = shift; ### _request_xids(): @_ return _request_card32s($X, map { _num_none($_) } @_); } sub _request_card32s { shift; ### _request_card32s(): @_ return pack 'L*', @_; } sub _request_xid_xy_region { my ($X, $xid, $x, $y, $region) = @_; return pack('LLss', $xid, _num_none($region), $x, $y); } sub _request_region_and_rectangles { shift; # $X ### _request_region_and_rectangles: @_ my $region = shift; ### ret: pack('L',$region) . _pack_rectangles(@_) return pack('L', $region) . _pack_rectangles(@_); } sub _pack_rectangles { return join('', map { pack 'ssSS', @$_ } @_); } sub _num_none { my ($xid) = @_; if (defined $xid && $xid eq 'None') { return 0; } else { return $xid; } } sub _interp_none { my ($X, $xid) = @_; if ($X->{'do_interp'} && $xid == 0) { return 'None'; } else { return $xid; } } sub _interp_time { my ($time) = @_; if ($time == 0) { return 'CurrentTime'; } else { return $time; } } sub _num_time { my ($time) = @_; if ($time eq 'CurrentTime') { return 0; } else { return $time; } } sub _num_xinputdevice { my ($device) = @_; if ($device eq 'AllDevices') { return 0; } if ($device eq 'AllMasterDevices') { return 1; } return $device; } sub _ext_error_install { my $X = shift; # ($X, $errname1,$errname2,...) ### _ext_error_install: @_ my $error_num = shift; my $aref = $X->{'ext_const'}{'Error'} # copy = [@{$X->{'ext_const'}{'Error'} || []}]; my $href = $X->{'ext_const_num'}{'Error'} # copy = {%{$X->{'ext_const_num'}{'Error'} || {}}}; my $i; foreach $i (0 .. $#_) { $aref->[$error_num + $i] = $_[$i]; $href->{$_[$i]} = $error_num + $i; } } 1; __END__ =for stopwords XFIXES XID reparent Unmap arrayref AARRGGBB GG pre-multiplied pixmap RENDER ShapeKind subwindow Ryde hotspot ARGB GC ie latin-1 DisplayCursor RGB bitmask XIDs YX-banded subtypes XTEST Xvfb xdm Xlib Xinerama subtype =head1 NAME X11::Protocol::Ext::XFIXES - miscellaneous "fixes" extension =head1 SYNOPSIS use X11::Protocol; my $X = X11::Protocol->new; $X->init_extension('XFIXES') or print "XFIXES extension not available"; =head1 DESCRIPTION The XFIXES extension adds some features which are conceived as "fixing" omissions in the core X11 protocol, including =over =item * Events for changes to the selection (the cut and paste between clients). =item * Current cursor image fetching, cursor change events, and cursor naming and hiding. =item * Server-side "region" objects representing a set of rectangles. =back =head1 REQUESTS The following are made available with an C per L. my $bool = $X->init_extension('XFIXES'); =head2 XFIXES version 1.0 =over =item C<($server_major, $server_minor) = $X-EXFixesQueryVersion ($client_major, $client_minor)> Negotiate a protocol version with the server. C<$client_major> and C<$client_minor> is what the client would like, the returned C<$server_major> and C<$server_minor> is what the server will do, which might be less than requested (but not more than). The current code in this module supports up to 4.0 and automatically negotiates within C, so direct use of C is not necessary. Asking for higher than the code supports might be a bad idea. =item C<($atom, $str) = $X-EXFixesChangeSaveSet ($window, $mode, $target, $map)> Insert or delete C<$window> (an XID) from the "save set" of resources to be retained on the server when the client disconnects. This is an extended version of the core C request. C<$mode> is either "Insert" or "Delete". C<$target> is how to reparent C<$window> on client close-down, either "Nearest" or "Root". The core C is "Nearest" and means go to the next non-client ancestor window. "Root" means go to the root window. C<$map> is either "Map" or "Unmap" to apply to C<$window> on close-down. The core C is "Map". =item $X-EXFixesSelectSelectionInput ($window, $selection, $event_mask)> Select C events (see L below) to be sent to C<$window> when C<$selection> (an atom) changes. $X->XFixesSelectSelectionInput ($my_window, $X->atom('PRIMARY'), 0x07); C<$window> is given in the resulting C. It probably works to make it just a root window. Selections are global to the whole server, so the window doesn't implicitly choose a screen or anything. C<$event_mask> has three bits for which event subtypes should be reported. bitpos bitval SetSelectionOwner 0 0x01 SelectionWindowDestroy 1 0x02 SelectionClientClose 2 0x04 There's no pack function for these yet so just give an integer, for instance 0x07 for all three. See F for a sample program listening to selection changes with this request. =item $X-EXFixesSelectCursorInput ($window, $event_mask)> Select C events (see L below) to be sent to the client. C<$window> is given in the resulting C. It probably works to make it just a root window. The cursor image is global and the events are for any change, not merely within C<$window>. C<$event_mask> has only a single bit, asking for displayed cursor changes, bitpos bitval DisplayCursor 0 0x01 There's no pack function for this yet, just give integer 1 or 0. =item ($root_x,$root_y, $width,$height, $xhot,$yhot, $serial, $pixels) = $X-EXFixesGetCursorImage ()> Return the size and pixel contents of the currently displayed mouse pointer cursor. C<$root_x>,C<$root_y> is the pointer location in root window coordinates (similar to C). C<$width>,C<$height> is the size of the cursor image. C<$xhot>,C<$yhot> is the "hotspot" position within that, which is the pixel that follows the pointer location. C<$pixels> is a byte string of packed "ARGB" pixel values. Each is 32-bits in client byte order, with C<$width> many in each row and C<$height> such rows and no padding in between, so a total C<4*$width*$height> bytes. This can be unpacked with for instance my @argb = unpack 'L*', $pixels; # each 0xAARRGGBB # top left pixel is in $argb[0] my $alpha = ($argb[0] >> 24) & 0xFF; # each value my $red = ($argb[0] >> 16) & 0xFF; # 0 to 255 my $green = ($argb[0] >> 8) & 0xFF; my $blue = $argb[0] & 0xFF; The alpha transparency is pre-multiplied into the RGB components, so if the alpha is zero (transparent) then the components are zero too. The core C bitmask always makes alpha=0 transparent or alpha=255 opaque pixels. The RENDER extension (see L) can make partially transparent cursors. There's no direct way to get the image of a cursor by its XID (except something dodgy like a C to make it the displayed cursor). Usually cursor XIDs are only ever created by a client itself so no need to read back (and the cursor XID can't be read out of an arbitrary window -- though the XTEST extension can do some comparing, per L). For reference, in the X.org server circa version 1.11, the server may start up with no cursor at all, and when that happens an attempt to C gives a "Cursor" error. In practice this probably only happens using a bare Xvfb or similar, since in normal use xdm or the window manager will almost certainly have set a cursor. See F in the X11-Protocol-Other sources for a sample program getting the cursor image with this request. =back =head2 XFIXES version 2.0 A region object on the server represents a set of rectangles, each x,y,width,height, with positive or negative x,y, and the set possibly made of disconnected sections, etc. (Basically a server-side copy of the Xlib region code, see L.) Each rectangle might be just 1x1 for a single pixel, so a region can represent any bitmap, but it's geared towards the sort of rectangle arithmetic which arises from overlapping rectangular windows etc. =over =item C<$X-EXFixesCreateRegion ($region, $rect...)> Create C<$region> (a new XID) as a region and set it to the union of the given rectangles, or empty if none. Each C<$rect> is an arrayref C<[$x,$y,$width,$height]>. my $region = $X->new_rsrc; $X->XFixesCreateRegion ($region, [0,0,10,5], [100,100,1,1]); =item C<$X-EXFixesCreateRegionFromBitmap ($region, $bitmap)> Create a region initialized from the 1 bits of C<$bitmap> (a pixmap XID). my $region = $X->new_rsrc; $X->XFixesCreateRegionFromBitmap ($region, $bitmap); =item C<$X-EXFixesCreateRegionFromWindow ($region, $window, $kind)> Create a region initialized from the shape of C<$window> (an XID). C<$kind> is either "Bounding" or "Clip" as per the SHAPE extension (see L). my $region = $X->new_rsrc; $X->XFixesCreateRegionFromBitmap ($region, $window, 'Clip'); There's no need to C<$X-Einit_extension('SHAPE')> before using this request. Any shape is just on the server and results in a C<$region> of either a single rectangle or set of rectangles for a shape. =item C<$X-EXFixesCreateRegionFromGC ($region, $gc)> Create a region initialized from the clip mask of C<$gc> (an XID). my $region = $X->new_rsrc; $X->XFixesCreateRegionFromGC ($region, $gc); The region is relative to the GC C and C, ie. those offsets are not applied to the X,Y in the region. =item C<$X-EXFixesCreateRegionFromPicture ($region, $picture)> Create a region initialized from a RENDER C<$picture> (an XID). my $region = $X->new_rsrc; $X->XFixesCreateRegionFromBitmap ($region, $picture); The region is relative to the picture C and C, ie. those offsets are not applied to the X,Y in the region. Picture objects are from the RENDER extension (see L). This request always exists, but is not useful without RENDER. =item C<$X-EXFixesDestroyRegion ($region)> Destroy C<$region>. =item C<$X-EXFixesSetRegion ($region, $rect...)> Set C<$region> to the union of the given rectangles, or empty if none. Each C<$rect> is an arrayref C<[$x,$y,$width,$height]>, as per C above. $X->XFixesSetRegion ($region, [0,0,20,10], [100,100,5,5]) =item C<$X-EXFixesCopyRegion ($dst, $src)> Copy a region C<$src> to region C<$dst>. =item C<$X-EXFixesUnionRegion ($src1, $src2, $dst)> =item C<$X-EXFixesIntersectRegion ($src1, $src2, $dst)> =item C<$X-EXFixesSubtractRegion ($src1, $src2, $dst)> Set region C<$dst> to respectively the union or intersection of C<$src1> and C<$src2>, or the subtraction C<$src1> - C<$src2>. C<$dst> can be one of the source regions if desired, to change in-place. =item C<$X-EXFixesInvertRegion ($src, $rect, $dst)> Set region C<$dst> to the inverse of C<$src> bounded by rectangle C<$rect>, ie. C<$rect> subtract C<$src>. C<$rect> is an arrayref C<[$x,$y,$width,$height]>. $X-XFixesInvertRegion ($src, [10,10, 200,100], $dst)> C<$dst> can be the same as C<$src> to do an "in-place" invert. =item C<$X-EXFixesTranslateRegion ($region, $dx, $dy)> Move the area covered by C<$region> by an offset C<$dx> and C<$dy> (integers). =item C<$X-EXFixesRegionExtents ($dst, $src)> Set region C<$dst> to the rectangular bounds of region C<$src>. If C<$src> is empty then C<$dst> is set to empty. =item C<($bounding, @parts) = $X-EXFixesFetchRegion ($region)> Return the rectangles which cover C<$region>. Each returned element is an arrayref [$x,$y,$width,$height] The first is a bounding rectangle, and after that the individual rectangles making up the region, in "YX-banded" order. my ($bounding, @rects) = $X->XFixesFetchRegion ($region); print "bounded by ",join(',',@$bounding); foreach my $rect (@rects) { print " rect part ",join(',',@$rect); } =item C<$X-EXFixesSetGCClipRegion ($gc, $clip_x_origin, $clip_y_origin, $region)> Set the clip mask of C<$gc> (an XID) to C<$region> (an XID), and set the clip origin to C<$clip_x_origin>,C<$clip_x_origin>. This is similar to the core C, but the rectangles are from C<$region> (and no "ordering" parameter). =item C<$X-EXFixesSetWindowShapeRegion ($window, $kind, $x_offset, $y_offset, $region)> Set the shape mask of C<$window> (an XID) to C<$region>, at offset C<$x_offset>,C<$y_offset> into the window. C<$kind> is a ShapeKind, either "Bounding" or "Clip". This is similar to C (see L) with operation "Set" and a a region instead of a bitmap. It's not necessary to C<$X-Einit_extension('SHAPE')> before using this request. If SHAPE is not available on the server then presumably this request gives an error reply. =item C<$X-EXFixesSetPictureClipRegion ($picture, $clip_x_origin, $clip_y_origin, $region)> Set the clip mask of RENDER C<$picture> (an XID) to C<$region>, and set the clip origin to C<$clip_x_origin>,C<$clip_x_origin>. This is similar to C, but the rectangles are from C<$region>. Picture objects are from the RENDER extension (see L). The request always exists, but is not useful without RENDER. =item C<$X-EXFixesSetCursorName ($cursor, $str)> Set a name for cursor object C<$cursor> (an XID). The name string C<$str> is interned as an atom in the server and therefore should consist only of latin-1 characters. (Perhaps in the future that might be enforced here, or wide chars converted.) =item C<($atom, $str) = $X-EXFixesGetCursorName ($cursor)> Get the name of mouse pointer cursor C<$cursor> (an XID), as set by C. The returned C<$atom> is the name atom (an integer) and C<$str> is the name string (which is the atom's name). If there's no name for C<$cursor> then C<$atom> is string "None" (or 0 if no C<$X-E{'do_interp'}>) and C<$str> is empty "". =item C<($x,$y, $width,$height, $xhot,$yhot, $serial, $pixels, $atom, $str) = $X-EXFixesGetCursorImageAndName ()> Get the image and name of the current mouse pointer cursor. The return is per C plus C described above. =item C<$X-EXFixesChangeCursor ($src, $dst)> Change the contents of cursor C<$dst> (an XID) to the contents of cursor C<$src> (an XID). =item C<$X-EXFixesChangeCursorByName ($src, $dst_str)> Change the contents of any cursors with name C<$dst_str> (a string) to the contents of cursor C<$src>. If there's no cursors with name C<$dst_str> then do nothing. =back =head2 XFIXES version 3.0 =over =item C<$X-EXFixesExpandRegion ($src, $dst, $left,$right,$top,$bottom)> Set region C<$dst> (an XID) to the rectangles of region C<$src>, with each rectangle expanded by C<$left>, C<$right>, C<$top>, C<$bottom> many pixels in those respective directions. Notice it doesn't matter how C<$src> is expressed as rectangles, the effect is as if each individual pixel in C<$src> was expanded and the union of the result taken. =back =head2 XFIXES version 4.0 =over =item C<$X-EXFixesHideCursor ($window)> =item C<$X-EXFixesShowCursor ($window)> Hide or show the mouse pointer cursor while it's in C<$window> (an XID) or any subwindow of C<$window>. This hiding for each window is a per-client setting. If more than one client requests hiding then the cursor remains hidden until all of them "show" again. If a client disconnects or is killed then its hides are automatically undone. =back =head2 XFIXES version 5.0 =over =item C<$X-EXFixesCreatePointerBarrier ($barrier, $drawable, $x1,$y1, $x2,$y2, $directions)> =item C<$X-EXFixesCreatePointerBarrier ($barrier, $drawable, $x1,$y1, $x2,$y2, $directions, $deviceid...)> Create C<$barrier> (a new XID) as a barrier object which prevents user mouse pointer movement across a line between points C<$x1,$y1> and C<$x2,$y2>. For example my $barrier = $X->new_rsrc; $X->XFixesCreatePointerBarrier ($barrier, $X->root, 100,100, 100,500, 0); X,Y coordinates are screen coordinates on the screen of C<$drawable>. The line must be horizontal or vertical, so either C<$x1==$x2> or C<$y1==$y2> (but not both). A horizontal barrier is across the top edge of the line pixels, a vertical barrier is along the left edge of the line pixels. C<$directions> is an integer OR of the follow bits for which directions to allow some movement across the line. A value 0 means no movement across is allowed. PositiveX 1 PositiveY 2 NegativeX 4 NegativeY 8 For example on a horizontal line, value 8 would allow the pointer to move through the line in the negative Y direction (up the screen), and movement in the positive Y direction (down the screen) would still be forbidden. C<$directions> can let the user move the mouse out of some sort of forbidden region but not go back in. Optional C<$deviceid> arguments are X Input Extension 2.0 devices the barrier should apply to (see L). With no arguments the barrier is just for the core protocol mouse pointer. Each argument can be device ID integer "AllDevices" enum string, 0 "AllMasterDevices" enum string, 1 It's not necessary to C<$X-Einit_extension('XInputExtension')> before using this request. The user can move the mouse pointer to go around a barrier line but by putting lines together a region can be constructed keeping the pointer inside or outside, or even making a maze to trick the user! Touchscreen pad input is not affected by barriers, and C<$X-EWarpPointer()> can still move the pointer anywhere. One intended use is when a Xinerama screen (see L) is made from monitors of different pixel sizes so parts of the logical screen extent are off the edge of one of the smaller monitors. Barriers can prevent the user losing the mouse in one of those dead regions. For reference, some X.org server versions prior to some time around version 1.14 did not accept C<$deviceid> arguments in the request and gave a C error on attempting to pass them. Those servers might have given an C error anyway (for barrier feature not yet implemented). =item C<$X-EXFixesDestroyPointerBarrier ($barrier)> Destroy the given barrier (an XID). =back =head1 EVENTS The following events have the usual fields name "XFixes..." synthetic true if from a SendEvent code integer opcode sequence_number integer =over =item C This is sent to the client when selected by C above. It reports changes to the selection. The event-specific fields are subtype enum string window XID owner XID of owner window, or "None" selection atom integer time integer, server timestamp selection_time integer, server timestamp C is one of SetSelectionOwner SelectionWindowDestroy SelectionClientClose C