~random-stuff/libpng/libpng-1.6.x

« back to all changes in this revision

Viewing changes to contrib/gregbook/rpng-x.c

  • Committer: Sérgio Benjamim
  • Date: 2015-10-10 23:00:20 UTC
  • Revision ID: sergio_br2@yahoo.com.br-20151010230020-gdtmmv30zn25396n
Update to 1.6.18.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    - 1.14:  added support for X resources (thanks to Gerhard Niklasch)
27
27
    - 2.00:  dual-licensed (added GNU GPL)
28
28
    - 2.01:  fixed improper display of usage screen on PNG error(s)
 
29
    - 2.02:  Added "void(argc);" statement to quiet pedantic compiler warnings
 
30
             about unused variable (GR-P)
29
31
 
30
32
  ---------------------------------------------------------------------------
31
33
 
80
82
 
81
83
#define PROGNAME  "rpng-x"
82
84
#define LONGNAME  "Simple PNG Viewer for X"
83
 
#define VERSION   "2.01 of 16 March 2008"
84
 
#define RESNAME   "rpng"        /* our X resource application name */
85
 
#define RESCLASS  "Rpng"        /* our X resource class name */
 
85
#define VERSION   "2.02 of 15 June 2014"
 
86
#define RESNAME   "rpng"        /* our X resource application name */
 
87
#define RESCLASS  "Rpng"        /* our X resource class name */
86
88
 
87
89
#include <stdio.h>
88
90
#include <stdlib.h>
252
254
            else {
253
255
                bgstr = *argv;
254
256
                if (strlen(bgstr) != 7 || bgstr[0] != '#')
255
 
                    ++error; 
256
 
                else 
 
257
                    ++error;
 
258
                else
257
259
                    have_bg = TRUE;
258
260
            }
259
261
        } else {
279
281
          "Usage:  %s [-display xdpy] [-gamma exp] [-bgcolor bg] file.png\n"
280
282
          "    xdpy\tname of the target X display (e.g., ``hostname:0'')\n"
281
283
          "    exp \ttransfer-function exponent (``gamma'') of the display\n"
282
 
          "\t\t  system in floating-point format (e.g., ``%.1f''); equal\n"
 
284
          "\t\t  system in floating-point format (e.g., ``%.1f''); equal\n",
 
285
          PROGNAME, default_display_exponent);
 
286
 
 
287
        fprintf(stderr, "\n"
283
288
          "\t\t  to the product of the lookup-table exponent (varies)\n"
284
289
          "\t\t  and the CRT exponent (usually 2.2); must be positive\n"
285
290
          "    bg  \tdesired background color in 7-character hex RGB format\n"
286
291
          "\t\t  (e.g., ``#ff7700'' for orange:  same as HTML colors);\n"
287
292
          "\t\t  used with transparent images\n"
288
293
          "\nPress Q, Esc or mouse button 1 (within image window, after image\n"
289
 
          "is displayed) to quit.\n"
290
 
          "\n", PROGNAME, default_display_exponent);
 
294
          "is displayed) to quit.\n");
291
295
        exit(1);
292
296
    }
293
297
 
419
423
 
420
424
    rpng_x_cleanup();
421
425
 
 
426
    (void)argc; /* Unused */
 
427
 
422
428
    return 0;
423
429
}
424
430