<chapter id="technical-reference">
<chapterinfo>

<authorgroup>
<author
><firstname
>Éric</firstname
> <surname
>Bischoff</surname
> </author>
<othercredit role="translator"
> <firstname
>Rafael</firstname
> <surname
>Osuna</surname
> <affiliation
><address
><email
>rosuna@wol.es</email
></address
></affiliation
> <contrib
>Traductor</contrib
> </othercredit
> <othercredit role="translator"
> <firstname
>Miguel</firstname
> <surname
>Revilla Rodríguez</surname
> <affiliation
><address
><email
>yo@miguelrevilla.com</email
></address
></affiliation
> <contrib
>Traductor</contrib
> </othercredit
> <othercredit role="translator"
> <firstname
>Kira</firstname
> <surname
>J. Fernández</surname
> <affiliation
><address
><email
>kirajfdez@gmail.com</email
></address
></affiliation
> <contrib
>Traductora</contrib
> </othercredit
> 
</authorgroup>

<date
>2016-05-11</date>
<releaseinfo
>1.0.0 (Applications 16.04)</releaseinfo>

<keywordset>
<keyword
>KDE</keyword>
<keyword
>KTuberling</keyword>
<keyword
>referencia técnica</keyword>
</keywordset>
</chapterinfo>

<title
>Referencia técnica</title>

<para
>&ktuberling; ofrece una interesante y satisfactoria introducción a la personalización y programación de &kde;. Es posible extender la aplicación. Por ejemplo, sin necesidad de programar, se pueden añadir más zonas de juego cambiando los archivos de gráficos. ¡Añadiendo los archivos de sonido adecuados, los traductores pueden poner el audio en su propio idioma! </para>

<para
>Si extiende o añade algo al juego, piense en enviar sus mejoras al desarrollador <ulink url="mailto:alex@eyeos.org"
>Alex Fiestas</ulink
>para incluirlas en futuras versiones. </para>

<sect1 id="for-artists">
<title
>Para los artistas</title>

<para
>Para crear una zona de juego nueva en &ktuberling; debe hacer lo siguiente: </para>

<itemizedlist>

<listitem>
    <para
>Draw the playground in a SVG file, there you have to: <itemizedlist>
            <listitem
><para
>Name the place where items can dragged "background".</para
></listitem>
            <listitem
><para
>Dar nombre a cada uno de los elementos que se pueden dibujar con un nombre único.</para
></listitem>
        </itemizedlist>
    </para>
</listitem>

<listitem>
    <para
>Create a .theme file, it has to follow this schema:</para>
    <programlisting
>&lt;playground gameboard="<replaceable
>yourSVGFile</replaceable
>" name="<replaceable
>theDesktopFile</replaceable
>"&gt;
    &lt;object name="<replaceable
>itemName</replaceable
>" sound="<replaceable
>soundName</replaceable
>" scale="<replaceable
>someValue</replaceable
>" /&gt;
    ...
    ...
    ...
    &lt;/playground&gt;
    </programlisting>
    <itemizedlist>
        <listitem
><para
><replaceable
>yourSVGFile</replaceable
> is the name of the svg file that has the drawing.</para
></listitem>
        <listitem
><para
><replaceable
>elArchivoEscritorio</replaceable
> es el nombre del archivo de escritorio que contiene el nombre del tema.</para
></listitem>
        <listitem
><para
>For each object you need a &lt;object&gt; entry. <replaceable
>itemName</replaceable
> is the unique name you used on the SVG file, <replaceable
>soundName</replaceable
> is the sound name that will be played when dragging it, see sound themes howto for more information.</para
></listitem>
        <listitem
><para
>scale is optional and <replaceable
>someValue</replaceable
> is the scale factor that will be used when drawing this object outside the warehouse, if not specified is 1.</para
></listitem>
    </itemizedlist>
</listitem>

<listitem>
    <para
>Create a .desktop file, it has to follow this schema</para>
    <programlisting
>[KTuberlingTheme]
    Name=<replaceable
>themeName</replaceable
>
    </programlisting>
    <itemizedlist>
        <listitem
><para
><replaceable
>nombreTema</replaceable
> es el nombre que identifica el tema. Se mostrará en el menú Zona de juego.</para
></listitem>
    </itemizedlist>
</listitem>

<listitem>
    <para
>If you are adding the theme to &ktuberling; repository, add .svg, .theme, and .desktop files to FILES section of the CMakeLists.txt in the pics/ directory </para>
</listitem>

<listitem>
    <para
>If you want to install it for yourself, place .svg, .theme, and .desktop files in <filename class="directory"
>ktuberling/pics</filename
> in <userinput
><command
>qtpaths</command
> <option
>--paths GenericDataLocation</option
></userinput
> </para>
</listitem>

</itemizedlist>

</sect1>

<sect1 id="for-translators">
<title
>Para los traductores</title>

<para
>Además del mecanismo habitual de archivos <literal role="extension"
>.po</literal
> para la traducción de los mensajes escritos del programa, también es posible traducir los sonidos. </para>

<para
>Para crear un nuevo tema de sonido para &ktuberling; debe hacer lo siguiente: </para>

<itemizedlist>

<listitem
><para
>Grabar los sonidos en un archivo de formato OGG Vorbis rc3.</para
></listitem>

<listitem>
<para
>Create a <replaceable
>yourLanguageTwoLetterCode</replaceable
>.soundtheme file, it has to follow this schema:</para>
<programlisting
>&lt;language code="<replaceable
>suCódigoDeIdiomaDeDosLetras</replaceable
>"&gt;
&lt;sound name="<replaceable
>nombreSonido</replaceable
>" file="<replaceable
>rutaRelativa</replaceable
>" /&gt;
...
...
...
&lt;/language&gt;
</programlisting>
<itemizedlist>
<listitem
><para
><replaceable
>suCódigoDeIdiomaDeDosLetras</replaceable
> es el código de dos letras de su idioma, por ejemplo, gl para Gallego.</para
></listitem>
<listitem
><para
>For each sound a &lt;sound&gt; entry. <replaceable
>soundName</replaceable
> should match with the soundName specified in the playground theme (see themes HOWTO). <replaceable
>relativePath</replaceable
> should be the relative path you are going to install the file with this sound to, typically it will be someUniquePath/soundName.format (someUniquePath can be your language two letter code for example).</para
></listitem>
</itemizedlist>
</listitem>

<listitem
><para
>Si está añadiendo el tema de sonido a &ktuberling;: en la carpeta de su idioma:</para>
<itemizedlist>
<listitem
><para
>Add the sound files and the .soundtheme files to the data/kdegames/ktuberling directory of your language translations.</para
></listitem>
<listitem
><para
>On that very same dir you need a CMakeLists.txt describing how to install the files, typically it will be.</para>
<!--FIXME l10n-kf5/*/data/kdegames/ktuberling/CMakeLists.txt has DATA_INSTALL_DIR, has this to be changed?-->
<programlisting
>FILE( GLOB oggfiles *.ogg )
INSTALL( FILES ${oggfiles} DESTINATION ${KDE_INSTALL_DATADIR}/ktuberling/sounds/<replaceable
>códigoDeDosLetrasDeSuIdioma</replaceable
> )
INSTALL( FILES <replaceable
>códigoDeDosLetrasDeSuIdioma</replaceable
>.soundtheme DESTINATION ${KDE_INSTALL_DATADIR}/ktuberling/sounds/ )
</programlisting>
</listitem>
</itemizedlist>
</listitem>

<listitem>
<para
>Si desea instalarlo por si mismo debe:</para>
<itemizedlist>
<listitem
><para
>Place <replaceable
>yourLanguageTwoLetterCode</replaceable
>.soundtheme file in <filename class="directory"
>ktuberling/sounds</filename
> in <userinput
><command
>qtpaths</command
> <option
>--paths GenericDataLocation </option
></userinput
></para
></listitem>
<listitem
><para
>Place your sound files in <filename class="directory"
>ktuberling/sounds/someUniquePath</filename
> in<userinput
><command
>qtpaths</command
> <option
>--paths GenericDataLocation </option
></userinput
></para
></listitem>
</itemizedlist>
</listitem>

</itemizedlist>

<para
>Information on how to work with the translation mechanisms in &kde; is available in <ulink url="http://l10n.kde.org/docs/translation-howto/index.html"
>The &kde; Translation HOWTO</ulink
>. </para>

</sect1>

<sect1 id="for-programmers">

<title
>Para programadores</title>
<para
>&ktuberling; resulta sencillo de extender por programadores.</para>

<sect2 id="classes">
<title
>Clases C++</title>

<variablelist>
<varlistentry>
<term
><classname
>TopLevel</classname
></term>
<listitem>
<para
>Top-level window and basic program management</para>
</listitem>
</varlistentry>

<varlistentry>
<term
><classname
>PlayGround</classname
></term>
<listitem>
<para
>Description of one of the game levels</para
> </listitem>
</varlistentry>

<varlistentry>
<term
><classname
>ToDraw</classname
></term>
<listitem>
<para
>Description of one of the graphical <quote
>objects</quote
> to be drawn</para
> </listitem>
</varlistentry>

<varlistentry>
<term
><classname
>SoundFactory</classname
></term>
<listitem>
<para
>Description of one of the languages and its sounds</para
> </listitem>
</varlistentry>

<varlistentry>
<term
><classname
>Action</classname
></term>
<listitem>
<para
>One of the user's manipulation in the undo/redo stack</para
> </listitem>
</varlistentry>
</variablelist>

</sect2>

</sect1>
</chapter>
