/*======================================================
FILE:  AEEStockFonts.c

SERVICES:
   Standard BREW Bitmapped Fonts

GENERAL DESCRIPTION:
   Standard set of ROM/Flash-based bitmapped fonts covering CP1252 repertoire

PUBLIC CLASSES AND STATIC FUNCTIONS:

   AEEStockFonts_New(), which constructs the following classes:
   
   AEECLSID_FONT_FIXED4X6
   AEECLSID_FONT_BASIC6
   AEECLSID_FONT_BASIC9
   AEECLSID_FONT_BASIC10
   AEECLSID_FONT_BASIC11
   AEECLSID_FONT_BASIC11B
   AEECLSID_FONT_BASIC14

   
INITIALIZATION & SEQUENCING REQUIREMENTS:

	See Exported Routines

        Copyright © 1999-2001 QUALCOMM Incorporated.
               All Rights Reserved.
            QUALCOMM Proprietary/GTDR
=====================================================*/

#include "AEE.h"
#include "AEEError.h"
#include "AEEBitFont.h"
#include "AEEStockFonts.h"


static int AEEStockFonts_New(IShell * piShell, AEECLSID cls, void **ppif);


const AEEStaticClass gAEEStockFontsClasses[] = {
   {AEECLSID_FONT_FIXED4X6,   ASCF_UPGRADE, 0, 0, AEEStockFonts_New},
   {AEECLSID_FONT_BASIC6,     ASCF_UPGRADE, 0, 0, AEEStockFonts_New},
   {AEECLSID_FONT_BASIC9,     ASCF_UPGRADE, 0, 0, AEEStockFonts_New},
   {AEECLSID_FONT_BASIC10,    ASCF_UPGRADE, 0, 0, AEEStockFonts_New},
   {AEECLSID_FONT_BASIC11,    ASCF_UPGRADE, 0, 0, AEEStockFonts_New},
   {AEECLSID_FONT_BASIC11B,   ASCF_UPGRADE, 0, 0, AEEStockFonts_New},
   {AEECLSID_FONT_BASIC14,    ASCF_UPGRADE, 0, 0, AEEStockFonts_New},
   {AEECLSID_FONT_BASIC12,    ASCF_UPGRADE, 0, 0, AEEStockFonts_New},
   {AEECLSID_FONT_BASIC12B,   ASCF_UPGRADE, 0, 0, AEEStockFonts_New},
   {AEECLSID_FONT_BASIC15,    ASCF_UPGRADE, 0, 0, AEEStockFonts_New},
   NULL
};

//----  Font data
//
// Here bitmap data is included as byte arrays from which the stock font
// objects are created.
//


static const byte abyFixed4x6[] = {
#include "fixed4x6.h"
};

static const byte abyBasic6[] = {
#include "basic6.h"
};

static const byte abyBasic9[] = {
#include "basic9.h"
};

static const byte abyBasic10[] = {
#include "basic10.h"
};

static const byte abyBasic11[] = {
#include "basic11.h"
};

static const byte abyBasic11b[] = {
#include "basic11b.h"
};

static const byte abyBasic14[] = {
#include "basic14.h"
};

static const byte abyBasic12[] = {
#include "basic12.h"
};

static const byte abyBasic12b[] = {
#include "basic12b.h"
};

static const byte abyBasic15[] = {
#include "basic15.h"
};



//------  New function for AEEStaticClass entries:
//


static AEEStockFonts_New(IShell * piShell, AEECLSID cls, void **ppif)
{
   const byte *pby;
   int cb;

   switch (cls) {
   case AEECLSID_FONT_FIXED4X6:
      pby = abyFixed4x6;
      cb = sizeof(abyFixed4x6);
      break;
      
   case AEECLSID_FONT_BASIC6:
      pby = abyBasic6;
      cb = sizeof(abyBasic6);
      break;
      
   case AEECLSID_FONT_BASIC9:
      pby = abyBasic9;
      cb = sizeof(abyBasic9);
      break;
      
   case AEECLSID_FONT_BASIC10:
      pby = abyBasic10;
      cb = sizeof(abyBasic10);
      break;
      
   case AEECLSID_FONT_BASIC11:
      pby = abyBasic11;
      cb = sizeof(abyBasic11);
      break;
      
   case AEECLSID_FONT_BASIC11B:
      pby = abyBasic11b;
      cb = sizeof(abyBasic11b);
      break;
      
   case AEECLSID_FONT_BASIC14:
      pby = abyBasic14;
      cb = sizeof(abyBasic14);
      break;

   case AEECLSID_FONT_BASIC12:
      pby = abyBasic12;
      cb = sizeof(abyBasic12);
      break;
      
   case AEECLSID_FONT_BASIC12B:
      pby = abyBasic12b;
      cb = sizeof(abyBasic12b);
      break;
      
   case AEECLSID_FONT_BASIC15:
      pby = abyBasic15;
      cb = sizeof(abyBasic15);
      break;

   default:
      return ECLASSNOTSUPPORT;
   }

   return AEEBitFont_NewFromBBF(pby, cb, AEEBITFONT_STATICDATA, 0, (IFont**) ppif);
}

