[gnome-screenshot: 1/2] Clean up formatting. Remove extra whitespace, convert tabs to spaces, fix indentation
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-screenshot: 1/2] Clean up formatting. Remove extra whitespace, convert tabs to spaces, fix indentation
- Date: Mon, 3 Sep 2018 23:31:38 +0000 (UTC)
commit 37e520fae7c4d711030a6037e08e6830466e928a
Author: Evan Jarrett <ejfirestar00 gmail com>
Date: Fri Jun 15 22:14:20 2018 -0700
Clean up formatting. Remove extra whitespace, convert tabs to spaces, fix indentation
src/cheese-flash.c | 4 +-
src/gnome-screenshot.1 | 2 +-
src/gnome-screenshot.convert | 2 +-
src/screenshot-application.c | 12 +--
src/screenshot-application.h | 6 +-
src/screenshot-area-selection.c | 6 +-
src/screenshot-config.h | 24 ++---
src/screenshot-dialog.c | 52 +++++-----
src/screenshot-dialog.h | 8 +-
src/screenshot-filename-builder.c | 12 +--
src/screenshot-interactive-dialog.c | 14 +--
src/screenshot-shadow.c | 191 ++++++++++++++++++------------------
src/screenshot-utils.c | 84 ++++++++--------
13 files changed, 207 insertions(+), 210 deletions(-)
---
diff --git a/src/cheese-flash.c b/src/cheese-flash.c
index f60cd56..e04dec0 100644
--- a/src/cheese-flash.c
+++ b/src/cheese-flash.c
@@ -176,7 +176,7 @@ cheese_flash_start_fade (gpointer data)
return FALSE;
}
- flash_priv->fade_timeout_tag =
+ flash_priv->fade_timeout_tag =
g_timeout_add_full (G_PRIORITY_DEFAULT,
1000.0 / FLASH_ANIMATION_RATE,
cheese_flash_opacity_fade,
@@ -201,7 +201,7 @@ cheese_flash_fire (CheeseFlash *flash,
gtk_widget_set_opacity (GTK_WIDGET (flash_window), 0.99);
gtk_widget_show_all (GTK_WIDGET (flash_window));
- flash_priv->flash_timeout_tag =
+ flash_priv->flash_timeout_tag =
g_timeout_add_full (G_PRIORITY_DEFAULT,
FLASH_DURATION,
cheese_flash_start_fade,
diff --git a/src/gnome-screenshot.1 b/src/gnome-screenshot.1
index 4a91e30..c2acd50 100644
--- a/src/gnome-screenshot.1
+++ b/src/gnome-screenshot.1
@@ -35,7 +35,7 @@ Take the screenshot after the specified delay [in seconds].
.TP
\fB-e, --border-effect=\fIEFFECT\fB,\fR
Add an effect to the outside of the screenshot border.
-\fIEFFECT\fR can be ``shadow''
+\fIEFFECT\fR can be ``shadow''
(adding drop shadow), ``border'' (adding rectangular
space around the screenshot), ``vintage'' (desaturating
the screenshot slightly, tinting it and adding
diff --git a/src/gnome-screenshot.convert b/src/gnome-screenshot.convert
index b230664..ebdad47 100644
--- a/src/gnome-screenshot.convert
+++ b/src/gnome-screenshot.convert
@@ -4,4 +4,4 @@ delay = /apps/gnome-screenshot/delay
last-save-directory = /apps/gnome-screenshot/last_save_directory
include-border = /apps/gnome-screenshot/include_border
include-pointer = /apps/gnome-screenshot/include_pointer
-border-effect = /apps/gnome-screenshot/border_effect
\ No newline at end of file
+border-effect = /apps/gnome-screenshot/border_effect
diff --git a/src/screenshot-application.c b/src/screenshot-application.c
index 672c9ce..3728a58 100644
--- a/src/screenshot-application.c
+++ b/src/screenshot-application.c
@@ -89,7 +89,7 @@ set_recent_entry (ScreenshotApplication *self)
}
recent = gtk_recent_manager_get_default ();
-
+
exec_name = g_app_info_get_executable (app);
app_exec = g_strjoin (" ", exec_name, "%u", NULL);
@@ -151,7 +151,7 @@ save_pixbuf_handle_error (ScreenshotApplication *self,
gchar *detail = g_strdup_printf (_("A file named ā%sā already exists in ā%sā"),
file_name, folder_name);
gint response;
-
+
response = screenshot_show_dialog (GTK_WINDOW (dialog->dialog),
GTK_MESSAGE_WARNING,
GTK_BUTTONS_YES_NO,
@@ -215,7 +215,7 @@ save_pixbuf_ready_cb (GObject *source,
static void
find_out_writable_format_by_extension (gpointer data,
- gpointer user_data)
+ gpointer user_data)
{
GdkPixbufFormat *format = (GdkPixbufFormat*) data;
gchar **name = (gchar **) user_data;
@@ -229,7 +229,7 @@ find_out_writable_format_by_extension (gpointer data,
gdk_pixbuf_format_is_writable (format) == TRUE)
{
*name = gdk_pixbuf_format_get_name (format);
- found = TRUE;
+ found = TRUE;
break;
}
ptr++;
@@ -371,7 +371,7 @@ screenshot_save_to_file (ScreenshotApplication *self)
NULL, FALSE,
G_FILE_CREATE_NONE,
G_PRIORITY_DEFAULT,
- NULL,
+ NULL,
save_file_create_ready_cb, self);
}
else
@@ -614,7 +614,7 @@ screenshot_start (ScreenshotApplication *self)
delay = 0;
/* HACK: give time to the dialog to actually disappear.
- * We don't have any way to tell when the compositor has finished
+ * We don't have any way to tell when the compositor has finished
* re-drawing.
*/
if (delay == 0 && screenshot_config->interactive)
diff --git a/src/screenshot-application.h b/src/screenshot-application.h
index 3549590..3b6fe93 100644
--- a/src/screenshot-application.h
+++ b/src/screenshot-application.h
@@ -40,12 +40,12 @@
typedef struct _ScreenshotApplicationPriv ScreenshotApplicationPriv;
typedef struct {
- GtkApplication parent;
- ScreenshotApplicationPriv *priv;
+ GtkApplication parent;
+ ScreenshotApplicationPriv *priv;
} ScreenshotApplication;
typedef struct {
- GtkApplicationClass parent_class;
+ GtkApplicationClass parent_class;
} ScreenshotApplicationClass;
GType screenshot_application_get_type (void);
diff --git a/src/screenshot-area-selection.c b/src/screenshot-area-selection.c
index 79a185a..b74aa22 100644
--- a/src/screenshot-area-selection.c
+++ b/src/screenshot-area-selection.c
@@ -140,7 +140,7 @@ select_area_key_press (GtkWidget *window,
gtk_main_quit ();
}
-
+
return TRUE;
}
@@ -197,7 +197,7 @@ create_select_window (void)
gtk_window_move (GTK_WINDOW (window), -100, -100);
gtk_window_resize (GTK_WINDOW (window), 10, 10);
gtk_widget_show (window);
-
+
return window;
}
@@ -253,7 +253,7 @@ screenshot_select_area_x11_async (CallbackData *cb_data)
res = gdk_device_grab (pointer, gtk_widget_get_window (data.window),
GDK_OWNERSHIP_NONE, FALSE,
GDK_POINTER_MOTION_MASK |
- GDK_BUTTON_PRESS_MASK |
+ GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK,
cursor, GDK_CURRENT_TIME);
diff --git a/src/screenshot-config.h b/src/screenshot-config.h
index ff7e473..a1989d2 100644
--- a/src/screenshot-config.h
+++ b/src/screenshot-config.h
@@ -50,18 +50,18 @@ typedef struct {
extern ScreenshotConfig *screenshot_config;
-void screenshot_load_config (void);
-void screenshot_save_config (void);
-gboolean screenshot_config_parse_command_line (gboolean clipboard_arg,
- gboolean window_arg,
- gboolean area_arg,
- gboolean include_border_arg,
- gboolean disable_border_arg,
- gboolean include_pointer_arg,
- const gchar *border_effect_arg,
- guint delay_arg,
- gboolean interactive_arg,
- const gchar *file_arg);
+void screenshot_load_config (void);
+void screenshot_save_config (void);
+gboolean screenshot_config_parse_command_line (gboolean clipboard_arg,
+ gboolean window_arg,
+ gboolean area_arg,
+ gboolean include_border_arg,
+ gboolean disable_border_arg,
+ gboolean include_pointer_arg,
+ const gchar *border_effect_arg,
+ guint delay_arg,
+ gboolean interactive_arg,
+ const gchar *file_arg);
G_END_DECLS
diff --git a/src/screenshot-dialog.c b/src/screenshot-dialog.c
index d5befdc..248e5f1 100644
--- a/src/screenshot-dialog.c
+++ b/src/screenshot-dialog.c
@@ -71,8 +71,8 @@ on_preview_draw (GtkWidget *drawing_area,
static gboolean
on_preview_button_press_event (GtkWidget *drawing_area,
- GdkEventButton *event,
- gpointer data)
+ GdkEventButton *event,
+ gpointer data)
{
ScreenshotDialog *dialog = data;
@@ -84,8 +84,8 @@ on_preview_button_press_event (GtkWidget *drawing_area,
static gboolean
on_preview_button_release_event (GtkWidget *drawing_area,
- GdkEventButton *event,
- gpointer data)
+ GdkEventButton *event,
+ gpointer data)
{
ScreenshotDialog *dialog = data;
@@ -97,11 +97,11 @@ on_preview_button_release_event (GtkWidget *drawing_area,
static void
drag_data_get (GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- ScreenshotDialog *dialog)
+ GdkDragContext *context,
+ GtkSelectionData *selection_data,
+ guint info,
+ guint time,
+ ScreenshotDialog *dialog)
{
if (info == TYPE_IMAGE_PNG)
gtk_selection_data_set_pixbuf (selection_data, dialog->screenshot);
@@ -111,11 +111,11 @@ drag_data_get (GtkWidget *widget,
static void
drag_begin (GtkWidget *widget,
- GdkDragContext *context,
- ScreenshotDialog *dialog)
+ GdkDragContext *context,
+ ScreenshotDialog *dialog)
{
gtk_drag_set_icon_pixbuf (context, dialog->preview_image,
- dialog->drag_x, dialog->drag_y);
+ dialog->drag_x, dialog->drag_y);
}
static gboolean
@@ -172,8 +172,8 @@ setup_drawing_area (ScreenshotDialog *dialog, GtkBuilder *ui)
gtk_widget_set_size_request (preview_darea, width, height);
gtk_aspect_frame_set (GTK_ASPECT_FRAME (aspect_frame), 0.0, 0.5,
- (gfloat) width / (gfloat) height,
- FALSE);
+ (gfloat) width / (gfloat) height,
+ FALSE);
if (screenshot_config->take_window_shot)
gtk_frame_set_shadow_type (GTK_FRAME (aspect_frame), GTK_SHADOW_NONE);
@@ -186,21 +186,21 @@ setup_drawing_area (ScreenshotDialog *dialog, GtkBuilder *ui)
/* setup dnd */
gtk_drag_source_set (preview_darea,
- GDK_BUTTON1_MASK | GDK_BUTTON3_MASK,
- drag_types, G_N_ELEMENTS (drag_types),
- GDK_ACTION_COPY);
+ GDK_BUTTON1_MASK | GDK_BUTTON3_MASK,
+ drag_types, G_N_ELEMENTS (drag_types),
+ GDK_ACTION_COPY);
g_signal_connect (G_OBJECT (preview_darea), "drag_begin",
- G_CALLBACK (drag_begin), dialog);
+ G_CALLBACK (drag_begin), dialog);
g_signal_connect (G_OBJECT (preview_darea), "drag_data_get",
- G_CALLBACK (drag_data_get), dialog);
+ G_CALLBACK (drag_data_get), dialog);
}
ScreenshotDialog *
screenshot_dialog_new (GdkPixbuf *screenshot,
- char *initial_uri,
- SaveScreenshotCallback f,
- gpointer user_data)
+ char *initial_uri,
+ SaveScreenshotCallback f,
+ gpointer user_data)
{
ScreenshotDialog *dialog;
GtkBuilder *ui;
@@ -263,9 +263,9 @@ screenshot_dialog_new (GdkPixbuf *screenshot,
gtk_widget_grab_focus (dialog->filename_entry);
gtk_editable_select_region (GTK_EDITABLE (dialog->filename_entry),
- 0,
- pos);
-
+ 0,
+ pos);
+
g_free (current_name);
g_free (current_folder);
g_object_unref (ui);
@@ -324,7 +324,7 @@ screenshot_dialog_get_filename (ScreenshotDialog *dialog)
void
screenshot_dialog_set_busy (ScreenshotDialog *dialog,
- gboolean busy)
+ gboolean busy)
{
GdkWindow *window;
diff --git a/src/screenshot-dialog.h b/src/screenshot-dialog.h
index 67bfbd5..d9b07a5 100644
--- a/src/screenshot-dialog.h
+++ b/src/screenshot-dialog.h
@@ -50,14 +50,14 @@ typedef struct {
} ScreenshotDialog;
ScreenshotDialog *screenshot_dialog_new (GdkPixbuf *screenshot,
- char *initial_uri,
- SaveScreenshotCallback f,
- gpointer user_data);
+ char *initial_uri,
+ SaveScreenshotCallback f,
+ gpointer user_data);
char *screenshot_dialog_get_uri (ScreenshotDialog *dialog);
char *screenshot_dialog_get_folder (ScreenshotDialog *dialog);
char *screenshot_dialog_get_filename (ScreenshotDialog *dialog);
void screenshot_dialog_set_busy (ScreenshotDialog *dialog,
- gboolean busy);
+ gboolean busy);
#endif /* __SCREENSHOT_DIALOG_H__ */
diff --git a/src/screenshot-filename-builder.c b/src/screenshot-filename-builder.c
index f29beaa..86c1a51 100644
--- a/src/screenshot-filename-builder.c
+++ b/src/screenshot-filename-builder.c
@@ -36,7 +36,7 @@ typedef enum
NUM_TESTS
} TestType;
-typedef struct
+typedef struct
{
char *base_paths[NUM_TESTS];
char *screenshot_origin;
@@ -54,7 +54,7 @@ expand_initial_tilde (const char *path)
if (path[1] == '/' || path[1] == '\0') {
return g_build_filename (g_get_home_dir (), &path[1], NULL);
}
-
+
slash_after_user_name = strchr (&path[1], '/');
if (slash_after_user_name == NULL) {
user_name = g_strdup (&path[1]);
@@ -64,11 +64,11 @@ expand_initial_tilde (const char *path)
}
passwd_file_entry = getpwnam (user_name);
g_free (user_name);
-
+
if (passwd_file_entry == NULL || passwd_file_entry->pw_dir == NULL) {
return g_strdup (path);
}
-
+
return g_strconcat (passwd_file_entry->pw_dir,
slash_after_user_name,
NULL);
@@ -217,7 +217,7 @@ retry:
file = g_file_new_for_path (path);
info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_TYPE,
- G_FILE_QUERY_INFO_NONE, cancellable, &error);
+ G_FILE_QUERY_INFO_NONE, cancellable, &error);
if (info != NULL)
{
/* file already exists, iterate again */
@@ -302,7 +302,7 @@ out:
void
screenshot_build_filename_async (const char *save_dir,
- const char *screenshot_origin,
+ const char *screenshot_origin,
GAsyncReadyCallback callback,
gpointer user_data)
{
diff --git a/src/screenshot-interactive-dialog.c b/src/screenshot-interactive-dialog.c
index 65ef702..e3b95de 100644
--- a/src/screenshot-interactive-dialog.c
+++ b/src/screenshot-interactive-dialog.c
@@ -68,7 +68,7 @@ target_toggled_cb (GtkToggleButton *button,
{
take_window_shot = (target_toggle == TARGET_TOGGLE_WINDOW);
take_area_shot = (target_toggle == TARGET_TOGGLE_AREA);
-
+
gtk_widget_set_sensitive (border_check, take_window_shot);
gtk_widget_set_sensitive (effect_combo, take_window_shot);
gtk_widget_set_sensitive (effect_label, take_window_shot);
@@ -122,10 +122,10 @@ effect_combo_changed_cb (GtkComboBox *combo,
}
}
-static gint
-interactive_dialog_key_press_cb (GtkWidget *widget,
+static gint
+interactive_dialog_key_press_cb (GtkWidget *widget,
GdkEventKey *event,
- gpointer user_data)
+ gpointer user_data)
{
if (event->keyval == GDK_KEY_F1)
{
@@ -174,7 +174,7 @@ create_effects_combo (void)
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_UINT);
-
+
for (i = 0; i < n_effects; i++)
{
GtkTreeIter iter;
@@ -213,7 +213,7 @@ create_effects_combo (void)
default:
break;
}
-
+
renderer = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (retval), renderer, TRUE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (retval), renderer,
@@ -480,7 +480,7 @@ screenshot_interactive_dialog_new (CaptureClickedCallback f, gpointer user_data)
gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
g_signal_connect (dialog, "key-press-event",
- G_CALLBACK (interactive_dialog_key_press_cb),
+ G_CALLBACK (interactive_dialog_key_press_cb),
NULL);
button = gtk_button_new_with_mnemonic (_("_Cancel"));
diff --git a/src/screenshot-shadow.c b/src/screenshot-shadow.c
index eda983b..db0c891 100644
--- a/src/screenshot-shadow.c
+++ b/src/screenshot-shadow.c
@@ -50,7 +50,7 @@ static double
gaussian (double x, double y, double r)
{
return ((1 / (2 * M_PI * r)) *
- exp ((- (x * x + y * y)) / (2 * r * r)));
+ exp ((- (x * x + y * y)) / (2 * r * r)));
}
static ConvFilter *
@@ -59,33 +59,32 @@ create_blur_filter (int radius)
ConvFilter *filter;
int x, y;
double sum;
-
+
filter = g_new0 (ConvFilter, 1);
filter->size = radius * 2 + 1;
filter->data = g_new (double, filter->size * filter->size);
sum = 0.0;
-
+
for (y = 0 ; y < filter->size; y++)
{
for (x = 0 ; x < filter->size; x++)
- {
- sum += filter->data[y * filter->size + x] = gaussian (x - (filter->size >> 1),
- y - (filter->size >> 1),
- radius);
- }
+ {
+ sum += filter->data[y * filter->size + x] = gaussian (x - (filter->size >> 1),
+ y - (filter->size >> 1),
+ radius);
+ }
}
for (y = 0; y < filter->size; y++)
{
for (x = 0; x < filter->size; x++)
- {
- filter->data[y * filter->size + x] /= sum;
- }
+ {
+ filter->data[y * filter->size + x] /= sum;
+ }
}
return filter;
-
}
static ConvFilter *
@@ -93,7 +92,7 @@ create_outline_filter (int radius)
{
ConvFilter *filter;
double *iter;
-
+
filter = g_new0 (ConvFilter, 1);
filter->size = radius * 2 + 1;
filter->data = g_new (double, filter->size * filter->size);
@@ -123,7 +122,7 @@ create_effect (GdkPixbuf *src,
int src_width, src_height;
int src_rowstride, dest_rowstride;
gboolean src_has_alpha;
-
+
guchar *src_pixels, *dest_pixels;
src_has_alpha = gdk_pixbuf_get_has_alpha (src);
@@ -134,56 +133,56 @@ create_effect (GdkPixbuf *src,
dest_height = src_height + 2 * radius + offset;
dest = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (src),
- TRUE,
- gdk_pixbuf_get_bits_per_sample (src),
- dest_width, dest_height);
-
- gdk_pixbuf_fill (dest, 0);
-
+ TRUE,
+ gdk_pixbuf_get_bits_per_sample (src),
+ dest_width, dest_height);
+
+ gdk_pixbuf_fill (dest, 0);
+
src_pixels = gdk_pixbuf_get_pixels (src);
src_rowstride = gdk_pixbuf_get_rowstride (src);
-
+
dest_pixels = gdk_pixbuf_get_pixels (dest);
dest_rowstride = gdk_pixbuf_get_rowstride (dest);
-
+
for (y = 0; y < dest_height; y++)
{
for (x = 0; x < dest_width; x++)
- {
- suma = 0;
-
- src_x = x - radius;
- src_y = y - radius;
-
- /* We don't need to compute effect here, since this pixel will be
- * discarded when compositing */
- if (src_x >= 0 && src_x < src_width &&
- src_y >= 0 && src_y < src_height &&
- (!src_has_alpha ||
- src_pixels [src_y * src_rowstride + src_x * 4 + 3] == 0xFF))
- continue;
-
- for (i = 0; i < filter->size; i++)
- {
- for (j = 0; j < filter->size; j++)
- {
- src_y = -(radius + offset) + y - (filter->size >> 1) + i;
- src_x = -(radius + offset) + x - (filter->size >> 1) + j;
-
- if (src_y < 0 || src_y >= src_height ||
- src_x < 0 || src_x >= src_width)
- continue;
-
- suma += ( src_has_alpha ?
- src_pixels [src_y * src_rowstride + src_x * 4 + 3] :
- 0xFF ) * filter->data [i * filter->size + j];
- }
- }
-
- dest_pixels [y * dest_rowstride + x * 4 + 3] = CLAMP (suma * opacity, 0x00, 0xFF);
- }
+ {
+ suma = 0;
+
+ src_x = x - radius;
+ src_y = y - radius;
+
+ /* We don't need to compute effect here, since this pixel will be
+ * discarded when compositing */
+ if (src_x >= 0 && src_x < src_width &&
+ src_y >= 0 && src_y < src_height &&
+ (!src_has_alpha ||
+ src_pixels [src_y * src_rowstride + src_x * 4 + 3] == 0xFF))
+ continue;
+
+ for (i = 0; i < filter->size; i++)
+ {
+ for (j = 0; j < filter->size; j++)
+ {
+ src_y = -(radius + offset) + y - (filter->size >> 1) + i;
+ src_x = -(radius + offset) + x - (filter->size >> 1) + j;
+
+ if (src_y < 0 || src_y >= src_height ||
+ src_x < 0 || src_x >= src_width)
+ continue;
+
+ suma += ( src_has_alpha ?
+ src_pixels [src_y * src_rowstride + src_x * 4 + 3] :
+ 0xFF ) * filter->data [i * filter->size + j];
+ }
+ }
+
+ dest_pixels [y * dest_rowstride + x * 4 + 3] = CLAMP (suma * opacity, 0x00, 0xFF);
+ }
}
-
+
return dest;
}
@@ -192,23 +191,23 @@ screenshot_add_shadow (GdkPixbuf **src)
{
GdkPixbuf *dest;
static ConvFilter *filter = NULL;
-
+
if (!filter)
filter = create_blur_filter (BLUR_RADIUS);
-
- dest = create_effect (*src, filter,
- BLUR_RADIUS,
+
+ dest = create_effect (*src, filter,
+ BLUR_RADIUS,
SHADOW_OFFSET, SHADOW_OPACITY);
if (dest == NULL)
- return;
+ return;
gdk_pixbuf_composite (*src, dest,
- BLUR_RADIUS, BLUR_RADIUS,
- gdk_pixbuf_get_width (*src),
- gdk_pixbuf_get_height (*src),
- BLUR_RADIUS, BLUR_RADIUS, 1.0, 1.0,
- GDK_INTERP_BILINEAR, 255);
+ BLUR_RADIUS, BLUR_RADIUS,
+ gdk_pixbuf_get_width (*src),
+ gdk_pixbuf_get_height (*src),
+ BLUR_RADIUS, BLUR_RADIUS, 1.0, 1.0,
+ GDK_INTERP_BILINEAR, 255);
g_object_unref (*src);
*src = dest;
}
@@ -218,23 +217,23 @@ screenshot_add_border (GdkPixbuf **src)
{
GdkPixbuf *dest;
static ConvFilter *filter = NULL;
-
+
if (!filter)
filter = create_outline_filter (OUTLINE_RADIUS);
-
- dest = create_effect (*src, filter,
- OUTLINE_RADIUS,
+
+ dest = create_effect (*src, filter,
+ OUTLINE_RADIUS,
OUTLINE_OFFSET, OUTLINE_OPACITY);
if (dest == NULL)
- return;
+ return;
gdk_pixbuf_composite (*src, dest,
- OUTLINE_RADIUS, OUTLINE_RADIUS,
- gdk_pixbuf_get_width (*src),
- gdk_pixbuf_get_height (*src),
- OUTLINE_RADIUS, OUTLINE_RADIUS, 1.0, 1.0,
- GDK_INTERP_BILINEAR, 255);
+ OUTLINE_RADIUS, OUTLINE_RADIUS,
+ gdk_pixbuf_get_width (*src),
+ gdk_pixbuf_get_height (*src),
+ OUTLINE_RADIUS, OUTLINE_RADIUS, 1.0, 1.0,
+ GDK_INTERP_BILINEAR, 255);
g_object_unref (*src);
*src = dest;
}
@@ -244,38 +243,38 @@ screenshot_add_vintage (GdkPixbuf **src)
{
GdkPixbuf *dest;
static ConvFilter *filter = NULL;
-
+
if (!filter)
filter = create_outline_filter (VINTAGE_OUTLINE_RADIUS);
-
- dest = create_effect (*src, filter,
- VINTAGE_OUTLINE_RADIUS,
+
+ dest = create_effect (*src, filter,
+ VINTAGE_OUTLINE_RADIUS,
OUTLINE_OFFSET, OUTLINE_OPACITY);
if (dest == NULL)
- return;
+ return;
- gdk_pixbuf_fill(dest, VINTAGE_OUTLINE_COLOR);
+ gdk_pixbuf_fill (dest, VINTAGE_OUTLINE_COLOR);
gdk_pixbuf_composite (*src, dest,
- VINTAGE_OUTLINE_RADIUS, VINTAGE_OUTLINE_RADIUS,
- gdk_pixbuf_get_width (*src),
- gdk_pixbuf_get_height (*src),
- VINTAGE_OUTLINE_RADIUS, VINTAGE_OUTLINE_RADIUS, 1.0, 1.0,
- GDK_INTERP_HYPER, 255);
+ VINTAGE_OUTLINE_RADIUS, VINTAGE_OUTLINE_RADIUS,
+ gdk_pixbuf_get_width (*src),
+ gdk_pixbuf_get_height (*src),
+ VINTAGE_OUTLINE_RADIUS, VINTAGE_OUTLINE_RADIUS, 1.0, 1.0,
+ GDK_INTERP_HYPER, 255);
g_object_unref (*src);
*src = dest;
- gdk_pixbuf_saturate_and_pixelate(*src, *src,
- VINTAGE_SATURATION, FALSE);
- dest = gdk_pixbuf_composite_color_simple(*src,
- gdk_pixbuf_get_width(*src),
- gdk_pixbuf_get_height(*src),
- GDK_INTERP_BILINEAR,
- VINTAGE_SOURCE_ALPHA, 64,
- VINTAGE_OVERLAY_COLOR, VINTAGE_OVERLAY_COLOR);
+ gdk_pixbuf_saturate_and_pixelate (*src, *src,
+ VINTAGE_SATURATION, FALSE);
+ dest = gdk_pixbuf_composite_color_simple (*src,
+ gdk_pixbuf_get_width(*src),
+ gdk_pixbuf_get_height(*src),
+ GDK_INTERP_BILINEAR,
+ VINTAGE_SOURCE_ALPHA, 64,
+ VINTAGE_OVERLAY_COLOR, VINTAGE_OVERLAY_COLOR);
if (dest == NULL)
- return;
+ return;
g_object_unref (*src);
*src = dest;
diff --git a/src/screenshot-utils.c b/src/screenshot-utils.c
index fb2166d..b62bf26 100644
--- a/src/screenshot-utils.c
+++ b/src/screenshot-utils.c
@@ -63,7 +63,6 @@ screenshot_window_is_desktop (GdkWindow *window)
return TRUE;
return FALSE;
-
}
static Window
@@ -81,13 +80,13 @@ find_wm_window (GdkWindow *window)
{
if (XQueryTree (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
xid, &root, &parent, &children, &nchildren) == 0)
- {
- g_warning ("Couldn't find window manager window");
- return None;
- }
+ {
+ g_warning ("Couldn't find window manager window");
+ return None;
+ }
if (root == parent)
- return xid;
+ return xid;
xid = parent;
}
@@ -128,7 +127,7 @@ blank_rectangle_in_pixbuf (GdkPixbuf *pixbuf, GdkRectangle *rect)
gboolean has_alpha;
g_assert (gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB);
-
+
x2 = rect->x + rect->width;
y2 = rect->y + rect->height;
@@ -145,14 +144,14 @@ blank_rectangle_in_pixbuf (GdkPixbuf *pixbuf, GdkRectangle *rect)
p = row + rect->x * n_channels;
for (x = rect->x; x < x2; x++)
- {
- *p++ = 0;
- *p++ = 0;
- *p++ = 0;
-
- if (has_alpha)
- *p++ = 255; /* opaque black */
- }
+ {
+ *p++ = 0;
+ *p++ = 0;
+ *p++ = 0;
+
+ if (has_alpha)
+ *p++ = 255; /* opaque black */
+ }
}
}
@@ -169,8 +168,8 @@ blank_region_in_pixbuf (GdkPixbuf *pixbuf, cairo_region_t *region)
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
- pixbuf_rect.x = 0;
- pixbuf_rect.y = 0;
+ pixbuf_rect.x = 0;
+ pixbuf_rect.y = 0;
pixbuf_rect.width = width;
pixbuf_rect.height = height;
@@ -180,7 +179,7 @@ blank_region_in_pixbuf (GdkPixbuf *pixbuf, cairo_region_t *region)
cairo_region_get_rectangle (region, i, &rect);
if (gdk_rectangle_intersect (&rect, &pixbuf_rect, &dest))
- blank_rectangle_in_pixbuf (pixbuf, &dest);
+ blank_rectangle_in_pixbuf (pixbuf, &dest);
}
}
@@ -234,7 +233,7 @@ screenshot_fallback_get_window_rect_coords (GdkWindow *window,
{
real_coordinates.width = gdk_window_get_width (window);
real_coordinates.height = gdk_window_get_height (window);
-
+
gdk_window_get_origin (window, &real_coordinates.x, &real_coordinates.y);
}
@@ -304,7 +303,6 @@ screenshot_play_sound_effect (const gchar *event_id,
done:
if (p != NULL)
ca_proplist_destroy (p);
-
}
static void
@@ -338,7 +336,7 @@ do_find_current_window (void)
current_window = screenshot_find_active_window ();
manager = gdk_display_get_device_manager (gdk_display_get_default ());
device = gdk_device_manager_get_client_pointer (manager);
-
+
/* If there's no active window, we fall back to returning the
* window that the cursor is in.
*/
@@ -348,8 +346,8 @@ do_find_current_window (void)
if (current_window)
{
if (screenshot_window_is_desktop (current_window))
- /* if the current window is the desktop (e.g. nautilus), we
- * return NULL, as getting the whole screen makes more sense.
+ /* if the current window is the desktop (e.g. nautilus), we
+ * return NULL, as getting the whole screen makes more sense.
*/
return NULL;
@@ -391,7 +389,7 @@ screenshot_fallback_get_pixbuf (GdkRectangle *rectangle)
window = screenshot_fallback_find_current_window ();
- screenshot_fallback_get_window_rect_coords (window,
+ screenshot_fallback_get_window_rect_coords (window,
screenshot_config->include_border,
&real_coords,
&screenshot_coords);
@@ -401,7 +399,7 @@ screenshot_fallback_get_pixbuf (GdkRectangle *rectangle)
{
GdkRectangle wm_real_coords;
- wm_window = gdk_x11_window_foreign_new_for_display
+ wm_window = gdk_x11_window_foreign_new_for_display
(gdk_window_get_display (window), wm);
screenshot_fallback_get_window_rect_coords (wm_window,
@@ -450,11 +448,11 @@ screenshot_fallback_get_pixbuf (GdkRectangle *rectangle)
if (rectangles && rectangle_count > 0)
{
gboolean has_alpha = gdk_pixbuf_get_has_alpha (screenshot);
-
+
tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
screenshot_coords.width, screenshot_coords.height);
gdk_pixbuf_fill (tmp, 0);
-
+
for (i = 0; i < rectangle_count; i++)
{
gint rec_x, rec_y;
@@ -528,7 +526,7 @@ screenshot_fallback_get_pixbuf (GdkRectangle *rectangle)
/* if we have a selected area, there were by definition no cursor in the
* screenshot */
- if (screenshot_config->include_pointer && !rectangle)
+ if (screenshot_config->include_pointer && !rectangle)
{
GdkCursor *cursor;
GdkPixbuf *cursor_pixbuf;
@@ -536,7 +534,7 @@ screenshot_fallback_get_pixbuf (GdkRectangle *rectangle)
cursor = gdk_cursor_new_for_display (gdk_display_get_default (), GDK_LEFT_PTR);
cursor_pixbuf = gdk_cursor_get_image (cursor);
- if (cursor_pixbuf != NULL)
+ if (cursor_pixbuf != NULL)
{
GdkDeviceManager *manager;
GdkDevice *device;
@@ -563,7 +561,7 @@ screenshot_fallback_get_pixbuf (GdkRectangle *rectangle)
rect.height = gdk_pixbuf_get_height (cursor_pixbuf);
/* see if the pointer is inside the window */
- if (gdk_rectangle_intersect (&real_coords, &rect, &rect))
+ if (gdk_rectangle_intersect (&real_coords, &rect, &rect))
{
gint cursor_x, cursor_y;
@@ -573,7 +571,7 @@ screenshot_fallback_get_pixbuf (GdkRectangle *rectangle)
cursor_x, cursor_y,
rect.width, rect.height,
cursor_x, cursor_y,
- 1.0, 1.0,
+ 1.0, 1.0,
GDK_INTERP_BILINEAR,
255);
}
@@ -682,17 +680,17 @@ screenshot_show_dialog (GtkWindow *parent,
g_return_val_if_fail ((parent == NULL) || (GTK_IS_WINDOW (parent)),
GTK_RESPONSE_NONE);
g_return_val_if_fail (message != NULL, GTK_RESPONSE_NONE);
-
+
dialog = gtk_message_dialog_new (parent,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- message_type,
- buttons_type,
- "%s", message);
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ message_type,
+ buttons_type,
+ "%s", message);
gtk_window_set_title (GTK_WINDOW (dialog), "");
-
+
if (detail)
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
- "%s", detail);
+ "%s", detail);
if (parent)
{
@@ -702,7 +700,7 @@ screenshot_show_dialog (GtkWindow *parent,
}
response = gtk_dialog_run (GTK_DIALOG (dialog));
-
+
gtk_widget_destroy (dialog);
return response;
@@ -714,15 +712,15 @@ screenshot_display_help (GtkWindow *parent)
GError *error = NULL;
gtk_show_uri (gtk_window_get_screen (parent),
- "help:gnome-help/screen-shot-record",
- gtk_get_current_event_time (), &error);
+ "help:gnome-help/screen-shot-record",
+ gtk_get_current_event_time (), &error);
if (error)
{
- screenshot_show_dialog (parent,
+ screenshot_show_dialog (parent,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
- _("Error loading the help page"),
+ _("Error loading the help page"),
error->message);
g_error_free (error);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]