[Goodies-commits] r6372 - in xfce4-screenshooter-plugin/trunk: . lib panel-plugin src

Jerome Guelfucci jeromeg at xfce.org
Sun Dec 28 12:03:34 CET 2008


Author: jeromeg
Date: 2008-12-28 11:03:34 +0000 (Sun, 28 Dec 2008)
New Revision: 6372

Modified:
   xfce4-screenshooter-plugin/trunk/ChangeLog
   xfce4-screenshooter-plugin/trunk/lib/screenshooter-actions.c
   xfce4-screenshooter-plugin/trunk/lib/screenshooter-dialogs.c
   xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.c
   xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.h
   xfce4-screenshooter-plugin/trunk/panel-plugin/screenshooter-plugin.c
   xfce4-screenshooter-plugin/trunk/src/main.c
Log:
Rename mode into region and RECTANGLE into SELECT.

Modified: xfce4-screenshooter-plugin/trunk/ChangeLog
===================================================================
--- xfce4-screenshooter-plugin/trunk/ChangeLog	2008-12-28 10:43:24 UTC (rev 6371)
+++ xfce4-screenshooter-plugin/trunk/ChangeLog	2008-12-28 11:03:34 UTC (rev 6372)
@@ -1,5 +1,9 @@
 2008-12-28 jeromeg
 
+  * Rename "mode" into "region" and "RECTANGLE" into "SELECT".
+
+2008-12-28 jeromeg
+
   * NEWS: updated.
 
 2008-12-28 jeromeg

Modified: xfce4-screenshooter-plugin/trunk/lib/screenshooter-actions.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/lib/screenshooter-actions.c	2008-12-28 10:43:24 UTC (rev 6371)
+++ xfce4-screenshooter-plugin/trunk/lib/screenshooter-actions.c	2008-12-28 11:03:34 UTC (rev 6372)
@@ -22,7 +22,7 @@
 void screenshooter_take_and_output_screenshot (ScreenshotData *sd)
 {
   GdkPixbuf *screenshot = 
-    screenshooter_take_screenshot (sd->mode, sd->delay);
+    screenshooter_take_screenshot (sd->region, sd->delay);
   
   if (sd->action == SAVE)
     {

Modified: xfce4-screenshooter-plugin/trunk/lib/screenshooter-dialogs.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/lib/screenshooter-dialogs.c	2008-12-28 10:43:24 UTC (rev 6371)
+++ xfce4-screenshooter-plugin/trunk/lib/screenshooter-dialogs.c	2008-12-28 11:03:34 UTC (rev 6372)
@@ -86,7 +86,7 @@
 {
   if (gtk_toggle_button_get_active (tb))
     {
-      sd->mode = FULLSCREEN;
+      sd->region = FULLSCREEN;
     }
 }
 
@@ -98,7 +98,7 @@
 {
   if (gtk_toggle_button_get_active (tb))
     {
-      sd->mode = ACTIVE_WINDOW;
+      sd->region = ACTIVE_WINDOW;
     }
 }
 
@@ -110,7 +110,7 @@
 {
   if (gtk_toggle_button_get_active (tb))
     {
-      sd->mode = RECTANGLE;
+      sd->region = SELECT;
     }
 }
 
@@ -555,7 +555,7 @@
                       FALSE, 0);
   
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (fullscreen_button),
-                                (sd->mode == FULLSCREEN));
+                                (sd->region == FULLSCREEN));
   
   #if GTK_CHECK_VERSION(2,12,0)                              
   gtk_widget_set_tooltip_text (fullscreen_button,
@@ -579,7 +579,7 @@
                       FALSE, 0);
   
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (active_window_button),
-                                (sd->mode == ACTIVE_WINDOW));
+                                (sd->region == ACTIVE_WINDOW));
   
   #if GTK_CHECK_VERSION(2,12,0)
   gtk_widget_set_tooltip_text (active_window_button,
@@ -603,7 +603,7 @@
                        FALSE, 0);
                        
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rectangle_button),
-                                (sd->mode == RECTANGLE));
+                                (sd->region == SELECT));
   
   #if GTK_CHECK_VERSION(2,12,0)
   gtk_widget_set_tooltip_text (rectangle_button,

Modified: xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.c	2008-12-28 10:43:24 UTC (rev 6371)
+++ xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.c	2008-12-28 11:03:34 UTC (rev 6372)
@@ -31,7 +31,7 @@
 *get_window_screenshot                (GdkWindow        *window);
 
 static GdkPixbuf
-*get_rectangle_screenshot             ();
+*get_rectangle_screenshot             (void);
 
 
 
@@ -126,7 +126,7 @@
 static GdkPixbuf
 *get_rectangle_screenshot ()
 {
-  GdkPixbuf *screenshot=NULL;
+  GdkPixbuf *screenshot = NULL;
  
   /* Get display and root window */
   GdkDisplay *display = gdk_display_get_default ();
@@ -282,7 +282,7 @@
 *sd: a ScreenshotData struct.
 returns: the screenshot in a *GdkPixbuf.
 */
-GdkPixbuf *screenshooter_take_screenshot (gint mode, gint delay)
+GdkPixbuf *screenshooter_take_screenshot (gint region, gint delay)
 {
   GdkPixbuf *screenshot;
   GdkWindow *window = NULL;
@@ -297,28 +297,28 @@
   screen = gdk_screen_get_default ();
   
   /* wait for n=delay seconds */ 
-  if (mode != RECTANGLE)
+  if (region != SELECT)
     sleep (delay);
     
   /* Get the window/desktop we want to screenshot*/  
-  if (mode == FULLSCREEN)
+  if (region == FULLSCREEN)
     {
       window = gdk_get_default_root_window ();
       needs_unref = FALSE;
     } 
-  else if (mode == ACTIVE_WINDOW)
+  else if (region == ACTIVE_WINDOW)
     {
       window = get_active_window (screen, &needs_unref);      
     }
       
-  if (mode == FULLSCREEN || mode == ACTIVE_WINDOW)
+  if (region == FULLSCREEN || region == ACTIVE_WINDOW)
     {
       screenshot = get_window_screenshot (window);
       
       if (needs_unref)
 	      g_object_unref (window);
     }
-  else if (mode == RECTANGLE)
+  else if (region == SELECT)
     {
       screenshot = get_rectangle_screenshot ();
     }
@@ -358,7 +358,7 @@
 {
   XfceRc *rc;
   gint delay = 0;
-  gint mode = FULLSCREEN;
+  gint region = FULLSCREEN;
   gint action = SAVE;
   gint show_save_dialog = 1;
   gchar *screenshot_dir = g_strdup (DEFAULT_SAVE_DIRECTORY);
@@ -374,7 +374,7 @@
         {
           delay = xfce_rc_read_int_entry (rc, "delay", 0);
               
-          mode = xfce_rc_read_int_entry (rc, "mode", FULLSCREEN);
+          region = xfce_rc_read_int_entry (rc, "region", FULLSCREEN);
               
           action = xfce_rc_read_int_entry (rc, "action", SAVE);
               
@@ -401,7 +401,7 @@
    
   /* And set the sd values */
   sd->delay = delay;
-  sd->mode = mode;
+  sd->region = region;
   sd->action = action;
   sd->show_save_dialog = show_save_dialog;
   sd->screenshot_dir = screenshot_dir;
@@ -429,7 +429,7 @@
   g_return_if_fail (rc != NULL);
   
   xfce_rc_write_int_entry (rc, "delay", sd->delay);
-  xfce_rc_write_int_entry (rc, "mode", sd->mode);
+  xfce_rc_write_int_entry (rc, "region", sd->region);
   xfce_rc_write_int_entry (rc, "action", sd->action);
   xfce_rc_write_int_entry (rc, "show_save_dialog", 
                            sd->show_save_dialog);

Modified: xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.h
===================================================================
--- xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.h	2008-12-28 10:43:24 UTC (rev 6371)
+++ xfce4-screenshooter-plugin/trunk/lib/screenshooter-utils.h	2008-12-28 11:03:34 UTC (rev 6372)
@@ -42,7 +42,7 @@
   MODE_0,
   FULLSCREEN,
   ACTIVE_WINDOW,
-  RECTANGLE,
+  SELECT,
 };
 
 
@@ -62,7 +62,7 @@
 /* Struct to store the screenshot options */
 typedef struct
 {
-  gint mode;
+  gint region;
   gint show_save_dialog;
   gint delay;
   gint action;
@@ -76,7 +76,7 @@
 
 
 GdkPixbuf 
-*screenshooter_take_screenshot   (gint                  mode, 
+*screenshooter_take_screenshot   (gint                  region, 
                                   gint                  delay);
 void
 screenshooter_copy_to_clipboard  (GdkPixbuf            *screenshot) ;

Modified: xfce4-screenshooter-plugin/trunk/panel-plugin/screenshooter-plugin.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/panel-plugin/screenshooter-plugin.c	2008-12-28 10:43:24 UTC (rev 6371)
+++ xfce4-screenshooter-plugin/trunk/panel-plugin/screenshooter-plugin.c	2008-12-28 11:03:34 UTC (rev 6372)
@@ -221,17 +221,17 @@
       
       /* Update tooltips according to the chosen option */
       #if GTK_CHECK_VERSION(2,12,0)
-      if (pd->sd->mode == FULLSCREEN)
+      if (pd->sd->region == FULLSCREEN)
       {
         gtk_widget_set_tooltip_text (GTK_WIDGET (pd->button),
                         _("Take a screenshot of the entire screen"));
       }
-      else if (pd->sd->mode == ACTIVE_WINDOW)
+      else if (pd->sd->region == ACTIVE_WINDOW)
       {
         gtk_widget_set_tooltip_text (GTK_WIDGET (pd->button),
                         _("Take a screenshot of the active window"));
       }
-      else if (pd->sd->mode == RECTANGLE)
+      else if (pd->sd->region == SELECT)
       {
         gtk_widget_set_tooltip_text (GTK_WIDGET (pd->button),
    _("Select a region to be captured by clicking a point of the screen "
@@ -311,17 +311,17 @@
   
   /* Set the tooltips if available */
   #if GTK_CHECK_VERSION(2,12,0)
-  if (pd->sd->mode == FULLSCREEN)
+  if (pd->sd->region == FULLSCREEN)
    {
      gtk_widget_set_tooltip_text (GTK_WIDGET (pd->button),
                       _("Take a screenshot of the entire screen"));
    }
-  else if (pd->sd->mode == ACTIVE_WINDOW)
+  else if (pd->sd->region == ACTIVE_WINDOW)
     {
       gtk_widget_set_tooltip_text (GTK_WIDGET (pd->button),
                       _("Take a screenshot of the active window"));
     }
-  else if (pd->sd->mode == RECTANGLE)
+  else if (pd->sd->region == SELECT)
     {
       gtk_widget_set_tooltip_text (GTK_WIDGET (pd->button),
    _("Select a region to be captured by clicking a point of the screen "

Modified: xfce4-screenshooter-plugin/trunk/src/main.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/src/main.c	2008-12-28 10:43:24 UTC (rev 6371)
+++ xfce4-screenshooter-plugin/trunk/src/main.c	2008-12-28 11:03:34 UTC (rev 6372)
@@ -103,7 +103,7 @@
           
       /* Make sure the window manager had time to set the new active
       * window.*/
-      if (sd->mode != RECTANGLE)
+      if (sd->region != SELECT)
         sleep (1);
               
       screenshooter_take_and_output_screenshot (sd);
@@ -197,21 +197,21 @@
       return 0;
     }
     
-  /* If a mode cli option is given, take the screenshot accordingly. */
+  /* If a region cli option is given, take the screenshot accordingly.*/
   if (fullscreen || window || region)
     {
       /* Set the region to be captured */
       if (window)
         {
-          sd->mode = ACTIVE_WINDOW;    
+          sd->region = ACTIVE_WINDOW;    
         }
       else if (fullscreen)
         {
-          sd->mode = FULLSCREEN;
+          sd->region = FULLSCREEN;
         }
       else if (region)
         {
-          sd->mode = RECTANGLE;
+          sd->region = SELECT;
         }
       
       /* Wether to show the save dialog allowing to choose a filename 




More information about the Goodies-commits mailing list