<sect2 id="s3dw_button_new"><title>s3dw_button_new</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>s3dw_button *<function>s3dw_button_new</function></funcdef><paramdef>const s3dw_surface *<parameter>surface</parameter></paramdef><paramdef>const char *<parameter>text</parameter></paramdef><paramdef>float <parameter>posx</parameter></paramdef><paramdef>float <parameter>posy</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Creates a new button on the surface, with &quot;text&quot; written on it and the upper left corner at (posx,posy) on the surface.</para><para>See <link linkend="s3dw_button">s3dw_button</link> for information about callbacks which may be defined.         </para></sect2>
<sect2 id="s3dw_label_new"><title>s3dw_label_new</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>s3dw_label *<function>s3dw_label_new</function></funcdef><paramdef>const s3dw_surface *<parameter>surface</parameter></paramdef><paramdef>const char *<parameter>text</parameter></paramdef><paramdef>float <parameter>posx</parameter></paramdef><paramdef>float <parameter>posy</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Creates a new label on the surface, with &quot;text&quot; written on it and the upper left corner at (posx,posy) on the surface.</para><para>See <link linkend="s3dw_label">s3dw_label</link> for information about callbacks which may be defined.         </para></sect2>
<sect2 id="s3dw_input_new"><title>s3dw_input_new</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>s3dw_input *<function>s3dw_input_new</function></funcdef><paramdef>const s3dw_surface *<parameter>surface</parameter></paramdef><paramdef>float <parameter>width</parameter></paramdef><paramdef>float <parameter>posx</parameter></paramdef><paramdef>float <parameter>posy</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Creates a new input-box on the surface with a input width of &quot;width&quot;, the upper left corner at (posx,posy) on the surface. The input-box is empty on creation and can be change with <link linkend="s3dw_input_change_text">s3dw_input_change_text</link>, and received with <link linkend="s3dw_input_gettext">s3dw_input_gettext</link></para><para>See <link linkend="s3dw_input">s3dw_input</link> for information about callbacks which may be defined.         </para></sect2>
<sect2 id="s3dw_textbox_new"><title>s3dw_textbox_new</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>s3dw_textbox *<function>s3dw_textbox_new</function></funcdef><paramdef>const s3dw_surface *<parameter>surface</parameter></paramdef><paramdef>const char *<parameter>text</parameter></paramdef><paramdef>float <parameter>posx</parameter></paramdef><paramdef>float <parameter>posy</parameter></paramdef><paramdef>float <parameter>width</parameter></paramdef><paramdef>float <parameter>height</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Creates a new textbox on the surface, with &quot;text&quot; written on it and the upper left corner at (posx,posy) on the surface. Width and height define the size of the textbox including scrollbars which are rendered around the textfield.</para><para>See <link linkend="s3dw_textbox">s3dw_textbox</link> for information about callbacks which may be defined.         </para></sect2>
<sect2 id="s3dw_input_gettext"><title>s3dw_input_gettext</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>char *<function>s3dw_input_gettext</function></funcdef><paramdef>s3dw_input *<parameter>input</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Returns the text which is currently entered in the referenced input-box.         </para></sect2>
<sect2 id="s3dw_input_change_text"><title>s3dw_input_change_text</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>void <function>s3dw_input_change_text</function></funcdef><paramdef>s3dw_input *<parameter>input</parameter></paramdef><paramdef>const char *<parameter>text</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Change the text in the referenced input-box to the specified text.         </para></sect2>
<sect2 id="s3dw_label_change_text"><title>s3dw_label_change_text</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>void <function>s3dw_label_change_text</function></funcdef><paramdef>s3dw_label *<parameter>label</parameter></paramdef><paramdef>const char *<parameter>text</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Change the text in the referenced label to the specified text.         </para></sect2>
<sect2 id="s3dw_surface_new"><title>s3dw_surface_new</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>s3dw_surface *<function>s3dw_surface_new</function></funcdef><paramdef>const char *<parameter>title</parameter></paramdef><paramdef>float <parameter>width</parameter></paramdef><paramdef>float <parameter>height</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Creates a new surface (a new window) with title &quot;title&quot; and dimension &quot;width&quot; x &quot;height&quot;.</para><para>See <link linkend="s3dw_surface">s3dw_surface</link> for information about callbacks which may be defined.         </para></sect2>
<sect2 id="s3dw_getroot"><title>s3dw_getroot</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>s3dw_widget *<function>s3dw_getroot</function></funcdef><void/></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Returns the root-widget, which holds all the surfaces. E.g. if you want to move all widgets at once, adjust the root-widgets x,y,z and use <link linkend="s3dw_moveit">s3dw_moveit</link>()</para><programlisting> <link linkend="s3dw_widget">s3dw_widget</link> *root = <link linkend="s3dw_getroot">s3dw_getroot</link>();
 // move widget center to (0,5,0). upon creation, it's centered at (0,0,0),
 // so this might move it up
 root-&gt;x=0;
 root-&gt;y=5;
 root-&gt;z=0;
 <link linkend="s3dw_moveit">s3dw_moveit</link>(root);
</programlisting></sect2>
<sect2 id="s3dw_moveit"><title>s3dw_moveit</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>void <function>s3dw_moveit</function></funcdef><paramdef>s3dw_widget *<parameter>widget</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Moves/translates the widget as you specified in it's private <link linkend="s3dw_widget">s3dw_widget</link> structure. Should be casted with S3DWIDGET().         </para></sect2>
<sect2 id="s3dw_delete"><title>s3dw_delete</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>void <function>s3dw_delete</function></funcdef><paramdef>s3dw_widget *<parameter>widget</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Deletes any widget. Should be casted with S3DWIDGET().         </para></sect2>
<sect2 id="s3dw_show"><title>s3dw_show</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>void <function>s3dw_show</function></funcdef><paramdef>s3dw_widget *<parameter>widget</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Switches a widget visible. Should be casted with S3DWIDGET().         </para></sect2>
<sect2 id="s3dw_focus"><title>s3dw_focus</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>void <function>s3dw_focus</function></funcdef><paramdef>s3dw_widget *<parameter>focus</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Gives focus to the widget, relative to its parent. That means you can focus a surface, and each surface can focus one of its element, e.g. an input field. Should be casted with S3DWIDGET().         </para></sect2>
<sect2 id="s3dw_textbox_scrollup"><title>s3dw_textbox_scrollup</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>void <function>s3dw_textbox_scrollup</function></funcdef><paramdef>s3dw_textbox *<parameter>textbox</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Scrolls the text in the textbox up by one line, if possible.         </para></sect2>
<sect2 id="s3dw_textbox_scrolldown"><title>s3dw_textbox_scrolldown</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>void <function>s3dw_textbox_scrolldown</function></funcdef><paramdef>s3dw_textbox *<parameter>textbox</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Scrolls the text in the textbox down by one line, if possible.         </para></sect2>
<sect2 id="s3dw_textbox_scrollleft"><title>s3dw_textbox_scrollleft</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>void <function>s3dw_textbox_scrollleft</function></funcdef><paramdef>s3dw_textbox *<parameter>textbox</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Scrolls the text in the textbox to the left by one character, if possible.         </para></sect2>
<sect2 id="s3dw_textbox_scrollright"><title>s3dw_textbox_scrollright</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>void <function>s3dw_textbox_scrollright</function></funcdef><paramdef>s3dw_textbox *<parameter>textbox</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Scrolls the text in the textbox to the right by one character, if possible.         </para></sect2>
<sect2 id="s3dw_textbox_scrollto"><title>s3dw_textbox_scrollto</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>void <function>s3dw_textbox_scrollto</function></funcdef><paramdef>s3dw_textbox *<parameter>textbox</parameter></paramdef><paramdef>int <parameter>x</parameter></paramdef><paramdef>int <parameter>y</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Scrolls the text in the textbox so that the character in row y, column x is in the top left corner of the textbox.         </para></sect2>
<sect2 id="s3dw_textbox_change_text"><title>s3dw_textbox_change_text</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>void <function>s3dw_textbox_change_text</function></funcdef><paramdef>s3dw_textbox *<parameter>textbox</parameter></paramdef><paramdef>const char *<parameter>text</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Change the text in the referenced textbox to the specified text.         </para></sect2>
<sect2 id="s3dw_handle_click"><title>s3dw_handle_click</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>int <function>s3dw_handle_click</function></funcdef><paramdef>const struct s3d_evt *<parameter>event</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>If you want your widgets on mouseclicks (believe me, you want that), you have to call this either in your clickhandler-function or specify it itself as the clickhandler.</para><programlisting> // way 1:
 <link linkend="s3d_set_callback">s3d_set_callback</link>(S3D_EVENT_OBJ_CLICK,<link linkend="s3dw_handle_click">s3dw_handle_click</link>);

 // way 2:
 ...
 void click(struct <link linkend="structs3d_evt">s3d_evt</link> *evt)
 {
         <link linkend="s3dw_handle_click">s3dw_handle_click</link>(evt);
         ....
         // your own clickhandler code
         ...
 }
 ....
 <link linkend="s3d_set_callback">s3d_set_callback</link>(S3D_EVENT_OBJ_CLICK,click);
</programlisting></sect2>
<sect2 id="s3dw_handle_key"><title>s3dw_handle_key</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>int <function>s3dw_handle_key</function></funcdef><paramdef>const struct s3d_evt *<parameter>event</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>This is somehow useful to call in your keyhandler functions if you want to have input-boxes work. ;)</para><programlisting> // way 1:
 <link linkend="s3d_set_callback">s3d_set_callback</link>(S3D_EVENT_KEY,<link linkend="s3dw_handle_key">s3dw_handle_key</link>);

 // way 2:
 ...
 void key(struct <link linkend="structs3d_evt">s3d_evt</link> *evt)
 {
         <link linkend="s3dw_handle_key">s3dw_handle_key</link>(evt);
         ....
         // your own keyhandler code
         ...
 }
 ....
 <link linkend="s3d_set_callback">s3d_set_callback</link>(S3D_EVENT_KEY,key);
</programlisting></sect2>
<sect2 id="s3dw_object_info"><title>s3dw_object_info</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>int <function>s3dw_object_info</function></funcdef><paramdef>struct s3d_evt *<parameter>event</parameter></paramdef></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>This can be used to let s3dw handle S3D_EVENT_OBJ_INFO-events. With this, s3dw can consider the camera position and makes things like following the camera possible.         </para></sect2>
<sect2 id="s3dw_ani_mate"><title>s3dw_ani_mate</title><funcsynopsis><funcsynopsisinfo>#include &lt;s3dw.h&gt;</funcsynopsisinfo><funcprototype><funcdef>void <function>s3dw_ani_mate</function></funcdef><void/></funcprototype><?dbhtml funcsynopsis-style='ansi'?></funcsynopsis><para>Just call this in your mainloop if you want some nice window sliding animations. it's somewhat bloating, but you don't want to miss it ;)</para><programlisting> #include &lt;time.h&gt;   // nanosleep()
 static struct timespec t={0.33*1000*1000}; // 33 mili seconds
 void mainloop()
 {
         // keep this in your mainloop. this will do smooth animations for you ...
         <link linkend="s3dw_ani_mate">s3dw_ani_mate</link>();
         nanosleep(&amp;t,NULL);
 }

 ....
 <link linkend="s3d_mainloop">s3d_mainloop</link>(mainloop);
</programlisting></sect2>
