/*DDK*************************************************************************/
/*                                                                           */
/* COPYRIGHT (C) Lexmark Corporation, 1989                                   */
/* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
/*                                                                           */
/*    The following IBM OS/2 WARP source code is provided to you solely for  */
/*    the purpose of assisting you in your development of OS/2 WARP device   */
/*    drivers. You may use this code in accordance with the IBM License      */
/*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
/*    Copyright statement may not be removed.                                */
/*                                                                           */
/*****************************************************************************/
/**************************************************************************
 *                            Lexmark Confidential
 *
 * SOURCE FILE NAME = PRDMEXTF
 *
 * DESCRIPTIVE NAME = Printer Device Driver external files for
 *                    (Device) Modes functions
 *
 *
 * VERSION
 *
 * DATE
 *
 * DESCRIPTION
 *
 * FUNCTIONS
 *
 * ENTRY POINTS:
 *
 * DEPENDENCIES:
 *
 * NOTES
 *
 *
 * STRUCTURES
 *
 * EXTERNAL REFERENCES
 *
 * EXTERNAL FUNCTIONS
 *
*/

VOID DrvInstall();

/**********************************************************************/
/* PD00149 : Defined this as an exported entry point                  */
/**********************************************************************/
ULONG EXPENTRY OS2_PM_DRV_DEVMODE(
            PDRIVDATA,
            PBYTE,
            PBYTE,
            PBYTE,
            ULONG);

/**********************************************************************/
/* PD00149 : New function. This is the old OS2_PM_DRV_DEVMODE         */
/**********************************************************************/
ULONG prdm_DevMode(
            PDRIVDATA,
            PBYTE,
            PBYTE,
            PBYTE,
            ULONG);

USHORT prdm_Dialog(
            PDRIVDATA,
            PBYTE,
            PBYTE,
            PBYTE,
            ULONG);


USHORT prdm_ConvertOldIniToNew( BOOL );

/*
USHORT prdm_ReadTerminatedWordFromText ( PBYTE, */
SHORT prdm_ReadTerminatedWordFromText ( PBYTE,             /* CON3201 */
                                                    PBYTE,
                                                    PBYTE,
                                                    PBYTE *);


MRESULT prdm_MainDlgProc(
            HWND,
            USHORT,
            MPARAM,
            MPARAM);

MRESULT prdm_CardDlgProc(
            HWND,
            USHORT,
            MPARAM,
            MPARAM);

MRESULT prdm_DownFontDlgProc(
            HWND,
            USHORT,
            MPARAM,
            MPARAM);

MRESULT prdm_DfltFontDlgProc(
            HWND,
            USHORT,
            MPARAM,
            MPARAM);

MRESULT prdm_ConnDlgProc(
            HWND,
            USHORT,
            MPARAM,
            MPARAM);

MRESULT prdm_JobSetUpDlgProc(
            HWND,
            USHORT,
            MPARAM,
            MPARAM);

USHORT prdm_EnterValues(
            HWND);

USHORT prdm_EnterCardValues(
            HWND);

USHORT prdm_EnterDownFontValues(
            HWND);

USHORT prdm_EnterConnections(
            HWND);

USHORT prdm_EnterJobSetUp(
            HWND);

VOID prdm_InitMainDlg(
            HWND);

USHORT prdm_ControlProc(
            HWND,
            USHORT,
            USHORT);

USHORT prdm_GetDeviceName( PBYTE,
                                  USHORT *,
                                  PBYTE);

//PBYTE prdm_ConvertOldIniEntry( PBYTE,
//                                      PUSHORT,
//                                      PBYTE,
//                                      USHORT *);

VOID prdm_InitFormsDlg(
            HWND);

VOID prdm_InitFormList(
            HWND,
            USHORT);

VOID prdm_InitFormListTemplate(
            HWND,
            USHORT);

VOID prdm_PaintForm(
            HWND,
            USHORT,
            BOOL);

VOID prdm_PaintFormTemplate(
            HWND,
            USHORT);

VOID prdm_TextFromNumeric(
            ULONG,
            PBYTE *,
            USHORT);

USHORT prdm_GetDownFontEntry(
            PBYTE );

USHORT prdm_CopyDownFontFiles();

VOID prdm_DisplayDownFontEntry(
            HWND,
            USHORT );

VOID prdm_DisplayDfltFontEntry(
            HWND,
            lpFMFFileStruc,
            PBYTE );

VOID prdm_CopyFaceNameAcross(
            PBYTE *,
            PBYTE *,
            PBYTE );

VOID prdm_InitDfltFontList(
            HWND,
            USHORT);

PBYTE prdm_GetCardData(
            PBYTE );

USHORT prdm_CopyFMFFiles(
            HWND,
            PBYTE);

USHORT prdm_AddCDFName(
            PBYTE);

USHORT prdm_RefreshCardList(
            HWND);

VOID prdm_RefreshSlotLists(
            HWND,
            USHORT );

USHORT prdm_CheckFileExists(
            PSZ,
            PSZ,
            PSZ,
            PHDIR,
            PFILEFINDBUF3 );

USHORT prdm_UnpackInitMetrics(
            HWND,
            PSZ,
            PSZ,
            PUSHORT,
            lpCard * );

VOID prdm_FillFontCardsBox(
            HWND );

USHORT prdm_ReadFileContents(
            PSZ,
            PSZ,
            PSZ,
            PUSHORT,
            PBYTE * );

USHORT prdm_CheckCardUnique(
            PSZ);

VOID prdm_RemoveDownEntry(
            USHORT );

VOID prdm_RemoveShipCard(
            USHORT );

VOID prdm_RemoveAddedCard(
            USHORT );

USHORT prdm_FindShipped(
            USHORT,
            lpCard,
            USHORT);

VOID prdm_ReadyDMData();

VOID prdm_FreeDMDataSegments();

/* CON3201
USHORT prdm_LoadDMDataDefaults(
            USHORT );
*/

SHORT prdm_LoadDMDataDefaults(
            USHORT );

VOID prdm_QueryMainBoxSelections (
            HWND );

USHORT prdm_ReadBodyData (
            USHORT );

//VOID prdm_WriteHeaderData(
//            PBYTE,
//            lpDMSettings );

VOID prdm_WriteBodyData (
            USHORT );

USHORT prdm_WriteIniEntry (
            USHORT,
            HWND );

USHORT prdm_DispMessageBox (
            HWND,
            USHORT,
            SHORT,
            USHORT,
            USHORT );

USHORT prdm_DispConversionMsg (
            HWND,
            USHORT,
            SHORT,
            USHORT,
            USHORT );

VOID prdm_DeleteForm (
            HWND );

VOID prdm_RemoveMenuOptions (
            HWND );

USHORT prdm_CheckRemoveDefFont (
            HWND );

/**********************************************************************/
/* PD00183 : Redefinition                                             */
/**********************************************************************/
VOID prdm_InitSourceBoxes(
            HWND );

/**********************************************************************/
/* PD00183 : New function                                             */
/**********************************************************************/
VOID prdm_RadioButtonControl(
            HWND,
            lpRadCtrlType);

MRESULT prdm_CodePageDlgProc(
            HWND,
            USHORT,
            MPARAM,
            MPARAM);

VOID prdm_DisplayCodePage(
            HWND,
            USHORT,
            USHORT );

USHORT prdm_EnterCodePageValues(
            HWND);

USHORT prdm_AddCodePage(
            HWND,
            PSZ );

USHORT prdm_CopyFile(
            PSZ,
            PSZ,
            PSZ,
            PSZ,
            PSZ );

USHORT prdm_CheckFileOKForPrinter(
            PSZ,
            PSZ,
            PSZ,
            USHORT );


VOID prdm_DisplayDownList(
            HWND );

USHORT prdm_ReadWordFromDecText(
            PBYTE,
            PUSHORT );

USHORT prdm_DisplayCodePageFonts(
            HWND,
            USHORT,
            lpFMFFontList );

BOOL prdm_StringsAreEqual(
            PSZ,
            PSZ );

//SHORT prdm_MatchDescription(
//            PSZ );

//PBYTE prdm_ReadIniString( PSZ,
//                                     PSZ);


USHORT prdm_ReadFontResource(
           lpFMFFileStruc *,
           USHORT,
           PBOOL,
           USHORT,
           lpFMFFontList,
           lpDDTType );

VOID prdm_FontTableMemory( );

lpFMFFontList prdm_ResidentFonts( );

VOID prdm_CardFonts( USHORT );

VOID prdm_ExpandFaceName(
           PFOCAMETRICS,
           USHORT );

VOID prdm_LoadMatchParameters(
           PFOCAMETRICS,
           USHORT );

VOID prdm_EnterFontValue(
           HWND,
           USHORT);

VOID prdm_CheckMatchParameters( );

USHORT prdm_CheckDefaultFont( );

VOID prdm_MoreFontTableMemory( );

VOID prdm_ReleaseFontTableMemory( );

VOID prdm_DisplayDefaultFontList(
           HWND,
           USHORT);

//USHORT prdm_GetIniVersionType( PBYTE );

PBYTE prdm_TranslateOldIniEntry( PBYTE, PUSHORT );

//PBYTE prdm_ReadOld4019Header( PBYTE, lpDMSettings );

//PBYTE prdm_TranslateOld4019Body( PBYTE, PBYTE, lpDMSettings );

VOID prdm_DisplayDfltPMFPath( HWND );

/**********************************************************************/
/* PD00199 : Changed the type of the functions to                 */
/**********************************************************************/
VOID prdm_EnableHelp(HWND);
VOID prdm_DisableHelp ();

/**********************************************************************/
/* PD00200 : New function to read the fully qualified help path.      */
/**********************************************************************/
PBYTE prdm_GetHelpPath(HWND);

/**********************************************************************/
/* PD00199 : Redefined this function                                  */
/**********************************************************************/
VOID prdm_HelpMessageProcessing (HWND,
                                            USHORT,
                                            MPARAM,
                                            MPARAM);

pFormInfoStruc prdm_FindFormInfo( ULONG );

ULONG prdm_FindFormNumber( pFormInfoStruc );

ULONG prdm_FindDfltFormNo ();

USHORT prdm_SetupSingleFormList( HWND );

/**********************************************************************/
/* PD00149 : New function. Coded specifically for OS2_PM_DRV_DEVMODE  */
/* Defined in BITMOUT.ASM for want of an assembler module             */
/**********************************************************************/
VOID Prdm_ReplaceStack (USHORT, USHORT);

/**********************************************************************/
/* PD00149 : New function. Coded specifically for OS2_PM_DRV_DEVMODE  */
/* Defined in BITMOUT.ASM for want of an assembler module             */
/**********************************************************************/
VOID Prdm_RestoreStack (USHORT, USHORT);

/**********************************************************************/
/* PD00137 : New functions. Coded specifically for default outline    */
/* fonts' pointsize selection                                         */
/**********************************************************************/
VOID prdm_DisplayPointSzList( HWND, USHORT);
USHORT prdm_GetPointSzIndex(USHORT);
USHORT prdm_EnterFontPointSz(HWND, USHORT);
VOID   prdm_DfltFontPSzControlProc(HWND,USHORT);

/**********************************************************************/
/* PD00208 : New function. To write a PM_DD Ini entry for specific   */
/* logical printer and device.                                        */
/**********************************************************************/
USHORT prdm_PM_DD_Write( PBYTE, PBYTE ,PBYTE, PBYTE, USHORT);

/**********************************************************************/
/* PD00542 : New function. To select the old driver if there is one. */
/**********************************************************************/
USHORT prdm_SelectOldDriver( PBYTE );


