10139N/A<!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [
10139N/A<!--ArborText, Inc., 1988-1999, v.4002-->
10139N/A<!ENTITY cmd "gdk-pixbuf-csource">
10139N/A<!ENTITY % commonents SYSTEM "smancommon.ent">
10139N/A%commonents;
10139N/A<!ENTITY % booktitles SYSTEM "booktitles.ent">
10139N/A%booktitles;
10139N/A<!ENTITY suncopy "Copyright (c) 2003,2006 Sun Microsystems, Inc. All Rights Reserved.">
10139N/A]>
10139N/A<?Pub UDT _bookmark _target>
10139N/A<?Pub Inc>
10139N/A<refentry id="gdk-pixbuf-csource-1">
10139N/A<!-- %Z%%M% %I% %E% SMI; -->
17616N/A<refmeta>
17616N/A<refentrytitle>gdk-pixbuf-csource</refentrytitle><manvolnum>1</manvolnum>
10139N/A<refmiscinfo class="date">02 April 2003</refmiscinfo>
10139N/A<refmiscinfo class="sectdesc">&man1;</refmiscinfo>
10139N/A<refmiscinfo class="software">&release;</refmiscinfo>
10139N/A<refmiscinfo class="arch">generic</refmiscinfo>
10139N/A<refmiscinfo class="copyright">&suncopy;</refmiscinfo>
10139N/A</refmeta>
17616N/A
17616N/A<indexterm><primary>&cmd;</primary></indexterm>
17616N/A<indexterm><primary>C code generator for GdkPixbuf images</primary></indexterm>
17616N/A<refnamediv id="gdk-pixbuf-csource-1-name">
17616N/A<refname>gdk-pixbuf-csource</refname>
17616N/A<refpurpose>C code generator for GdkPixbuf images.</refpurpose></refnamediv>
10139N/A<refsynopsisdiv id="gdk-pixbuf-csource-1-synp"><title>&synp-tt;</title>
10139N/A<cmdsynopsis><command>&cmd;</command>
10139N/A<arg choice="opt"><option>-decoder</option></arg>
10139N/A<arg choice="opt"><option>-extern</option></arg>
10139N/A<arg choice="opt"><option>-help</option></arg>
10139N/A<arg choice="opt"><option>-g-fatal-warnings</option></arg>
10139N/A<arg choice="opt"><option>-macros</option></arg>
10139N/A<arg choice="opt"><option>-name=<replaceable>identifier</replaceable></option></arg>
10139N/A<arg choice="opt"><option>-raw</option></arg>
10139N/A<arg choice="opt"><option>-rle</option></arg>
10139N/A<arg choice="opt"><option>-static</option></arg>
10139N/A<arg choice="opt"><option>-stream</option></arg>
10139N/A<arg choice="opt"><option>-struct</option></arg>
10139N/A<arg choice="opt"><option>-version</option></arg>
10139N/A<arg choice="req"><replaceable>image</replaceable></arg>
10139N/A</cmdsynopsis>
10139N/A<cmdsynopsis><command>&cmd;</command>
10139N/A<arg choice="opt"><option>-decoder</option></arg>
10139N/A<arg choice="opt"><option>-extern</option></arg>
10139N/A<arg choice="opt"><option>-help</option></arg>
10139N/A<arg choice="opt"><option>-g-fatal-warnings</option></arg>
10139N/A<arg choice="opt"><option>-macros</option></arg>
10139N/A<arg choice="opt"><option>-raw</option></arg>
10139N/A<arg choice="opt"><option>-rle</option></arg>
10139N/A<arg choice="opt"><option>-static</option></arg>
10139N/A<arg choice="opt"><option>-stream</option></arg>
10139N/A<arg choice="opt"><option>-struct</option></arg>
10139N/A<arg choice="opt"><option>-version</option></arg>
10139N/A<arg choice="opt"><option>-build-list</option></arg>
17616N/A<arg choice="req">[<replaceable>name image</replaceable>]...</arg>
10139N/A</cmdsynopsis></refsynopsisdiv>
17593N/A
10139N/A<refsect1 id="gdk-pixbuf-csource-1-desc"><title>&desc-tt;</title>
17616N/A<para>
17616N/AThe <command>gdk-pixbuf-csource</command> utility generates C code containing
17616N/Aimages. You can use <command>gdk-pixbuf-csource</command> to compile images
17616N/Adirectly into programs.
17616N/A</para>
17616N/A<para>
17616N/AYou can use the following types of input with
17616N/A<command>gdk-pixbuf-csource</commadn>:
17616N/A</para>
17616N/A
10139N/A<itemizedlist>
15995N/A<listitem>A single file, to generate code for the file.</listitem>
17616N/A<listitem>A list of
17616N/A[<replaceable>name</replaceable> <replaceable>image</replaceable>] pairs, using
17616N/Athe <option>-build-list</option>
15995N/Aoption, to generate code for a list of images into named variables.
10139N/A</listitem>
10139N/A</itemizedlist>
10139N/A</refsect1>
17593N/A
10139N/A<refsect1 id="gdk-pixbuf-csource-1-opts"><title>&opts-tt;</title>
17616N/A<para>
17616N/AThe following options are supported:
17616N/A</para>
17616N/A
10139N/A<variablelist termlength="medium">
17616N/A<varlistentry>
17616N/A<term><option>-build-list</option></term>
17616N/A<listitem><para>
17616N/AEnable [<replaceable>name</replaceable> <replaceable>image</replaceable>]
17616N/Apair parsing mode.
17616N/A</para>
10139N/A</listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-decoder</option></term>
17616N/A<listitem><para>
17616N/AProvide the following macro definition to decode run-length encoded image data:
17616N/A</para>
10139N/A<itemizedlist mark="none">
17616N/A<listitem>*_RUN_LENGTH_DECODE image_buf, rle_data, size, bpp</listitem>
10139N/A</itemizedlist>
10139N/A</listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-extern</option></term>
17616N/A<listitem><para>
17616N/AGenerate extern symbols. This option is only useful with
17616N/A<option>-stream</option> or <option>-struct</option>. The
17616N/A<option>--extern</option> option causes the structure created to be defined as: <literal>
10139N/Aconst [...]</literal></para>
10139N/A</listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>h</option>, <option>--help</option></term>
17616N/A<listitem><para>
17616N/APrint brief help and exit.
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-g-fatal-warnings</option></term>
17616N/A<listitem><para>
17616N/AMake warnings fatal. This option causes the program to abort when warnings
17616N/Aoccur.
17616N/A</para>
10139N/A</listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-macros</option></term>
17616N/A<listitem><para>
17616N/AGenerate the following macro definitions for the image:
15995N/A</para>
15995N/A<itemizedlist>
15995N/A<listitem>*_ROWSTRIDE
10139N/A</listitem>
15995N/A<listitem>*_WIDTH
10139N/A</listitem>
15995N/A<listitem>*_HEIGHT
10139N/A</listitem>
15995N/A<listitem>*_BYTES_PER_PIXEL
10139N/A</listitem>
15995N/A<listitem>*_RLE_PIXEL_DATA or *_PIXEL_DATA
10139N/A</listitem>
15995N/A</itemizedlist>
10139N/A</listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-name=<replaceable>identifier</replaceable></option></term>
17616N/A<listitem><para>
17616N/ASpecify the identifier name, or prefix, for the generated variables or macros.
17616N/AThis option is useful only if you do not specify <option>-build-list</option>.
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-raw</option></term>
17616N/A<listitem><para>
17616N/ADisable run-length encoding for the generated pixel data. The
17616N/A<option>-raw</option> option dumps out each &ldquo;(line of data)&rdquo; in raw
17616N/Aimage format
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-rle</option></term>
17616N/A<listitem><para>
17616N/AEnable run-length encoding for the generated pixel data. The
10139N/A<option>-rle</option> option dumps out each line of data in run-length-encoding
17616N/Aformat. This is a default setting.
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-static</option></term>
17616N/A<listitem><para>
17616N/AGenerate static symbols. This is a default setting. This option is only useful
17616N/Awith <option>-stream</option> or <option>-struct</option>. The
17616N/A<option>-static</option> option causes the structure created to be defined as:
17616N/A<literal>static const [...]</literal>
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-stream</option></term>
17616N/A<listitem><para>
17616N/AGenerate a pixbuf data stream; a single string containing a serialized
17616N/AGdkPixdata structure in network byte order.
17616N/A</para>
10139N/A</listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>-struct</option></term>
17616N/A<listitem>
17616N/A<para>
17616N/AGenerate GdkPixdata structure; needs the GdkPixdata structure definition from
17616N/Agdk-pixdata.h.
17616N/A</para></listitem></varlistentry>
17616N/A<varlistentry>
17616N/A<term><option>v</option>, <option>-version</option></term>
17616N/A<listitem><para>
17616N/APrint version and exit.
17616N/A</para>
10139N/A</listitem></varlistentry>
10139N/A</variablelist></refsect1>
17593N/A
10139N/A<refsect1 id="gdk-pixbuf-csource-1-exam"><title>&exam-tt;</title>
10139N/A<example role="example">
10139N/A<title>To Generate Code From a File</title>
17616N/A<para><screen>
17616N/Aexample% <userinput>&cmd; <replaceable>input_filename</replaceable></userinput>
17616N/A</screen></para>
17616N/A<para>
17616N/ARunning <command>&cmd;</command> without any options is the same as specifying
17616N/Athe following options:
17616N/A</para>
10139N/A<itemizedlist>
15995N/A<listitem><option>-stream</option></listitem>
15995N/A<listitem><option>-rle</option></listitem>
15995N/A<listitem><option>-static</option></listitem>
10139N/A</itemizedlist>
10139N/A</example>
17616N/A
10139N/A<example role="example">
10139N/A<title>To Specify a Value for the Structure in the Generated Output</title>
17616N/A<para><screen>
17616N/Aexample% <userinput>&cmd; --name=my_struct --struct <replaceable>input_filename</replaceable></userinput>
17616N/A</screen></para>
17616N/A<para>
17616N/AThe <option>-name</option> option affects the name of the structure in the
17616N/Agenerated output when you use either the <option>-stream</option> option or the
17616N/A<option>-struct</option> option. The <option>-name</option> option affects the
17616N/Aname of the macro when you use the <option>-macros</option> option.
17616N/A</para>
17616N/A<para>
17616N/AIf you use either the <option>-stream</option> option or the
17616N/A<option>-struct</option> option, but you do not specify the
17616N/A<option>-name</option> option, then the default name of the structure in the
17616N/Agenerated output is <literal>my_pixbuf</literal>.
17616N/A</para>
17616N/A<para>
17616N/AIf you use the <option>-macros</option> option, but you do not specify the
17616N/A<option>-name</option> option, then the default macro names are prefixed with
17616N/A<literal>MY_PIXBUF_</literal>.
17616N/A</para></example>
17616N/A
10139N/A<example role="example">
10139N/A<title>To Display the Command Output as an Array of Strings</title>
17616N/A<para><screen>
17616N/Aexample% <userinput>&cmd; --name=my_struct --stream <replaceable>input_filename</replaceable></userinput>
17616N/A</screen>
17616N/A<screen>
17616N/Astatic const guint8 my_struct[] =
10139N/A{ ""
10139N/A /* Pixbuf magic (0x47646b50) */
10139N/A "GdkP"
10139N/A /* length: header (24) + pixel_data (215281) */
10139N/A "\0\3I\11"
10139N/A /* pixdata_type (0x2010001) */
10139N/A "\2\1\0\1"
10139N/A /* rowstride (960) */
10139N/A "\0\0\3\300"
10139N/A /* width (320) */
10139N/A "\0\0\1@"
10139N/A /* height (240) */
10139N/A "\0\0\0\360"
10139N/A /* pixel_data: */
10139N/A "(line of data)"
10139N/A[...]</screen></para>
10139N/A</example>
17616N/A
10139N/A<example role="example">
10139N/A<title>To Display the Output as a GdkPixdata Structure</title>
17616N/A<para><screen>
17616N/Aexample% <userinput>&cmd; --name=my_struct --struct <replaceable>input_filename</replaceable></userinput>
17616N/A</screen>
17616N/A<screen>
17616N/Aconst GdkPixdata my_struct = {
10139N/A 0x47646b50, /* Pixbuf magic: 'GdkP' */
10139N/A 24 + 215281, /* header length + pixel_data length */
10139N/A 0x2010001, /* pixdata_type */
10139N/A 960, /* rowstride */
10139N/A 320, /* width */
10139N/A 240, /* height */
10139N/A /* pixel_data: */
10139N/A "(line of data)"
17616N/A[...]
17616N/A</screen></para>
10139N/A</example>
17616N/A
10139N/A<example role="example">
10139N/A<title>To Display the Output as C Macros</title>
17616N/A<para><screen>
17616N/Aexample% <userinput>&cmd; --name=my_struct --macros <replaceable>input_filename</replaceable></userinput>
17616N/A</screen>
17616N/A
17616N/A<screen>
17616N/A#define MY_STRUCT_ROWSTRIDE (960)
10139N/A#define MY_STRUCT_WIDTH (320)
10139N/A#define MY_STRUCT_HEIGHT (240)
10139N/A#define MY_STRUCT_BYTES_PER_PIXEL (3) /* 3:RGB, 4:RGBA */
10139N/A#define MY_STRUCT_RLE_PIXEL_DATA ((guint8*) \
10139N/A "(line of data)" \
17616N/A[...]
17616N/A</screen></para>
10139N/A</example>
10139N/A</refsect1>
17593N/A
10139N/A<refsect1 id="gdk-pixbuf-csource-1-exit"><title>&exit-tt;</title>
17593N/A<para>
17593N/AThe following exit values are returned:
17593N/A</para>
10139N/A<variablelist termlength="xtranarrow">
17593N/A<varlistentry><term><returnvalue>0</returnvalue></term>
17593N/A<listitem><para>
17593N/AApplication exited successfully.
17593N/A</para>
10139N/A</listitem></varlistentry>
17593N/A<varlistentry>
17593N/A<term><returnvalue>1</returnvalue></term>
17593N/A<listitem><para>
17593N/AApplication exited with failure, if any file specified on the command line
17593N/Acannot be read.
10139N/A</para>
10139N/A</listitem></varlistentry>
10139N/A</variablelist></refsect1>
17593N/A
10139N/A<refsect1 id="gdk-pixbuf-csource-1-file"><title>&file-tt;</title>
17593N/A<para>
17593N/AThe following files are used by this application:
17593N/A</para>
17593N/A<variablelist termlength="wholeline">
17593N/A<varlistentry>
17593N/A<term><filename>/usr/bin/&cmd;</filename></term>
17593N/A<listitem><para>
17593N/AThe command-line executable for the application.
17593N/A</para></listitem>
10139N/A</varlistentry>
17593N/A<varlistentry>
17593N/A<term><filename>/usr/share/gtk-doc/html/gdk-pixbuf</filename></term>
17593N/A<listitem><para>
17593N/ALocation of developer documentation
17593N/A</para></listitem>
10139N/A</varlistentry>
10139N/A</variablelist>
10139N/A</refsect1>
17593N/A
10139N/A<refsect1 id="gdk-pixbuf-csource-1-attr"><title>&attr-tt;</title>
17616N/A<para>
17616N/ASee
17616N/A<olink targetdocent="REFMAN5" localinfo="attributes-5">
17616N/A<citerefentry><refentrytitle>attributes</refentrytitle>
17616N/A<manvolnum>5</manvolnum></citerefentry></olink>
17616N/Afor descriptions of the following attributes:
17616N/A</para>
17616N/A
10139N/A<informaltable frame="all">
17616N/A<tgroup cols="2" colsep="1" rowsep="1">
17616N/A<colspec colname="COLSPEC0" colwidth="1*">
10139N/A<colspec colname="COLSPEC1" colwidth="1*">
10139N/A<thead>
17616N/A<row>
17616N/A<entry align="center" valign="middle">ATTRIBUTE TYPE</entry>
17616N/A<entry align="center" valign="middle">ATTRIBUTE VALUE</entry>
17616N/A</row>
10139N/A</thead>
10139N/A<tbody>
17616N/A<row>
17616N/A<entry><para>Availability</para></entry>
20793N/A<entry><para>library/desktop/gdk-pixbuf</para></entry>
17616N/A</row>
17616N/A<row>
17616N/A<entry colname="COLSPEC0"><para>Interface stability</para></entry>
17616N/A<entry colname="COLSPEC1"><para>Committed</para></entry>
17616N/A</row>
17616N/A</tbody></tgroup></informaltable>
10139N/A</refsect1>
17593N/A
10139N/A<refsect1 id="gdk-pixbuf-csource-1-also"><title>&also-tt;</title>
10139N/A<!--Reference to another man page-->
10139N/A<!--Reference to a Help manual-->
10139N/A<!--Reference to a book.-->
10139N/A<para>
10139N/A<citerefentry><refentrytitle>gdk-pixbuf-query-loaders</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
10139N/A<citerefentry><refentrytitle>glib-genmarshal</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
10139N/A<citerefentry><refentrytitle>glib-gettextize</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
10139N/A<citerefentry><refentrytitle>glib-mkenums</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
10139N/A<citerefentry><refentrytitle>gobject-query</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
10139N/A<citerefentry><refentrytitle>gtk-query-immodules-2.0</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
10139N/A<citerefentry><refentrytitle>gtk-update-icon-cache</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
11904N/A<citerefentry><refentrytitle>libgdk_pixbuf-2.0</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
11904N/A<citerefentry><refentrytitle>attributes</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
11904N/A<citerefentry><refentrytitle>gnome-interfaces</refentrytitle><manvolnum>5</manvolnum></citerefentry>
11904N/A<para>
10139N/A</refsect1>
17593N/A
10139N/A<refsect1 id="gdk-pixbuf-csource-1-note"><title>&note-tt;</title>
17593N/A<para>
17593N/AUpdated by Brian Cameron, Sun Microsystems Inc., April 2003, 2006.
17593N/A</para>
17593N/A<para>
17593N/AWritten by Tim Janik timj@gtk.org
17593N/A</para>
10139N/A</refsect1>
10139N/A</refentry>