//	Zinc Interface Library - G_FGDSP.CPP
//	COPYRIGHT (C) 1990-1993.  All Rights Reserved.
//	Zinc Software Incorporated.  Pleasant Grove, Utah  USA

/*       This file is a part of OpenZinc

          OpenZinc is free software; you can redistribute it and/or modify it under
          the terms of the GNU Lessor General Public License as published by
          the Free Software Foundation, either version 3 of the License, or (at
          your option) any later version

	OpenZinc 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 GNU Lesser 
          General Public License for more details.

          You should have received a copy of the GNU Lessor General Public License
	 along with OpenZinc. If not, see <http://www.gnu.org/licenses/>                          */


//	Hacked to provide support for FlashGraphics for general compilers
//

#include <string.h>

#include <fg.h>

#include "ui_env.hpp"
#include "ui_fg.hpp"

UI_PATH *UI_FG_DISPLAY::searchPath	= NULL;

void z_fgdsp_dummy(void)	// Bug fix for Zortech & Microsoft linkers.
{
	fg_font_t defaultFont;
	fg_get_font(&defaultFont);

	UI_FG_DISPLAY::fontTable[FNT_DIALOG_FONT].fontptr = 
				defaultFont.fontptr;
	UI_FG_DISPLAY::fontTable[FNT_DIALOG_FONT].fontptr2 = 
				defaultFont.fontptr2;
	UI_FG_DISPLAY::fontTable[FNT_DIALOG_FONT].maxWidth = 
				defaultFont.charbox[FG_X2] + 1;	// Default 8.
	UI_FG_DISPLAY::fontTable[FNT_DIALOG_FONT].maxHeight = 
				defaultFont.charbox[FG_Y2] + 1;	// Default 14.

	UI_FG_DISPLAY::fontTable[FNT_SMALL_FONT] = 
				UI_FG_DISPLAY::fontTable[FNT_DIALOG_FONT];
	UI_FG_DISPLAY::fontTable[FNT_SYSTEM_FONT] = 
				UI_FG_DISPLAY::fontTable[FNT_DIALOG_FONT];
}

UI_FG_DISPLAY::FGFONT UI_FG_DISPLAY::fontTable[ZIL_MAXFONTS] =
{
	{ NULL, NULL, 0, 0},	// FNT_SMALL_FONT
	{ NULL, NULL, 0, 0},	// FNT_DIALOG_FONT
	{ NULL, NULL, 0, 0},	// FNT_SYSTEM_FONT
	{ NULL, NULL, 0, 0},
	{ NULL, NULL, 0, 0},
	{ NULL, NULL, 0, 0},
	{ NULL, NULL, 0, 0},
	{ NULL, NULL, 0, 0},
	{ NULL, NULL, 0, 0},
	{ NULL, NULL, 0, 0}
};

UI_FG_DISPLAY::FGPATTERN UI_FG_DISPLAY::patternTable[ZIL_MAXPATTERNS] =
{
	{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
	  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 
	  0x0000, 0x0000, 0x0000, 0x0000 },	// EMPTY_FILL
	{ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 
	  0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 
	  0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF },	// SOLID_FILL
	{ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 
	  0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 
	  0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF },	// LINE_FILL
	{ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 
	  0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 
	  0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF },	// LTSLASH_FILL
	{ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 
	  0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 
	  0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF },	// SLASH_FILL
	{ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 
	  0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFF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