diff -Nru maim-3.3.41/CMakeLists.txt maim-3.4.47/CMakeLists.txt --- maim-3.3.41/CMakeLists.txt 2014-12-04 02:34:41.000000000 +0000 +++ maim-3.4.47/CMakeLists.txt 2016-02-05 06:35:30.000000000 +0000 @@ -2,8 +2,8 @@ project( "maim" ) set( maim_VERSION_MAJOR 3 ) -set( maim_VERSION_MINOR 3 ) -set( maim_VERSION_PATCH 41 ) +set( maim_VERSION_MINOR 4 ) +set( maim_VERSION_PATCH 47 ) set( BIN_TARGET "${PROJECT_NAME}" ) @@ -30,7 +30,7 @@ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-parameter" ) - set( CMAKE_CXX_FLAGS_DEBUG "-Wextra -pedantic-errors -O0 -g" ) + set( CMAKE_CXX_FLAGS_DEBUG "-Wextra -pedantic -O0 -g" ) set( CMAKE_CXX_FLAGS_RELEASE "-O2" ) set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" ) # -Wall: Enable all warnings. diff -Nru maim-3.3.41/debian/changelog maim-3.4.47/debian/changelog --- maim-3.3.41/debian/changelog 2016-03-26 20:26:27.000000000 +0000 +++ maim-3.4.47/debian/changelog 2017-03-20 14:10:44.000000000 +0000 @@ -1,3 +1,16 @@ +maim (3.4.47-1~webupd8~zesty0) zesty; urgency=medium + + * Upload for Zesty + + -- Alin Andrei Mon, 20 Mar 2017 16:10:44 +0200 + +maim (3.4.47-1~webupd8~yakkety0) yakkety; urgency=medium + + * Import from Debian + * Recommends: slop + + -- Alin Andrei Mon, 17 Oct 2015 13:43:19 +0100 + maim (3.3.41-1) unstable; urgency=low * Initial release (Closes: #819330) diff -Nru maim-3.3.41/debian/control maim-3.4.47/debian/control --- maim-3.3.41/debian/control 2016-03-26 20:36:58.000000000 +0000 +++ maim-3.4.47/debian/control 2015-10-17 12:43:19.000000000 +0000 @@ -10,7 +10,8 @@ Package: maim Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: slop Description: takes screenshts of your desktop maim (make image) takes screenshots of your desktop. It has options to take only a region, and relies on slop to query for regions. maim is supposed to be - an improved scrot. \ No newline at end of file + an improved scrot. diff -Nru maim-3.3.41/man-src/maim.1 maim-3.4.47/man-src/maim.1 --- maim-3.3.41/man-src/maim.1 2014-12-04 02:34:41.000000000 +0000 +++ maim-3.4.47/man-src/maim.1 2016-02-05 06:35:30.000000000 +0000 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "MAIM" "1" "December 2014" "" "" +.TH "MAIM" "1" "July 2015" "" "" . .SH "NAME" \fBmaim\fR \- Takes screenshots @@ -29,6 +29,10 @@ Sets the x display\. . .TP +\fB\-\-format=FORMAT\fR +Sets output format (png, jpg, etc) (default=`auto\') +. +.TP \fB\-s\fR, \fB\-\-select\fR Enables user region selection\. Requires slop to be installed\. (default=off) . @@ -65,8 +69,8 @@ Localizes given geometry to the given window\. So \fBmaim \-i $ID \-g 100x100+0+0 \-\-localize\fR would screenshot the top\-left 100x100 pixels of the given window, rather than the top\-left 100x100 pixels of the root window\. (default=off) . .TP -\fB\-\-hidecursor\fR -Prevents the system cursor from showing up in screenshots\. (default=off) +\fB\-\-showcursor\fR +Causes the system cursor to be blended on top of the screenshot\. (default=off) . .TP \fB\-m\fR, \fB\-\-mask=STRING\fR @@ -114,6 +118,30 @@ \fB\-l\fR, \fB\-\-highlight\fR Instead of outlining selections, slop highlights it\. This is only useful when \fB\-\-color\fR is set to a transparent color\. (default=off) . +.TP +\fB\-\-opengl\fR +Enable hardware acceleration\. Only works with modern systems that are also running a compositor\. (default=off) +. +.TP +\fB\-\-magnify\fR +Display a magnifying glass when \-\-opengl is also enabled\. (default=off) +. +.TP +\fB\-\-magstrength=FLOAT\fR +Sets how many times the magnification window size is multiplied\. (default=`4\') +. +.TP +\fB\-\-magpixels=INT\fR +Sets how many pixels are displayed in the magnification\. The less pixels the bigger the magnification\. (default=`64\') +. +.TP +\fB\-\-theme=STRING\fR +Sets the theme of the selection, using textures from ~/\.config/slop/ or /usr/share/\. (default=`none\') +. +.TP +\fB\-\-shader=STRING\fR +Sets the shader to load and use from ~/\.config/slop/ or /usr/share/\. (default=`simple\') +. .SH "EXAMPLES" Screenshot the active window . @@ -151,6 +179,19 @@ . .fi . +.IP "" 0 +. +.P +Output screenshot to stdout +. +.IP "" 4 +. +.nf + +$ maim \-\-format png /dev/stdout +. +.fi +. .IP "" 0 . .SH "COPYRIGHT" Binary files /tmp/tmp9pjbPY/Avwmp9WQ_a/maim-3.3.41/man-src/maim.1.gz and /tmp/tmp9pjbPY/r3STHPDOJI/maim-3.4.47/man-src/maim.1.gz differ diff -Nru maim-3.3.41/man-src/maim.1.ronn maim-3.4.47/man-src/maim.1.ronn --- maim-3.3.41/man-src/maim.1.ronn 2014-12-04 02:34:41.000000000 +0000 +++ maim-3.4.47/man-src/maim.1.ronn 2016-02-05 06:35:30.000000000 +0000 @@ -24,6 +24,9 @@ * `--xdisplay=hostname:number.screen_number`: Sets the x display. + * `--format=FORMAT`: + Sets output format (png, jpg, etc) (default=`auto') + * `-s`, `--select`: Enables user region selection. Requires slop to be installed. (default=off) @@ -52,8 +55,8 @@ * `--localize`: Localizes given geometry to the given window. So `maim -i $ID -g 100x100+0+0 --localize` would screenshot the top-left 100x100 pixels of the given window, rather than the top-left 100x100 pixels of the root window. (default=off) - * `--hidecursor`: - Prevents the system cursor from showing up in screenshots. (default=off) + * `--showcursor`: + Causes the system cursor to be blended on top of the screenshot. (default=off) * `-m`, `--mask=STRING`: Masks off-screen pixels so they don't show up in screenshots. (possible values="auto", "off", "on" default=`auto') @@ -90,6 +93,24 @@ * `-l`, `--highlight`: Instead of outlining selections, slop highlights it. This is only useful when `--color` is set to a transparent color. (default=off) + * `--opengl`: + Enable hardware acceleration. Only works with modern systems that are also running a compositor. (default=off) + + * `--magnify`: + Display a magnifying glass when --opengl is also enabled. (default=off) + + * `--magstrength=FLOAT`: + Sets how many times the magnification window size is multiplied. (default=`4') + + * `--magpixels=INT`: + Sets how many pixels are displayed in the magnification. The less pixels the bigger the magnification. (default=`64') + + * `--theme=STRING`: + Sets the theme of the selection, using textures from ~/.config/slop/ or /usr/share/. (default=`none') + + * `--shader=STRING`: + Sets the shader to load and use from ~/.config/slop/ or /usr/share/. (default=`simple') + ## EXAMPLES Screenshot the active window @@ -102,6 +123,11 @@ Save a dated screenshot. $ maim ~/$(date +%F-%T).png + +Output screenshot to stdout + + $ maim --format png /dev/stdout + ## COPYRIGHT Copyright (C) 2014 Dalton Nell ``, Maim Contributors ``. diff -Nru maim-3.3.41/README.md maim-3.4.47/README.md --- maim-3.3.41/README.md 2014-12-04 02:34:41.000000000 +0000 +++ maim-3.4.47/README.md 2016-02-05 06:35:30.000000000 +0000 @@ -64,6 +64,8 @@ * [Void Linux: maim](https://github.com/voidlinux/void-packages/blob/24ac22af44018e2598047e5ef7fd3522efa79db5/srcpkgs/maim/template) * [FreeBSD: graphics/maim](http://www.freshports.org/graphics/maim/) * [OpenBSD: graphics/maim](http://openports.se/graphics/maim) +* [CRUX: 6c37/maim](https://github.com/6c37/crux-ports/tree/master/maim) +* [Gentoo: media-gfx/maim::fkmclane](https://github.com/fkmclane/overlay/tree/master/media-gfx/maim) * Please make a package for maim on your favorite system, and make a pull request to add it to this list. @@ -80,11 +82,15 @@ Make sure to check out and install [slop](https://github.com/naelstrof/slop) too if you want selection capabilities! -help +Special Thanks for Special People +---- +[Evan Purkhiser](https://github.com/EvanPurkhiser) + +Help ---- Join us on irc at freenode in *#maim*. ```text -maim v3.3.41 +maim v3.4.47 Copyright (C) 2014 Dalton Nell, Maim Contributors (https://github.com/naelstrof/maim/graphs/contributors) @@ -102,6 +108,8 @@ Options --xdisplay=hostname:number.screen_number Sets the x display. + --format=FORMAT Sets output format (png, jpg, etc) + (default=`auto') -s, --select Enables user region selection. Requires slop to be installed. (default=off) -x, --x=INT Sets the x coordinate for taking an image @@ -119,8 +127,9 @@ of the given window, rather than the top-left 100x100 pixels of the root window. (default=off) - --hidecursor Prevents the system cursor from showing up in - screenshots. (default=off) + --showcursor Causes the system cursor to be blended on top + of the screenshot. (default=off) + --hidecursor Deprecated, does nothing. (default=off) -m, --mask=STRING Masks off-screen pixels so they don't show up in screenshots. (possible values="auto", "off", "on" default=`auto') @@ -158,6 +167,22 @@ highlights it. This is only useful when --color is set to a transparent color. (default=off) + --opengl Enable hardware acceleration. Only works with + modern systems that are also running a + compositor. (default=off) + --magnify Display a magnifying glass when --opengl is + also enabled. (default=off) + --magstrength=FLOAT Sets how many times the magnification window + size is multiplied. (default=`4') + --magpixels=INT Sets how many pixels are displayed in the + magnification. The less pixels the bigger the + magnification. (default=`64') + --theme=STRING Sets the theme of the selection, using textures + from ~/.config/slop/ or /usr/share/. + (default=`none') + --shader=STRING Sets the shader to load and use from + ~/.config/slop/ or /usr/share/. + (default=`simple') Examples $ # Screenshot the active window @@ -168,4 +193,7 @@ $ # Save a dated screenshot. $ maim ~/$(date +%F-%T).png + + $ # Output screenshot to stdout. + $ maim --format png /dev/stdout ``` diff -Nru maim-3.3.41/src/cmdline.c maim-3.4.47/src/cmdline.c --- maim-3.3.41/src/cmdline.c 2014-12-04 02:34:41.000000000 +0000 +++ maim-3.4.47/src/cmdline.c 2016-02-05 06:35:30.000000000 +0000 @@ -38,6 +38,7 @@ " -V, --version Print version and exit", "Options", " --xdisplay=hostname:number.screen_number\n Sets the x display.", + " --format=FORMAT Sets output format (png, jpg, etc)\n (default=`auto')", " -s, --select Enables user region selection. Requires slop to\n be installed. (default=off)", " -x, --x=INT Sets the x coordinate for taking an image", " -y, --y=INT Sets the y coordinate for taking an image", @@ -47,7 +48,8 @@ " -d, --delay=FLOAT Set the amount of time to wait before taking an\n image. (default=`0.0')", " -i, --windowid=INT Set the window to capture. Defaults to the root\n window id.", " --localize Localizes given geometry to the given window.\n So \"maim -i $ID -g 100x100+0+0 --localize\"\n would screenshot the top-left 100x100 pixels\n of the given window, rather than the top-left\n 100x100 pixels of the root window.\n (default=off)", - " --hidecursor Prevents the system cursor from showing up in\n screenshots. (default=off)", + " --showcursor Causes the system cursor to be blended on top\n of the screenshot. (default=off)", + " --hidecursor Deprecated, does nothing. (default=off)", " -m, --mask=STRING Masks off-screen pixels so they don't show up\n in screenshots. (possible values=\"auto\",\n \"off\", \"on\" default=`auto')", "\nSlop Options", " --nokeyboard Disables the ability to cancel selections with\n the keyboard. (default=off)", @@ -60,7 +62,13 @@ " --min=INT Set the minimum output of width or height\n values. This is useful to avoid outputting 0.\n Setting min and max to the same value\n disables drag selections. (default=`0')", " --max=INT Set the maximum output of width or height\n values. Setting min and max to the same value\n disables drag selections. (default=`0')", " -l, --highlight Instead of outlining selections, slop\n highlights it. This is only useful when\n --color is set to a transparent color.\n (default=off)", - "\nExamples\n $ # Screenshot the active window\n $ maim -i $(xdotool getactivewindow)\n\n $ # Prompt a transparent red selection to screenshot.\n $ maim -s -c 1,0,0,0.6\n\n $ # Save a dated screenshot.\n $ maim ~/$(date +%F-%T).png\n", + " --opengl Enable hardware acceleration. Only works with\n modern systems that are also running a\n compositor. (default=off)", + " --magnify Display a magnifying glass when --opengl is\n also enabled. (default=off)", + " --magstrength=FLOAT Sets how many times the magnification window\n size is multiplied. (default=`4')", + " --magpixels=INT Sets how many pixels are displayed in the\n magnification. The less pixels the bigger the\n magnification. (default=`64')", + " --theme=STRING Sets the theme of the selection, using textures\n from ~/.config/slop/ or /usr/share/.\n (default=`none')", + " --shader=STRING Sets the shader to load and use from\n ~/.config/slop/ or /usr/share/.\n (default=`simple')", + "\nExamples\n $ # Screenshot the active window\n $ maim -i $(xdotool getactivewindow)\n\n $ # Prompt a transparent red selection to screenshot.\n $ maim -s -c 1,0,0,0.6\n\n $ # Save a dated screenshot.\n $ maim ~/$(date +%F-%T).png\n\n $ # Output screenshot to stdout.\n $ maim --format png /dev/stdout\n\n", 0 }; @@ -68,6 +76,7 @@ , ARG_FLAG , ARG_STRING , ARG_INT + , ARG_FLOAT } cmdline_parser_arg_type; static @@ -91,6 +100,7 @@ args_info->help_given = 0 ; args_info->version_given = 0 ; args_info->xdisplay_given = 0 ; + args_info->format_given = 0 ; args_info->select_given = 0 ; args_info->x_given = 0 ; args_info->y_given = 0 ; @@ -100,6 +110,7 @@ args_info->delay_given = 0 ; args_info->windowid_given = 0 ; args_info->localize_given = 0 ; + args_info->showcursor_given = 0 ; args_info->hidecursor_given = 0 ; args_info->mask_given = 0 ; args_info->nokeyboard_given = 0 ; @@ -112,6 +123,12 @@ args_info->min_given = 0 ; args_info->max_given = 0 ; args_info->highlight_given = 0 ; + args_info->opengl_given = 0 ; + args_info->magnify_given = 0 ; + args_info->magstrength_given = 0 ; + args_info->magpixels_given = 0 ; + args_info->theme_given = 0 ; + args_info->shader_given = 0 ; } static @@ -120,6 +137,8 @@ FIX_UNUSED (args_info); args_info->xdisplay_arg = NULL; args_info->xdisplay_orig = NULL; + args_info->format_arg = gengetopt_strdup ("auto"); + args_info->format_orig = NULL; args_info->select_flag = 0; args_info->x_orig = NULL; args_info->y_orig = NULL; @@ -131,6 +150,7 @@ args_info->delay_orig = NULL; args_info->windowid_orig = NULL; args_info->localize_flag = 0; + args_info->showcursor_flag = 0; args_info->hidecursor_flag = 0; args_info->mask_arg = gengetopt_strdup ("auto"); args_info->mask_orig = NULL; @@ -151,6 +171,16 @@ args_info->max_arg = 0; args_info->max_orig = NULL; args_info->highlight_flag = 0; + args_info->opengl_flag = 0; + args_info->magnify_flag = 0; + args_info->magstrength_arg = 4; + args_info->magstrength_orig = NULL; + args_info->magpixels_arg = 64; + args_info->magpixels_orig = NULL; + args_info->theme_arg = gengetopt_strdup ("none"); + args_info->theme_orig = NULL; + args_info->shader_arg = gengetopt_strdup ("simple"); + args_info->shader_orig = NULL; } @@ -162,27 +192,35 @@ args_info->help_help = gengetopt_args_info_help[0] ; args_info->version_help = gengetopt_args_info_help[1] ; args_info->xdisplay_help = gengetopt_args_info_help[3] ; - args_info->select_help = gengetopt_args_info_help[4] ; - args_info->x_help = gengetopt_args_info_help[5] ; - args_info->y_help = gengetopt_args_info_help[6] ; - args_info->w_help = gengetopt_args_info_help[7] ; - args_info->h_help = gengetopt_args_info_help[8] ; - args_info->geometry_help = gengetopt_args_info_help[9] ; - args_info->delay_help = gengetopt_args_info_help[10] ; - args_info->windowid_help = gengetopt_args_info_help[11] ; - args_info->localize_help = gengetopt_args_info_help[12] ; - args_info->hidecursor_help = gengetopt_args_info_help[13] ; - args_info->mask_help = gengetopt_args_info_help[14] ; - args_info->nokeyboard_help = gengetopt_args_info_help[16] ; - args_info->bordersize_help = gengetopt_args_info_help[17] ; - args_info->padding_help = gengetopt_args_info_help[18] ; - args_info->tolerance_help = gengetopt_args_info_help[19] ; - args_info->gracetime_help = gengetopt_args_info_help[20] ; - args_info->color_help = gengetopt_args_info_help[21] ; - args_info->nodecorations_help = gengetopt_args_info_help[22] ; - args_info->min_help = gengetopt_args_info_help[23] ; - args_info->max_help = gengetopt_args_info_help[24] ; - args_info->highlight_help = gengetopt_args_info_help[25] ; + args_info->format_help = gengetopt_args_info_help[4] ; + args_info->select_help = gengetopt_args_info_help[5] ; + args_info->x_help = gengetopt_args_info_help[6] ; + args_info->y_help = gengetopt_args_info_help[7] ; + args_info->w_help = gengetopt_args_info_help[8] ; + args_info->h_help = gengetopt_args_info_help[9] ; + args_info->geometry_help = gengetopt_args_info_help[10] ; + args_info->delay_help = gengetopt_args_info_help[11] ; + args_info->windowid_help = gengetopt_args_info_help[12] ; + args_info->localize_help = gengetopt_args_info_help[13] ; + args_info->showcursor_help = gengetopt_args_info_help[14] ; + args_info->hidecursor_help = gengetopt_args_info_help[15] ; + args_info->mask_help = gengetopt_args_info_help[16] ; + args_info->nokeyboard_help = gengetopt_args_info_help[18] ; + args_info->bordersize_help = gengetopt_args_info_help[19] ; + args_info->padding_help = gengetopt_args_info_help[20] ; + args_info->tolerance_help = gengetopt_args_info_help[21] ; + args_info->gracetime_help = gengetopt_args_info_help[22] ; + args_info->color_help = gengetopt_args_info_help[23] ; + args_info->nodecorations_help = gengetopt_args_info_help[24] ; + args_info->min_help = gengetopt_args_info_help[25] ; + args_info->max_help = gengetopt_args_info_help[26] ; + args_info->highlight_help = gengetopt_args_info_help[27] ; + args_info->opengl_help = gengetopt_args_info_help[28] ; + args_info->magnify_help = gengetopt_args_info_help[29] ; + args_info->magstrength_help = gengetopt_args_info_help[30] ; + args_info->magpixels_help = gengetopt_args_info_help[31] ; + args_info->theme_help = gengetopt_args_info_help[32] ; + args_info->shader_help = gengetopt_args_info_help[33] ; } @@ -271,6 +309,8 @@ unsigned int i; free_string_field (&(args_info->xdisplay_arg)); free_string_field (&(args_info->xdisplay_orig)); + free_string_field (&(args_info->format_arg)); + free_string_field (&(args_info->format_orig)); free_string_field (&(args_info->x_orig)); free_string_field (&(args_info->y_orig)); free_string_field (&(args_info->w_orig)); @@ -291,6 +331,12 @@ free_string_field (&(args_info->color_orig)); free_string_field (&(args_info->min_orig)); free_string_field (&(args_info->max_orig)); + free_string_field (&(args_info->magstrength_orig)); + free_string_field (&(args_info->magpixels_orig)); + free_string_field (&(args_info->theme_arg)); + free_string_field (&(args_info->theme_orig)); + free_string_field (&(args_info->shader_arg)); + free_string_field (&(args_info->shader_orig)); for (i = 0; i < args_info->inputs_num; ++i) @@ -373,6 +419,8 @@ write_into_file(outfile, "version", 0, 0 ); if (args_info->xdisplay_given) write_into_file(outfile, "xdisplay", args_info->xdisplay_orig, 0); + if (args_info->format_given) + write_into_file(outfile, "format", args_info->format_orig, 0); if (args_info->select_given) write_into_file(outfile, "select", 0, 0 ); if (args_info->x_given) @@ -391,6 +439,8 @@ write_into_file(outfile, "windowid", args_info->windowid_orig, 0); if (args_info->localize_given) write_into_file(outfile, "localize", 0, 0 ); + if (args_info->showcursor_given) + write_into_file(outfile, "showcursor", 0, 0 ); if (args_info->hidecursor_given) write_into_file(outfile, "hidecursor", 0, 0 ); if (args_info->mask_given) @@ -415,6 +465,18 @@ write_into_file(outfile, "max", args_info->max_orig, 0); if (args_info->highlight_given) write_into_file(outfile, "highlight", 0, 0 ); + if (args_info->opengl_given) + write_into_file(outfile, "opengl", 0, 0 ); + if (args_info->magnify_given) + write_into_file(outfile, "magnify", 0, 0 ); + if (args_info->magstrength_given) + write_into_file(outfile, "magstrength", args_info->magstrength_orig, 0); + if (args_info->magpixels_given) + write_into_file(outfile, "magpixels", args_info->magpixels_orig, 0); + if (args_info->theme_given) + write_into_file(outfile, "theme", args_info->theme_orig, 0); + if (args_info->shader_given) + write_into_file(outfile, "shader", args_info->shader_orig, 0); i = EXIT_SUCCESS; @@ -598,6 +660,9 @@ case ARG_INT: if (val) *((int *)field) = strtol (val, &stop_char, 0); break; + case ARG_FLOAT: + if (val) *((float *)field) = (float)strtod (val, &stop_char); + break; case ARG_STRING: if (val) { string_field = (char **)field; @@ -613,6 +678,7 @@ /* check numeric conversion */ switch(arg_type) { case ARG_INT: + case ARG_FLOAT: if (val && !(stop_char && *stop_char == '\0')) { fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); return 1; /* failure */ @@ -683,6 +749,7 @@ { "help", 0, NULL, 0 }, { "version", 0, NULL, 'V' }, { "xdisplay", 1, NULL, 0 }, + { "format", 1, NULL, 0 }, { "select", 0, NULL, 's' }, { "x", 1, NULL, 'x' }, { "y", 1, NULL, 'y' }, @@ -692,6 +759,7 @@ { "delay", 1, NULL, 'd' }, { "windowid", 1, NULL, 'i' }, { "localize", 0, NULL, 0 }, + { "showcursor", 0, NULL, 0 }, { "hidecursor", 0, NULL, 0 }, { "mask", 1, NULL, 'm' }, { "nokeyboard", 0, NULL, 0 }, @@ -704,6 +772,12 @@ { "min", 1, NULL, 0 }, { "max", 1, NULL, 0 }, { "highlight", 0, NULL, 'l' }, + { "opengl", 0, NULL, 0 }, + { "magnify", 0, NULL, 0 }, + { "magstrength", 1, NULL, 0 }, + { "magpixels", 1, NULL, 0 }, + { "theme", 1, NULL, 0 }, + { "shader", 1, NULL, 0 }, { 0, 0, 0, 0 } }; @@ -914,6 +988,20 @@ goto failure; } + /* Sets output format (png, jpg, etc). */ + else if (strcmp (long_options[option_index].name, "format") == 0) + { + + + if (update_arg( (void *)&(args_info->format_arg), + &(args_info->format_orig), &(args_info->format_given), + &(local_args_info.format_given), optarg, 0, "auto", ARG_STRING, + check_ambiguity, override, 0, 0, + "format", '-', + additional_error)) + goto failure; + + } /* Localizes given geometry to the given window. So \"maim -i $ID -g 100x100+0+0 --localize\" would screenshot the top-left 100x100 pixels of the given window, rather than the top-left 100x100 pixels of the root window.. */ else if (strcmp (long_options[option_index].name, "localize") == 0) { @@ -926,7 +1014,19 @@ goto failure; } - /* Prevents the system cursor from showing up in screenshots.. */ + /* Causes the system cursor to be blended on top of the screenshot.. */ + else if (strcmp (long_options[option_index].name, "showcursor") == 0) + { + + + if (update_arg((void *)&(args_info->showcursor_flag), 0, &(args_info->showcursor_given), + &(local_args_info.showcursor_given), optarg, 0, 0, ARG_FLAG, + check_ambiguity, override, 1, 0, "showcursor", '-', + additional_error)) + goto failure; + + } + /* Deprecated, does nothing.. */ else if (strcmp (long_options[option_index].name, "hidecursor") == 0) { @@ -991,6 +1091,86 @@ additional_error)) goto failure; + } + /* Enable hardware acceleration. Only works with modern systems that are also running a compositor.. */ + else if (strcmp (long_options[option_index].name, "opengl") == 0) + { + + + if (update_arg((void *)&(args_info->opengl_flag), 0, &(args_info->opengl_given), + &(local_args_info.opengl_given), optarg, 0, 0, ARG_FLAG, + check_ambiguity, override, 1, 0, "opengl", '-', + additional_error)) + goto failure; + + } + /* Display a magnifying glass when --opengl is also enabled.. */ + else if (strcmp (long_options[option_index].name, "magnify") == 0) + { + + + if (update_arg((void *)&(args_info->magnify_flag), 0, &(args_info->magnify_given), + &(local_args_info.magnify_given), optarg, 0, 0, ARG_FLAG, + check_ambiguity, override, 1, 0, "magnify", '-', + additional_error)) + goto failure; + + } + /* Sets how many times the magnification window size is multiplied.. */ + else if (strcmp (long_options[option_index].name, "magstrength") == 0) + { + + + if (update_arg( (void *)&(args_info->magstrength_arg), + &(args_info->magstrength_orig), &(args_info->magstrength_given), + &(local_args_info.magstrength_given), optarg, 0, "4", ARG_FLOAT, + check_ambiguity, override, 0, 0, + "magstrength", '-', + additional_error)) + goto failure; + + } + /* Sets how many pixels are displayed in the magnification. The less pixels the bigger the magnification.. */ + else if (strcmp (long_options[option_index].name, "magpixels") == 0) + { + + + if (update_arg( (void *)&(args_info->magpixels_arg), + &(args_info->magpixels_orig), &(args_info->magpixels_given), + &(local_args_info.magpixels_given), optarg, 0, "64", ARG_INT, + check_ambiguity, override, 0, 0, + "magpixels", '-', + additional_error)) + goto failure; + + } + /* Sets the theme of the selection, using textures from ~/.config/slop/ or /usr/share/.. */ + else if (strcmp (long_options[option_index].name, "theme") == 0) + { + + + if (update_arg( (void *)&(args_info->theme_arg), + &(args_info->theme_orig), &(args_info->theme_given), + &(local_args_info.theme_given), optarg, 0, "none", ARG_STRING, + check_ambiguity, override, 0, 0, + "theme", '-', + additional_error)) + goto failure; + + } + /* Sets the shader to load and use from ~/.config/slop/ or /usr/share/.. */ + else if (strcmp (long_options[option_index].name, "shader") == 0) + { + + + if (update_arg( (void *)&(args_info->shader_arg), + &(args_info->shader_orig), &(args_info->shader_given), + &(local_args_info.shader_given), optarg, 0, "simple", ARG_STRING, + check_ambiguity, override, 0, 0, + "shader", '-', + additional_error)) + goto failure; + } break; diff -Nru maim-3.3.41/src/cmdline.in maim-3.4.47/src/cmdline.in --- maim-3.3.41/src/cmdline.in 2014-12-04 02:34:41.000000000 +0000 +++ maim-3.4.47/src/cmdline.in 2016-02-05 06:35:30.000000000 +0000 @@ -42,6 +42,9 @@ char * xdisplay_arg; /**< @brief Sets the x display.. */ char * xdisplay_orig; /**< @brief Sets the x display. original value given at command line. */ const char *xdisplay_help; /**< @brief Sets the x display. help description. */ + char * format_arg; /**< @brief Sets output format (png, jpg, etc) (default='auto'). */ + char * format_orig; /**< @brief Sets output format (png, jpg, etc) original value given at command line. */ + const char *format_help; /**< @brief Sets output format (png, jpg, etc) help description. */ int select_flag; /**< @brief Enables user region selection. Requires slop to be installed. (default=off). */ const char *select_help; /**< @brief Enables user region selection. Requires slop to be installed. help description. */ int x_arg; /**< @brief Sets the x coordinate for taking an image. */ @@ -67,8 +70,10 @@ const char *windowid_help; /**< @brief Set the window to capture. Defaults to the root window id. help description. */ int localize_flag; /**< @brief Localizes given geometry to the given window. So \"maim -i $ID -g 100x100+0+0 --localize\" would screenshot the top-left 100x100 pixels of the given window, rather than the top-left 100x100 pixels of the root window. (default=off). */ const char *localize_help; /**< @brief Localizes given geometry to the given window. So \"maim -i $ID -g 100x100+0+0 --localize\" would screenshot the top-left 100x100 pixels of the given window, rather than the top-left 100x100 pixels of the root window. help description. */ - int hidecursor_flag; /**< @brief Prevents the system cursor from showing up in screenshots. (default=off). */ - const char *hidecursor_help; /**< @brief Prevents the system cursor from showing up in screenshots. help description. */ + int showcursor_flag; /**< @brief Causes the system cursor to be blended on top of the screenshot. (default=off). */ + const char *showcursor_help; /**< @brief Causes the system cursor to be blended on top of the screenshot. help description. */ + int hidecursor_flag; /**< @brief Deprecated, does nothing. (default=off). */ + const char *hidecursor_help; /**< @brief Deprecated, does nothing. help description. */ char * mask_arg; /**< @brief Masks off-screen pixels so they don't show up in screenshots. (default='auto'). */ char * mask_orig; /**< @brief Masks off-screen pixels so they don't show up in screenshots. original value given at command line. */ const char *mask_help; /**< @brief Masks off-screen pixels so they don't show up in screenshots. help description. */ @@ -99,10 +104,27 @@ const char *max_help; /**< @brief Set the maximum output of width or height values. Setting min and max to the same value disables drag selections. help description. */ int highlight_flag; /**< @brief Instead of outlining selections, slop highlights it. This is only useful when --color is set to a transparent color. (default=off). */ const char *highlight_help; /**< @brief Instead of outlining selections, slop highlights it. This is only useful when --color is set to a transparent color. help description. */ + int opengl_flag; /**< @brief Enable hardware acceleration. Only works with modern systems that are also running a compositor. (default=off). */ + const char *opengl_help; /**< @brief Enable hardware acceleration. Only works with modern systems that are also running a compositor. help description. */ + int magnify_flag; /**< @brief Display a magnifying glass when --opengl is also enabled. (default=off). */ + const char *magnify_help; /**< @brief Display a magnifying glass when --opengl is also enabled. help description. */ + float magstrength_arg; /**< @brief Sets how many times the magnification window size is multiplied. (default='4'). */ + char * magstrength_orig; /**< @brief Sets how many times the magnification window size is multiplied. original value given at command line. */ + const char *magstrength_help; /**< @brief Sets how many times the magnification window size is multiplied. help description. */ + int magpixels_arg; /**< @brief Sets how many pixels are displayed in the magnification. The less pixels the bigger the magnification. (default='64'). */ + char * magpixels_orig; /**< @brief Sets how many pixels are displayed in the magnification. The less pixels the bigger the magnification. original value given at command line. */ + const char *magpixels_help; /**< @brief Sets how many pixels are displayed in the magnification. The less pixels the bigger the magnification. help description. */ + char * theme_arg; /**< @brief Sets the theme of the selection, using textures from ~/.config/slop/ or /usr/share/. (default='none'). */ + char * theme_orig; /**< @brief Sets the theme of the selection, using textures from ~/.config/slop/ or /usr/share/. original value given at command line. */ + const char *theme_help; /**< @brief Sets the theme of the selection, using textures from ~/.config/slop/ or /usr/share/. help description. */ + char * shader_arg; /**< @brief Sets the shader to load and use from ~/.config/slop/ or /usr/share/. (default='simple'). */ + char * shader_orig; /**< @brief Sets the shader to load and use from ~/.config/slop/ or /usr/share/. original value given at command line. */ + const char *shader_help; /**< @brief Sets the shader to load and use from ~/.config/slop/ or /usr/share/. help description. */ unsigned int help_given ; /**< @brief Whether help was given. */ unsigned int version_given ; /**< @brief Whether version was given. */ unsigned int xdisplay_given ; /**< @brief Whether xdisplay was given. */ + unsigned int format_given ; /**< @brief Whether format was given. */ unsigned int select_given ; /**< @brief Whether select was given. */ unsigned int x_given ; /**< @brief Whether x was given. */ unsigned int y_given ; /**< @brief Whether y was given. */ @@ -112,6 +134,7 @@ unsigned int delay_given ; /**< @brief Whether delay was given. */ unsigned int windowid_given ; /**< @brief Whether windowid was given. */ unsigned int localize_given ; /**< @brief Whether localize was given. */ + unsigned int showcursor_given ; /**< @brief Whether showcursor was given. */ unsigned int hidecursor_given ; /**< @brief Whether hidecursor was given. */ unsigned int mask_given ; /**< @brief Whether mask was given. */ unsigned int nokeyboard_given ; /**< @brief Whether nokeyboard was given. */ @@ -124,6 +147,12 @@ unsigned int min_given ; /**< @brief Whether min was given. */ unsigned int max_given ; /**< @brief Whether max was given. */ unsigned int highlight_given ; /**< @brief Whether highlight was given. */ + unsigned int opengl_given ; /**< @brief Whether opengl was given. */ + unsigned int magnify_given ; /**< @brief Whether magnify was given. */ + unsigned int magstrength_given ; /**< @brief Whether magstrength was given. */ + unsigned int magpixels_given ; /**< @brief Whether magpixels was given. */ + unsigned int theme_given ; /**< @brief Whether theme was given. */ + unsigned int shader_given ; /**< @brief Whether shader was given. */ char **inputs ; /**< @brief unamed options (options without names) */ unsigned inputs_num ; /**< @brief unamed options number */ diff -Nru maim-3.3.41/src/im.cpp maim-3.4.47/src/im.cpp --- maim-3.3.41/src/im.cpp 2014-12-04 02:34:41.000000000 +0000 +++ maim-3.4.47/src/im.cpp 2016-02-05 06:35:30.000000000 +0000 @@ -60,23 +60,24 @@ Window root; int x, y; unsigned int w, h, b, d; - int status = XGetGeometry( xengine->m_display, id, &root, &x, &y, &w, &h, &b, &d ); + const int status = XGetGeometry( xengine->m_display, id, &root, &x, &y, &w, &h, &b, &d ); if ( status == 0 ) { fprintf( stderr, "Error: Failed to grab window geometry of window id: %lu\n", id ); return EXIT_FAILURE; } - // Create an uninitialized image buffer of the same width and height as the window - Imlib_Image buffer = imlib_create_image( w, h ); - imlib_context_set_image( buffer ); - // Make sure that imlib knows that it's possible for the image to have alpha - // prevents blending issues in the future. - imlib_image_set_has_alpha( 1 ); - imlib_context_set_drawable( id ); - int destinationx = x < 0 ? -x : 0; - int destinationy = y < 0 ? -y : 0; - imlib_copy_drawable_to_image( 0, destinationx, destinationy, w, h, 0, 0, 0 ); - // Screenshot image is now in the imlib context! - return EXIT_SUCCESS; + Window junk, parent, *children = NULL; + unsigned int num_children; + + if(!XQueryTree( xengine->m_display, id, &junk, &parent, &children, &num_children ) ) { + return EXIT_FAILURE; + } + + if ( parent == None ) { + parent = xengine->m_root; + } + XTranslateCoordinates( xengine->m_display, parent, id, x, y, &x, &y, &junk ); + + return screenshot (id, x, y, w, h); } /** @@ -106,8 +107,8 @@ // of the drawable. Since asking for it to copy from a negative // x or y position doesn't seem to do anything. // Might be a bug, but if it's fixed it'll break my program as it is now. :v - int destinationx = x < 0 ? -x : 0; - int destinationy = y < 0 ? -y : 0; + const int destinationx = x < 0 ? -x : 0; + const int destinationy = y < 0 ? -y : 0; imlib_copy_drawable_to_image( 0, x, y, w, h, destinationx, destinationy, 0 ); // Screenshot image is now in the imlib context! return EXIT_SUCCESS; @@ -141,8 +142,10 @@ // For whatever reason, XFixes returns 32 bit ARGB colors with 64 bit longs? // I'm guessing this is because some old AMD cpu's longs are actually 32 bits. // Regardless this is how I convert it to the correct bit length. - uint32_t* pixels = new uint32_t[ xcursor->width * xcursor->height ]; - for ( int i=0;iwidth*xcursor->height;i++ ) { + const size_t size_px = xcursor->width * xcursor->height; + DATA32 pixels [ size_px ]; + + for ( unsigned int i=0;ipixels[ i ]; } Imlib_Image cursor = imlib_create_image_using_data( xcursor->width, xcursor->height, pixels ); @@ -160,6 +163,7 @@ int status = XGetGeometry( xengine->m_display, id, &root, &tx, &ty, &tw, &th, &tb, &td ); if ( status == 0 ) { fprintf( stderr, "Error: Failed to grab window geometry of window id: %lu\n", id ); + XFree( xcursor ); return EXIT_FAILURE; } // Make sure the window's position is in root coordinates @@ -170,8 +174,7 @@ imlib_context_set_image( cursor ); imlib_free_image(); imlib_context_set_image( buffer ); - free( xcursor ); - delete[] pixels; + XFree( xcursor ); return EXIT_SUCCESS; } @@ -254,11 +257,14 @@ * * @return 0 on success, 1 on failure. */ -int maim::IMEngine::save( std::string file ) { +int maim::IMEngine::save( std::string file, std::string format ) { Imlib_Load_Error err; + if ( format != "auto" ) { + imlib_image_set_format(format.c_str()); + } imlib_save_image_with_error_return( file.c_str(), &err ); + imlib_free_image(); if ( err == IMLIB_LOAD_ERROR_NONE ) { - imlib_free_image(); return EXIT_SUCCESS; } fprintf( stderr, "Failed to save image %s: ", file.c_str() ); @@ -310,6 +316,5 @@ break; } } - imlib_free_image(); return EXIT_FAILURE; } diff -Nru maim-3.3.41/src/im.hpp maim-3.4.47/src/im.hpp --- maim-3.3.41/src/im.hpp 2014-12-04 02:34:41.000000000 +0000 +++ maim-3.4.47/src/im.hpp 2016-02-05 06:35:30.000000000 +0000 @@ -41,7 +41,7 @@ int screenshot( Window id ); int blendCursor( Window id, int x = 0, int y = 0 ); int mask( int x = 0, int y = 0, unsigned int w = 0, unsigned int h = 0 ); - int save( std::string filename ); + int save( std::string filename, std::string format = "auto" ); private: }; diff -Nru maim-3.3.41/src/main.cpp maim-3.4.47/src/main.cpp --- maim-3.3.41/src/main.cpp 2014-12-04 02:34:41.000000000 +0000 +++ maim-3.4.47/src/main.cpp 2016-02-05 06:35:30.000000000 +0000 @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -55,24 +56,29 @@ return EXIT_SUCCESS; } +// Replace all x's and +'s with spaces. This is so that sscanf works properly, it just doesn't +// like using anything but spaces for delimiters. +const std::string findGeometryValues ( char arg[] ) { + std::string values; + const char * const delimiters ="x+"; + char * tok = std::strtok (arg, delimiters); + + while( tok != NULL) { + values += tok; + values += " "; + tok = std::strtok (NULL, delimiters); + } + return values; +} + // Parse geometry from a string, it's pretty simple really. -int parseGeometry( std::string arg, int* x, int* y, int* w, int* h ) { - std::string copy = arg; - // Replace all x's and +'s with spaces. This is so that sscanf works properly, it just doesn't - // like using anything but spaces for delimiters. - int find = copy.find( "x" ); - while( find != (int)copy.npos ) { - copy.at( find ) = ' '; - find = copy.find( "x" ); - } - find = copy.find( "+" ); - while( find != (int)copy.npos ) { - copy.at( find ) = ' '; - find = copy.find( "+" ); - } - int num = sscanf( copy.c_str(), "%d %d %d %d", w, h, x, y ); - if ( num != 4 ) { - fprintf( stderr, "Error parsing geometry from %s\n", arg.c_str() ); +int parseGeometry( gengetopt_args_info option, int* x, int* y, int* w, int* h ) { + + const std::string values = findGeometryValues( option.geometry_arg ); + const int num = sscanf( values.c_str(), "%d %d %d %d", w, h, x, y ); + + if ( num != 4 || *w <= 0 || *h <= 0) { + fprintf( stderr, "Error parsing geometry from %s\n", option.geometry_orig ); return EXIT_FAILURE; } return EXIT_SUCCESS; @@ -84,9 +90,13 @@ // takes a full screenshot, then he would most certainly want it masked, but // only if they have pixels that are offscreen. bool checkMask( std::string type, int x, int y, int w, int h, Window id ) { - int sw = WidthOfScreen( xengine->m_screen ); - int sh = HeightOfScreen( xengine->m_screen ); if ( type == "auto" ) { + // If we specified an actual window we certainly don't want to mask anything. + if ( id != None && id != xengine->m_root ) { + return false; + } + const int sw = WidthOfScreen( xengine->m_screen ); + const int sh = HeightOfScreen( xengine->m_screen ); // First we check if there's even any offscreen pixels int monitorArea = 0; std::vector monitors = xengine->getCRTCS(); @@ -99,10 +109,6 @@ if ( monitorArea >= sw * sh ) { return false; } - // If we specified an actual window we certainly don't want to mask anything. - if ( id != None && id != xengine->m_root ) { - return false; - } // If our screenshot has > 80% of the screen covered, we probably want it masked by off-screen pixels. if ( abs( (int)( (float)sw - (float)w ) ) / (float)sw < 0.2 && abs( (int)( (float)sh - (float)h ) ) / (float)sh < 0.2 && @@ -140,6 +146,16 @@ if ( options.highlight_flag ) { slopcommand << " -l"; } + if ( options.opengl_flag ) { + slopcommand << " --opengl"; + if ( options.magnify_flag ) { + slopcommand << " --magnify"; + } + slopcommand << " --magstrength=" << options.magstrength_arg; + slopcommand << " --magpixels=" << options.magpixels_arg; + slopcommand << " --theme=" << options.theme_arg; + slopcommand << " --shader=" << options.shader_arg; + } slopcommand << "\n"; std::string result; int err = exec( slopcommand.str(), &result ); @@ -170,6 +186,32 @@ return EXIT_SUCCESS; } + +//TODO: good english error message +int is_valid_directory ( const char * dirname ) { + + //assert ( dirname != NULL); + + struct stat st; + + if ( stat( dirname, &st ) == -1 ) { + fprintf( stderr, "Failed 'stat' process.\n"); + return EXIT_FAILURE; + } + + if ( ! S_ISDIR( st.st_mode ) ) { + fprintf( stderr, "Failed to save in the directory '%s': it's not a directory.\n", dirname); + return EXIT_FAILURE; + } + + if ( st.st_uid != getuid() || ! (st.st_mode & S_IWUSR) ) { + fprintf( stderr, "Failed to save in the directory '%s': permission denied\n", dirname); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} + int app( int argc, char** argv ) { // First parse any options and the filename we need. gengetopt_args_info options; @@ -227,9 +269,9 @@ cmdline_parser_free( &options ); return EXIT_FAILURE; } else if ( options.geometry_given ) { - err = parseGeometry( options.geometry_arg, &x, &y, &w, &h ); + err = parseGeometry( options, &x, &y, &w, &h ); if ( err != EXIT_SUCCESS ) { - fprintf( stderr, "Failed to parse geometry %s, should be in format WxH+X+Y!\n", options.geometry_arg ); + fprintf( stderr, "Failed to parse geometry %s, should be in format WxH+X+Y!\n", options.geometry_orig ); cmdline_parser_free( &options ); return EXIT_FAILURE; } @@ -239,12 +281,6 @@ Window window = xengine->m_root; if ( options.windowid_given ) { window = (Window)options.windowid_arg; - // Since we have a window we need to turn root coords into our local window coords. - // but only if the user wants us to. - if ( !options.localize_flag && window != None ) { - Window junk; - XTranslateCoordinates( xengine->m_display, xengine->m_root, window, x, y, &x, &y, &junk ); - } } // Get our file name std::string file = ""; @@ -252,9 +288,11 @@ if ( options.inputs_num == 0 ) { // Try as hard as we can to get the current directory. int trycount = 0; + char* home_env = getenv("HOME"); int length = MAXPATHLEN; char* currentdir = new char[ length ]; char* error = getcwd( currentdir, length ); + while ( error == NULL ) { delete[] currentdir; length *= 2; @@ -265,17 +303,30 @@ // the max path length. if ( trycount > 3 ) { fprintf( stderr, "Failed to grab the current directory!" ); - cmdline_parser_free( &options ); - return EXIT_FAILURE; + + // Try to HOME later + if ( home_env == NULL ) { + fprintf( stderr, "Failed to get HOME environment variable, no where left to save!" ); + cmdline_parser_free( &options ); + delete [] currentdir; + return EXIT_FAILURE; + } } } - file = currentdir; + + if ( is_valid_directory ( currentdir ) == EXIT_SUCCESS ) + { + file = currentdir; + } else { + file = home_env; + } + // Get unix timestamp std::stringstream result; result << (int)time( NULL ); file += "/" + result.str() + ".png"; printf( "No file specified, using %s\n", file.c_str() ); - free( currentdir ); + delete [] currentdir; } else if ( options.inputs_num == 1 ) { file = options.inputs[ 0 ]; } else { @@ -301,13 +352,13 @@ fprintf( stderr, "Failed to take screenshot.\n" ); return EXIT_FAILURE; } - if ( !options.hidecursor_flag ) { + if ( options.showcursor_flag ) { imengine->blendCursor( window, x, y ); } if ( checkMask( options.mask_arg, x, y, w, h, window ) ) { imengine->mask( x, y, w, h ); } - err = imengine->save( file ); + err = imengine->save( file, options.format_arg ); cmdline_parser_free( &options ); if ( err != EXIT_SUCCESS ) { fprintf( stderr, "Failed to take screenshot.\n" ); @@ -325,13 +376,13 @@ fprintf( stderr, "Failed to take screenshot.\n" ); return EXIT_FAILURE; } - if ( !options.hidecursor_flag ) { + if ( options.showcursor_flag ) { imengine->blendCursor( window, x, y ); } if ( checkMask( options.mask_arg, x, y, w, h, window ) ) { imengine->mask( x, y, w, h ); } - err = imengine->save( file ); + err = imengine->save( file, options.format_arg ); cmdline_parser_free( &options ); if ( err != EXIT_SUCCESS ) { fprintf( stderr, "Failed to take screenshot.\n" ); @@ -350,13 +401,13 @@ fprintf( stderr, "Failed to take screenshot.\n" ); return EXIT_FAILURE; } - if ( !options.hidecursor_flag ) { + if ( options.showcursor_flag ) { imengine->blendCursor( window ); } if ( checkMask( options.mask_arg, 0, 0, WidthOfScreen( xengine->m_screen ), HeightOfScreen( xengine->m_screen ), window ) ) { imengine->mask(); } - err = imengine->save( file ); + err = imengine->save( file, options.format_arg ); cmdline_parser_free( &options ); if ( err != EXIT_SUCCESS ) { fprintf( stderr, "Failed to take screenshot.\n" ); diff -Nru maim-3.3.41/src/options.ggo maim-3.4.47/src/options.ggo --- maim-3.3.41/src/options.ggo 2014-12-04 02:34:41.000000000 +0000 +++ maim-3.4.47/src/options.ggo 2016-02-05 06:35:30.000000000 +0000 @@ -14,6 +14,12 @@ typestr="hostname:number.screen_number" optional +option "format" - "Sets output format (png, jpg, etc)" + string + typestr="FORMAT" + default="auto" + optional + option "select" s "Enables user region selection. Requires slop to be installed." flag off @@ -53,7 +59,11 @@ flag off -option "hidecursor" - "Prevents the system cursor from showing up in screenshots." +option "showcursor" - "Causes the system cursor to be blended on top of the screenshot." + flag + off + +option "hidecursor" - "Deprecated, does nothing." flag off @@ -114,6 +124,34 @@ flag off +option "opengl" - "Enable hardware acceleration. Only works with modern systems that are also running a compositor." + flag + off + +option "magnify" - "Display a magnifying glass when --opengl is also enabled." + flag + off + +option "magstrength" - "Sets how many times the magnification window size is multiplied." + float + default="4" + optional + +option "magpixels" - "Sets how many pixels are displayed in the magnification. The less pixels the bigger the magnification." + int + default="64" + optional + +option "theme" - "Sets the theme of the selection, using textures from ~/.config/slop/ or /usr/share/." + string + default="none" + optional + +option "shader" - "Sets the shader to load and use from ~/.config/slop/ or /usr/share/." + string + default="simple" + optional + text "\nExamples\n" text " $ # Screenshot the active window\n" text " $ maim -i $(xdotool getactivewindow)\n" @@ -123,3 +161,7 @@ text "\n" text " $ # Save a dated screenshot.\n" text " $ maim ~/$(date +%F-%T).png\n" +text "\n" +text " $ # Output screenshot to stdout.\n" +text " $ maim --format png /dev/stdout\n" +text "\n" diff -Nru maim-3.3.41/src/x.cpp maim-3.4.47/src/x.cpp --- maim-3.3.41/src/x.cpp 2014-12-04 02:34:41.000000000 +0000 +++ maim-3.4.47/src/x.cpp 2016-02-05 06:35:30.000000000 +0000 @@ -26,6 +26,7 @@ m_display = NULL; m_visual = NULL; m_screen = NULL; + m_res = NULL; m_good = false; } @@ -33,6 +34,11 @@ if ( !m_good ) { return; } + + if ( m_res ) { + XRRFreeScreenResources( m_res ); + } + XCloseDisplay( m_display ); }