From 2c65c28f7d148b4f4d58899b91824859bf95407c Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Sun, 21 Jul 2013 13:57:43 +0000 Subject: Update to xrandr 1.4.1 --- app/xrandr/xrandr.c | 131 +++++++++++++++++++++++++++------------------------- 1 file changed, 69 insertions(+), 62 deletions(-) (limited to 'app/xrandr/xrandr.c') diff --git a/app/xrandr/xrandr.c b/app/xrandr/xrandr.c index 0e3818fbe..63be48609 100644 --- a/app/xrandr/xrandr.c +++ b/app/xrandr/xrandr.c @@ -41,7 +41,9 @@ #include #include +#ifdef HAVE_CONFIG_H #include "config.h" +#endif static char *program_name; static Display *dpy; @@ -95,62 +97,62 @@ static const struct { static void usage(void) { - printf("usage: %s [options]\n", program_name); - printf(" where options are:\n"); - printf(" -display or -d \n"); - printf(" --help\n"); - printf(" -o \n"); - printf(" or --orientation \n"); - printf(" -q or --query\n"); - printf(" -s /x or --size /x\n"); - printf(" -r or --rate or --refresh \n"); - printf(" -v or --version\n"); - printf(" -x (reflect in x)\n"); - printf(" -y (reflect in y)\n"); - printf(" --screen \n"); - printf(" --verbose\n"); - printf(" --current\n"); - printf(" --dryrun\n"); - printf(" --nograb\n"); - printf(" --prop or --properties\n"); - printf(" --fb x\n"); - printf(" --fbmm x\n"); - printf(" --dpi /\n"); - printf(" --output \n"); - printf(" --auto\n"); - printf(" --mode \n"); - printf(" --preferred\n"); - printf(" --pos x\n"); - printf(" --rate or --refresh \n"); - printf(" --reflect normal,x,y,xy\n"); - printf(" --rotate normal,inverted,left,right\n"); - printf(" --left-of \n"); - printf(" --right-of \n"); - printf(" --above \n"); - printf(" --below \n"); - printf(" --same-as \n"); - printf(" --set \n"); - printf(" --scale x\n"); - printf(" --scale-from x\n"); - printf(" --transform ,,,,,,,,\n"); - printf(" --off\n"); - printf(" --crtc \n"); - printf(" --panning x[++[/x++[////]]]\n"); - printf(" --gamma ::\n"); - printf(" --primary\n"); - printf(" --noprimary\n"); - printf(" --newmode \n"); - printf(" \n"); - printf(" \n"); - printf(" [flags...]\n"); - printf(" Valid flags: +HSync -HSync +VSync -VSync\n"); - printf(" +CSync -CSync CSync Interlace DoubleScan\n"); - printf(" --rmmode \n"); - printf(" --addmode \n"); - printf(" --delmode \n"); - printf(" --listproviders\n"); - printf(" --setprovideroutputsource \n"); - printf(" --setprovideroffloadsink \n"); + printf("usage: %s [options]\n%s", program_name, + " where options are:\n" + " --display or -d \n" + " --help\n" + " -o \n" + " or --orientation \n" + " -q or --query\n" + " -s /x or --size /x\n" + " -r or --rate or --refresh \n" + " -v or --version\n" + " -x (reflect in x)\n" + " -y (reflect in y)\n" + " --screen \n" + " --verbose\n" + " --current\n" + " --dryrun\n" + " --nograb\n" + " --prop or --properties\n" + " --fb x\n" + " --fbmm x\n" + " --dpi /\n" + " --output \n" + " --auto\n" + " --mode \n" + " --preferred\n" + " --pos x\n" + " --rate or --refresh \n" + " --reflect normal,x,y,xy\n" + " --rotate normal,inverted,left,right\n" + " --left-of \n" + " --right-of \n" + " --above \n" + " --below \n" + " --same-as \n" + " --set \n" + " --scale x\n" + " --scale-from x\n" + " --transform ,,,,,,,,\n" + " --off\n" + " --crtc \n" + " --panning x[++[/x++[////]]]\n" + " --gamma ::\n" + " --primary\n" + " --noprimary\n" + " --newmode \n" + " \n" + " \n" + " [flags...]\n" + " Valid flags: +HSync -HSync +VSync -VSync\n" + " +CSync -CSync CSync Interlace DoubleScan\n" + " --rmmode \n" + " --addmode \n" + " --delmode \n" + " --listproviders\n" + " --setprovideroutputsource \n" + " --setprovideroffloadsink \n"); } static void _X_NORETURN _X_ATTRIBUTE_PRINTF(1,2) @@ -227,7 +229,7 @@ reflection_name (Rotation rotation) return "invalid reflection"; } -static char * +static const char * capability_name (int cap_bit) { switch (cap_bit) { @@ -2508,7 +2510,8 @@ main (int argc, char **argv) program_name = argv[0]; for (i = 1; i < argc; i++) { - if (!strcmp ("-display", argv[i]) || !strcmp ("-d", argv[i])) { + if (!strcmp ("-display", argv[i]) || !strcmp ("--display", argv[i]) || + !strcmp ("-d", argv[i])) { if (++i >= argc) argerr ("%s requires an argument\n", argv[i-1]); display_name = argv[i]; continue; @@ -2924,7 +2927,7 @@ main (int argc, char **argv) } if (!strcmp ("--newmode", argv[i])) { - umode_t *m = malloc (sizeof (umode_t)); + umode_t *m = calloc (1, sizeof (umode_t)); double clock; ++i; @@ -2966,7 +2969,7 @@ main (int argc, char **argv) } if (!strcmp ("--rmmode", argv[i])) { - umode_t *m = malloc (sizeof (umode_t)); + umode_t *m = calloc (1, sizeof (umode_t)); if (++i >= argc) argerr ("%s requires an argument\n", argv[i-1]); set_name (&m->name, argv[i], name_string|name_xid); @@ -2979,7 +2982,7 @@ main (int argc, char **argv) } if (!strcmp ("--addmode", argv[i])) { - umode_t *m = malloc (sizeof (umode_t)); + umode_t *m = calloc (1, sizeof (umode_t)); if (i+2 >= argc) argerr ("%s requires two arguments\n", argv[i]); set_name (&m->output, argv[++i], name_string|name_xid); @@ -2993,7 +2996,7 @@ main (int argc, char **argv) } if (!strcmp ("--delmode", argv[i])) { - umode_t *m = malloc (sizeof (umode_t)); + umode_t *m = calloc (1, sizeof (umode_t)); if (i+2 >= argc) argerr ("%s requires two arguments\n", argv[i]); set_name (&m->output, argv[++i], name_string|name_xid); @@ -3560,6 +3563,8 @@ main (int argc, char **argv) print_output_property_value (False, 32, actual_type, (unsigned char *) &(propinfo->values[k * 2 + 1])); printf (")"); + if (k < propinfo->num_values / 2 - 1) + printf (", "); } printf ("\n"); } @@ -3570,6 +3575,8 @@ main (int argc, char **argv) { print_output_property_value (False, 32, actual_type, (unsigned char *) &(propinfo->values[k])); + if (k < propinfo->num_values - 1) + printf (", "); } printf ("\n"); } -- cgit v1.2.3