From 0b758e08f2bca283eb930ede8165bfa26e6cacea Mon Sep 17 00:00:00 2001 From: shuall Date: Fri, 28 Oct 2016 22:09:26 -0400 Subject: added support for XEMBED into other windows (ie tabbed) with -w --- options.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'options.c') diff --git a/options.c b/options.c index f7aac23..d292768 100644 --- a/options.c +++ b/options.c @@ -33,7 +33,7 @@ const options_t *options = (const options_t*) &_options; void print_usage(void) { printf("usage: sxiv [-abcfhioqrtvZ] [-G GAMMA] [-g GEOMETRY] [-n NUM] " - "[-N NAME] [-S DELAY] [-s MODE] [-z ZOOM] FILES...\n"); + "[-N NAME] [-S DELAY] [-s MODE] [-z ZOOM] [-w WID] FILES...\n"); } void print_version(void) @@ -62,6 +62,7 @@ void parse_options(int argc, char **argv) _options.slideshow = 0; _options.fullscreen = false; + _options.embed = 0; _options.hide_bar = false; _options.geometry = NULL; _options.res_name = NULL; @@ -70,7 +71,7 @@ void parse_options(int argc, char **argv) _options.thumb_mode = false; _options.clean_cache = false; - while ((opt = getopt(argc, argv, "abcfG:g:hin:N:oqrS:s:tvZz:")) != -1) { + while ((opt = getopt(argc, argv, "abcfG:g:hin:N:oqrS:s:tvw:Zz:")) != -1) { switch (opt) { case '?': print_usage(); @@ -138,6 +139,12 @@ void parse_options(int argc, char **argv) case 'v': print_version(); exit(EXIT_SUCCESS); + case 'w': + n = strtol(optarg, &end, 0); + if (*end != '\0') + error(EXIT_FAILURE, 0, "Invalid argument for option -w: %s", optarg); + _options.embed = n; + break; case 'Z': _options.scalemode = SCALE_ZOOM; _options.zoom = 1.0; -- cgit v1.2.3-54-g00ecf