Index: gnome-panel-screenshot.c =================================================================== RCS file: /cvs/gnome/gnome-utils/gnome-screenshot/gnome-panel-screenshot.c,v retrieving revision 1.84 diff -u -r1.84 gnome-panel-screenshot.c --- gnome-panel-screenshot.c 22 Dec 2004 17:57:01 -0000 1.84 +++ gnome-panel-screenshot.c 4 Mar 2005 23:21:27 -0000 @@ -53,7 +53,6 @@ static char *last_save_dir = NULL; static char *window_title = NULL; static char *temporary_file = NULL; -static gboolean drop_shadow = TRUE; static gboolean save_immediately = FALSE; /* Options */ @@ -318,12 +317,13 @@ screenshot = screenshot_get_pixbuf (win); - if (take_window_shot && drop_shadow) + if (take_window_shot && !strcmp (border_effect, "shadow")) { - GdkPixbuf *old = screenshot; - screenshot = screenshot_add_shadow (screenshot); - g_object_unref (old); + } + else if (take_window_shot && !strcmp (border_effect, "black-line")) + { + screenshot = screenshot_add_black_line (screenshot); } screenshot_release_lock (); Index: screenshot-shadow.c =================================================================== RCS file: /cvs/gnome/gnome-utils/gnome-screenshot/screenshot-shadow.c,v retrieving revision 1.1 diff -u -r1.1 screenshot-shadow.c --- screenshot-shadow.c 22 Oct 2004 19:41:05 -0000 1.1 +++ screenshot-shadow.c 4 Mar 2005 23:21:27 -0000 @@ -7,6 +7,8 @@ #define SHADOW_OFFSET (BLUR_RADIUS * 4 / 5) #define SHADOW_OPACITY 0.5 +#define BORDER_WIDTH 1 + typedef struct { int size; double *data; @@ -150,4 +152,43 @@ return dest; } +GdkPixbuf * +screenshot_add_black_line (GdkPixbuf *src) +{ + GdkPixbuf *dest; + int width, height; + int src_rowstride, dest_rowstride; + int src_bpp, dest_bpp; + guchar *src_pixels, *dest_pixels; + + /* get the width and height of unbordered image */ + width = gdk_pixbuf_get_width (src) + BORDER_WIDTH * 2; + height = gdk_pixbuf_get_height (src) + BORDER_WIDTH * 2; + + printf ("%d x %d", width, height); + + dest = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (src), + gdk_pixbuf_get_has_alpha (src), + gdk_pixbuf_get_bits_per_sample (src), + width, height); + gdk_pixbuf_fill (dest, 0xFF); + + /* what do these next six lines of code do? */ + src_pixels = gdk_pixbuf_get_pixels (src); + src_rowstride = gdk_pixbuf_get_rowstride (src); + src_bpp = gdk_pixbuf_get_has_alpha (src) ? 4 : 3; + + dest_pixels = gdk_pixbuf_get_pixels (dest); + dest_rowstride = gdk_pixbuf_get_rowstride (dest); + dest_bpp = gdk_pixbuf_get_has_alpha (dest) ? 4 : 3; + + /* overlay the original screenshot onto the black */ + gdk_pixbuf_composite (src, dest, + BORDER_WIDTH, BORDER_WIDTH, + gdk_pixbuf_get_width (src), + gdk_pixbuf_get_height (src), + BORDER_WIDTH, BORDER_WIDTH, 1.0, 1.0, + GDK_INTERP_NEAREST, 255); + return dest; +} Index: screenshot-shadow.h =================================================================== RCS file: /cvs/gnome/gnome-utils/gnome-screenshot/screenshot-shadow.h,v retrieving revision 1.1 diff -u -r1.1 screenshot-shadow.h --- screenshot-shadow.h 22 Oct 2004 19:41:05 -0000 1.1 +++ screenshot-shadow.h 4 Mar 2005 23:21:27 -0000 @@ -4,5 +4,6 @@ #include GdkPixbuf *screenshot_add_shadow (GdkPixbuf *src); +GdkPixbuf *screenshot_add_black_line (GdkPixbuf *src); #endif /* __SCREENSHOT_SHADOW_H__ */