<?xml version="1.0" encoding="iso-8859-1"?>
<!--

	** XHPD, XML hierarchical program description **

	This is digested by either ubuildinit, or by RAPP-type things.

-->
<xhpd version="1.0">

	<propset id="cpref">
		<property name="background" value="@background" />
		<property name="foreground" value="@foreground" />
		<property name="highlight" value="@highlight" />
		<property name="shadow" value="@shadow" />
		<property name="iecolor" value="@extra" />
		<property name="tentry" value="@tentry" />
	</propset>
	<propset id="selcpref">
		<property name="sel-background" value="@selback" />
		<property name="sel-foreground" value="@selfore" />
	</propset>
	<propset id="helvfont">
		<property name="font" value="-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-*" />
	</propset>
	<propset id="helvfont-small">
		<property name="font" value="-*-helvetica-medium-r-*-*-10-*-*-*-*-*-iso8859-*" />
	</propset>
	<propset id="lcarspref">
		<property name="lcars1" value="#9999CC" />
		<property name="lcars2" value="#996699" />
		<property name="lcars3" value="#996666" />
		<property name="lcars4" value="#DF6360" />
	</propset>

	<application>
		<property name="hint-delay" value="0, 800000" />
		<property name="hint-font" value="-adobe-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*" />
		<property name="hint-foreground" value="#000000" />
		<property name="hint-background" value="#d0f8d8" />
	</application>

	<section name="buildinit">
		<!--{{{  cpreface-->
		<cpreface>
			<![CDATA[
			#include <stdio.h>
			#include <stdlib.h>
			#include <string.h>
			#include <sys/types.h>
			#include <unistd.h>
			#include <stdarg.h>
			#include <sys/socket.h>
			#include <netinet/in.h>     
			#include <arpa/inet.h>

			#include <X11/Xlib.h>
			#include <X11/Xos.h>
			#include <X11/Xatom.h>
			#include <X11/Xutil.h>

			#include <uwg_support.h>
			#include <uwg.h>
			#include <uwg_visual.h>
			#include <uwg_nvisual.h>
			#include <uwg_textops.h>
			#include <uwg_3dops.h>
			#include <uwg_lcars.h>
			#include <uwg_propset.h>
			#include <uwg_isockcli.h>

			]]>
		</cpreface>
		<!--}}}-->
		<!--{{{  ctail-->
		<ctail>
			<![CDATA[

			static void isc_init (UWGISockCli *isc)
			{
				isc->set_property (isc, PROP_HOST, "frog");
				isc->set_property (isc, PROP_PORT, 401);
				isc->set_property (isc, PROP_LINEBUFFERED, 1);
			}

			static void isc_on_connect (UWGISockCli *isc)
			{
				fprintf (stderr, "connected to host!\n");
			}

			static void isc_on_line (UWGISockCli *isc, char *text)
			{
				if (cmsgwin1) {
					cmsgwin1->put_line (cmsgwin1, text);
				} else {
					/* ought not to happen, really .. */
					fprintf (stderr, "got data [%s]\n", text);
				}
			}

			static void isc_on_disconnect (UWGISockCli *isc)
			{
				fprintf (stderr, "disconnected from host!\n");
			}

			static void isc_on_create (UWGISockCli *isc)
			{
				isc->connect (isc);
			}

			int main (int argc, char **argv)
			{
				UWGXContext *xcxt;
				UWGISockCli *isc;
				UWGISockCliCB *isccb;

				uwg_init (argc, argv);
				xcxt = uwg_new_context (NULL);
				if (!xcxt) {
					fprintf (stderr, "%s: failed to create context\n", *argv);
					exit (EXIT_FAILURE);
				}

				create_mainwin (xcxt);

				uwg_set_property (PROP_HINT_DELAY, 0, 800000);
				uwg_set_property (PROP_HINT_FONT, "-adobe-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*");
				uwg_set_property (PROP_HINT_FOREGROUND_STR, "#000000");
				uwg_set_property (PROP_HINT_BACKGROUND_STR, "#d0f8d8");

				isccb = uwg_isockcli_cbcreate ();
				isccb->initfunc = isc_init;
				isccb->on_line = isc_on_line;
				isccb->on_connect = isc_on_connect;
				isccb->on_disconnect = isc_on_disconnect;
				isccb->on_create = isc_on_create;
				isc = uwg_isockcli_create (xcxt, isccb, NULL);

				uwg_mainloop ();

				isc->disconnect (isc);
				uwg_isockcli_destroy (isc);

				destroy_mainwin ();
				uwg_destroy_context (xcxt);

				return 0;
			}
			]]>
		</ctail>
		<!--}}}-->
	</section>

	<gadget type="UWGWindow" name="mainwin">
		<property name="filename" value="mainwin" />
		<property name="caption" value="Test application" />
		<property name="icon-name" value="testapp" />
		<property name="width" value="256" />
		<property name="height" value="408" />
		<property name="position" value="user" />
		<property name="style" value="sizeable" />
		<property name="visible" value="true" />
		<property set="cpref" />

		<!--{{{  @:UWGLayout-->
		<gadget type="UWGLayout">
			<property name="visible" value="1" />

			<!--{{{  tabtops1:UWGTabTops-->
			<gadget name="tabtops1" type="UWGTabTops">
				<property name="geometry" value="0,4,256,20" />
				<property name="layout" value="stretch-horiz" />
				<property set="helvfont" />
				<property name="visible" value="1" />
				<property set="cpref" />
				<property name="active-background" value="@background" />
				<property name="inactive-background" value="@background" />
				<property name="inactive-foreground" value="#606060" />
				<property name="leading-space" value="8" />

				<action name="on_create">
					<!-- these must be numbered sensibly to work with the pseudo tab-manager -->
					<command name="add_tab">
						<arg value="foobar" />
						<arg value="0" />
					</command>
					<command name="add_tab">
						<arg value="just bar" />
						<arg value="1" />
					</command>
					<command name="add_tab">
						<arg value="more" />
						<arg value="2" />
					</command>
					<command name="add_tab">
						<arg value="vgraph" />
						<arg value="3" />
					</command>
				</action>
				<action name="on_click">
					<update name="tabman1">
						<property name="value">
							<property name="value" source="tabtops1" />
						</property>
					</update>
				</action>
			</gadget>
			<!--}}}-->
			<gadget type="@TabManager" name="tabman1">
				<!--{{{  tab1:UWGContainer-->
				<gadget name="tab1" type="UWGContainer">
					<property name="geometry" value="0,24,256,384" />
					<property name="layout" value="stretch" />
					<property name="style" value="border" />
					<property set="cpref" />

					<!--{{{  @:UWGLabel-->
					<gadget type="UWGLabel">
						<property name="geometry" value="4,4,248,24" />
						<property name="font" value="fixed" />
						<property name="caption" value="Hello, world!" />
						<property name="alignment" value="center" />
						<property name="hint" value="this is a hint!" />
						<property set="cpref" />
					</gadget>
					<!--}}}-->
					<!--{{{  @:UWGScrollBar-->
					<gadget type="UWGScrollBar">
						<property name="geometry" value="4,24,248,16" />
						<property name="scroll-type" value="horizontal" />
						<property name="limit-min" value="0" />
						<property name="limit-max" value="100" />
						<property set="cpref" />
						<action name="on_scroll">
							<property name="value" />
							<![CDATA[
							printf ("on_scroll! value = %d\n", (int)value);
							]]>
						</action>
					</gadget>
					<!--}}}-->
					<!--{{{  listbox1:UWGListBox-->
					<gadget name="listbox1" type="UWGListBox">
						<property name="geometry" value="4,96,232,128" />
						<property name="font" value="variable" />
						<property set="cpref" />
						<property set="selcpref" />
						<property name="background" value="@tentry" />
						<action name="on_create">
							<command name="add_item"><arg value="sausages" /></command>
							<command name="add_item"><arg value="baked beans" /></command>
							<command name="add_item"><arg value="coffee" /></command>
							<command name="add_item"><arg value="testing the listbox thing" /></command>
						</action>
						<action name="on_click">
							<![CDATA[
							printf ("item %d clicked!\n", (int)button);
							]]>
						</action>
					</gadget>
					<!--}}}-->
					<!--{{{  listscroll1:UWGScrollBar-->
					<gadget name="listscroll1" type="UWGScrollBar">
						<property name="geometry" value="232,96,16,128" />
						<property name="scroll-type" value="vertical" />
						<property name="limit-min" value="0" />
						<property name="limit-max" value="100" />
						<property set="cpref" />
					</gadget>
					<!--}}}-->
					<!--{{{  @:UWGCheckBox-->
					<gadget type="UWGCheckBox">
						<property name="geometry" value="4,228,248,20" />
						<property name="font" value="-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-*" />
						<property name="caption" value="auto-save something or other" />
						<property set="cpref" />
					</gadget>
					<!--}}}-->
					<!--{{{  button1:UWGButton-->
					<gadget type="UWGButton" name="button1">
						<property name="geometry" value="4,48,96,40" />
						<property set="helvfont" />
						<property name="caption" value="Click me!" />
						<property set="cpref" />
						<property name="style" value="popup" />

						<action name="on_click">
							<property source="myedit" name="text" />
							<property name="foreground" />
							<command name="add_item" gadget="listbox1">
								<property name="text" source="myedit" />
							</command>
						</action>
						<action name="on_mouseenter" />
						<action name="on_mouseleave" />
					</gadget>
					<!--}}}-->
					<!--{{{  button2:UWGBitBtn-->
					<gadget type="UWGBitBtn" name="button2">
						<property name="geometry" value="100,48,144,40" />
						<property name="hint" value="this is a hint!" />
						<property set="helvfont" />
						<property name="caption" value="more click!" />
						<property name="style" value="popup" />
						<property name="img-up" value="/usr/include/X11/pixmaps/screen.xpm" />
						<property set="cpref" />

						<action name="on_click">
							<property name="shadow" />
							<property source="mylabel" name="font" />
							<![CDATA[
								printf ("button2 click!\n");
							]]>
						</action>
					</gadget>
					<!--}}}-->
					<!--{{{  @:UWGPanel-->
					<gadget type="UWGPanel">
						<property name="geometry" value="4, 256, 248, 124" />
						<property name="indent" value="-2" />
						<property set="cpref" />

						<!--{{{  mylabel:UWGLabel-->
						<gadget type="UWGLabel" name="mylabel">
							<property name="geometry" value="3, 3, 242, 48" />
							<property name="alignment" value="left" />
							<property name="font" value="-*-itc zapf chancery-*-*-*-*-17-*-*-*-*-*-*-*" />
							<property name="caption" value="Hello, micro-WG world!" />
							<property set="cpref" />
						</gadget>
						<!--}}}-->
						<!--{{{  myedit:UWGEdit-->
						<gadget type="UWGEdit" name="myedit">
							<property name="geometry" value="8, 64, 232, 24" />
							<property set="helvfont" />
							<property set="cpref" />
							<property name="background" value="@tentry" />
							<action name="on_accept">
								<property name="text" />
								<update name="mylabel">
									<property name="caption">
										<property name="text" source="myedit" />
									</property>
								</update>
								<![CDATA[
									printf ("edit accept!\n");
								]]>
							</action>
						</gadget>
						<!--}}}-->
					</gadget>
					<!--}}}-->
				</gadget>
				<!--}}}-->
				<!--{{{  tab2:UWGContainer-->
				<gadget name="tab2" type="UWGContainer">
					<property name="geometry" value="0,24,256,384" />
					<property name="layout" value="stretch" />
					<property name="style" value="border" />
					<property set="cpref" />
					<property name="visible" value="0" />

					<!--{{{  cmsgwin1:UWGCMessageWin-->
					<gadget type="UWGCMessageWin" name="cmsgwin1">
						<property name="geometry" value="4,4,248,256" />
						<property name="font" value="-misc-fixed-medium-r-*-*-10-*-*-*-*-*-*-*" />
						<property name="background" value="#000000" />
						<property name="foreground" value="#e8f4f4" />
						<property name="highlight" value="@highlight" />
						<property name="shadow" value="@shadow" />

					</gadget>
					<!--}}}-->
					<!--{{{  @:UWGButton-->
					<gadget type="UWGButton">
						<property name="geometry" value="72,264,64,24" />
						<property set="helvfont" />
						<property set="cpref" />
						<property name="caption" value="test2" />

						<action name="on_click">
							<command name="put_line" gadget="cmsgwin1">
								<arg value="\0330zero\0331one\0332two\0333three\0334four\0335five\0336six\0337seven\0338eight\0339nine" />
							</command>
						</action>
					</gadget>
					<!--}}}-->
					<!--{{{  @:UWGButton-->
					<gadget type="UWGButton">
						<property name="geometry" value="4,264,64,24" />
						<property set="helvfont" />
						<property set="cpref" />
						<property name="caption" value="test" />

						<action name="on_click">
							<command name="put_line" gadget="cmsgwin1">
								<arg value="blah \0332blah blah\0338" />
							</command>
						</action>
					</gadget>
					<!--}}}-->
				</gadget>
				<!--}}}-->
				<!--{{{  tab3:UWGContainer-->
				<gadget name="tab3" type="UWGContainer">
					<property name="geometry" value="0,24,256,384" />
					<property name="layout" value="stretch" />
					<property name="style" value="border" />
					<property set="cpref" />
					<property name="visible" value="0" />

					<!--{{{  @:UWGLabel-->
					<gadget type="UWGLabel">
						<property set="cpref" />
						<property set="helvfont" />
						<property name="geometry" value="4,4,248,24" />
						<property name="caption" value="This is another label!" />
						<property name="alignment" value="left" />
					</gadget>
					<!--}}}-->
					<!--{{{  @:UWGSpeedBtn-->
					<gadget type="UWGSpeedBtn">
						<property set="cpref" />
						<property name="geometry" value="32,32,28,28" />
						<property name="img-up" value="/home/develop/wgbuilder/wgb_ide/images/editCopy.xpm" />
						<property name="img-disabled" value="/home/develop/wgbuilder/wgb_ide/images/editCopy.disabled.xpm" />
						<property name="style" value="popup" />
						<property name="hint" value="copy thing" />
					</gadget>
					<!--}}}-->
					<!--{{{  @:UWGSpeedBtn-->
					<gadget type="UWGSpeedBtn">
						<property set="cpref" />
						<property name="geometry" value="60,32,28,28" />
						<property name="img-up" value="/home/develop/wgbuilder/wgb_ide/images/editCut.xpm" />
						<property name="img-disabled" value="/home/develop/wgbuilder/wgb_ide/images/editCut.disabled.xpm" />
						<property name="style" value="popup" />
						<property name="hint" value="cut thing" />
					</gadget>
					<!--}}}-->
					<!--{{{  @:UWGSpeedBtn-->
					<gadget type="UWGSpeedBtn">
						<property set="cpref" />
						<property name="geometry" value="88,32,28,28" />
						<property name="img-up" value="/home/develop/wgbuilder/wgb_ide/images/editPaste.xpm" />
						<property name="img-disabled" value="/home/develop/wgbuilder/wgb_ide/images/editPaste.disabled.xpm" />
						<property name="style" value="popup" />
						<property name="hint" value="paste thing" />
					</gadget>
					<!--}}}-->
					<!--{{{  @:UWGSpeedBtn-->
					<gadget type="UWGSpeedBtn">
						<property set="cpref" />
						<property name="geometry" value="116,32,28,28" />
						<property name="img-up" value="/home/develop/wgbuilder/wgb_ide/images/fileOpen.xpm" />
						<property name="img-disabled" value="/home/develop/wgbuilder/wgb_ide/images/fileOpen.disabled.xpm" />
						<property name="style" value="popup" />
						<property name="hint" value="open" />
					</gadget>
					<!--}}}-->
					<!--{{{  @:UWGSpeedBtn-->
					<gadget type="UWGSpeedBtn">
						<property set="cpref" />
						<property name="geometry" value="144,32,28,28" />
						<property name="img-up" value="/home/develop/wgbuilder/wgb_ide/images/fileSaveAs.xpm" />
						<property name="img-disabled" value="/home/develop/wgbuilder/wgb_ide/images/fileSaveAs.disabled.xpm" />
						<property name="style" value="popup" />
						<property name="hint" value="save-as" />
					</gadget>
					<!--}}}-->
					<!--{{{  @:UWGGroupBox-->
					<gadget type="UWGGroupBox">
						<property set="cpref" />
						<property name="geometry" value="4,68,248,312" />
						<property set="helvfont" />
						<property name="caption" value="a group-box" />

						<gadget type="UWGLcarsPanel">
							<property set="cpref" />
							<property name="background" value="black" />
							<property set="lcarspref" />
							<property name="geometry" value="32,32,192,256" />

						</gadget>
					</gadget>
					<!--}}}-->
				</gadget>
				<!--}}}-->
				<!--{{{  tab4:UWGContainer-->
				<gadget name="tab4" type="UWGContainer">
					<property name="geometry" value="0,24,256,384" />
					<property name="layout" value="stretch" />
					<property name="style" value="border" />
					<property set="cpref" />
					<property name="visible" value="0" />

					<!--{{{  @:UWGSpeedBtn-->
					<gadget type="UWGSpeedBtn">
						<property set="cpref" />
						<property name="geometry" value="4,4,28,28" />
						<property name="img-up" value="/home/develop/wgbuilder/wgb_ide/images/projectAddForm.xpm" />
						<property name="img-disabled" value="/home/develop/wgbuilder/wgb_ide/images/projectAddForm.disabled.xpm" />
						<property name="style" value="popup" />
						<property name="hint" value="add node" />

						<action name="on_click">
							<![CDATA[
								UWGVGraphNode *node;

								node = vgraph->add_node (vgraph);
								node->set_property (node, PROP_CAPTION, "default caption!");
							]]>
						</action>
					</gadget>
					<!--}}}-->
					<!--{{{  @:UWGSpeedBtn-->
					<gadget type="UWGSpeedBtn">
						<property set="cpref" />
						<property name="geometry" value="32,4,28,28" />
						<property name="img-up" value="/home/develop/wgbuilder/wgb_ide/images/projectRemoveForm.xpm" />
						<property name="img-disabled" value="/home/develop/wgbuilder/wgb_ide/images/projectRemoveForm.disabled.xpm" />
						<property name="style" value="popup" />
						<property name="hint" value="link nodes" />

						<action name="on_click">
							<command gadget="vgraph" name="link_nodes" />
						</action>
					</gadget>
					<!--}}}-->
					<!--{{{  vgraph:UWGVGraph-->
					<gadget name="vgraph" type="UWGVGraph">
						<property name="geometry" value="4,36,248,344" />
						<property name="layout" value="stretch" />
						<property set="cpref" />
						<property name="background" value="#f0f0f0" />
						<property name="sel-background" value="#e0e0e0" />
						<property name="sel-foreground" value="#500000" />
						<property set="helvfont-small" />

						<action name="on_create">
							<![CDATA[
								UWGVGraphNode *node1, *node2, *node3;
								UWGVGraphEdge *edge1, *edge2;

								fprintf (stderr, "UWGVGraph created!\n");
								node1 = gadget->add_node (gadget);
								node1->set_property (node1, PROP_GEOMETRY, 20, 20, 5, 5);
								node1->set_property (node1, PROP_CAPTION, "node1 caption");

								node2 = gadget->add_node (gadget);
								node2->set_property (node2, PROP_GEOMETRY, 40, 60, 5, 5);
								node2->set_property (node2, PROP_CAPTION, "node2 caption");

								node3 = gadget->add_node (gadget);
								node3->set_property (node3, PROP_GEOMETRY, 20, 100, 5, 5);
								node3->set_property (node3, PROP_CAPTION, "node3 caption");

								edge1 = gadget->add_edge (gadget, node1, node2);
								edge2 = gadget->add_edge (gadget, node2, node3);
							]]>
						</action>
					</gadget>
					<!--}}}-->
				</gadget>
				<!--}}}-->
			</gadget>
		</gadget>
		<!--}}}-->

		<action name="on_delete">
			<command name="@termloop">
				<arg value="0" />
			</command>
		</action>
	</gadget>

</xhpd>


