diff options
Diffstat (limited to 'mate-screenshot')
| -rw-r--r-- | mate-screenshot/Makefile.am | 15 | ||||
| -rw-r--r-- | mate-screenshot/data/Makefile.am | 26 | ||||
| -rw-r--r-- | mate-screenshot/data/mate-screenshot.ui | 205 | ||||
| -rw-r--r-- | mate-screenshot/data/org.mate.screenshot.gschema.xml.in | 5 | ||||
| -rw-r--r-- | mate-screenshot/src/Makefile.am | 15 | ||||
| -rw-r--r-- | mate-screenshot/src/mate-screenshot.c | 77 | ||||
| -rw-r--r-- | mate-screenshot/src/screenshot-dialog.c | 38 | ||||
| -rw-r--r-- | mate-screenshot/src/screenshot-dialog.h | 24 | ||||
| -rw-r--r-- | mate-screenshot/src/screenshot-save.c | 258 | ||||
| -rw-r--r-- | mate-screenshot/src/screenshot-save.h | 24 | ||||
| -rw-r--r-- | mate-screenshot/src/screenshot-shadow.c | 26 | ||||
| -rw-r--r-- | mate-screenshot/src/screenshot-shadow.h | 24 | ||||
| -rw-r--r-- | mate-screenshot/src/screenshot-utils.c | 32 | ||||
| -rw-r--r-- | mate-screenshot/src/screenshot-utils.h | 24 | ||||
| -rw-r--r-- | mate-screenshot/src/screenshot-xfer.c | 30 | ||||
| -rw-r--r-- | mate-screenshot/src/screenshot-xfer.h | 26 |
16 files changed, 384 insertions, 465 deletions
diff --git a/mate-screenshot/Makefile.am b/mate-screenshot/Makefile.am index 5d55ad08..da02ca28 100644 --- a/mate-screenshot/Makefile.am +++ b/mate-screenshot/Makefile.am @@ -1,3 +1,18 @@ +# This file is part of MATE Utils. +# +# MATE Utils 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 2 of the License, or +# (at your option) any later version. +# +# MATE Utils 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 MATE Utils. If not, see <https://www.gnu.org/licenses/>. + SUBDIRS = data src -include $(top_srcdir)/git.mk diff --git a/mate-screenshot/data/Makefile.am b/mate-screenshot/data/Makefile.am index b713dc6f..4f54db85 100644 --- a/mate-screenshot/data/Makefile.am +++ b/mate-screenshot/data/Makefile.am @@ -1,8 +1,28 @@ +# This file is part of MATE Utils. +# +# MATE Utils 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 2 of the License, or +# (at your option) any later version. +# +# MATE Utils 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 MATE Utils. If not, see <https://www.gnu.org/licenses/>. + mate_screenshotdir = $(datadir)/applications mate_screenshot_in_files = mate-screenshot.desktop.in mate_screenshot_DATA = $(mate_screenshot_in_files:.desktop.in=.desktop) + $(mate_screenshot_DATA): $(mate_screenshot_in_files) - $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ +if USE_NLS + $(AM_V_GEN) $(MSGFMT) --desktop --keyword= --keyword=Name --keyword=Comment --keyword=Keywords --template $< -d $(top_srcdir)/po -o $@ +else + $(AM_V_GEN) cp $< $@ +endif man_MANS = mate-screenshot.1 @@ -10,7 +30,11 @@ appdatadir = $(datadir)/metainfo appdata_in_files = mate-screenshot.appdata.xml.in appdata_DATA = $(appdata_in_files:.xml.in=.xml) $(appdata_DATA): $(appdata_in_files) +if USE_NLS $(AM_V_GEN) $(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@ +else + $(AM_V_GEN) cp $< $@ +endif gsettings_SCHEMAS = org.mate.screenshot.gschema.xml @GSETTINGS_RULES@ diff --git a/mate-screenshot/data/mate-screenshot.ui b/mate-screenshot/data/mate-screenshot.ui index a350face..46d0636c 100644 --- a/mate-screenshot/data/mate-screenshot.ui +++ b/mate-screenshot/data/mate-screenshot.ui @@ -1,64 +1,51 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.22.1 --> +<!-- Generated with glade 3.38.2 --> <!--*- mode: xml -*--> <interface> <requires lib="gtk+" version="3.22"/> <object class="GtkImage" id="image_cancel"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="icon_name">process-stop</property> + <property name="can-focus">False</property> + <property name="icon-name">process-stop</property> </object> <object class="GtkImage" id="image_copy"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="icon_name">edit-copy</property> + <property name="can-focus">False</property> + <property name="icon-name">edit-copy</property> </object> <object class="GtkImage" id="image_help"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="icon_name">help-browser</property> - </object> - <object class="GtkImage" id="image_new"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="icon_name">document-new</property> - </object> - <object class="GtkImage" id="image_save"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="icon_name">document-save</property> + <property name="can-focus">False</property> + <property name="icon-name">help-browser</property> </object> <object class="GtkDialog" id="toplevel"> - <property name="can_focus">False</property> - <property name="border_width">5</property> + <property name="can-focus">False</property> + <property name="border-width">5</property> <property name="title" translatable="yes">Save Screenshot</property> <property name="resizable">False</property> - <property name="type_hint">dialog</property> + <property name="type-hint">dialog</property> <signal name="key-press-event" handler="on_toplevel_key_press_event" swapped="no"/> - <child> - <placeholder/> - </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="orientation">vertical</property> <property name="spacing">2</property> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area1"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="layout_style">end</property> + <property name="can-focus">False</property> + <property name="layout-style">end</property> <child> <object class="GtkButton" id="help_button"> <property name="label" translatable="yes">_Help</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="receives-default">False</property> <property name="image">image_help</property> - <property name="use_underline">True</property> - <property name="always_show_image">True</property> + <property name="use-underline">True</property> + <property name="always-show-image">True</property> </object> <packing> <property name="expand">False</property> @@ -67,71 +54,71 @@ </packing> </child> <child> + <object class="GtkButton" id="new_button"> + <property name="label" translatable="yes">_New</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="receives-default">False</property> + <property name="image">image_new</property> + <property name="use-underline">True</property> + <property name="always-show-image">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> <object class="GtkButton" id="copy_button"> <property name="label" translatable="yes">C_opy to Clipboard</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="receives-default">False</property> <property name="image">image_copy</property> - <property name="use_underline">True</property> - <property name="always_show_image">True</property> + <property name="use-underline">True</property> + <property name="always-show-image">True</property> <accelerator key="C" signal="activate" modifiers="GDK_CONTROL_MASK"/> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> <child> <object class="GtkButton" id="cancel_button"> <property name="label" translatable="yes">_Cancel</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="receives-default">False</property> <property name="image">image_cancel</property> - <property name="use_underline">True</property> - <property name="always_show_image">True</property> + <property name="use-underline">True</property> + <property name="always-show-image">True</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> <child> <object class="GtkButton" id="ok_button"> <property name="label" translatable="yes">_Save</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">False</property> + <property name="can-focus">True</property> + <property name="can-default">True</property> + <property name="has-default">True</property> + <property name="receives-default">False</property> <property name="image">image_save</property> - <property name="use_underline">True</property> - <property name="always_show_image">True</property> + <property name="use-underline">True</property> + <property name="always-show-image">True</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">3</property> - </packing> - </child> - <child> - <object class="GtkButton" id="new_button"> - <property name="label" translatable="yes">_New</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="image">image_new</property> - <property name="use_underline">True</property> - <property name="always_show_image">True</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> <property name="position">4</property> </packing> </child> @@ -139,35 +126,35 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="pack_type">end</property> + <property name="pack-type">end</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkBox" id="vbox3"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="border_width">5</property> + <property name="can-focus">False</property> + <property name="border-width">5</property> <property name="orientation">vertical</property> <property name="spacing">18</property> <child> <object class="GtkBox" id="hbox6"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="spacing">12</property> <child> <object class="GtkAspectFrame" id="aspect_frame"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <property name="label_yalign">0</property> - <property name="shadow_type">in</property> + <property name="can-focus">False</property> + <property name="label-xalign">0</property> + <property name="label-yalign">0</property> + <property name="shadow-type">in</property> <property name="xalign">0</property> <property name="yalign">0</property> <child> <object class="GtkDrawingArea" id="preview_darea"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> </object> </child> </object> @@ -178,64 +165,80 @@ </packing> </child> <child> + <!-- n-columns=3 n-rows=3 --> <object class="GtkGrid" id="table1"> <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> + <property name="can-focus">False</property> + <property name="row-spacing">6</property> + <property name="column-spacing">12</property> <child> <object class="GtkLabel" id="label1"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes">_Name:</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">filename_entry</property> + <property name="use-underline">True</property> + <property name="mnemonic-widget">filename_entry</property> <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> + <property name="left-attach">0</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkLabel" id="label3"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <property name="label" translatable="yes">Save in _folder:</property> - <property name="use_underline">True</property> + <property name="use-underline">True</property> <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="left-attach">0</property> + <property name="top-attach">1</property> </packing> </child> <child> <object class="GtkEntry" id="filename_entry"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">True</property> - <property name="width_chars">32</property> + <property name="can-focus">True</property> + <property name="invisible-char">*</property> + <property name="activates-default">True</property> + <property name="width-chars">32</property> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> + <property name="left-attach">1</property> + <property name="top-attach">0</property> </packing> </child> <child> <object class="GtkBox" id="file_chooser_box"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can-focus">False</property> <child> <placeholder/> </child> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> + <property name="left-attach">1</property> + <property name="top-attach">1</property> </packing> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> <packing> <property name="expand">True</property> @@ -261,10 +264,20 @@ </child> <action-widgets> <action-widget response="-11">help_button</action-widget> + <action-widget response="22">new_button</action-widget> <action-widget response="1">copy_button</action-widget> <action-widget response="-6">cancel_button</action-widget> <action-widget response="-5">ok_button</action-widget> - <action-widget response="22">new_button</action-widget> </action-widgets> </object> + <object class="GtkImage" id="image_new"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="icon-name">document-new</property> + </object> + <object class="GtkImage" id="image_save"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="icon-name">document-save</property> + </object> </interface> diff --git a/mate-screenshot/data/org.mate.screenshot.gschema.xml.in b/mate-screenshot/data/org.mate.screenshot.gschema.xml.in index caaff341..1af576bf 100644 --- a/mate-screenshot/data/org.mate.screenshot.gschema.xml.in +++ b/mate-screenshot/data/org.mate.screenshot.gschema.xml.in @@ -25,5 +25,10 @@ <summary>Border Effect</summary> <description>Effect to add to the outside of a border. Possible values are "shadow", "none", and "border".</description> </key> + <key name="enable-sound" type="b"> + <default>true</default> + <summary>Enable sound</summary> + <description>Whether to play a sound when taking a screenshot</description> + </key> </schema> </schemalist> diff --git a/mate-screenshot/src/Makefile.am b/mate-screenshot/src/Makefile.am index c57f5537..dd7b46ef 100644 --- a/mate-screenshot/src/Makefile.am +++ b/mate-screenshot/src/Makefile.am @@ -1,3 +1,18 @@ +# This file is part of MATE Utils. +# +# MATE Utils 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 2 of the License, or +# (at your option) any later version. +# +# MATE Utils 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 MATE Utils. If not, see <https://www.gnu.org/licenses/>. + NULL = AM_CPPFLAGS = \ diff --git a/mate-screenshot/src/mate-screenshot.c b/mate-screenshot/src/mate-screenshot.c index af94d1ef..b652f79a 100644 --- a/mate-screenshot/src/mate-screenshot.c +++ b/mate-screenshot/src/mate-screenshot.c @@ -1,30 +1,28 @@ -/* mate-screenshot.c - Take a screenshot of the desktop - * - * Copyright (C) 2001 Jonathan Blandford <[email protected]> +/* Copyright (C) 2001 Jonathan Blandford <[email protected]> * Copyright (C) 2006 Emmanuele Bassi <[email protected]> * Copyright (C) 2008 Cosimo Cecchi <[email protected]> + * Copyright (C) 2012-2021 MATE Developers + * + * This file is part of MATE Utils. * - * 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 2 of the - * License, or (at your option) any later version. + * MATE Utils 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 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * MATE Utils 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, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 - * USA + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ -/* THERE ARE NO FEATURE REQUESTS ALLOWED */ -/* IF YOU WANT YOUR OWN FEATURE -- WRITE THE DAMN THING YOURSELF (-: */ -/* MAYBE I LIED... -jrb */ - +#ifdef HAVE_CONFIG_H #include <config.h> +#endif + #include <gdk/gdkx.h> #include <gdk/gdkkeysyms.h> #include <sys/types.h> @@ -34,7 +32,9 @@ #include <unistd.h> #include <stdlib.h> #include <errno.h> +#ifdef ENABLE_NLS #include <locale.h> +#endif /* ENABLE_NLS */ #include <glib/gi18n.h> #include <gio/gio.h> #include <pwd.h> @@ -55,6 +55,7 @@ #define LAST_SAVE_DIRECTORY_KEY "last-save-directory" #define BORDER_EFFECT_KEY "border-effect" #define DELAY_KEY "delay" +#define ENABLE_SOUND_KEY "enable-sound" #define CAJA_PREFERENCES_SCHEMA "org.mate.caja.preferences" enum @@ -540,7 +541,7 @@ create_interactive_dialog (void) G_CALLBACK (interactive_dialog_response_cb), NULL); - g_signal_connect (G_OBJECT (retval), "key-press-event", + g_signal_connect (retval, "key-press-event", G_CALLBACK(key_press_cb), NULL); @@ -760,7 +761,6 @@ screenshot_dialog_response_cb (GtkDialog *d, } } - static void run_dialog (ScreenshotDialog *dialog) { @@ -853,7 +853,8 @@ finish_prepare_screenshot (char *initial_uri, GdkWindow *window, GdkRectangle *r exit (1); } - play_sound_effect (window); + if (g_settings_get_boolean (settings, ENABLE_SOUND_KEY)) + play_sound_effect (window); if (noninteractive_clipboard_arg) { save_screenshot_in_clipboard (gdk_window_get_display (window), screenshot); @@ -1113,7 +1114,6 @@ prepare_screenshot_timeout (gpointer data) return FALSE; } - static gchar * get_desktop_dir (void) { @@ -1180,8 +1180,10 @@ load_options (void) /* Find various dirs */ last_save_dir = g_settings_get_string (settings, LAST_SAVE_DIRECTORY_KEY); - if (!last_save_dir || !last_save_dir[0]) + + if (*last_save_dir == '\0') { + g_free (last_save_dir); last_save_dir = get_desktop_dir (); } else if (last_save_dir[0] == '~') @@ -1217,36 +1219,6 @@ save_options (void) BORDER_EFFECT_KEY, border_effect); } - -static void -register_screenshooter_icon (GtkIconFactory * factory) -{ - GtkIconSource *source; - GtkIconSet *icon_set; - - source = gtk_icon_source_new (); - gtk_icon_source_set_icon_name (source, SCREENSHOOTER_ICON); - - icon_set = gtk_icon_set_new (); - gtk_icon_set_add_source (icon_set, source); - - gtk_icon_factory_add (factory, SCREENSHOOTER_ICON, icon_set); - gtk_icon_set_unref (icon_set); - gtk_icon_source_free (source); -} - -static void -screenshooter_init_stock_icons (void) -{ - GtkIconFactory *factory; - - factory = gtk_icon_factory_new (); - gtk_icon_factory_add_default (factory); - - register_screenshooter_icon (factory); - g_object_unref (factory); -} - void loop_dialog_screenshot (void) { @@ -1321,13 +1293,15 @@ main (int argc, char *argv[]) { "border-effect", 'e', 0, G_OPTION_ARG_STRING, &border_effect_arg, N_("Effect to add to the border (shadow, border or none)"), N_("effect") }, { "interactive", 'i', 0, G_OPTION_ARG_NONE, &interactive_arg, N_("Interactively set options"), NULL }, { "version", 0, 0, G_OPTION_ARG_NONE, &version_arg, N_("Print version information and exit"), NULL }, - { NULL }, + { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }, }; +#ifdef ENABLE_NLS setlocale (LC_ALL, ""); bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); +#endif /* ENABLE_NLS */ context = g_option_context_new (_("Take a picture of the screen")); g_option_context_set_ignore_unknown_options (context, FALSE); @@ -1364,7 +1338,6 @@ main (int argc, char *argv[]) } gtk_window_set_default_icon_name (SCREENSHOOTER_ICON); - screenshooter_init_stock_icons (); settings = g_settings_new (MATE_SCREENSHOT_SCHEMA); load_options (); diff --git a/mate-screenshot/src/screenshot-dialog.c b/mate-screenshot/src/screenshot-dialog.c index 118e03ee..cd1afeb2 100644 --- a/mate-screenshot/src/screenshot-dialog.c +++ b/mate-screenshot/src/screenshot-dialog.c @@ -1,23 +1,26 @@ -/* screenshot-dialog.c - main MATE Screenshot dialog +/* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * This file is part of MATE Utils. * - * 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 2 of the License, or (at your option) any later version. + * MATE Utils 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 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * MATE Utils 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. + * 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, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * You should have received a copy of the GNU General Public License + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ +#ifdef HAVE_CONFIG_H #include <config.h> +#endif + #include <string.h> #include <stdlib.h> @@ -164,7 +167,6 @@ drag_begin (GtkWidget *widget, dialog->drag_x, dialog->drag_y); } - ScreenshotDialog * screenshot_dialog_new (GdkPixbuf *screenshot, char *initial_uri, @@ -251,10 +253,12 @@ screenshot_dialog_new (GdkPixbuf *screenshot, gtk_frame_set_shadow_type (GTK_FRAME (aspect_frame), GTK_SHADOW_IN); /* setup dnd */ - g_signal_connect (G_OBJECT (preview_darea), "drag_begin", - G_CALLBACK (drag_begin), dialog); - g_signal_connect (G_OBJECT (preview_darea), "drag_data_get", - G_CALLBACK (drag_data_get), dialog); + g_signal_connect (preview_darea, "drag_begin", + G_CALLBACK (drag_begin), + dialog); + g_signal_connect (preview_darea, "drag_data_get", + G_CALLBACK (drag_data_get), + dialog); gtk_widget_show_all (toplevel); diff --git a/mate-screenshot/src/screenshot-dialog.h b/mate-screenshot/src/screenshot-dialog.h index ba9702d6..40108a31 100644 --- a/mate-screenshot/src/screenshot-dialog.h +++ b/mate-screenshot/src/screenshot-dialog.h @@ -1,20 +1,20 @@ -/* screenshot-dialog.h - main MATE Screenshot dialog +/* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * This file is part of MATE Utils. * - * 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 2 of the License, or (at your option) any later version. + * MATE Utils 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 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * MATE Utils 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. + * 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, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * You should have received a copy of the GNU General Public License + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ #ifndef __SCREENSHOT_DIALOG_H__ diff --git a/mate-screenshot/src/screenshot-save.c b/mate-screenshot/src/screenshot-save.c index 85559ed6..dd9c032c 100644 --- a/mate-screenshot/src/screenshot-save.c +++ b/mate-screenshot/src/screenshot-save.c @@ -1,27 +1,29 @@ -/* screenshot-save.c - image saving functions for MATE Screenshot +/* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * This file is part of MATE Utils. * - * 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 2 of the License, or (at your option) any later version. + * MATE Utils 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 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * MATE Utils 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. + * 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, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * You should have received a copy of the GNU General Public License + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ +#ifdef HAVE_CONFIG_H #include <config.h> +#endif + #include <stdlib.h> #include <unistd.h> #include <errno.h> -#include <signal.h> #include <string.h> #include <glib/gi18n.h> @@ -30,234 +32,100 @@ static char *parent_dir = NULL; static char *tmp_filename = NULL; -static SaveFunction save_callback = NULL; -static gpointer save_user_data = NULL; - -/* Strategy for saving: - * - * We keep another process around to handle saving the image. This is - * done for two reasons. One, the saving takes a non-zero amount of - * time (about a quarter of a second on my box.) This will make it - * more interactive. The second reason is to make the child - * responsible for cleaning up the temp dir. If the parent process is - * killed or segfaults, the child process can clean up the temp dir. - */ static void -clean_up_temporary_dir (gboolean gui_on_error) +clean_up_temporary_dir (void) { char *message; gboolean error_occurred = FALSE; - if (g_file_test (tmp_filename, G_FILE_TEST_EXISTS)) + if (tmp_filename && g_file_test (tmp_filename, G_FILE_TEST_EXISTS)) error_occurred = unlink (tmp_filename); - if (g_file_test (parent_dir, G_FILE_TEST_EXISTS)) + if (parent_dir && g_file_test (parent_dir, G_FILE_TEST_EXISTS)) error_occurred = rmdir (parent_dir) || error_occurred; if (error_occurred) { message = g_strdup_printf (_("Unable to clear the temporary folder:\n%s"), tmp_filename); - if (gui_on_error) - { - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (NULL, 0, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - "%s", message); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - else - { - g_warning ("%s", message); - } + g_warning ("%s", message); g_free (message); } g_free (tmp_filename); g_free (parent_dir); -} - -static void -child_done_notification (GPid pid, - gint status, - gpointer data) -{ - /* This should never be called. */ - - /* We expect the child to die after the parent. If the child dies - * than it either segfaulted, or was randomly killed. In either - * case, we can't reasonably continue. */ - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (NULL, 0, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("The child save process unexpectedly exited. We are unable to write the screenshot to disk.")); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - - clean_up_temporary_dir (TRUE); - - exit (1); -} - -static gboolean -read_pipe_from_child (GIOChannel *source, - GIOCondition condition, - gpointer data) -{ - if (condition & G_IO_IN) - { - gchar *message = NULL; - gchar *error_message = NULL; - GtkWidget *dialog; - GIOStatus status; - - status = g_io_channel_read_line (source, &error_message, NULL, NULL, NULL); - - if (status == G_IO_STATUS_NORMAL) - { - message = g_strdup_printf ("Unable to save the screenshot to disk:\n\n%s", error_message); - dialog = gtk_message_dialog_new (NULL, 0, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - "%s", message); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - exit (1); - } - } - - (*save_callback) (save_user_data); - - return FALSE; + tmp_filename = NULL; + parent_dir = NULL; } static char * make_temp_directory (void) { - gint result, i; gchar *dir_name; - i = 0; - do - { - gchar *tmp_dir = g_strdup_printf ("mate-screenshot.%u.%d", - (unsigned int) getpid (), - i++); - - dir_name = g_build_filename (g_get_tmp_dir (), - tmp_dir, - NULL); - g_free (tmp_dir); - - result = g_mkdir_with_parents (dir_name, 0777); - if (result < 0) - { - g_free (dir_name); + // mkdtemp uses XXXXXX as a template to create a unique name for the temp dir + dir_name = g_build_filename (g_get_tmp_dir (), + "mate-screenshot.XXXXXX", + NULL); - if (errno != EEXIST) - return NULL; - else - continue; - } - else - return dir_name; + if (mkdtemp (dir_name) == NULL) + { + g_warning ("Failed to create temporary directory: %s", g_strerror (errno)); + g_free (dir_name); + return NULL; } - while (TRUE); + + return dir_name; } static void -signal_handler (int sig) +cleanup_handler (void) { - clean_up_temporary_dir (FALSE); - - signal (sig, SIG_DFL); - kill (getpid (), sig); + clean_up_temporary_dir (); } void screenshot_save_start (GdkPixbuf *pixbuf, - SaveFunction callback, - gpointer user_data) + SaveFunction callback, + gpointer user_data) { - GPid pid; - int parent_exit_notification[2]; - int pipe_from_child[2]; + GError *error = NULL; - if (pipe (parent_exit_notification) == -1) - perror("pipe error"); + static gboolean cleanup_registered = FALSE; + if (!cleanup_registered) + { + atexit (cleanup_handler); + cleanup_registered = TRUE; + } - if (pipe (pipe_from_child) == -1) - perror("pipe error"); + clean_up_temporary_dir (); parent_dir = make_temp_directory (); if (parent_dir == NULL) - return; + { + if (callback) + callback (user_data); + return; + } tmp_filename = g_build_filename (parent_dir, - _("Screenshot.png"), - NULL); - save_callback = callback; - save_user_data = user_data; + _("Screenshot.png"), + NULL); - pid = fork (); - if (pid == 0) + if (! gdk_pixbuf_save (pixbuf, tmp_filename, + "png", &error, + "tEXt::Software", "mate-screenshot", + NULL)) { - GError *error = NULL; - char c; - - signal (SIGINT, signal_handler); - signal (SIGTERM, signal_handler); - - close (parent_exit_notification [1]); - close (pipe_from_child [0]); - - if (! gdk_pixbuf_save (pixbuf, tmp_filename, - "png", &error, - "tEXt::Software", "mate-screenshot", - NULL)) - { - if (error && error->message) - if (write (pipe_from_child[1], error->message, strlen (error->message)) == -1) - perror("write error"); - else -#define ERROR_MESSAGE _("Unknown error saving screenshot to disk") - if (write (pipe_from_child[1], ERROR_MESSAGE, strlen (ERROR_MESSAGE)) == -1) - perror("write error"); - } - /* By closing the pipe, we let the main process know that we're - * done saving it. */ - close (pipe_from_child[1]); + if (error && error->message) + g_warning ("Failed to save screenshot: %s", error->message); + else + g_warning ("Failed to save screenshot: Unknown error"); - if (read (parent_exit_notification[0], &c, 1) == -1) - perror("read error"); + g_error_free (error); - clean_up_temporary_dir (FALSE); - _exit (0); + clean_up_temporary_dir (); } - else if (pid > 0) - { - GIOChannel *channel; - close (parent_exit_notification[0]); - close (pipe_from_child[1]); - - channel = g_io_channel_unix_new (pipe_from_child[0]); - g_io_add_watch (channel, - G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL, - read_pipe_from_child, - NULL); - g_io_channel_unref (channel); - g_child_watch_add (pid, child_done_notification, NULL); - } - else - /* George awesomely wrote code originally to handle the - * could-not-fork case synchronously. I'm not copying it, as I'm - * guessing that the system is pretty hosed if that's the case. - * However, he gets major kudos for trying. (-: - */ - g_assert_not_reached (); + if (callback) + callback (user_data); } const char * diff --git a/mate-screenshot/src/screenshot-save.h b/mate-screenshot/src/screenshot-save.h index ccca2f5f..3db39631 100644 --- a/mate-screenshot/src/screenshot-save.h +++ b/mate-screenshot/src/screenshot-save.h @@ -1,20 +1,20 @@ -/* screenshot-save.h - image saving functions for MATE Screenshot +/* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * This file is part of MATE Utils. * - * 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 2 of the License, or (at your option) any later version. + * MATE Utils 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 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * MATE Utils 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. + * 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, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * You should have received a copy of the GNU General Public License + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ #ifndef __SCREENSHOT_SAVE_H__ diff --git a/mate-screenshot/src/screenshot-shadow.c b/mate-screenshot/src/screenshot-shadow.c index 76e75812..dfef5edf 100644 --- a/mate-screenshot/src/screenshot-shadow.c +++ b/mate-screenshot/src/screenshot-shadow.c @@ -1,24 +1,22 @@ -/* screenshot-shadow.c - part of MATE Screenshot +/* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * This file is part of MATE Utils. * - * 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 2 of the License, or (at your option) any later version. + * MATE Utils 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 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * MATE Utils 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. + * 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, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * You should have received a copy of the GNU General Public License + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ -/* Shadow code from anders */ - #ifdef HAVE_CONFIG_H #include <config.h> #endif diff --git a/mate-screenshot/src/screenshot-shadow.h b/mate-screenshot/src/screenshot-shadow.h index c4162a5f..16c16e3a 100644 --- a/mate-screenshot/src/screenshot-shadow.h +++ b/mate-screenshot/src/screenshot-shadow.h @@ -1,20 +1,20 @@ -/* screenshot-shadow.h - part of MATE Screenshot +/* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * This file is part of MATE Utils. * - * 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 2 of the License, or (at your option) any later version. + * MATE Utils 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 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * MATE Utils 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. + * 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, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * You should have received a copy of the GNU General Public License + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ #ifndef __SCREENSHOT_SHADOW_H__ diff --git a/mate-screenshot/src/screenshot-utils.c b/mate-screenshot/src/screenshot-utils.c index 88095710..6ee457c9 100644 --- a/mate-screenshot/src/screenshot-utils.c +++ b/mate-screenshot/src/screenshot-utils.c @@ -1,24 +1,27 @@ -/* screenshot-utils.c - common functions for MATE Screenshot - * - * Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> +/* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> * Copyright (C) 2008 Cosimo Cecchi <[email protected]> + * Copyright (C) 2012-2021 MATE Developers + * + * This file is part of MATE Utils. * - * 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 2 of the License, or (at your option) any later version. + * MATE Utils 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 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * MATE Utils 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. + * 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, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * You should have received a copy of the GNU General Public License + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ -#include "config.h" +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include "screenshot-utils.h" #include <X11/Xatom.h> @@ -311,7 +314,6 @@ select_area_key_press (GtkWidget *window, return TRUE; } - static gboolean draw (GtkWidget *window, cairo_t *cr, gpointer unused) { diff --git a/mate-screenshot/src/screenshot-utils.h b/mate-screenshot/src/screenshot-utils.h index 88fd43ea..0b7e5700 100644 --- a/mate-screenshot/src/screenshot-utils.h +++ b/mate-screenshot/src/screenshot-utils.h @@ -1,20 +1,20 @@ -/* screenshot-utils.h - common functions for MATE Screenshot +/* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * This file is part of MATE Utils. * - * 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 2 of the License, or (at your option) any later version. + * MATE Utils 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 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * MATE Utils 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. + * 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, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * You should have received a copy of the GNU General Public License + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ #ifndef __SCREENSHOT_UTILS_H__ diff --git a/mate-screenshot/src/screenshot-xfer.c b/mate-screenshot/src/screenshot-xfer.c index a11131a7..66aff329 100644 --- a/mate-screenshot/src/screenshot-xfer.c +++ b/mate-screenshot/src/screenshot-xfer.c @@ -1,24 +1,26 @@ -/* screenshot-xfer.c - file transfer functions for MATE Screenshot +/* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * Copyright (C) 2008 Cosimo Cecchi <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> - * Copyright (C) 2008 Cosimo Cecchi <[email protected]> + * This file is part of MATE Utils. * - * 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 2 of the License, or (at your option) any later version. + * MATE Utils 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 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * MATE Utils 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. + * 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, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * You should have received a copy of the GNU General Public License + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ -#include "config.h" +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif #include "screenshot-xfer.h" diff --git a/mate-screenshot/src/screenshot-xfer.h b/mate-screenshot/src/screenshot-xfer.h index 52262f11..df4a6bb2 100644 --- a/mate-screenshot/src/screenshot-xfer.h +++ b/mate-screenshot/src/screenshot-xfer.h @@ -1,21 +1,21 @@ -/* screenshot-xfer.h - file transfer functions for MATE Screenshot +/* Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> + * Copyright (C) 2008 Cosimo Cecchi <[email protected]> + * Copyright (C) 2012-2021 MATE Developers * - * Copyright (C) 2001-2006 Jonathan Blandford <[email protected]> - * Copyright (C) 2008 Cosimo Cecchi <[email protected]> + * This file is part of MATE Utils. * - * 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 2 of the License, or (at your option) any later version. + * MATE Utils 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 2 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * MATE Utils 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. + * 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, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * You should have received a copy of the GNU General Public License + * along with MATE Utils. If not, see <https://www.gnu.org/licenses/>. */ #ifndef __SCREENSHOT_XFER_H__ |
