John R. Sheets | 1e8e5ba | 2000-08-08 01:24:00 +0000 | [diff] [blame] | 1 | <chapter id="tools"> |
| 2 | <title>Tools</title> |
| 3 | |
| 4 | <sect1 id="bin2res"> |
| 5 | <title>bin2res</title> |
| 6 | |
| 7 | <para> |
| 8 | written by juergen.schmied@debitel.net (11/99) |
| 9 | </para> |
| 10 | <para> |
| 11 | (Extracted from <filename>wine/documentation/resources</filename>) |
| 12 | </para> |
| 13 | |
| 14 | <para> |
| 15 | This document desribes tools for handling resources within wine |
| 16 | </para> |
| 17 | |
| 18 | <sect2> |
| 19 | <title>bin2res</title> |
| 20 | |
| 21 | <para> |
| 22 | This tool allows the editing of embedded binary resources |
| 23 | within <filename>*.rc</filename> files. These resources are |
| 24 | stored as hex dump so they can be stored within the cvs |
| 25 | tree. This makes the editing of the embedded bitmaps and |
| 26 | icons harder. |
| 27 | </para> |
| 28 | </sect2> |
| 29 | |
| 30 | <sect2> |
| 31 | <title>Create binary files from an <filename>.rc</filename> file</title> |
| 32 | |
| 33 | <para> |
| 34 | The resources in the <filename>.rc</filename> file have to |
| 35 | be marked by a header: |
| 36 | </para> |
| 37 | <programlisting> |
| 38 | /* BINRES idb_std_small.bmp */ |
| 39 | IDB_STD_SMALL BITMAP LOADONCALL DISCARDABLE |
| 40 | { |
| 41 | '42 4D 20 07 00 00 00 00 00 00 76 00 00 00 28 00' |
| 42 | </programlisting> |
| 43 | <para> |
| 44 | <constant>BINRES</constant> is the keyword followed by a |
| 45 | filename. <command>bin2res -d bin rsrc.rc</command> |
| 46 | generates binary files from all marked resources. If the |
| 47 | binary file is newer it gets not overwritten. To force |
| 48 | overwriting use the <parameter>-f</parameter> switch. |
| 49 | </para> |
| 50 | </sect2> |
| 51 | |
| 52 | <sect2> |
| 53 | <title>Create a <filename>.rc</filename> file from binaries</title> |
| 54 | |
| 55 | <para> |
| 56 | Put a header followed by empty brackets in the |
| 57 | <filename>.rc</filename> file. |
| 58 | </para> |
| 59 | <programlisting> |
| 60 | /* BINRES idb_std_small.bmp */ |
| 61 | {} |
| 62 | </programlisting> |
| 63 | <para> |
| 64 | Then run <command>bin2res rsrc.rc</command>. It will merge |
| 65 | the resources into the <filename>.rc</filename> file if the |
| 66 | binary resources are newer than the.rc file. To force the |
| 67 | resources into the <filename>.rc</filename> file use the |
| 68 | <parameter>-f</parameter> switch. If there is already a |
| 69 | resource with the same filename in the |
| 70 | <filename>.rc</filename> file it gets overwritten. |
| 71 | </para> |
| 72 | </sect2> |
| 73 | |
| 74 | <sect2> |
| 75 | <title>output of <command>bin2res</command></title> |
| 76 | |
| 77 | <programlisting> |
| 78 | bash-2.03# ../../tools/bin2res -d bin shres.rc |
| 79 | [000.ico:c][003.ico:c][008.ico:s][015.ico:s][034.ico:s] |
| 80 | </programlisting> |
| 81 | <para> |
| 82 | <literal>s</literal> means skipped, <literal>c</literal> |
| 83 | means changed. |
| 84 | </para> |
| 85 | </sect2> |
| 86 | </sect1> |
| 87 | </chapter> |
| 88 | |
| 89 | <!-- Keep this comment at the end of the file |
| 90 | Local variables: |
| 91 | mode: sgml |
| 92 | sgml-parent-document:("wine-doc.sgml" "book" "part" "chapter" "") |
| 93 | End: |
| 94 | --> |