1reswrap(1) FOX Programmers Manual reswrap(1)
2
3
4
6 reswrap - wrap icon resources into C code
7
9 reswrap [options] [-o[a] outfile] files...
10
12 Reswrap is a tool to turn images, text, and other resource files into
13 C++ data arrays. This allows various binary resources to be embedded
14 in the source code, and compiled into an application.
15
16 In development of graphical applications with FOX, it is used to embed
17 icons and images for the user interface into the executable and elimi‐
18 nate the need to distribute separate icon and image files.
19
20 Reswrap is typically invoked as a part of the build process to generate
21 C++ source files from a collection of icons and images and other binary
22 resources.
23
24 By default reswrap will interpret the files listed as a stream of raw
25 bytes and output them as an initialized data array to stdout.
26
28 -o[a] outfile
29 Write the result into the file outfile instead of writing to
30 stdout. With -o the outfile will be overwritten with the data
31 from the input. With the -oa option, the resulting code is
32 appended to the output file, allowing multiple input files to be
33 placed into one single source file.
34
35
36 -h Print a short usage message.
37
38
39 -v Just print out the version number and license information.
40
41
42 -d Write data as decimal numbers instead of using the default hexa‐
43 decimal numbers.
44
45
46 -m Read files with MS-DOS mode (default is binary). This replaces
47 "\r\n" with "\n" when reading the resource file.
48
49
50 -x Write data as hexadecimal numbers (default).
51
52
53 -t[a] Write data as a text string, with each byte represented as a
54 hexadecimal excape sequence, as in "\x33".
55
56 Note that the C++ compiler appends a nul-character at the end of
57 the text string, thus making the data array one character longer
58 than the file.
59
60 With the a option, printable ascii characters are passed
61 unescaped, while special characters like tabs and newlines are
62 given the usual escape codes.
63
64
65 -e Places the storage modifier extern in front of the data array,
66 ensuring that the data array can be linked with other compila‐
67 tion units. Normally, constant declarations are not visible in
68 other compilation units.
69
70
71 -i Instead of generating an array definition only write a declara‐
72 tion, which can be included as a header file.
73
74
75 -k This option causes reswrap to keep the file extension, replacing
76 the "." with an underscore "_". Usage of this option is recom‐
77 mended as it reduces errors when using the data arrays.
78
79
80 -s This option suppresses comments inserted by reswrap to indicate
81 the original file name from which the data statement was gener‐
82 ated.
83
84
85 -p prefix
86 Prepend the given prefix in front of the name of the resource;
87 this may be used to generate class names or namespace names in
88 front of symbols.
89
90
91 -n namespace
92 Generate all declarations inside the given C++ namespace decla‐
93 ration. Using a namespace may be used to ensure that declara‐
94 tions are only accessible within the given scope, and thus won't
95 clash with symbols.
96
97
98 -c cols
99 Writes cols columns instead of the default number of columns in
100 the data statements generated by reswrap. The default number of
101 columns for decimal and hex printout is 16 characters; the
102 default for text string printout is 80 characters.
103
104
105 -u Force output as unsigned chars in text mode.
106
107
108 -z Output the size of the resource in the declaration of a
109 resource-array. This allows the C++ sizeof() operator to return
110 the correct size of the resource even for external declarations.
111 Note that in text mode, (-t option), an extra byte is added to
112 the size for the end of string character.
113
114
115 -r name
116 Instead of using a resource name based on the filename, reswrap
117 substitutes name for the resource name used in the declaration
118 or definition for the following resource file. This is useful
119 if the filename can not be used as an identifier, for example if
120 the filename is a reserved word in C or C++, like "while".
121
122
124 When using the text string mode, please remember the C compiler appends
125 one nul-character after the string, making the data array one element
126 longer than the resource file.
127
129 This manpage was originally written by Torsten Landschoff
130 (torsten@debian.org) for the Debian distribution of the FOX Toolkit,
131 and is currently maintained by Jeroen van der Zijp (jeroen@fox-tool‐
132 kit.org).
133
135 Copyright © 1997,2005 Jeroen van der Zijp.
136 This is free software; see the source for copying conditions. There is
137 NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
138 PURPOSE.
139
141 The reswrap program is a part of the FOX GUI Toolkit. Further informa‐
142 tion about reswrap can be found at:
143
144 http://www.fox-toolkit.org
145
146 The FOX Toolkit website includes detailed information about reswrap and
147 its use.
148
149
150
151
152The FOX C++ GUI Toolkit Sept 2005 reswrap(1)