////////////////////////////////////////////////////////////////////////////////
// CM2VisInterface.pas
// -------------------
// This unit contains the interface for all the visual interfaces to CoolMon 2.
//
// Last Edit: June, 20th 2006
// Certified: NA
//
// This unit is coded in : Delphi 7
//
// Unit is copyright (c) 2003 - 2006, The CoolMon Project
////////////////////////////////////////////////////////////////////////////////
//
// NOTE
//  You can use whatever interface you feel like, the lower the number the
//  higher compatibility, RCV Min lists what required core version the user
//  needs to run the plugin. (Remember to supply this value in the plugins
//  RequiredCoreVersion function)
//
// What's in what
// ICM2VisPlug  = The first interface it will just let you draw on CM2
// ICM2VisPlug2 = Adding events, however with this interface the events
//                needs to be defined in the CML to work. I recommend you
//                stay clear of this interface. Use 3 or 4 instead
// ICM2VisPlug3 = Events, but no longer needs to be setup in the CML, so they
//                work out of the box.
// ICM2VisPlug4 = Like VisPlug3, but allows you to sent API messages back to
//                CoolMon 2 for advanced processing.
//
////////////////////////////////////////////////////////////////////////////////
unit CM2VISInterface;

interface

Type
 ICM2VisPlug4 = Interface {RCV Min 0.8.0.0}
  ['{AC05B3EA-963D-4F30-91FE-CFCEEB1690EB}']
  // Declare Basics
   Function Name(OUT Name: Pchar): HResult; stdcall;
   Function Version(OUT Version: word): HResult; stdcall; // Uses MMRB Notation
   Function RequiredCoreVersion(OUT RCV: Word): HResult; stdcall; // Uses MMRB Notation - Please refer to CM2Plugtypes for details
  // Declare Error commands
   Function GetLastErrorMsg(OUT Msg: PChar): HResult; stdcall;
  // Declare Info system
   Function GetInfoCount(OUT InfoCount: Integer): HResult; stdcall;
   Function GetInfo(Index: Integer; OUT InfoName: PChar; OUT InfoVar: PChar): HResult; stdcall;
  // Declare Visual Basics
   Function SetDC(CONST NewDC: THandle): HResult; stdcall;
   Function SetDimensions(Left, Top, Width, Height : Integer): HResult; stdcall;
   Function SetConfigString(NewConfigString: PChar): HResult; stdcall;
  // Declare "Event" functions
   Function Redraw(OUT CallBack: PChar): HResult; stdcall;
   Function Update(SensorStyle: Byte; NewString: PChar; NewValue: Double; OUT CallBack: PChar): HResult; stdcall;
   Function Init(PaintDC: THandle): HResult; stdcall;
   Function Terminating: HResult; stdcall;
   Function Setup: HResult; stdcall;
   Function APICallBack(FromCM2: PChar; OUT CallBack: PChar): HResult; stdCall;
  // Declare Support types
   // Default (Required)
   Function GetDefaultCount(OUT DefaultCount: Integer): HResult; stdcall;
   Function GetDefault(Index: Integer; OUT Name: Pchar; OUT Value: PChar; OUT Description: PChar): HResult; stdcall;
   // Optional
   Function GetOptionalCount(OUT OptionalCount: Integer): HResult; stdcall;
   Function GetOptional(Index: Integer; OUT Name: Pchar; OUT Value: PChar; OUT Description: PChar): HResult; stdcall;
   // OnEvent
   Function OnEvent(Sender: Pchar; EventType: Byte; ModKeys: Byte; X, Y: Integer; OUT CallBack: PChar): HResult; stdcall;
   Function NotifyOnEvent(OUT EventList: Cardinal): HResult; stdcall;
 End;
 ICM2VisPlug3 = Interface {RCV Min 0.6.5.0}
  ['{5FB8C3D2-677C-4C36-BDD4-9589481830B0}']
  // Declare Basics
   Function Name(OUT Name: Pchar): HResult; stdcall;
   Function Version(OUT Version: word): HResult; stdcall; // Uses MMRB Notation
   Function RequiredCoreVersion(OUT RCV: Word): HResult; stdcall; // Uses MMRB Notation - Please refer to CM2Plugtypes for details
  // Declare Error commands
   Function GetLastErrorMsg(OUT Msg: PChar): HResult; stdcall;
  // Declare Info system
   Function GetInfoCount(OUT InfoCount: Integer): HResult; stdcall;
   Function GetInfo(Index: Integer; OUT InfoName: PChar; OUT InfoVar: PChar): HResult; stdcall;
  // Declare Visual Basics
   Function SetDC(CONST NewDC: THandle): HResult; stdcall;
   Function SetDimensions(Left, Top, Width, Height : Integer): HResult; stdcall;
   Function SetConfigString(NewConfigString: PChar): HResult; stdcall;
  // Declare "Event" functions
   Function Redraw: HResult; stdcall;
   Function Update(SensorStyle: Byte; NewString: PChar; NewValue: Double): HResult; stdcall;
   Function Init(PaintDC: THandle): HResult; stdcall;
   Function Terminating: HResult; stdcall;
   Function Setup: HResult; stdcall;
  // Declare Support types
   // Default (Required)
   Function GetDefaultCount(OUT DefaultCount: Integer): HResult; stdcall;
   Function GetDefault(Index: Integer; OUT Name: Pchar; OUT Value: PChar; OUT Description: PChar): HResult; stdcall;
   // Optional
   Function GetOptionalCount(OUT OptionalCount: Integer): HResult; stdcall;
   Function GetOptional(Index: Integer; OUT Name: Pchar; OUT Value: PChar; OUT Description: PChar): HResult; stdcall;
   // OnEvent
   Function OnEvent(Sender: Pchar; EventType: Byte; ModKeys: Byte; X, Y: Integer; OUT CallBack: PChar): HResult; stdcall;
   Function NotifyOnEvent(OUT EventList: Cardinal): HResult; stdcall;
 End;
 ICM2VisPlug2 = Interface {RCV Min 0.6.0.0}
  ['{D337B641-BA21-4E6B-9B2E-363155E84041}']
  // Declare Basics
   Function Name(OUT Name: Pchar): HResult; stdcall;
   Function Version(OUT Version: word): HResult; stdcall; // Uses MMRB Notation
   Function RequiredCoreVersion(OUT RCV: Word): HResult; stdcall; // Uses MMRB Notation - Please refer to CM2Plugtypes for details
  // Declare Error commands
   Function GetLastErrorMsg(OUT Msg: PChar): HResult; stdcall;
  // Declare Info system
   Function GetInfoCount(OUT InfoCount: Integer): HResult; stdcall;
   Function GetInfo(Index: Integer; OUT InfoName: PChar; OUT InfoVar: PChar): HResult; stdcall;
  // Declare Visual Basics
   Function SetDC(CONST NewDC: THandle): HResult; stdcall;
   Function SetDimensions(Left, Top, Width, Height : Integer): HResult; stdcall;
   Function SetConfigString(NewConfigString: PChar): HResult; stdcall;
  // Declare "Event" functions
   Function Redraw: HResult; stdcall;
   Function Update(SensorStyle: Byte; NewString: PChar; NewValue: Double): HResult; stdcall;
   Function Init(PaintDC: THandle): HResult; stdcall;
   Function Terminating: HResult; stdcall;
   Function Setup: HResult; stdcall;
  // Declare Support types
   // Default (Required)
   Function GetDefaultCount(OUT DefaultCount: Integer): HResult; stdcall;
   Function GetDefault(Index: Integer; OUT Name: Pchar; OUT Value: PChar; OUT Description: PChar): HResult; stdcall;
   // Optional
   Function GetOptionalCount(OUT OptionalCount: Integer): HResult; stdcall;
   Function GetOptional(Index: Integer; OUT Name: Pchar; OUT Value: PChar; OUT Description: PChar): HResult; stdcall;
   // OnEvent
   Function OnEvent(Sender: Pchar; EventType: Byte; ModKeys: Byte; X, Y: Integer; Var CallBack: PChar): HResult; stdcall;
 End;
 ICM2VisPlug = Interface {RCV Min 0.2.2.0}
  ['{E68EB965-D026-4646-B527-B0B3B11C057A}']
  // Declare Basics
   Function Name(OUT Name: Pchar): HResult; stdcall;
   Function Version(OUT Version: word): HResult; stdcall; // Uses MMRB Notation
   Function RequiredCoreVersion(OUT RCV: Word): HResult; stdcall; // Uses MMRB Notation - Please refer to CM2Plugtypes for details
  // Declare Error commands
   Function GetLastErrorMsg(OUT Msg: PChar): HResult; stdcall;
  // Declare Info system
   Function GetInfoCount(OUT InfoCount: Integer): HResult; stdcall;
   Function GetInfo(Index: Integer; OUT InfoName: PChar; OUT InfoVar: PChar): HResult; stdcall;
  // Declare Visual Basics
   Function SetDC(CONST NewDC: THandle): HResult; stdcall;
   Function SetDimensions(Left, Top, Width, Height : Integer): HResult; stdcall;
   Function SetConfigString(NewConfigString: PChar): HResult; stdcall;
  // Declare "Event" functions
   Function Redraw: HResult; stdcall;
   Function Update(SensorStyle: Byte; NewString: PChar; NewValue: Double): HResult; stdcall;
   Function Init(PaintDC: THandle): HResult; stdcall;
   Function Terminating: HResult; stdcall;
   Function Setup: HResult; stdcall;
  // Declare Support types
   // Default (Required)
   Function GetDefaultCount(OUT DefaultCount: Integer): HResult; stdcall;
   Function GetDefault(Index: Integer; OUT Name: Pchar; OUT Value: PChar; OUT Description: PChar): HResult; stdcall;
   // Optional
   Function GetOptionalCount(OUT OptionalCount: Integer): HResult; stdcall;
   Function GetOptional(Index: Integer; OUT Name: Pchar; OUT Value: PChar; OUT Description: PChar): HResult; stdcall;
 End;

Const
 // EventType
 et_Unknown          = 0;
 et_DblClick         = 1;
 et_MouseDownLeft    = 2;
 et_MouseDownMiddle  = 3;
 et_MouseDownRight   = 4;
 et_MouseUpLeft      = 5;
 et_MouseUpMiddle    = 6;
 et_MouseUpRight     = 7;
 et_MouseWheelAny    = 8;
 et_MouseWheelUp     = 9;
 et_MouseWheelDown   = 10;
 et_MouseMove        = 11;
 // ModKeys
 mkUnknown          = 0;
 mkNone             = 1;
 mkShift            = 2;
 mkAlt              = 3;
 mkCtrl             = 4;
 mkAltShift         = 5;
 mkAltCtrl          = 6;
 mkCtrlShift        = 7;
 mkAltCtrlShift     = 8;
 mkAny              = 9;
 // Notify On Event (Modkeys are excluded here)
 noeNone            = 0;
 noeDblClick        = 1;
 noeMouseDownLeft   = 2;
 noeMouseDownRight  = 4;
 noeMouseDownMiddle = 8;
 noeMouseUpLeft     = 16;
 noeMouseUpRight    = 32;
 noeMouseUpMiddle   = 64;
 noeMouseWheelAny   = 128;
 noeMouseWheelUp    = 256;
 noeMouseWheelDown  = 512;
 noeMouseMove       = 1024;

implementation

end.
 