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/src/Makefile.am | 15 | ||||
-rw-r--r-- | mate-screenshot/src/mate-screenshot.c | 73 | ||||
-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 | 71 | ||||
-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 |
15 files changed, 352 insertions, 301 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/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..9786c994 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> @@ -540,7 +540,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 +760,6 @@ screenshot_dialog_response_cb (GtkDialog *d, } } - static void run_dialog (ScreenshotDialog *dialog) { @@ -1113,7 +1112,6 @@ prepare_screenshot_timeout (gpointer data) return FALSE; } - static gchar * get_desktop_dir (void) { @@ -1180,8 +1178,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 +1217,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 +1291,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 +1336,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..1acf898f 100644 --- a/mate-screenshot/src/screenshot-save.c +++ b/mate-screenshot/src/screenshot-save.c @@ -1,23 +1,26 @@ -/* 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> @@ -178,12 +181,12 @@ signal_handler (int sig) 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]; + int parent_exit_notification[2]; + int pipe_from_child[2]; if (pipe (parent_exit_notification) == -1) perror("pipe error"); @@ -196,8 +199,8 @@ screenshot_save_start (GdkPixbuf *pixbuf, return; tmp_filename = g_build_filename (parent_dir, - _("Screenshot.png"), - NULL); + _("Screenshot.png"), + NULL); save_callback = callback; save_user_data = user_data; @@ -214,18 +217,22 @@ screenshot_save_start (GdkPixbuf *pixbuf, 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 + "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"); - } + 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]); @@ -245,9 +252,9 @@ screenshot_save_start (GdkPixbuf *pixbuf, 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_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); } 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__ |