[gnome-screenshot] Add GActions for taking a screen- or window-shot



commit 0c016662cbb915616bad550b1e534e90103f301d
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Feb 12 18:57:35 2015 -0500

    Add GActions for taking a screen- or window-shot
    
    These are required to make the "Desktop Action" entries
    in the desktop file work.

 src/screenshot-application.c |   44 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 43 insertions(+), 1 deletions(-)
---
diff --git a/src/screenshot-application.c b/src/screenshot-application.c
index ccd93ce..aab5e85 100644
--- a/src/screenshot-application.c
+++ b/src/screenshot-application.c
@@ -773,10 +773,52 @@ action_about (GSimpleAction *action,
                          NULL);
 }
 
+static void
+action_screen_shot (GSimpleAction *action,
+                    GVariant *parameter,
+                    gpointer user_data)
+{
+  ScreenshotApplication *self = SCREENSHOT_APPLICATION (user_data);
+
+  screenshot_config_parse_command_line (FALSE, /* clipboard */
+                                        FALSE,  /* window */
+                                        FALSE, /* area */
+                                        FALSE, /* include border */
+                                        FALSE, /* disable border */
+                                        FALSE, /* include pointer */
+                                        NULL,  /* border effect */
+                                        0,     /* delay */
+                                        FALSE, /* interactive */
+                                        NULL); /* file */
+  screenshot_start (self);
+}
+
+static void
+action_window_shot (GSimpleAction *action,
+                    GVariant *parameter,
+                    gpointer user_data)
+{
+  ScreenshotApplication *self = SCREENSHOT_APPLICATION (user_data);
+
+  screenshot_config_parse_command_line (FALSE, /* clipboard */
+                                        TRUE,  /* window */
+                                        FALSE, /* area */
+                                        FALSE, /* include border */
+                                        FALSE, /* disable border */
+                                        FALSE, /* include pointer */
+                                        NULL,  /* border effect */
+                                        0,     /* delay */
+                                        FALSE, /* interactive */
+                                        NULL); /* file */
+  screenshot_start (self);
+}
+
 static GActionEntry action_entries[] = {
   { "about", action_about, NULL, NULL, NULL },
   { "help", action_help, NULL, NULL, NULL },
-  { "quit", action_quit, NULL, NULL, NULL }
+  { "quit", action_quit, NULL, NULL, NULL },
+  { "screen-shot", action_screen_shot, NULL, NULL, NULL },
+  { "window-shot", action_window_shot, NULL, NULL, NULL }
 };
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]