<?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>

	<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 <X11/Xlib.h>
			#include <X11/Xos.h>
			#include <X11/Xatom.h>
			#include <X11/Xutil.h>

			#include <support.h>
			#include <uwg.h>
			#include <uwg_visual.h>
			#include <uwg_textops.h>
			#include <uwg_3dops.h>
			#include <uwg_propset.h>

			]]>
		</cpreface>
		<!--}}}-->
		<!--{{{  ctail-->
		<ctail>
			<![CDATA[
			int main (int argc, char **argv)
			{
				UWGXContext *xcxt;

				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");

				uwg_mainloop ();

				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="256" />
		<property name="position" value="user" />
		<property name="style" value="border" />
		<property name="visible" value="true" />
		<property set="cpref" />

		<!--{{{  @:UWGPanel-->
		<gadget type="UWGPanel">
			<property name="width" value="256" />
			<property name="height" value="256" />
			<property name="x" value="0" />
			<property name="y" value="0" />
			<property name="indent" value="2" />
			<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>
			<!--}}}-->
			<!--{{{  button1:UWGButton-->
			<gadget type="UWGButton" name="button1">
				<property name="geometry" value="4,32,96,40" />
				<property name="font" value="fixed" />
				<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" />
					<![CDATA[
						printf ("button1 click!\n");
					]]>
				</action>
				<action name="on_mouseenter" />
				<action name="on_mouseleave" />
			</gadget>
			<!--}}}-->
			<!--{{{  button2:UWGBitBtn-->
			<gadget type="UWGBitBtn" name="button2">
				<property name="geometry" value="100,32,144,40" />
				<property name="hint" value="this is a hint!" />
				<property name="font" value="fixed" />
				<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, 128, 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 name="font" value="variable" />
					<property set="cpref" />
					<property name="background" value="@tentry" />
					<action name="on_accept">
						<property name="text" />
						<![CDATA[
							printf ("edit accept!\n");
						]]>
					</action>
				</gadget>
				<!--}}}-->
			</gadget>
			<!--}}}-->
		</gadget>
		<!--}}}-->

		<action name="on_delete">
			<![CDATA[
			uwg_termloop (0);
			]]>
		</action>
	</gadget>

</xhpd>


