/*

Directory Opus 5
Original APL release version 5.82
Copyright 1993-2012 Jonathan Potter & GP Software

This program is free software; you can redistribute it and/or
modify it under the terms of the AROS Public License version 1.1.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
AROS Public License for more details.

The release of Directory Opus 5 under the GPL in NO WAY affects
the existing commercial status of Directory Opus for Windows.

For more information on Directory Opus for Windows please see:

                 http://www.gpsoft.com.au

*/

#include "dopuslib.h"
#define BOOPSI_LIBS
#include "boopsi.h"

// String dispatcher
ULONG __asm __saveds string_dispatch(
	register __a0 Class *cl,
	register __a2 Object *obj,
	register __a1 Msg msg)
{
	struct Gadget *gadget;
	ButtonData *data;
	ULONG retval=0;

	// Get gadget and data pointer
	if (obj)
	{
		gadget=(struct Gadget *)obj;
		data=INST_DATA(cl,obj);
	}

	// Look at method
	switch (msg->MethodID)
	{
		// Render gadget
		case GM_RENDER:
			string_render(cl,gadget,data,(struct gpRender *)msg);
			break;

		// Unknown method
		default:
			retval=DoSuperMethodA(cl,obj,msg);
			break;
	}

	return retval;
}


// Render string
void string_render(
	Class *cl,
	struct Gadget *gadget,
	ButtonData *data,
	struct gpRender *render)
{
	struct RastPort *rp;
	UWORD *pens;

	// Get rastport to use
	rp=render->gpr_RPort;

	// Get pen array
	pens=render->gpr_GInfo->gi_DrInfo->dri_Pens;

	// Pass on to super class
	DoSuperMethodA(cl,(Object *)gadget,(Msg)render);
}
