mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] Split a long output string in contrib/gregbook/rpng2-x.c.
This commit is contained in:
parent
225af8f363
commit
33ebeec0b5
1
ANNOUNCE
1
ANNOUNCE
@ -31,6 +31,7 @@ Version 1.6.13beta01 [June 13, 2014]
|
|||||||
contrib/pngminus/*.c
|
contrib/pngminus/*.c
|
||||||
Added "(void) png_ptr;" where needed in contrib/gregbook to quiet
|
Added "(void) png_ptr;" where needed in contrib/gregbook to quiet
|
||||||
compiler complaints about unused pointers.
|
compiler complaints about unused pointers.
|
||||||
|
Split a long output string in contrib/gregbook/rpng2-x.c.
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
|||||||
1
CHANGES
1
CHANGES
@ -4945,6 +4945,7 @@ Version 1.6.13beta01 [June 13, 2014]
|
|||||||
contrib/pngminus/*.c
|
contrib/pngminus/*.c
|
||||||
Added "(void) png_ptr;" where needed in contrib/gregbook to quiet
|
Added "(void) png_ptr;" where needed in contrib/gregbook to quiet
|
||||||
compiler complaints about unused pointers.
|
compiler complaints about unused pointers.
|
||||||
|
Split a long output string in contrib/gregbook/rpng2-x.c.
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
|||||||
@ -41,7 +41,11 @@
|
|||||||
unexpected-EOF and file-read-error cases; fixed Trace() cut-and-
|
unexpected-EOF and file-read-error cases; fixed Trace() cut-and-
|
||||||
paste bugs
|
paste bugs
|
||||||
- 2.03: deleted runtime MMX-enabling/disabling and obsolete -mmx* options
|
- 2.03: deleted runtime MMX-enabling/disabling and obsolete -mmx* options
|
||||||
|
- 2.04: Added "void(foo);" statements to quiet pedantic compiler warnings
|
||||||
|
about unused variables (GR-P)
|
||||||
|
|
||||||
|
TO DO:
|
||||||
|
use nanosleep() instead of usleep(), which is obsolete/deprecated.
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 1998-2008 Greg Roelofs. All rights reserved.
|
Copyright (c) 1998-2008 Greg Roelofs. All rights reserved.
|
||||||
@ -95,10 +99,13 @@
|
|||||||
|
|
||||||
#define PROGNAME "rpng2-x"
|
#define PROGNAME "rpng2-x"
|
||||||
#define LONGNAME "Progressive PNG Viewer for X"
|
#define LONGNAME "Progressive PNG Viewer for X"
|
||||||
#define VERSION "2.03 of 25 February 2010"
|
#define VERSION "2.04 of 15 June 2014"
|
||||||
#define RESNAME "rpng2" /* our X resource application name */
|
#define RESNAME "rpng2" /* our X resource application name */
|
||||||
#define RESCLASS "Rpng" /* our X resource class name */
|
#define RESCLASS "Rpng" /* our X resource class name */
|
||||||
|
|
||||||
|
/* This is temporary until the code is rewritten to use nanosleep(). */
|
||||||
|
#define usleep(x) sleep(((x)+499999)/1000000)
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -456,40 +463,47 @@ int main(int argc, char **argv)
|
|||||||
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
|
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
|
||||||
readpng2_version_info();
|
readpng2_version_info();
|
||||||
fprintf(stderr, "\n"
|
fprintf(stderr, "\n"
|
||||||
"Usage: %s [-display xdpy] [-gamma exp] [-bgcolor bg | -bgpat pat]\n"
|
"Usage: ");
|
||||||
|
fprintf(stderr,
|
||||||
|
"%s [-display xdpy] [-gamma exp] [-bgcolor bg | -bgpat pat]\n"
|
||||||
|
" %*s [-usleep dur | -timing] [-pause]\n",
|
||||||
|
PROGNAME, (int)strlen(PROGNAME), " ");
|
||||||
|
fprintf(stderr,
|
||||||
#ifdef FEATURE_LOOP
|
#ifdef FEATURE_LOOP
|
||||||
" %*s [-usleep dur | -timing] [-pause] [-loop [sec]] file.png\n\n"
|
" [-loop [sec]]"
|
||||||
#else
|
|
||||||
" %*s [-usleep dur | -timing] [-pause] file.png\n\n"
|
|
||||||
#endif
|
#endif
|
||||||
|
" file.png\n\n");
|
||||||
|
fprintf(stderr,
|
||||||
" xdpy\tname of the target X display (e.g., ``hostname:0'')\n"
|
" xdpy\tname of the target X display (e.g., ``hostname:0'')\n"
|
||||||
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
" exp \ttransfer-function exponent (``gamma'') of the display\n"
|
||||||
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
|
"\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
|
||||||
"\t\t to the product of the lookup-table exponent (varies)\n"
|
"\t\t to the product of the lookup-table exponent (varies)\n",
|
||||||
|
default_display_exponent);
|
||||||
|
fprintf(stderr,
|
||||||
"\t\t and the CRT exponent (usually 2.2); must be positive\n"
|
"\t\t and the CRT exponent (usually 2.2); must be positive\n"
|
||||||
" bg \tdesired background color in 7-character hex RGB format\n"
|
" bg \tdesired background color in 7-character hex RGB format\n"
|
||||||
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
|
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
|
||||||
"\t\t used with transparent images; overrides -bgpat\n"
|
"\t\t used with transparent images; overrides -bgpat\n"
|
||||||
" pat \tdesired background pattern number (0-%d); used with\n"
|
" pat \tdesired background pattern number (0-%d); used with\n"
|
||||||
"\t\t transparent images; overrides -bgcolor\n"
|
"\t\t transparent images; overrides -bgcolor\n",
|
||||||
|
num_bgpat-1);
|
||||||
#ifdef FEATURE_LOOP
|
#ifdef FEATURE_LOOP
|
||||||
|
fprintf(stderr,
|
||||||
" -loop\tloops through background images after initial display\n"
|
" -loop\tloops through background images after initial display\n"
|
||||||
"\t\t is complete (depends on -bgpat)\n"
|
"\t\t is complete (depends on -bgpat)\n"
|
||||||
" sec \tseconds to display each background image (default = 2)\n"
|
" sec \tseconds to display each background image (default = 2)\n");
|
||||||
#endif
|
#endif
|
||||||
|
fprintf(stderr,
|
||||||
" dur \tduration in microseconds to wait after displaying each\n"
|
" dur \tduration in microseconds to wait after displaying each\n"
|
||||||
"\t\t row (for demo purposes)\n"
|
"\t\t row (for demo purposes)\n"
|
||||||
" -timing\tenables delay for every block read, to simulate modem\n"
|
" -timing\tenables delay for every block read, to simulate modem\n"
|
||||||
"\t\t download of image (~36 Kbps)\n"
|
"\t\t download of image (~36 Kbps)\n"
|
||||||
" -pause\tpauses after displaying each pass until mouse clicked\n"
|
" -pause\tpauses after displaying each pass until mouse clicked\n"
|
||||||
"\nPress Q, Esc or mouse button 1 (within image window, after image\n"
|
"\nPress Q, Esc or mouse button 1 (within image window, after image\n"
|
||||||
"is displayed) to quit.\n"
|
"is displayed) to quit.\n");
|
||||||
"\n", PROGNAME,
|
|
||||||
(int)strlen(PROGNAME), " ", default_display_exponent, num_bgpat-1);
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!(infile = fopen(filename, "rb"))) {
|
if (!(infile = fopen(filename, "rb"))) {
|
||||||
fprintf(stderr, PROGNAME ": can't open PNG file [%s]\n", filename);
|
fprintf(stderr, PROGNAME ": can't open PNG file [%s]\n", filename);
|
||||||
++error;
|
++error;
|
||||||
@ -735,6 +749,7 @@ int main(int argc, char **argv)
|
|||||||
Trace((stderr, "about to call rpng2_x_cleanup()\n"))
|
Trace((stderr, "about to call rpng2_x_cleanup()\n"))
|
||||||
rpng2_x_cleanup();
|
rpng2_x_cleanup();
|
||||||
|
|
||||||
|
(void)argc; /* Unused */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1826,6 +1841,9 @@ static void rpng2_x_redisplay_image(ulg startcol, ulg startrow,
|
|||||||
XFlush(display);
|
XFlush(display);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(void)startcol;
|
||||||
|
(void)width;
|
||||||
|
|
||||||
} /* end function rpng2_x_redisplay_image() */
|
} /* end function rpng2_x_redisplay_image() */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user