BEGIN {
		print "// Automatically-generated SDPGTK wrappers for Gtk+ events"
		print "//"
		print "// This file was generated with 'awk -f sdpgtkevents.h.awk sdpgtkevents.data > include/sdpgtkevents.h'"
		print "// Do not edit this file by hand!  Alter sdpgtkevents.h.awk or sdpgtkevents.data!"
		print ""
		print ""

		print "#include \"sdpgtkevent.h\""
		print ""

		FS = " "
}




# Create class ...

{
	class = $1
	signal = $2
	result = $3
	firstarg = 4

	print "///////////////////////////////////////////////////////////////////////////////"
	print "// " class " ('" signal "')"
	print ""
	print "class " class " : public sdpGtkObjectEvent"
	print "{"
	print "public:"

# Class constructor ...

	print "  " class "(SDPCSTRING EventSignal, SDPCSTRING EventName, bool After, sdpGtkObjectContainer* EventContainer, GtkObject* EventObject);"

# Connect() pure-virtual override ...

	print "  void Connect();"

# Event arguments ...

	fullargs = ""
	setargs = ""
	args = ""

	for(i = firstarg; i < NF; i+=2)
		{
			if(i > firstarg)
				{
					fullargs = fullargs ", "
					args = args ", "
				}

			fullargs = fullargs $i " " $(i+1)
			setargs = setargs "Set" $(i+1) "(" $(i+1) "); "
			args = args $(i+1)
		}

# Event and raw-event handlers ...

	if(result == "void")
		{
			print "  void Event(" fullargs ");"
			print "  static void RawEvent(" fullargs ", gpointer EventData);"
		}
	else
		{
			print "  " result " Event(" fullargs ");"
			print "  static " result " RawEvent(" fullargs ", gpointer EventData);"
			print "  inline void SetResult(" result " Result) { m_Result = Result; }"
			print "  inline " result " Result() { return m_Result; }"
		}

# Member data set methods ...

	for(i = firstarg; i < NF; i+=2)
		{
			print "  inline void Set" $(i+1) "(" $i " " $(i+1) ") { m_" $(i+1) " = " $(i+1) "; }"
		}

# Member data get methods ...

	for(i = firstarg; i < NF; i+=2)
		{
			print "  inline " $i " " $(i+1) "() { return m_" $(i+1) "; }"
		}

	print "protected:"

# Member data ...

	if(result != "void")
		{
			print "  " result " m_Result;"
		}

	for(i = firstarg; i < NF; i+=2)
		{
			print "  " $i " m_" $(i+1) ";"
		}

	print "};\n"
}

