From b8ad42dffb33d5f825faf4aaa2b62de687fab883 Mon Sep 17 00:00:00 2001 From: g Date: Wed, 24 Sep 2003 21:18:57 +0000 Subject: [PATCH] Sorted the options letters. git-svn-id: file:///srv/svn/gliv/trunk@100 dbf4865f-1ec6-0310-8412-f61adeb1ccb1 committer: g --- gliv.1 | 110 ++++++------ src/cmdline.c | 454 +++++++++++++++++++++++++------------------------- src/include/cmdline.h | 82 ++++----- src/ipc.c | 2 +- src/main.c | 13 +- tools/_gliv | 42 ++--- tools/gliv.1.start | 110 ++++++------ tools/gliv.ggo | 45 +++-- 8 files changed, 425 insertions(+), 433 deletions(-) diff --git a/gliv.1 b/gliv.1 index 707f1b4..a49c5b2 100644 --- a/gliv.1 +++ b/gliv.1 @@ -18,95 +18,93 @@ Print help and exit. \fB\-V, \-\-version\fR Print version and exit. .TP -\fB\-s, \-\-shuffle\fR -Show images in random order. The images list will be shuffled before the slide show. -.TP -\fB\-S, \-\-sort\fR -Show images in sorted order. The images list will be sorted before the slide show. -.TP -\fB\-R, \-\-recursive\fR -Processe directories recursively (default=off). If you specify a directory in the command line \fIgliv\fR will open every image in this directory and its subdirectories. -.TP -\fB\-f, \-\-fullscreen\fR -Start in full screen mode (default=off). You can still go back to windowed mode by pressing 'f' or using the menu. +\fB\-aINT, \-\-duration=INT\fR +Delay between each image. This is the minimal time to wait between each image during the slide show. It does not include the time load the image, and is exprimed in seconds. .TP -\fB\-l, \-\-scale\-down\fR -Reduce the image to the window (default=off). Make the image fit window if the image need to be reduced. It implies \-f and is like typing 'l' with every image. +\fB\-b, \-\-menu\fR +Display the menu bar (default=on). Use it to display the currently minimal menubar, you can also use the 'b' key. .TP -\fB\-M, \-\-maximize\fR -Maximize the image to the window (default=off). Make the image fit window if the image need to be enlarged. It implies \-f and is like typing 'M' with every image. +\fB\-C, \-\-client\fR +Connect to an already running gliv (default=off). With this option, GLiv will open the files passed in the arguments in the GLiv server window. It only honours the options to sort, shuffle and recursively traverse directories. It can also be used with the above \-0 option. The GLiv server is the latest launched gliv or the one which has been chosen using the Options menu. .TP -\fB\-m, \-\-make\-fit\fR -Make the image fit the window (default=off). Make the image fit the window wathever the image size, this is the equivalent of \-l and \-M. It is like typing 'm' with every image. +\fB\-c, \-\-alpha\-checks\fR +Alpha checks in the background (default=on). Use it to have a checker background when the image has an alpha channel. This may cause slowdown when redrawing images with an alpha channel. You can also use the 'a' key. .TP -\fB\-z, \-\-zoom\-pointer\fR -Zoom centered on pointer (default=off). By default the zoom is centered on the window center, with this option, it is on the mouse pointer. +\fB\-dINT, \-\-delay=INT\fR +Delay before hiding the cursor. If you use this option with a strictly positive number t as argument, \fIgliv\fR will wait for t milliseconds of mouse inactivity and then hide the cursor. It reappears when you move the mouse. .TP -\fB\-t, \-\-dither\fR -Enable dithering (default=off). Use this option if you are on a low colors display, that is with a depth of 16 bits, and the image quality does not satisfy you. -.br -Note that it makes loading a bit slower. +\fB\-e, \-\-build\-menus\fR +Build images menu at startup (default=on). Disabling the images menus creation at startup makes it faster, especially with many files on the command line. .TP \fB\-F, \-\-force\-load\fR Try to load every file (default=off). When loading a file, the loader is chosen according to the filename extension in order to optimize the loading time. If the extension is unknown, the file is ignored, with this option \fIgliv\fR will always try to load the file. .TP -\fB\-p, \-\-mipmap\fR -Build mipmaps (default=off). Mipmaps are good on a not so fast graphics board, to speed up drawing large images zoomed out. On the other hand, it makes loading slower. +\fB\-f, \-\-fullscreen\fR +Start in full screen mode (default=off). You can still go back to windowed mode by pressing 'f' or using the menu. .TP -\fB\-n, \-\-mnemonics\fR -Make mnemonics for images menus (default=off). When this option is disabled the images menus are built much more quickly. +\fB\-g, \-\-glivrc\fR +Load ~/.glivrc (default=on). Specify it once to disable loading of the rc file. It can be used to make finding which argument to put on the command line easier. .TP -\fB\-w, \-\-slide\-show\fR -Start the slide show immediately (default=off). This way you will not have to start the slide show from the menu. +\fB\-i, \-\-info\fR +Show infos about displayed image (default=on). With this option, \fIgliv\fR will by default print the info line you can obtain by typing 'i'. .TP \fB\-L, \-\-loop\fR Make the slide show loop at the end (default=off). When the last image is displayed, asking for the next one will show the first one. .TP -\fB\-1, \-\-one\-image\fR -Keep only one image in memory (default=off). This is useful when you load very big images that would not fit in memory if they were not alone. Otherwise it would just make switching between images slower since the image is not preloaded anymore. -.TP -\fB\-0, \-\-null\fR -Read null\-terminated filenames (default=off). This can be used with "find \-print0" or with "tr '\en' '\e0'" when you have a very long list of filenames to pass to gliv. Unlike xargs(1) it allows an unlimited number of filenames. -.TP -\fB\-C, \-\-client\fR -Connect to an already running gliv (default=off). With this option, GLiv will open the files passed in the arguments in the GLiv server window. It only honours the options to sort, shuffle and recursively traverse directories. It can also be used with the above \-0 option. The GLiv server is the latest launched gliv or the one which has been chosen using the Options menu. +\fB\-l, \-\-scale\-down\fR +Reduce the image to the window (default=off). Make the image fit window if the image need to be reduced. It implies \-f and is like typing 'l' with every image. .TP -\fB\-e, \-\-build\-menus\fR -Build images menu at startup (default=on). Disabling the images menus creation at startup makes it faster, especially with many files on the command line. +\fB\-M, \-\-maximize\fR +Maximize the image to the window (default=off). Make the image fit window if the image need to be enlarged. It implies \-f and is like typing 'M' with every image. .TP -\fB\-b, \-\-menu\fR -Display the menu bar (default=on). Use it to display the currently minimal menubar, you can also use the 'b' key. +\fB\-m, \-\-make\-fit\fR +Make the image fit the window (default=off). Make the image fit the window wathever the image size, this is the equivalent of \-l and \-M. It is like typing 'm' with every image. .TP -\fB\-i, \-\-info\fR -Show infos about displayed image (default=on). With this option, \fIgliv\fR will by default print the info line you can obtain by typing 'i'. +\fB\-n, \-\-mnemonics\fR +Make mnemonics for images menus (default=off). When this option is disabled the images menus are built much more quickly. .TP \fB\-o, \-\-scrollbars\fR Display scrollbars (default=on). Enable or disable the scrollbars on the borders. .TP -\fB\-g, \-\-glivrc\fR -Load ~/.glivrc (default=on). Specify it once to disable loading of the rc file. It can be used to make finding which argument to put on the command line easier. +\fB\-PINT, \-\-fps=INT\fR +Maximum framerate. When moving the image with the mouse, the framerate can become quite big, and the CPU usage too. With this option and a positive argument, the framerate can be limited in this situation. .TP -\fB\-c, \-\-alpha\-checks\fR -Alpha checks in the background (default=on). Use it to have a checker background when the image has an alpha channel. This may cause slowdown when redrawing images with an alpha channel. You can also use the 'a' key. +\fB\-p, \-\-mipmap\fR +Build mipmaps (default=off). Mipmaps are good on a not so fast graphics board, to speed up drawing large images zoomed out. On the other hand, it makes loading slower. +.TP +\fB\-R, \-\-recursive\fR +Processe directories recursively (default=off). If you specify a directory in the command line \fIgliv\fR will open every image in this directory and its subdirectories. +.TP +\fB\-S, \-\-sort\fR +Show images in sorted order. The images list will be sorted before the slide show. +.TP +\fB\-s, \-\-shuffle\fR +Show images in random order. The images list will be shuffled before the slide show. .TP \fB\-T, \-\-thumbnails\fR Show thumbnails in images menus (default=on). The thumbnails size is configurable in the option dialog. .TP -\fB\-W, \-\-resize\-win\fR -Automatic window resizing (default=on). By default, in window mode, GLiv resizes the window for each image. You can disable this behaviour with this option. -.TP -\fB\-dINT, \-\-delay=INT\fR -Delay before hiding the cursor. If you use this option with a strictly positive number t as argument, \fIgliv\fR will wait for t milliseconds of mouse inactivity and then hide the cursor. It reappears when you move the mouse. +\fB\-t, \-\-dither\fR +Enable dithering (default=off). Use this option if you are on a low colors display, that is with a depth of 16 bits, and the image quality does not satisfy you. Note that it makes loading a bit slower. .TP \fB\-uINT, \-\-history=INT\fR Length of history. The maximum number of items in the history. Use 0 to disable the history, and \-1 to make it unlimited. The default is 1000 but the suggested value is \-1, because the size of an item is 44 bytes (on a 32 bits system) which won't fill your memory. .TP -\fB\-aINT, \-\-duration=INT\fR -Delay between each image. This is the minimal time to wait between each image during the slide show. It does not include the time load the image, and is exprimed in seconds. +\fB\-W, \-\-resize\-win\fR +Automatic window resizing (default=on). By default, in window mode, GLiv resizes the window for each image. You can disable this behaviour with this option. .TP -\fB\-PINT, \-\-fps=INT\fR -Maximum framerate. When moving the image with the mouse, the framerate can become quite big, and the CPU usage too. With this option and a positive argument, the framerate can be limited in this situation. +\fB\-w, \-\-slide\-show\fR +Start the slide show immediately (default=off). This way you will not have to start the slide show from the menu. +.TP +\fB\-z, \-\-zoom\-pointer\fR +Zoom centered on pointer (default=off). By default the zoom is centered on the window center, with this option, it is on the mouse pointer. +.TP +\fB\-0, \-\-null\fR +Read null\-terminated filenames (default=off). This can be used with "find \-print0" or with "tr '\en' '\e0'" when you have a very long list of filenames to pass to gliv. Unlike xargs(1) it allows an unlimited number of filenames. +.TP +\fB\-1, \-\-one\-image\fR +Keep only one image in memory (default=off). This is useful when you load very big images that would not fit in memory if they were not alone. Otherwise it would just make switching between images slower since the image is not preloaded anymore. .SH "COLLECTIONS" Starting with version 1.8, GLiv supports a file format called "GLiv collection". It contains an images list and the associated thumbnails, this way, when you load a collection the images menus rebuilding is faster since it does not have to make thumbnails. .br diff --git a/src/cmdline.c b/src/cmdline.c index 3497525..fa46bd6 100644 --- a/src/cmdline.c +++ b/src/cmdline.c @@ -39,37 +39,35 @@ cmdline_parser_print_help (void) "Usage: %s [OPTIONS]... [FILES]...\n", CMDLINE_PARSER_PACKAGE); printf(" -h --help Print help and exit\n"); printf(" -V --version Print version and exit\n"); - printf("\n"); - printf(" Group: sort\n"); - printf(" -s --shuffle Show images in random order\n"); - printf(" -S --sort Show images in sorted order\n"); - printf(" -R --recursive Process directories recursively (default=off)\n"); + printf(" -aINT --duration=INT Delay between each image\n"); + printf(" -b --menu Display the menu bar (default=on)\n"); + printf(" -C --client Connect to an already running gliv (default=off)\n"); + printf(" -c --alpha-checks Alpha checks in the background (default=on)\n"); + printf(" -dINT --delay=INT Delay before hiding the cursor\n"); + printf(" -e --build-menus Build images menu at startup (default=on)\n"); + printf(" -F --force-load Try to load every file (default=off)\n"); printf(" -f --full-screen Start in full screen mode (default=off)\n"); + printf(" -g --glivrc Load ~/.glivrc (default=on)\n"); + printf(" -i --info Show infos about displayed image (default=on)\n"); + printf(" -L --loop Make the slide show loop at the end (default=off)\n"); printf(" -l --scale-down Reduce the image to the window (default=off)\n"); printf(" -M --maximize Maximize the image to the window (default=off)\n"); printf(" -m --make-fit Make the image fit the window (default=off)\n"); - printf(" -z --zoom-pointer Zoom centered on pointer (default=off)\n"); - printf(" -t --dither Enable dithering (default=off)\n"); - printf(" -F --force-load Try to load every file (default=off)\n"); - printf(" -p --mipmap Build Mipmaps (default=off)\n"); printf(" -n --mnemonics Make mnemonics for images menus (default=off)\n"); - printf(" -w --slide-show Start the slide show immediately (default=off)\n"); - printf(" -L --loop Make the slide show loop at the end (default=off)\n"); - printf(" -1 --one-image Keep only one image in memory (default=off)\n"); - printf(" -0 --null Read null-terminated filenames (default=off)\n"); - printf(" -C --client Connect to an already running gliv (default=off)\n"); - printf(" -e --build-menus Build images menu at startup (default=on)\n"); - printf(" -b --menu Display the menu bar (default=on)\n"); - printf(" -i --info Show infos about displayed image (default=on)\n"); printf(" -o --scrollbars Display scrollbars (default=on)\n"); - printf(" -g --glivrc Load ~/.glivrc (default=on)\n"); - printf(" -c --alpha-checks Alpha checks in the background (default=on)\n"); + printf(" -PINT --fps=INT Maximum framerate\n"); + printf(" -p --mipmap Build Mipmaps (default=off)\n"); + printf(" -R --recursive Process directories recursively (default=off)\n"); + printf(" -S --sort Show images in sorted order (default=off)\n"); + printf(" -s --shuffle Show images in random order (default=off)\n"); printf(" -T --thumbnails Show thumbnails in images menus (default=on)\n"); - printf(" -W --resize-win Automatic window resizing (default=on)\n"); - printf(" -dINT --delay=INT Delay before hiding the cursor\n"); + printf(" -t --dither Enable dithering (default=off)\n"); printf(" -uINT --history=INT Length of history\n"); - printf(" -aINT --duration=INT Delay between each image\n"); - printf(" -PINT --fps=INT Maximum framerate\n"); + printf(" -W --resize-win Automatic window resizing (default=on)\n"); + printf(" -w --slide-show Start the slide show immediately (default=off)\n"); + printf(" -z --zoom-pointer Zoom centered on pointer (default=off)\n"); + printf(" -0 --null Read null-terminated filenames (default=off)\n"); + printf(" -1 --one-image Keep only one image in memory (default=off)\n"); } @@ -92,64 +90,64 @@ cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_i { int c; /* Character of the parsed option. */ int missing_required_options = 0; - int sort_group_counter = 0; - args_info->help_given = 0 ; args_info->version_given = 0 ; - args_info->shuffle_given = 0 ; - args_info->sort_given = 0 ; - args_info->recursive_given = 0 ; + args_info->duration_given = 0 ; + args_info->menu_given = 0 ; + args_info->client_given = 0 ; + args_info->alpha_checks_given = 0 ; + args_info->delay_given = 0 ; + args_info->build_menus_given = 0 ; + args_info->force_load_given = 0 ; args_info->full_screen_given = 0 ; + args_info->glivrc_given = 0 ; + args_info->info_given = 0 ; + args_info->loop_given = 0 ; args_info->scale_down_given = 0 ; args_info->maximize_given = 0 ; args_info->make_fit_given = 0 ; - args_info->zoom_pointer_given = 0 ; - args_info->dither_given = 0 ; - args_info->force_load_given = 0 ; - args_info->mipmap_given = 0 ; args_info->mnemonics_given = 0 ; - args_info->slide_show_given = 0 ; - args_info->loop_given = 0 ; - args_info->one_image_given = 0 ; - args_info->null_given = 0 ; - args_info->client_given = 0 ; - args_info->build_menus_given = 0 ; - args_info->menu_given = 0 ; - args_info->info_given = 0 ; args_info->scrollbars_given = 0 ; - args_info->glivrc_given = 0 ; - args_info->alpha_checks_given = 0 ; + args_info->fps_given = 0 ; + args_info->mipmap_given = 0 ; + args_info->recursive_given = 0 ; + args_info->sort_given = 0 ; + args_info->shuffle_given = 0 ; args_info->thumbnails_given = 0 ; - args_info->resize_win_given = 0 ; - args_info->delay_given = 0 ; + args_info->dither_given = 0 ; args_info->history_given = 0 ; - args_info->duration_given = 0 ; - args_info->fps_given = 0 ; + args_info->resize_win_given = 0 ; + args_info->slide_show_given = 0 ; + args_info->zoom_pointer_given = 0 ; + args_info->null_given = 0 ; + args_info->one_image_given = 0 ; #define clear_args() { \ - args_info->recursive_flag = 0;\ + args_info->menu_flag = 1;\ + args_info->client_flag = 0;\ + args_info->alpha_checks_flag = 1;\ + args_info->build_menus_flag = 1;\ + args_info->force_load_flag = 0;\ args_info->full_screen_flag = 0;\ + args_info->glivrc_flag = 1;\ + args_info->info_flag = 1;\ + args_info->loop_flag = 0;\ args_info->scale_down_flag = 0;\ args_info->maximize_flag = 0;\ args_info->make_fit_flag = 0;\ - args_info->zoom_pointer_flag = 0;\ - args_info->dither_flag = 0;\ - args_info->force_load_flag = 0;\ - args_info->mipmap_flag = 0;\ args_info->mnemonics_flag = 0;\ - args_info->slide_show_flag = 0;\ - args_info->loop_flag = 0;\ - args_info->one_image_flag = 0;\ - args_info->null_flag = 0;\ - args_info->client_flag = 0;\ - args_info->build_menus_flag = 1;\ - args_info->menu_flag = 1;\ - args_info->info_flag = 1;\ args_info->scrollbars_flag = 1;\ - args_info->glivrc_flag = 1;\ - args_info->alpha_checks_flag = 1;\ + args_info->mipmap_flag = 0;\ + args_info->recursive_flag = 0;\ + args_info->sort_flag = 0;\ + args_info->shuffle_flag = 0;\ args_info->thumbnails_flag = 1;\ + args_info->dither_flag = 0;\ args_info->resize_win_flag = 1;\ + args_info->slide_show_flag = 0;\ + args_info->zoom_pointer_flag = 0;\ + args_info->null_flag = 0;\ + args_info->one_image_flag = 0;\ } clear_args(); @@ -170,40 +168,40 @@ cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_i static struct option long_options[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, - { "shuffle", 0, NULL, 's' }, - { "sort", 0, NULL, 'S' }, - { "recursive", 0, NULL, 'R' }, + { "duration", 1, NULL, 'a' }, + { "menu", 0, NULL, 'b' }, + { "client", 0, NULL, 'C' }, + { "alpha-checks", 0, NULL, 'c' }, + { "delay", 1, NULL, 'd' }, + { "build-menus", 0, NULL, 'e' }, + { "force-load", 0, NULL, 'F' }, { "full-screen", 0, NULL, 'f' }, + { "glivrc", 0, NULL, 'g' }, + { "info", 0, NULL, 'i' }, + { "loop", 0, NULL, 'L' }, { "scale-down", 0, NULL, 'l' }, { "maximize", 0, NULL, 'M' }, { "make-fit", 0, NULL, 'm' }, - { "zoom-pointer", 0, NULL, 'z' }, - { "dither", 0, NULL, 't' }, - { "force-load", 0, NULL, 'F' }, - { "mipmap", 0, NULL, 'p' }, { "mnemonics", 0, NULL, 'n' }, - { "slide-show", 0, NULL, 'w' }, - { "loop", 0, NULL, 'L' }, - { "one-image", 0, NULL, '1' }, - { "null", 0, NULL, '0' }, - { "client", 0, NULL, 'C' }, - { "build-menus", 0, NULL, 'e' }, - { "menu", 0, NULL, 'b' }, - { "info", 0, NULL, 'i' }, { "scrollbars", 0, NULL, 'o' }, - { "glivrc", 0, NULL, 'g' }, - { "alpha-checks", 0, NULL, 'c' }, + { "fps", 1, NULL, 'P' }, + { "mipmap", 0, NULL, 'p' }, + { "recursive", 0, NULL, 'R' }, + { "sort", 0, NULL, 'S' }, + { "shuffle", 0, NULL, 's' }, { "thumbnails", 0, NULL, 'T' }, - { "resize-win", 0, NULL, 'W' }, - { "delay", 1, NULL, 'd' }, + { "dither", 0, NULL, 't' }, { "history", 1, NULL, 'u' }, - { "duration", 1, NULL, 'a' }, - { "fps", 1, NULL, 'P' }, + { "resize-win", 0, NULL, 'W' }, + { "slide-show", 0, NULL, 'w' }, + { "zoom-pointer", 0, NULL, 'z' }, + { "null", 0, NULL, '0' }, + { "one-image", 0, NULL, '1' }, { NULL, 0, NULL, 0 } }; stop_char = 0; - c = getopt_long (argc, argv, "hVsSRflMmztFpnwL10CebiogcTWd:u:a:P:", long_options, &option_index); + c = getopt_long (argc, argv, "hVa:bCcd:eFfgiLlMmnoP:pRSsTtu:Wwz01", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ @@ -219,268 +217,268 @@ cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_i cmdline_parser_print_version (); exit (EXIT_SUCCESS); - case 's': /* Show images in random order. */ - if (args_info->shuffle_given) + case 'a': /* Delay between each image. */ + if (args_info->duration_given) { - fprintf (stderr, "%s: `--shuffle' (`-s') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--duration' (`-a') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->shuffle_given = 1; - sort_group_counter += 1; - break; + args_info->duration_given = 1; + args_info->duration_arg = strtol (optarg,&stop_char,0); + break; - case 'S': /* Show images in sorted order. */ - if (args_info->sort_given) + case 'b': /* Display the menu bar. */ + if (args_info->menu_given) { - fprintf (stderr, "%s: `--sort' (`-S') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--menu' (`-b') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->sort_given = 1; - sort_group_counter += 1; - break; + args_info->menu_given = 1; + args_info->menu_flag = !(args_info->menu_flag); + break; - case 'R': /* Process directories recursively. */ - if (args_info->recursive_given) + case 'C': /* Connect to an already running gliv. */ + if (args_info->client_given) { - fprintf (stderr, "%s: `--recursive' (`-R') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--client' (`-C') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->recursive_given = 1; - args_info->recursive_flag = !(args_info->recursive_flag); + args_info->client_given = 1; + args_info->client_flag = !(args_info->client_flag); break; - case 'f': /* Start in full screen mode. */ - if (args_info->full_screen_given) + case 'c': /* Alpha checks in the background. */ + if (args_info->alpha_checks_given) { - fprintf (stderr, "%s: `--full-screen' (`-f') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--alpha-checks' (`-c') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->full_screen_given = 1; - args_info->full_screen_flag = !(args_info->full_screen_flag); + args_info->alpha_checks_given = 1; + args_info->alpha_checks_flag = !(args_info->alpha_checks_flag); break; - case 'l': /* Reduce the image to the window. */ - if (args_info->scale_down_given) + case 'd': /* Delay before hiding the cursor. */ + if (args_info->delay_given) { - fprintf (stderr, "%s: `--scale-down' (`-l') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--delay' (`-d') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->scale_down_given = 1; - args_info->scale_down_flag = !(args_info->scale_down_flag); + args_info->delay_given = 1; + args_info->delay_arg = strtol (optarg,&stop_char,0); break; - case 'M': /* Maximize the image to the window. */ - if (args_info->maximize_given) + case 'e': /* Build images menu at startup. */ + if (args_info->build_menus_given) { - fprintf (stderr, "%s: `--maximize' (`-M') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--build-menus' (`-e') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->maximize_given = 1; - args_info->maximize_flag = !(args_info->maximize_flag); + args_info->build_menus_given = 1; + args_info->build_menus_flag = !(args_info->build_menus_flag); break; - case 'm': /* Make the image fit the window. */ - if (args_info->make_fit_given) + case 'F': /* Try to load every file. */ + if (args_info->force_load_given) { - fprintf (stderr, "%s: `--make-fit' (`-m') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--force-load' (`-F') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->make_fit_given = 1; - args_info->make_fit_flag = !(args_info->make_fit_flag); + args_info->force_load_given = 1; + args_info->force_load_flag = !(args_info->force_load_flag); break; - case 'z': /* Zoom centered on pointer. */ - if (args_info->zoom_pointer_given) + case 'f': /* Start in full screen mode. */ + if (args_info->full_screen_given) { - fprintf (stderr, "%s: `--zoom-pointer' (`-z') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--full-screen' (`-f') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->zoom_pointer_given = 1; - args_info->zoom_pointer_flag = !(args_info->zoom_pointer_flag); + args_info->full_screen_given = 1; + args_info->full_screen_flag = !(args_info->full_screen_flag); break; - case 't': /* Enable dithering. */ - if (args_info->dither_given) + case 'g': /* Load ~/.glivrc. */ + if (args_info->glivrc_given) { - fprintf (stderr, "%s: `--dither' (`-t') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--glivrc' (`-g') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->dither_given = 1; - args_info->dither_flag = !(args_info->dither_flag); + args_info->glivrc_given = 1; + args_info->glivrc_flag = !(args_info->glivrc_flag); break; - case 'F': /* Try to load every file. */ - if (args_info->force_load_given) + case 'i': /* Show infos about displayed image. */ + if (args_info->info_given) { - fprintf (stderr, "%s: `--force-load' (`-F') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--info' (`-i') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->force_load_given = 1; - args_info->force_load_flag = !(args_info->force_load_flag); + args_info->info_given = 1; + args_info->info_flag = !(args_info->info_flag); break; - case 'p': /* Build Mipmaps. */ - if (args_info->mipmap_given) + case 'L': /* Make the slide show loop at the end. */ + if (args_info->loop_given) { - fprintf (stderr, "%s: `--mipmap' (`-p') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--loop' (`-L') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->mipmap_given = 1; - args_info->mipmap_flag = !(args_info->mipmap_flag); + args_info->loop_given = 1; + args_info->loop_flag = !(args_info->loop_flag); break; - case 'n': /* Make mnemonics for images menus. */ - if (args_info->mnemonics_given) + case 'l': /* Reduce the image to the window. */ + if (args_info->scale_down_given) { - fprintf (stderr, "%s: `--mnemonics' (`-n') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--scale-down' (`-l') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->mnemonics_given = 1; - args_info->mnemonics_flag = !(args_info->mnemonics_flag); + args_info->scale_down_given = 1; + args_info->scale_down_flag = !(args_info->scale_down_flag); break; - case 'w': /* Start the slide show immediately. */ - if (args_info->slide_show_given) + case 'M': /* Maximize the image to the window. */ + if (args_info->maximize_given) { - fprintf (stderr, "%s: `--slide-show' (`-w') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--maximize' (`-M') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->slide_show_given = 1; - args_info->slide_show_flag = !(args_info->slide_show_flag); + args_info->maximize_given = 1; + args_info->maximize_flag = !(args_info->maximize_flag); break; - case 'L': /* Make the slide show loop at the end. */ - if (args_info->loop_given) + case 'm': /* Make the image fit the window. */ + if (args_info->make_fit_given) { - fprintf (stderr, "%s: `--loop' (`-L') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--make-fit' (`-m') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->loop_given = 1; - args_info->loop_flag = !(args_info->loop_flag); + args_info->make_fit_given = 1; + args_info->make_fit_flag = !(args_info->make_fit_flag); break; - case '1': /* Keep only one image in memory. */ - if (args_info->one_image_given) + case 'n': /* Make mnemonics for images menus. */ + if (args_info->mnemonics_given) { - fprintf (stderr, "%s: `--one-image' (`-1') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--mnemonics' (`-n') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->one_image_given = 1; - args_info->one_image_flag = !(args_info->one_image_flag); + args_info->mnemonics_given = 1; + args_info->mnemonics_flag = !(args_info->mnemonics_flag); break; - case '0': /* Read null-terminated filenames. */ - if (args_info->null_given) + case 'o': /* Display scrollbars. */ + if (args_info->scrollbars_given) { - fprintf (stderr, "%s: `--null' (`-0') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--scrollbars' (`-o') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->null_given = 1; - args_info->null_flag = !(args_info->null_flag); + args_info->scrollbars_given = 1; + args_info->scrollbars_flag = !(args_info->scrollbars_flag); break; - case 'C': /* Connect to an already running gliv. */ - if (args_info->client_given) + case 'P': /* Maximum framerate. */ + if (args_info->fps_given) { - fprintf (stderr, "%s: `--client' (`-C') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--fps' (`-P') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->client_given = 1; - args_info->client_flag = !(args_info->client_flag); + args_info->fps_given = 1; + args_info->fps_arg = strtol (optarg,&stop_char,0); break; - case 'e': /* Build images menu at startup. */ - if (args_info->build_menus_given) + case 'p': /* Build Mipmaps. */ + if (args_info->mipmap_given) { - fprintf (stderr, "%s: `--build-menus' (`-e') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--mipmap' (`-p') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->build_menus_given = 1; - args_info->build_menus_flag = !(args_info->build_menus_flag); + args_info->mipmap_given = 1; + args_info->mipmap_flag = !(args_info->mipmap_flag); break; - case 'b': /* Display the menu bar. */ - if (args_info->menu_given) + case 'R': /* Process directories recursively. */ + if (args_info->recursive_given) { - fprintf (stderr, "%s: `--menu' (`-b') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--recursive' (`-R') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->menu_given = 1; - args_info->menu_flag = !(args_info->menu_flag); + args_info->recursive_given = 1; + args_info->recursive_flag = !(args_info->recursive_flag); break; - case 'i': /* Show infos about displayed image. */ - if (args_info->info_given) + case 'S': /* Show images in sorted order. */ + if (args_info->sort_given) { - fprintf (stderr, "%s: `--info' (`-i') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--sort' (`-S') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->info_given = 1; - args_info->info_flag = !(args_info->info_flag); + args_info->sort_given = 1; + args_info->sort_flag = !(args_info->sort_flag); break; - case 'o': /* Display scrollbars. */ - if (args_info->scrollbars_given) + case 's': /* Show images in random order. */ + if (args_info->shuffle_given) { - fprintf (stderr, "%s: `--scrollbars' (`-o') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--shuffle' (`-s') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->scrollbars_given = 1; - args_info->scrollbars_flag = !(args_info->scrollbars_flag); + args_info->shuffle_given = 1; + args_info->shuffle_flag = !(args_info->shuffle_flag); break; - case 'g': /* Load ~/.glivrc. */ - if (args_info->glivrc_given) + case 'T': /* Show thumbnails in images menus. */ + if (args_info->thumbnails_given) { - fprintf (stderr, "%s: `--glivrc' (`-g') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--thumbnails' (`-T') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->glivrc_given = 1; - args_info->glivrc_flag = !(args_info->glivrc_flag); + args_info->thumbnails_given = 1; + args_info->thumbnails_flag = !(args_info->thumbnails_flag); break; - case 'c': /* Alpha checks in the background. */ - if (args_info->alpha_checks_given) + case 't': /* Enable dithering. */ + if (args_info->dither_given) { - fprintf (stderr, "%s: `--alpha-checks' (`-c') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--dither' (`-t') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->alpha_checks_given = 1; - args_info->alpha_checks_flag = !(args_info->alpha_checks_flag); + args_info->dither_given = 1; + args_info->dither_flag = !(args_info->dither_flag); break; - case 'T': /* Show thumbnails in images menus. */ - if (args_info->thumbnails_given) + case 'u': /* Length of history. */ + if (args_info->history_given) { - fprintf (stderr, "%s: `--thumbnails' (`-T') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--history' (`-u') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->thumbnails_given = 1; - args_info->thumbnails_flag = !(args_info->thumbnails_flag); + args_info->history_given = 1; + args_info->history_arg = strtol (optarg,&stop_char,0); break; case 'W': /* Automatic window resizing. */ @@ -494,48 +492,48 @@ cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_i args_info->resize_win_flag = !(args_info->resize_win_flag); break; - case 'd': /* Delay before hiding the cursor. */ - if (args_info->delay_given) + case 'w': /* Start the slide show immediately. */ + if (args_info->slide_show_given) { - fprintf (stderr, "%s: `--delay' (`-d') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--slide-show' (`-w') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->delay_given = 1; - args_info->delay_arg = strtol (optarg,&stop_char,0); + args_info->slide_show_given = 1; + args_info->slide_show_flag = !(args_info->slide_show_flag); break; - case 'u': /* Length of history. */ - if (args_info->history_given) + case 'z': /* Zoom centered on pointer. */ + if (args_info->zoom_pointer_given) { - fprintf (stderr, "%s: `--history' (`-u') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--zoom-pointer' (`-z') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->history_given = 1; - args_info->history_arg = strtol (optarg,&stop_char,0); + args_info->zoom_pointer_given = 1; + args_info->zoom_pointer_flag = !(args_info->zoom_pointer_flag); break; - case 'a': /* Delay between each image. */ - if (args_info->duration_given) + case '0': /* Read null-terminated filenames. */ + if (args_info->null_given) { - fprintf (stderr, "%s: `--duration' (`-a') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--null' (`-0') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->duration_given = 1; - args_info->duration_arg = strtol (optarg,&stop_char,0); + args_info->null_given = 1; + args_info->null_flag = !(args_info->null_flag); break; - case 'P': /* Maximum framerate. */ - if (args_info->fps_given) + case '1': /* Keep only one image in memory. */ + if (args_info->one_image_given) { - fprintf (stderr, "%s: `--fps' (`-P') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--one-image' (`-1') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); return (EXIT_FAILURE); } - args_info->fps_given = 1; - args_info->fps_arg = strtol (optarg,&stop_char,0); + args_info->one_image_given = 1; + args_info->one_image_flag = !(args_info->one_image_flag); break; @@ -551,12 +549,6 @@ cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_i } /* switch */ } /* while */ - if ( sort_group_counter > 1) - { - fprintf (stderr, "%s: %d options of group sort were given. At most one is required\n", CMDLINE_PARSER_PACKAGE, sort_group_counter); - missing_required_options = 1; - } - if ( missing_required_options ) return (EXIT_FAILURE); diff --git a/src/include/cmdline.h b/src/include/cmdline.h index 01b908f..fb580b6 100644 --- a/src/include/cmdline.h +++ b/src/include/cmdline.h @@ -24,65 +24,67 @@ extern "C" { struct gengetopt_args_info { - int recursive_flag; /* Process directories recursively (default=off). */ + int duration_arg; /* Delay between each image. */ + int menu_flag; /* Display the menu bar (default=on). */ + int client_flag; /* Connect to an already running gliv (default=off). */ + int alpha_checks_flag; /* Alpha checks in the background (default=on). */ + int delay_arg; /* Delay before hiding the cursor. */ + int build_menus_flag; /* Build images menu at startup (default=on). */ + int force_load_flag; /* Try to load every file (default=off). */ int full_screen_flag; /* Start in full screen mode (default=off). */ + int glivrc_flag; /* Load ~/.glivrc (default=on). */ + int info_flag; /* Show infos about displayed image (default=on). */ + int loop_flag; /* Make the slide show loop at the end (default=off). */ int scale_down_flag; /* Reduce the image to the window (default=off). */ int maximize_flag; /* Maximize the image to the window (default=off). */ int make_fit_flag; /* Make the image fit the window (default=off). */ - int zoom_pointer_flag; /* Zoom centered on pointer (default=off). */ - int dither_flag; /* Enable dithering (default=off). */ - int force_load_flag; /* Try to load every file (default=off). */ - int mipmap_flag; /* Build Mipmaps (default=off). */ int mnemonics_flag; /* Make mnemonics for images menus (default=off). */ - int slide_show_flag; /* Start the slide show immediately (default=off). */ - int loop_flag; /* Make the slide show loop at the end (default=off). */ - int one_image_flag; /* Keep only one image in memory (default=off). */ - int null_flag; /* Read null-terminated filenames (default=off). */ - int client_flag; /* Connect to an already running gliv (default=off). */ - int build_menus_flag; /* Build images menu at startup (default=on). */ - int menu_flag; /* Display the menu bar (default=on). */ - int info_flag; /* Show infos about displayed image (default=on). */ int scrollbars_flag; /* Display scrollbars (default=on). */ - int glivrc_flag; /* Load ~/.glivrc (default=on). */ - int alpha_checks_flag; /* Alpha checks in the background (default=on). */ + int fps_arg; /* Maximum framerate. */ + int mipmap_flag; /* Build Mipmaps (default=off). */ + int recursive_flag; /* Process directories recursively (default=off). */ + int sort_flag; /* Show images in sorted order (default=off). */ + int shuffle_flag; /* Show images in random order (default=off). */ int thumbnails_flag; /* Show thumbnails in images menus (default=on). */ - int resize_win_flag; /* Automatic window resizing (default=on). */ - int delay_arg; /* Delay before hiding the cursor. */ + int dither_flag; /* Enable dithering (default=off). */ int history_arg; /* Length of history. */ - int duration_arg; /* Delay between each image. */ - int fps_arg; /* Maximum framerate. */ + int resize_win_flag; /* Automatic window resizing (default=on). */ + int slide_show_flag; /* Start the slide show immediately (default=off). */ + int zoom_pointer_flag; /* Zoom centered on pointer (default=off). */ + int null_flag; /* Read null-terminated filenames (default=off). */ + int one_image_flag; /* Keep only one image in memory (default=off). */ int help_given ; /* Whether help was given. */ int version_given ; /* Whether version was given. */ - int shuffle_given ; /* Whether shuffle was given. */ - int sort_given ; /* Whether sort was given. */ - int recursive_given ; /* Whether recursive was given. */ + int duration_given ; /* Whether duration was given. */ + int menu_given ; /* Whether menu was given. */ + int client_given ; /* Whether client was given. */ + int alpha_checks_given ; /* Whether alpha-checks was given. */ + int delay_given ; /* Whether delay was given. */ + int build_menus_given ; /* Whether build-menus was given. */ + int force_load_given ; /* Whether force-load was given. */ int full_screen_given ; /* Whether full-screen was given. */ + int glivrc_given ; /* Whether glivrc was given. */ + int info_given ; /* Whether info was given. */ + int loop_given ; /* Whether loop was given. */ int scale_down_given ; /* Whether scale-down was given. */ int maximize_given ; /* Whether maximize was given. */ int make_fit_given ; /* Whether make-fit was given. */ - int zoom_pointer_given ; /* Whether zoom-pointer was given. */ - int dither_given ; /* Whether dither was given. */ - int force_load_given ; /* Whether force-load was given. */ - int mipmap_given ; /* Whether mipmap was given. */ int mnemonics_given ; /* Whether mnemonics was given. */ - int slide_show_given ; /* Whether slide-show was given. */ - int loop_given ; /* Whether loop was given. */ - int one_image_given ; /* Whether one-image was given. */ - int null_given ; /* Whether null was given. */ - int client_given ; /* Whether client was given. */ - int build_menus_given ; /* Whether build-menus was given. */ - int menu_given ; /* Whether menu was given. */ - int info_given ; /* Whether info was given. */ int scrollbars_given ; /* Whether scrollbars was given. */ - int glivrc_given ; /* Whether glivrc was given. */ - int alpha_checks_given ; /* Whether alpha-checks was given. */ + int fps_given ; /* Whether fps was given. */ + int mipmap_given ; /* Whether mipmap was given. */ + int recursive_given ; /* Whether recursive was given. */ + int sort_given ; /* Whether sort was given. */ + int shuffle_given ; /* Whether shuffle was given. */ int thumbnails_given ; /* Whether thumbnails was given. */ - int resize_win_given ; /* Whether resize-win was given. */ - int delay_given ; /* Whether delay was given. */ + int dither_given ; /* Whether dither was given. */ int history_given ; /* Whether history was given. */ - int duration_given ; /* Whether duration was given. */ - int fps_given ; /* Whether fps was given. */ + int resize_win_given ; /* Whether resize-win was given. */ + int slide_show_given ; /* Whether slide-show was given. */ + int zoom_pointer_given ; /* Whether zoom-pointer was given. */ + int null_given ; /* Whether null was given. */ + int one_image_given ; /* Whether one-image was given. */ char **inputs ; /* unamed options */ unsigned inputs_num ; /* unamed options number */ diff --git a/src/ipc.c b/src/ipc.c index 5052491..620c4f8 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -281,7 +281,7 @@ gboolean connect_server(gint argc, gchar ** argv) cmdline_parser(argc, argv, &ggo); if (write_params(fd, ggo.recursive_flag, - ggo.shuffle_given, ggo.sort_given) == FALSE) { + ggo.shuffle_flag, ggo.sort_flag) == FALSE) { close(fd); return FALSE; } diff --git a/src/main.c b/src/main.c index 3e95332..7fe3820 100644 --- a/src/main.c +++ b/src/main.c @@ -161,11 +161,16 @@ static void init_args(gint argc, gchar ** argv) struct gengetopt_args_info ggo; options_struct *rc_file; - /* Command line (only the glivrc and client flags). */ + /* Command line (some flags only). */ if (cmdline_parser(argc, argv, &ggo) != 0) quit(1); + if (ggo.sort_flag && ggo.shuffle_flag) { + g_printerr(_("Cannot sort and shuffle at the same time\n")); + quit(1); + } + if (ggo.client_flag && connect_server(argc, argv)) /* Successfully reused a GLiv window. */ quit(0); @@ -187,16 +192,16 @@ static void init_args(gint argc, gchar ** argv) if (ggo.null_flag) { read_null_filenames(ggo.recursive_flag, - ggo.shuffle_given, ggo.sort_given); + ggo.shuffle_flag, ggo.sort_flag); insert_after_current(ggo.inputs, ggo.inputs_num, ggo.recursive_flag, - ggo.shuffle_given, ggo.sort_given); + ggo.shuffle_flag, ggo.sort_flag); } else if (ggo.inputs_num > 0) /* There are filenames on the command line. */ init_list(ggo.inputs, ggo.inputs_num, - ggo.recursive_flag, ggo.shuffle_given, ggo.sort_given); + ggo.recursive_flag, ggo.shuffle_flag, ggo.sort_flag); g_free(ggo.inputs); } diff --git a/tools/_gliv b/tools/_gliv index b7b0ff7..190670e 100644 --- a/tools/_gliv +++ b/tools/_gliv @@ -1,33 +1,33 @@ #compdef gliv _arguments \ -'(--shuffle -s)'{--shuffle,-s}'[Show images in random order]' \ -'(--sort -S)'{--sort,-S}'[Show images in sorted order]' \ -'(--recursive -R)'{--recursive,-R}'[Process directories recursively]' \ +'(--duration -a)'{--duration,-a+}'[Delay between each image]:number' \ +'(--menu -b)'{--menu,-b}'[Display the menu bar]' \ +'(--client -C)'{--client,-C}'[Connect to an already running gliv]' \ +'(--alpha-checks -c)'{--alpha-checks,-c}'[Alpha checks in the background]' \ +'(--delay -d)'{--delay,-d+}'[Delay before hiding the cursor]:number' \ +'(--build-menus -e)'{--build-menus,-e}'[Build images menu at startup]' \ +'(--force-load -F)'{--force-load,-F}'[Try to load every file]' \ '(--full-screen -f)'{--full-screen,-f}'[Start in full screen mode]' \ +'(--glivrc -g)'{--glivrc,-g}'[Load ~/.glivrc]' \ +'(--info -i)'{--info,-i}'[Show infos about displayed image]' \ +'(--loop -L)'{--loop,-L}'[Make the slide show loop at the end]' \ '(--scale-down -l)'{--scale-down,-l}'[Reduce the image to the window]' \ '(--maximize -M)'{--maximize,-M}'[Maximize the image to the window]' \ '(--make-fit -m)'{--make-fit,-m}'[Make the image fit the window]' \ -'(--zoom-pointer -z)'{--zoom-pointer,-z}'[Zoom centered on pointer]' \ -'(--dither -t)'{--dither,-t}'[Enable dithering]' \ -'(--force-load -F)'{--force-load,-F}'[Try to load every file]' \ -'(--mipmap -p)'{--mipmap,-p}'[Build Mipmaps]' \ '(--mnemonics -n)'{--mnemonics,-n}'[Make mnemonics for images menus]' \ -'(--slide-show -w)'{--slide-show,-w}'[Start the slide show immediately]' \ -'(--loop -L)'{--loop,-L}'[Make the slide show loop at the end]' \ -'(--one-image -1)'{--one-image,-1}'[Keep only one image in memory]' \ -'(--null -0)'{--null,-0}'[Read null-terminated filenames]' \ -'(--client -C)'{--client,-C}'[Connect to an already running gliv]' \ -'(--build-menus -e)'{--build-menus,-e}'[Build images menu at startup]' \ -'(--menu -b)'{--menu,-b}'[Display the menu bar]' \ -'(--info -i)'{--info,-i}'[Show infos about displayed image]' \ '(--scrollbars -o)'{--scrollbars,-o}'[Display scrollbars]' \ -'(--glivrc -g)'{--glivrc,-g}'[Load ~/.glivrc]' \ -'(--alpha-checks -c)'{--alpha-checks,-c}'[Alpha checks in the background]' \ +'(--fps -P)'{--fps,-P+}'[Maximum framerate]:number' \ +'(--mipmap -p)'{--mipmap,-p}'[Build Mipmaps]' \ +'(--recursive -R)'{--recursive,-R}'[Process directories recursively]' \ +'(--sort -S)'{--sort,-S}'[Show images in sorted order]' \ +'(--shuffle -s)'{--shuffle,-s}'[Show images in random order]' \ '(--thumbnails -T)'{--thumbnails,-T}'[Show thumbnails in images menus]' \ -'(--resize-win -W)'{--resize-win,-W}'[Automatic window resizing]' \ -'(--delay -d)'{--delay,-d+}'[Delay before hiding the cursor]:number' \ +'(--dither -t)'{--dither,-t}'[Enable dithering]' \ '(--history -u)'{--history,-u+}'[Length of history]:number' \ -'(--duration -a)'{--duration,-a+}'[Delay between each image]:number' \ -'(--fps -P)'{--fps,-P+}'[Maximum framerate]:number' \ +'(--resize-win -W)'{--resize-win,-W}'[Automatic window resizing]' \ +'(--slide-show -w)'{--slide-show,-w}'[Start the slide show immediately]' \ +'(--zoom-pointer -z)'{--zoom-pointer,-z}'[Zoom centered on pointer]' \ +'(--null -0)'{--null,-0}'[Read null-terminated filenames]' \ +'(--one-image -1)'{--one-image,-1}'[Keep only one image in memory]' \ '*:files:_files' diff --git a/tools/gliv.1.start b/tools/gliv.1.start index 24ddf0e..568eb8a 100644 --- a/tools/gliv.1.start +++ b/tools/gliv.1.start @@ -18,95 +18,93 @@ Print help and exit. \fB\-V, \-\-version\fR Print version and exit. .TP -\fB\-s, \-\-shuffle\fR -Show images in random order. The images list will be shuffled before the slide show. -.TP -\fB\-S, \-\-sort\fR -Show images in sorted order. The images list will be sorted before the slide show. -.TP -\fB\-R, \-\-recursive\fR -Processe directories recursively (default=off). If you specify a directory in the command line \fIgliv\fR will open every image in this directory and its subdirectories. -.TP -\fB\-f, \-\-fullscreen\fR -Start in full screen mode (default=off). You can still go back to windowed mode by pressing 'f' or using the menu. +\fB\-aINT, \-\-duration=INT\fR +Delay between each image. This is the minimal time to wait between each image during the slide show. It does not include the time load the image, and is exprimed in seconds. .TP -\fB\-l, \-\-scale\-down\fR -Reduce the image to the window (default=off). Make the image fit window if the image need to be reduced. It implies \-f and is like typing 'l' with every image. +\fB\-b, \-\-menu\fR +Display the menu bar (default=on). Use it to display the currently minimal menubar, you can also use the 'b' key. .TP -\fB\-M, \-\-maximize\fR -Maximize the image to the window (default=off). Make the image fit window if the image need to be enlarged. It implies \-f and is like typing 'M' with every image. +\fB\-C, \-\-client\fR +Connect to an already running gliv (default=off). With this option, GLiv will open the files passed in the arguments in the GLiv server window. It only honours the options to sort, shuffle and recursively traverse directories. It can also be used with the above \-0 option. The GLiv server is the latest launched gliv or the one which has been chosen using the Options menu. .TP -\fB\-m, \-\-make\-fit\fR -Make the image fit the window (default=off). Make the image fit the window wathever the image size, this is the equivalent of \-l and \-M. It is like typing 'm' with every image. +\fB\-c, \-\-alpha\-checks\fR +Alpha checks in the background (default=on). Use it to have a checker background when the image has an alpha channel. This may cause slowdown when redrawing images with an alpha channel. You can also use the 'a' key. .TP -\fB\-z, \-\-zoom\-pointer\fR -Zoom centered on pointer (default=off). By default the zoom is centered on the window center, with this option, it is on the mouse pointer. +\fB\-dINT, \-\-delay=INT\fR +Delay before hiding the cursor. If you use this option with a strictly positive number t as argument, \fIgliv\fR will wait for t milliseconds of mouse inactivity and then hide the cursor. It reappears when you move the mouse. .TP -\fB\-t, \-\-dither\fR -Enable dithering (default=off). Use this option if you are on a low colors display, that is with a depth of 16 bits, and the image quality does not satisfy you. -.br -Note that it makes loading a bit slower. +\fB\-e, \-\-build\-menus\fR +Build images menu at startup (default=on). Disabling the images menus creation at startup makes it faster, especially with many files on the command line. .TP \fB\-F, \-\-force\-load\fR Try to load every file (default=off). When loading a file, the loader is chosen according to the filename extension in order to optimize the loading time. If the extension is unknown, the file is ignored, with this option \fIgliv\fR will always try to load the file. .TP -\fB\-p, \-\-mipmap\fR -Build mipmaps (default=off). Mipmaps are good on a not so fast graphics board, to speed up drawing large images zoomed out. On the other hand, it makes loading slower. +\fB\-f, \-\-fullscreen\fR +Start in full screen mode (default=off). You can still go back to windowed mode by pressing 'f' or using the menu. .TP -\fB\-n, \-\-mnemonics\fR -Make mnemonics for images menus (default=off). When this option is disabled the images menus are built much more quickly. +\fB\-g, \-\-glivrc\fR +Load ~/.glivrc (default=on). Specify it once to disable loading of the rc file. It can be used to make finding which argument to put on the command line easier. .TP -\fB\-w, \-\-slide\-show\fR -Start the slide show immediately (default=off). This way you will not have to start the slide show from the menu. +\fB\-i, \-\-info\fR +Show infos about displayed image (default=on). With this option, \fIgliv\fR will by default print the info line you can obtain by typing 'i'. .TP \fB\-L, \-\-loop\fR Make the slide show loop at the end (default=off). When the last image is displayed, asking for the next one will show the first one. .TP -\fB\-1, \-\-one\-image\fR -Keep only one image in memory (default=off). This is useful when you load very big images that would not fit in memory if they were not alone. Otherwise it would just make switching between images slower since the image is not preloaded anymore. -.TP -\fB\-0, \-\-null\fR -Read null\-terminated filenames (default=off). This can be used with "find \-print0" or with "tr '\en' '\e0'" when you have a very long list of filenames to pass to gliv. Unlike xargs(1) it allows an unlimited number of filenames. -.TP -\fB\-C, \-\-client\fR -Connect to an already running gliv (default=off). With this option, GLiv will open the files passed in the arguments in the GLiv server window. It only honours the options to sort, shuffle and recursively traverse directories. It can also be used with the above \-0 option. The GLiv server is the latest launched gliv or the one which has been chosen using the Options menu. +\fB\-l, \-\-scale\-down\fR +Reduce the image to the window (default=off). Make the image fit window if the image need to be reduced. It implies \-f and is like typing 'l' with every image. .TP -\fB\-e, \-\-build\-menus\fR -Build images menu at startup (default=on). Disabling the images menus creation at startup makes it faster, especially with many files on the command line. +\fB\-M, \-\-maximize\fR +Maximize the image to the window (default=off). Make the image fit window if the image need to be enlarged. It implies \-f and is like typing 'M' with every image. .TP -\fB\-b, \-\-menu\fR -Display the menu bar (default=on). Use it to display the currently minimal menubar, you can also use the 'b' key. +\fB\-m, \-\-make\-fit\fR +Make the image fit the window (default=off). Make the image fit the window wathever the image size, this is the equivalent of \-l and \-M. It is like typing 'm' with every image. .TP -\fB\-i, \-\-info\fR -Show infos about displayed image (default=on). With this option, \fIgliv\fR will by default print the info line you can obtain by typing 'i'. +\fB\-n, \-\-mnemonics\fR +Make mnemonics for images menus (default=off). When this option is disabled the images menus are built much more quickly. .TP \fB\-o, \-\-scrollbars\fR Display scrollbars (default=on). Enable or disable the scrollbars on the borders. .TP -\fB\-g, \-\-glivrc\fR -Load ~/.glivrc (default=on). Specify it once to disable loading of the rc file. It can be used to make finding which argument to put on the command line easier. +\fB\-PINT, \-\-fps=INT\fR +Maximum framerate. When moving the image with the mouse, the framerate can become quite big, and the CPU usage too. With this option and a positive argument, the framerate can be limited in this situation. .TP -\fB\-c, \-\-alpha\-checks\fR -Alpha checks in the background (default=on). Use it to have a checker background when the image has an alpha channel. This may cause slowdown when redrawing images with an alpha channel. You can also use the 'a' key. +\fB\-p, \-\-mipmap\fR +Build mipmaps (default=off). Mipmaps are good on a not so fast graphics board, to speed up drawing large images zoomed out. On the other hand, it makes loading slower. +.TP +\fB\-R, \-\-recursive\fR +Processe directories recursively (default=off). If you specify a directory in the command line \fIgliv\fR will open every image in this directory and its subdirectories. +.TP +\fB\-S, \-\-sort\fR +Show images in sorted order. The images list will be sorted before the slide show. +.TP +\fB\-s, \-\-shuffle\fR +Show images in random order. The images list will be shuffled before the slide show. .TP \fB\-T, \-\-thumbnails\fR Show thumbnails in images menus (default=on). The thumbnails size is configurable in the option dialog. .TP -\fB\-W, \-\-resize\-win\fR -Automatic window resizing (default=on). By default, in window mode, GLiv resizes the window for each image. You can disable this behaviour with this option. -.TP -\fB\-dINT, \-\-delay=INT\fR -Delay before hiding the cursor. If you use this option with a strictly positive number t as argument, \fIgliv\fR will wait for t milliseconds of mouse inactivity and then hide the cursor. It reappears when you move the mouse. +\fB\-t, \-\-dither\fR +Enable dithering (default=off). Use this option if you are on a low colors display, that is with a depth of 16 bits, and the image quality does not satisfy you. Note that it makes loading a bit slower. .TP \fB\-uINT, \-\-history=INT\fR Length of history. The maximum number of items in the history. Use 0 to disable the history, and \-1 to make it unlimited. The default is 1000 but the suggested value is \-1, because the size of an item is 44 bytes (on a 32 bits system) which won't fill your memory. .TP -\fB\-aINT, \-\-duration=INT\fR -Delay between each image. This is the minimal time to wait between each image during the slide show. It does not include the time load the image, and is exprimed in seconds. +\fB\-W, \-\-resize\-win\fR +Automatic window resizing (default=on). By default, in window mode, GLiv resizes the window for each image. You can disable this behaviour with this option. .TP -\fB\-PINT, \-\-fps=INT\fR -Maximum framerate. When moving the image with the mouse, the framerate can become quite big, and the CPU usage too. With this option and a positive argument, the framerate can be limited in this situation. +\fB\-w, \-\-slide\-show\fR +Start the slide show immediately (default=off). This way you will not have to start the slide show from the menu. +.TP +\fB\-z, \-\-zoom\-pointer\fR +Zoom centered on pointer (default=off). By default the zoom is centered on the window center, with this option, it is on the mouse pointer. +.TP +\fB\-0, \-\-null\fR +Read null\-terminated filenames (default=off). This can be used with "find \-print0" or with "tr '\en' '\e0'" when you have a very long list of filenames to pass to gliv. Unlike xargs(1) it allows an unlimited number of filenames. +.TP +\fB\-1, \-\-one\-image\fR +Keep only one image in memory (default=off). This is useful when you load very big images that would not fit in memory if they were not alone. Otherwise it would just make switching between images slower since the image is not preloaded anymore. .SH "COLLECTIONS" Starting with version 1.8, GLiv supports a file format called "GLiv collection". It contains an images list and the associated thumbnails, this way, when you load a collection the images menus rebuilding is faster since it does not have to make thumbnails. .br diff --git a/tools/gliv.ggo b/tools/gliv.ggo index 5a70312..dfd9cab 100644 --- a/tools/gliv.ggo +++ b/tools/gliv.ggo @@ -3,35 +3,32 @@ purpose "Image Viewer using OpenGL" -defgroup "sort" - -groupoption "shuffle" s "Show images in random order" group="sort" -groupoption "sort" S "Show images in sorted order" group="sort" - -option "recursive" R "Process directories recursively" flag off +option "duration" a "Delay between each image" int no +option "menu" b "Display the menu bar" flag on +option "client" C "Connect to an already running gliv" flag off +option "alpha-checks" c "Alpha checks in the background" flag on +option "delay" d "Delay before hiding the cursor" int no +option "build-menus" e "Build images menu at startup" flag on +option "force-load" F "Try to load every file" flag off option "full-screen" f "Start in full screen mode" flag off +option "glivrc" g "Load ~/.glivrc" flag on +option "info" i "Show infos about displayed image" flag on +option "loop" L "Make the slide show loop at the end" flag off option "scale-down" l "Reduce the image to the window" flag off option "maximize" M "Maximize the image to the window" flag off option "make-fit" m "Make the image fit the window" flag off -option "zoom-pointer" z "Zoom centered on pointer" flag off -option "dither" t "Enable dithering" flag off -option "force-load" F "Try to load every file" flag off -option "mipmap" p "Build Mipmaps" flag off option "mnemonics" n "Make mnemonics for images menus" flag off -option "slide-show" w "Start the slide show immediately" flag off -option "loop" L "Make the slide show loop at the end" flag off -option "one-image" 1 "Keep only one image in memory" flag off -option "null" 0 "Read null-terminated filenames" flag off -option "client" C "Connect to an already running gliv" flag off -option "build-menus" e "Build images menu at startup" flag on -option "menu" b "Display the menu bar" flag on -option "info" i "Show infos about displayed image" flag on option "scrollbars" o "Display scrollbars" flag on -option "glivrc" g "Load ~/.glivrc" flag on -option "alpha-checks" c "Alpha checks in the background" flag on +option "fps" P "Maximum framerate" int no +option "mipmap" p "Build Mipmaps" flag off +option "recursive" R "Process directories recursively" flag off +option "sort" S "Show images in sorted order" flag off +option "shuffle" s "Show images in random order" flag off option "thumbnails" T "Show thumbnails in images menus" flag on -option "resize-win" W "Automatic window resizing" flag on -option "delay" d "Delay before hiding the cursor" int no +option "dither" t "Enable dithering" flag off option "history" u "Length of history" int no -option "duration" a "Delay between each image" int no -option "fps" P "Maximum framerate" int no +option "resize-win" W "Automatic window resizing" flag on +option "slide-show" w "Start the slide show immediately" flag off +option "zoom-pointer" z "Zoom centered on pointer" flag off +option "null" 0 "Read null-terminated filenames" flag off +option "one-image" 1 "Keep only one image in memory" flag off -- 2.11.4.GIT