///////////////////////////////////////////////////////////////////////////
//
//  NAME
//    mcdlg_dl.h - Motion Control API setup dialogs header file
//
//  DESCRIPTION
//    Include this header file in your application if you will be using
//    the MCAPI setup dialogs.
//
//    #include "mcdlg.h"
//
//    To change your application from standard static linking (i.e. using
//    MCDLG32.LIB) to dynamic linking:
//
//      1. Include the file MCDLG.CPP in your project
//      2. Remove any reference to MCDLG32.LIB from your project
//      3. Replace the standard MCDLG header file (MCDLG.H) with this 
//         header file
//      4. Add a call to MCLoadDialogs() prior to calling any function
//         in the MCDLG package
//
//  RELEASE HISTORY
//    Copyright (c) 2002-2012 by Precision Micro Control Corp. All rights
//    reserved.
//
//    $Id: mcdlg_dl.h 796 2013-04-20 00:35:12Z brian $
//
//    Version 3.2.0      4-Jan-02       Programmer: Brian Gaynor
//      - First release
//
//    Version 3.2.1     26-Apr-02       Programmer: Brian Gaynor
//      - No changes
//
//    Version 3.3.0		15-Jan-03		Programmer: Brian Gaynor
//      - Wrapped constant _MCDLG_VER so it can be defined outside of
//        this header file
//
//    Version 3.4.0		 2-Jun-03		Programmer: Brian Gaynor
//      - No changes
//
//    Version 3.4.1		31-Oct-03		Programmer: Brian Gaynor
//      - No changes
//
//    Version 3.4.2		 5-Jul-04		Programmer: Brian Gaynor
//      - No changes
//
//    Version 3.5.0		19-Nov-04		Programmer: Brian Gaynor
//      - Renamed to mcdlg_dl.h so the dynamic linking code can more 
//        easily co-exist with the standard headers
//
//    Version 3.5.1		 1-Feb-05		Programmer: Brian Gaynor
//      - No changes
//
//    Version 3.5.2		24-Feb-05		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.0.0		16-Jan-06		Programmer: Brian Gaynor
//      - Converted long int types to int, doesn't effect 32-bit code,
//        sizeof(long int) == sizeof(int), but this will make sure that 
//        parameter sizes don't swell under 64-bit builds
//      - Added MCGetDigitalIOEx(), can return status of 32 digital I/O
//        channels in one call (BR #121).
//
//    Version 4.0.1		27-Mar-06		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.0.2		21-Apr-06		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.0.2		21-Apr-06		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.0.3		17-Nov-06		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.0.4		16-May-07		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.0.5		13-Jul-07		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.1.0		 1-Dec-08		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.1.1		14-Jul-09		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.1.2		25-Sep-09		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.2.0		 1-Apr-10		Programmer: Brian Gaynor
//      - Paths for default INI files are now explicitly set (required
//        for them to work on Windows 7).
//
//    Version 4.3.0		19-Dec-12		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.3.1		XX-Apr-13		Programmer: Brian Gaynor
//      - DLL not found will now return MCERR_NOT_FOUND to differentiate
//        from missing functions which return MCERR_NOT_PRESENT. Missing
//        DLL usually means no API installed (application may want to run
//        in an offline mode), whereas missing functions usually mean the
//        version of the API installed is too old (bug #100201).
//
///////////////////////////////////////////////////////////////////////////

#ifndef MCDLG_DL_H
#define MCDLG_DL_H

#ifndef _MCDLG_VER
  #define _MCDLG_VER 430   		// change this value to limit function pointers
#endif                     		// to an earlier release of MCDLG. For instance,
                           		// if set to "210" only pointers for functions
								// present in MCDLG Ver 2.10 will be declared

//
//  LED Window Class
//
#define LEDM_GETUNCHECKCOLOR    (WM_USER + 0x3000)
#define LEDM_GETCHECKCOLOR      (WM_USER + 0x3001)
#define LEDM_GETINDETRMCOLOR    (WM_USER + 0x3002)
#define LEDM_SETUNCHECKCOLOR    (WM_USER + 0x3003)
#define LEDM_SETCHECKCOLOR      (WM_USER + 0x3004)
#define LEDM_SETINDETRMCOLOR    (WM_USER + 0x3005)

#define MCDLG_LEDCLASS          "MCDLG_LEDWindowClass"

//
//  READOUT Window Class
//
#define RDTM_GETTEXTCOLOR       (WM_USER + 0x3010)
#define RDTM_GETBKCOLOR         (WM_USER + 0x3011)
#define RDTM_SETTEXTCOLOR       (WM_USER + 0x3012)
#define RDTM_SETBKCOLOR         (WM_USER + 0x3013)

#define RDTS_LEFT               0x0000      // same as SS_LEFT
#define RDTS_CENTER             0x0001      // same as SS_CENTER
#define RDTS_RIGHT              0x0002      // same as SS_RIGHT
#define RDTS_DIALOGBOX          0x0008      // replaces SS_USERITEM

#define MCDLG_READOUTCLASS      "MCDLG_ReadoutWindowClass"

//
//  TERMINAL Window Class (used by winctl)
//
#define TLM_RCVCHAR             (WM_USER + 0x3020)
#define TLM_PUTS                (WM_USER + 0x3021)
#define TLM_ECHOS               (WM_USER + 0x3022)
#define TLM_GETECHO             (WM_USER + 0x3023)
#define TLM_SETECHO             (WM_USER + 0x3024)
#define TLM_GETCONNECT          (WM_USER + 0x3025)
#define TLM_SETCONNECT          (WM_USER + 0x3026)
#define TLM_MAKEROOM            (WM_USER + 0x3027)
#define TLM_SETHANDLE           (WM_USER + 0x3028)

#define MCDLG_TERMINALCLASS "MCDLG_TerminalWindowClass"

//
//  MCDLG_RestoreAxis / MCDLG_SaveAxis / MCDLG_ConfigureAxis flags
//
#define MCDLG_PROMPT            0x0001      // save / restore
#define MCDLG_NOMOTION          0x0002      // save / restore / configure
#define MCDLG_NOFILTER          0x0004      // save / restore / configure
#define MCDLG_NOPHASE           0x0008      // save / restore
#define MCDLG_NOPOSITION        0x0010      // save / restore / configure
#define MCDLG_NOSCALE           0x0020      // save / restore
#define MCDLG_NOHARDLIMITS      0x0040      // configure
#define MCDLG_NOSOFTLIMITS      0x0080      // configure
#define MCDLG_NORATES           0x0100      // configure
#define MCDLG_NOPROFILES        0x0200      // save / restore / configure
#define MCDLG_NOMISC            0x0400      // configure
#define MCDLG_CHECKACTIVE       0x0800      // configure / restore

//
//  MCDLG_ControllerDesc / MCDLG_ModuleDesc flags
//
#define MCDLG_NAMEONLY          0x0001
#define MCDLG_DESCONLY          0x0002

#ifdef __cplusplus      		// avoid c++ name mangling
  extern "C" {
#endif 

//
//  Function prototypes
//
extern int (APIENTRY*		MCDLG_AboutBox)(HWND hWnd, LPCSTR title, int BitmapID);
extern LPCSTR (APIENTRY*	MCDLG_CommandFileExt)(int nType, int flags, LPSTR buffer, int length);
extern int (APIENTRY*		MCDLG_ConfigureAxis)(HWND hWnd, HCTRLR hCtlr, WORD wAxis, int flags, LPCSTR title);
extern LPCSTR (APIENTRY*	MCDLG_ControllerDesc)(short int type, LPSTR buffer, int length);
extern LPCSTR (APIENTRY*	MCDLG_ControllerDescEx)(int type, int flags, LPSTR buffer, int length);
extern int (APIENTRY*		MCDLG_ControllerInfo)(HWND hWnd, HCTRLR hCtlr, int flags, LPCSTR title);
extern int (APIENTRY*		MCDLG_DownloadFile)(HWND hWnd, HCTRLR hCtlr, int flags, LPCSTR filename);
extern int (APIENTRY*		MCDLG_Initialize)(void);
extern int (APIENTRY*		MCDLG_ListControllers)(short int IDArray[], short int size);
extern LPCSTR (APIENTRY*	MCDLG_ModuleDesc)(short int type, LPSTR buffer, int length);
extern LPCSTR (APIENTRY*	MCDLG_ModuleDescEx)(int type, int flags, LPSTR buffer, int length);
extern int (APIENTRY*		MCDLG_RestoreAxis)(HCTRLR hCtlr, WORD wAxis, int flags, LPCSTR PrivateIniFile);
extern int (APIENTRY*		MCDLG_RestoreDigitalIO)(HCTRLR hCtlr, WORD wStartChannel, WORD wEndChannel, LPCSTR PrivateIniFile);
extern int (APIENTRY*		MCDLG_SaveAxis)(HCTRLR hCtlr, WORD wAxis, int flags, LPCSTR PrivateIniFile);
extern int (APIENTRY*		MCDLG_SaveDigitalIO)(HCTRLR hCtlr, WORD wStartChannel, WORD wEndChannel, LPCSTR PrivateIniFile);
extern int (APIENTRY*		MCDLG_Scaling)(HWND hWnd, HCTRLR hCtlr, WORD wAxis, int flags, LPCSTR title);
extern short int (APIENTRY*	MCDLG_SelectController)(HWND hWnd, short int CurrentID, int flags, LPCSTR title);

//
//  declared in mcdlg.cpp
//
extern int                MCLoadDialogs(void);

#ifdef __cplusplus
  }
#endif 

#endif			// MCDLG_DL_H
