'****************************************************************************
'                                                                           *
' ewconst.txt - E! API functions, types, and definitions                    *
'                                                                           *
'               Version 2.0                                                 *
'                                                                           *
'               Copyright (c) 1992,1994 MainSoft sarl                       *
'                                                                           *
'****************************************************************************

' Command codes used to identify EW functions from within hook functions

Global Const ew_MFOpen = 201
Global Const ew_MFNew = 202
Global Const ew_MFClone = 203
Global Const ew_MFGet = 204
Global Const ew_MFWrite = 205
Global Const ew_MFAppend = 206
Global Const ew_MFSave = 207
Global Const ew_MFSaveAs = 208
Global Const ew_MFRefresh = 209
Global Const ew_MFGrep = 210
Global Const ew_MFAssociate = 211
Global Const ew_MFCC = 215
Global Const ew_MFPrint = 217
Global Const ew_MFPrintSetup = 218
Global Const ew_MFPageSetup = 219
Global Const ew_MFExitEditor = 221
Global Const ew_MFExit = 222
Global Const ew_MEUndo = 301
Global Const ew_MERedo = 325
Global Const ew_MEClearUndo = 302
Global Const ew_MECut = 304
Global Const ew_MECutAppend = 305
Global Const ew_MECopy = 306
Global Const ew_MECopyAppend = 307
Global Const ew_MEPasteIns = 308
Global Const ew_MEPasteOvr = 309
Global Const ew_MEClear = 311
Global Const ew_MESelectAll = 312
Global Const ew_MEDelete = 314
Global Const ew_MEDraw = 316
Global Const ew_MERecordMac = 318
Global Const ew_MELoadMac = 319
Global Const ew_MESaveMac = 320
Global Const ew_MEReplayMac = 321
Global Const ew_MEReplayMacN = 322
Global Const ew_MEClearMac = 323
Global Const ew_MEAsciiMode = 324

Global Const ew_MBSet = 401
Global Const ew_MBGotoMark1 = 403
Global Const ew_MBGotoMark2 = 404
Global Const ew_MBGotoMark3 = 405
Global Const ew_MBRemoveMark1 = 407
Global Const ew_MBRemoveMark2 = 408
Global Const ew_MBRemoveMark3 = 409
Global Const ew_MBGoto = 411
Global Const ew_MBGotoSel = 412
Global Const ew_MBCompare = 414

Global Const ew_MSFind = 501
Global Const ew_MSRepeatFind = 502
Global Const ew_MSFindWord = 503

Global Const ew_MCCompile = 601
Global Const ew_MCMake = 602
Global Const ew_MCRebuild = 603
Global Const ew_MCDebug = 604
Global Const ew_MCExecute = 605
Global Const ew_MCNext = 607
Global Const ew_MCPrevious = 608
Global Const ew_MCCommands = 610
Global Const ew_MCScan = 612
Global Const ew_MCJumpToDef = 613
Global Const ew_MCEditProject = 614
Global Const ew_MCAddTag = 615

Global Const ew_MLSet = 701
Global Const ew_MLSaveCnf = 702
Global Const ew_MLLoadCnf = 703
Global Const ew_MLAssign = 705
Global Const ew_MLExpansion = 707

Global Const ew_MWRibbon = 801
Global Const ew_MWCustomRibbon = 802
Global Const ew_MWHide = 803
Global Const ew_MWTile = 805
Global Const ew_MWCascade = 806
Global Const ew_MWHideAll = 807
Global Const ew_MWIconizeAll = 808
Global Const ew_MWScrolling = 810
Global Const ew_MWFont = 812
Global Const ew_MWNextEditor = 814
Global Const ew_MWPrevEditor = 815

Global Const ew_MULoadExt = 901
Global Const ew_MUUnloadExt = 902
Global Const ew_MUExecuteExt = 903
Global Const ew_MUAutoLoad = 904
Global Const ew_DefineMenu = 906

Global Const ew_AddTab = 9001
Global Const ew_AlternateHelp = 9086
Global Const ew_BlockShift = 9010
Global Const ew_BeginLine = 9011
Global Const ew_CasePrimUpper = 9012
Global Const ew_CasePrimLower = 9013
Global Const ew_CheckBrace = 9014
Global Const ew_ClearLine = 9015
Global Const ew_DeleteCurLine = 9016
Global Const ew_DeleteEOL = 9017
Global Const ew_DeleteLeftChar = 9018
Global Const ew_DeleteWord = 9019
Global Const ew_EndLine = 9020
Global Const ew_Enter = 9021
Global Const ew_GoNextPar = 9022
Global Const ew_GoNextTab = 9023
Global Const ew_GoPrevPar = 9024
Global Const ew_GoPrevTab = 9025
Global Const ew_InputPause = 9026
Global Const ew_InsertBrace = 9027
Global Const ew_InsertDate = 9028
Global Const ew_InsertFilename = 9029
Global Const ew_InsertTime = 9030
Global Const ew_JoinLine = 9031
Global Const ew_LoadUserFile = 9032
Global Const ew_NextCol = 9041
Global Const ew_NextLine = 9042
Global Const ew_NextWord = 9043
Global Const ew_PageBottom = 9044
Global Const ew_PageTop = 9045
Global Const ew_PageScrollHLeft = 9046
Global Const ew_PageScrollHRight = 9047
Global Const ew_PageScrollVDown = 9048
Global Const ew_PageScrollVUp = 9049
Global Const ew_PrevCol = 9050
Global Const ew_PrevLine = 9051
Global Const ew_PrevWord = 9052
Global Const ew_Reflow = 9054
Global Const ew_RemoveTab = 9055
Global Const ew_SetCurLine2Bottom = 9056
Global Const ew_SetCurLine2Middle = 9057
Global Const ew_SetCurLine2Top = 9058
Global Const ew_ShiftTextRight = 9059
Global Const ew_SplitLine = 9072
Global Const ew_StepScrollDown = 9073
Global Const ew_StepScrollLeft = 9074
Global Const ew_StepScrollRight = 9075
Global Const ew_StepScrollUp = 9076
Global Const ew_StripFlow = 9077
Global Const ew_SumBlock = 9078
Global Const ew_TextBoundBegin = 9079
Global Const ew_TextBoundEnd = 9080
Global Const ew_TextToCursor = 9081
Global Const ew_ToggleIns = 9082
Global Const ew_UpcaseFirst = 9083
Global Const ew_UserBlockSort = 9084
Global Const ew_UserFillBlock = 9085
Global Const ew_RibbonMacro1 = 9088
Global Const ew_RibbonMacro2 = 9089
Global Const ew_RibbonMacro3 = 9090

' Value that should be returned by EWExecute or by a hook if the extension
' failed. Otherwise return 0 or leave the original EW return code unchanged.

Global Const ewerr_EXTFAILED = 300

' Values returned by EWCallUserExt if the extension could not be executed

Global Const ewerr_NOSUCHEXTENSION = 301
Global Const ewerr_NOEXECEXPORTED = 302

' Values that may be returned after execution of an editing function

Global Const ewerr_CANTMOVE = 351     ' The cursor could not be moved as requested
Global Const ewerr_CANTPROCEED = 352  ' The function could not be executed


' Global Flags constants

Global Const EWGlbShow = 1		 ' Show edit window when created
Global Const EWGlbShowWild = 2		 ' Show windows created with wildcards
Global Const EWGlbMinCC = 3		 ' Iconize CC after creating window
Global Const EWGlbReShowCC = 4		 ' Reshow CC after edit window creation
Global Const EWGlbDispShortCuts = 5	 ' Display shortcuts in menus
Global Const EWGlbReplaceSel = 6	 ' Typing replace Selection
Global Const EWGlbAddOnLast = 7 	 ' Insert with down arrow on last line
Global Const EWGlbFormatFrom = 8	 ' Format from current line only
Global Const EWGlbExpansion = 9 	 ' Syntax Expansion enabled
Global Const EWGlbAutoMacros = 10	 ' Auto Macros enabled
Global Const EWGlbEnterClassic = 11	 ' Split line with Enter
Global Const EWGlbInsert = 12		 ' Insert on by default
Global Const EWGlbAutoScroll = 13	 ' Use autoscroll mode
Global Const EWGlbAlarm = 14		 ' Beep on error
Global Const EWGlbLog = 15		 ' Maintain session logging
Global Const EWGlbBak = 16		 ' Create .BAK flags
Global Const EWGlbWarning = 17		 ' Warning before file overwrite
Global Const EWGlbLoadList = 18 	 ' @xxxx.xxx files are lists
Global Const EWGlbAutosaveOpt = 19	 ' Autosave options
Global Const EWGlbAutosave = 20 	 ' Autosave files
Global Const EWGlbDeleteOut = 21	 ' Suppress .ERR file
Global Const EWGlbGrepRegular = 22	 ' Grep uses Boolean Search
Global Const EWGlbGrepAnsi = 23 	 ' Grep uses Ansi charset
Global Const EWGlbGrepCase = 24 	 ' Grep makes a case sensitive search
Global Const EWGlbGrepSubDir = 25	 ' Grep searches in subdirectories
Global Const EWGlbJump = 26		 ' Jump on Home/End
Global Const EWGlbHasScrollbars = 27	 ' Edit Windows have Scrollbars
Global Const EWGlbHasRibbon = 28	 ' Edit Windows have a Ribbon
Global Const EWGlbRepaint = 29		 ' Scroll method
Global Const EWGlbStripJoin = 30	 ' Strip Spaces when joining lines
Global Const EWGlbSaveBefore = 31	 ' Autosave Files before compiling

' New flags

Global Const EWGlbHasQuickList = 32	  ' Ribbon has a QuickList
Global Const EWGlbCompoundWords = 33	  ' - and _ are delimiters
Global Const EWGlbSmartComp = 34	  ' Smart Compare
Global Const EWGlbHilite = 35		  ' Syntax Highlighting is on
Global Const EWGlbUseNoName = 36	  ' Untitled new files
Global Const EWGlbUseAlt = 37		  ' Use Alt key instead of Ctrl key for Drag and copy
Global Const EWGlbMacroRefresh = 38	  ' Refresh screen when replaying macro

' Local Flags constants

Global Const EWLclbBlank = 1		      ' Strip trailing blanks
Global Const EWLclbAutoBack = 2 	      ' Backspace behaviour
Global Const EWLclbAutoTab = 4		      ' Autotab flag
Global Const EWLclbAutoInsert = 5	      ' AutoInsert braces
Global Const EWLclbAutoComp = 6 	      ' AutoCompress tabs
Global Const EWLclbWordWrap = 7 	      ' Wordwrap
Global Const EWLclbJustify = 8		      ' Right justification
Global Const EWLclbLoadAscii = 9	      ' Loaded file supposed to be Ascii file
Global Const EWLclbSaveAscii = 10	       ' Save file in Ascii format
Global Const EWLclbEOF = 11		       ' Add a Ctrl Z at the end of the file
Global Const EWLclbAutoIndent = 12	       ' Auto Indentation

'Global Flags constants

Global Const EWSearchbBackward = 1	     ' Backward search
Global Const EWSearchbBlock = 2 	     ' Search within marked block only
Global Const EWSearchbCase = 3		     ' Case sensitive search
Global Const EWSearchbKeepCase = 4	     ' Keep case type when replacing string
Global Const EWSearchbGlobal = 5	     ' Global Search
Global Const EWSearchbGothru = 6	     ' Replace without prompting
Global Const EWSearchbRegular = 7	     ' Boolean search flag
Global Const EWSearchbWord = 8		     ' Word-only search
Global Const EWSearchbAcross = 9	     ' Search across edited files

' Compile command codes

Global Const EWCompileCommand = 0
Global Const EWMakeCommand = 1
Global Const EWBuildCommand = 2
Global Const EWDebugCommand = 3
Global Const EWExecuteCommand = 4

' Macro string codes

Global Const EWMacro_Time = 0
Global Const EWMacro_Date = 1
Global Const EWMacro_FileName = 2

' Position codes

Global Const EWPosition_Top = 0
Global Const EWPosition_Middle = 1
Global Const EWPosition_Bottom = 2

' Selection modes

Global Const EWSelection_None = 0
Global Const EWSelection_Line = 1
Global Const EWSelection_Stream = 2
Global Const EWSelection_Block = 3

' Write modes for EWWriteBlock

Global Const EWWrite_ReWrite = 1
Global Const EWWrite_Append = 2

Type TSelStruct
  SelType As Integer
  FirstSelLine As Long
  LastSelLine As Long
  StartSelIndex As Long
  EndSelIndex As Long
  FirstSelCol As Integer
  LastSelCol As Integer
End Type

' Editing functions

Declare Function EWAddTab Lib "EWAPI2.DLL" (ByVal col As Integer, ByVal fAdd As Integer) As Integer
Declare Function EWAlternateHelp Lib "EWAPI2.DLL" (ByVal col As Integer, ByVal row As Long) As Integer
Declare Function EWBeginLine Lib "EWAPI2.DLL" (ByVal fSkipToPrev As Integer) As Integer
Declare Function EWBlockShift Lib "EWAPI2.DLL" () As Integer
Declare Function EWBlockSort Lib "EWAPI2.DLL" (ByVal fAscend As Integer) As Integer
Declare Function EWCase Lib "EWAPI2.DLL" (ByVal fUpper As Integer) As Integer
Declare Function EWCheckBrace Lib "EWAPI2.DLL" (ByVal col As Integer, ByVal row As Long) As Integer
Declare Function EWClearLine Lib "EWAPI2.DLL" (ByVal row As Long) As Integer
Declare Function EWExecCompileCommand Lib "EWAPI2.DLL" (ByVal commandindex As Integer) As Integer
Declare Function EWDeleteChar Lib "EWAPI2.DLL" () As Integer
Declare Function EWDeleteCurLine Lib "EWAPI2.DLL" () As Integer
Declare Function EWDeleteEOL Lib "EWAPI2.DLL" () As Integer
Declare Function EWDeleteLeft Lib "EWAPI2.DLL" (ByVal fDeleteCurrent As Integer) As Integer
Declare Function EWDeleteLines Lib "EWAPI2.DLL" (ByVal start As Long, ByVal num As Long) As Integer
Declare Function EWDeleteSelection Lib "EWAPI2.DLL" () As Integer
Declare Function EWDeleteWord Lib "EWAPI2.DLL" () As Integer
Declare Function EWEndLine Lib "EWAPI2.DLL" (ByVal fSkipToNext As Integer, ByVal fStrip As Integer) As Integer
Declare Function EWFillBlock Lib "EWAPI2.DLL" (ch As Integer) As Integer
Declare Function EWGetFile Lib "EWAPI2.DLL" (ByVal FName As String, ByVal row As Long) As Integer
Declare Function EWGotoBookmark Lib "EWAPI2.DLL" (ByVal index As Integer) As Integer
Declare Function EWGotoNextParagraph Lib "EWAPI2.DLL" () As Integer
Declare Function EWGotoNextTab Lib "EWAPI2.DLL" () As Integer
Declare Function EWGotoPrevTab Lib "EWAPI2.DLL" () As Integer
Declare Function EWGotoPrevParagraph Lib "EWAPI2.DLL" () As Integer
Declare Function EWGotoCompileError Lib "EWAPI2.DLL" (ByVal fNext As Integer) As Integer
Declare Function EWGotoLine Lib "EWAPI2.DLL" (ByVal row As Long) As Integer
Declare Function EWGotoXY Lib "EWAPI2.DLL" (ByVal col As Integer, ByVal row As Long) As Integer
Declare Function EWGotoSelection Lib "EWAPI2.DLL" (ByVal fBegin As Integer) As Integer
Declare Function EWInsertBrace Lib "EWAPI2.DLL" (ByVal col As Integer, ByVal row As Long) As Integer
Declare Function EWInsertLines Lib "EWAPI2.DLL" (ByVal start As Long, ByVal num As Long) As Integer
Declare Function EWInsertMacroText Lib "EWAPI2.DLL" (ByVal col As Integer, ByVal row As Long, ByVal macrotype As Integer) As Integer
Declare Function EWJoinLine Lib "EWAPI2.DLL" (ByVal row As Long) As Integer
Declare Function EWLoadUserFile Lib "EWAPI2.DLL" (ByVal col As Integer, ByVal row As Long) As Integer
Declare Function EWNextCol Lib "EWAPI2.DLL" () As Integer
Declare Function EWNextLine Lib "EWAPI2.DLL" () As Integer
Declare Function EWNextWord Lib "EWAPI2.DLL" (ByVal fNext As Integer) As Integer
Declare Function EWTopOfPage Lib "EWAPI2.DLL" (ByVal fTop As Integer) As Integer
Declare Function EWHorzPageScroll Lib "EWAPI2.DLL" (ByVal fLeft As Integer) As Integer
Declare Function EWVerPageScroll Lib "EWAPI2.DLL" (ByVal fUp As Integer) As Integer
Declare Function EWPrevCol Lib "EWAPI2.DLL" () As Integer
Declare Function EWPrevLine Lib "EWAPI2.DLL" () As Integer
Declare Function EWPaste Lib "EWAPI2.DLL" (ByVal fInsert As Integer) As Integer
Declare Function EWReflow Lib "EWAPI2.DLL" (ByVal row As Long) As Integer
Declare Function EWRefresh Lib "EWAPI2.DLL" (ByVal bAsk As Integer) As Integer
Declare Function EWRemoveBookmark Lib "EWAPI2.DLL" (ByVal index As Integer) As Integer
Declare Function EWSaveFile Lib "EWAPI2.DLL" (ByVal FName As String) As Integer
Declare Function EWSelectAll Lib "EWAPI2.DLL" () As Integer
Declare Function EWSetBookmark Lib "EWAPI2.DLL" (ByVal col As Integer, ByVal row As Long) As Integer
Declare Function EWSetClipboard Lib "EWAPI2.DLL" (ByVal fAppend As Integer) As Integer
Declare Function EWPositionCurLine Lib "EWAPI2.DLL" (ByVal position As Integer) As Integer
Declare Function EWShiftTextRight Lib "EWAPI2.DLL" (ByVal col As Integer, ByVal row As Long, ByVal count As Integer) As Integer
Declare Function EWSplitLine Lib "EWAPI2.DLL" (ByVal col As Integer, ByVal row As Long) As Integer
Declare Function EWStepScroll Lib "EWAPI2.DLL" (ByVal dX As Integer, ByVal dY As Long) As Integer
Declare Function EWSumBlock Lib "EWAPI2.DLL" () As Integer
Declare Function EWStripFlow Lib "EWAPI2.DLL" () As Integer
Declare Function EWTopOfText Lib "EWAPI2.DLL" (ByVal fTop As Integer) As Integer
Declare Function EWTextToCurSor Lib "EWAPI2.DLL" () As Integer
Declare Function EWToggleInsert Lib "EWAPI2.DLL" () As Integer
Declare Function EWUpcaseFirst Lib "EWAPI2.DLL" (ByVal col As Integer, ByVal row As Long) As Integer
Declare Function EWWriteBlock Lib "EWAPI2.DLL" (ByVal startrow As Long,ByVal endrow As Long,ByVal startcol As Integer,ByVal endcol As Integer,ByVal FName As String,ByVal mode As Integer,ByVal fBlock As Integer,ByVal fCompress As Integer) As Integer

' Service functions

Declare Function EWBeginSelection Lib "EWAPI2.DLL" (ByVal SelType As Integer, ByVal col As Integer, ByVal row As Long) As Integer
Declare Function EWCallUserExt Lib "EWAPI2.DLL" (ByVal XName As String, ByVal RoutineId As Integer) As Integer
Declare Function EWEditFile Lib "EWAPI2.DLL" (ByVal FName As String) As Long
Declare Function EWEndSelection Lib "EWAPI2.DLL" () As Integer
Declare Function EWFind Lib "EWAPI2.DLL" (MatchLen As Integer, col As Integer) As Long
Declare Function EWFindRegular Lib "EWAPI2.DLL" (ByVal src As String, ByVal dest As String, MatchLen As Integer) As Integer
Declare Function EWGetCaretPosX Lib "EWAPI2.DLL" () As Integer
Declare Function EWGetCaretPosY Lib "EWAPI2.DLL" () As Long
Declare Function EWGetCloneNum Lib "EWAPI2.DLL" () As Integer
Declare Function EWGetCurWord Lib "EWAPI2.DLL" () As Long
Declare Function EWGetCurrentEditor Lib "EWAPI2.DLL" () As Long
Declare Function EWGetFilename Lib "EWAPI2.DLL" (ByVal EditorId As Long) As Long
Declare Function EWGetGlobalFlag Lib "EWAPI2.DLL" (ByVal FlagId As Integer) As Integer
Declare Function EWGetInsertState Lib "EWAPI2.DLL" () As Integer
Declare Function EWGetLineAt Lib "EWAPI2.DLL" (ByVal Linenum As Long) As Long
Declare Function EWGetLineCount Lib "EWAPI2.DLL" () As Long
Declare Function EWGetLocalFlag Lib "EWAPI2.DLL" (ByVal FlagId As Integer) As Integer
Declare Function EWGetSearchFlag Lib "EWAPI2.DLL" (ByVal FlagId As Integer) As Integer
Declare Sub EWGetSelection Lib "EWAPI2.DLL" (Selection As TSelStruct)
Declare Function EWGetTextPosX Lib "EWAPI2.DLL" () As Integer
Declare Function EWGetTextPosY Lib "EWAPI2.DLL" () As Long
Declare Function EWGetVersion Lib "EWAPI2.DLL" () As Integer
Declare Function EWGetWindowHandle Lib "EWAPI2.DLL" () As Integer
Declare Function EWMessageBox Lib "EWAPI2.DLL" (ByVal WndParent As Integer, ByVal Txt As Integer, ByVal Caption As String, TextType As Integer) As Integer
Declare Function EWRepeatFind Lib "EWAPI2.DLL" (MatchLen As Integer) As Long
Declare Function EWSetCurrentEditor Lib "EWAPI2.DLL" (ByVal EditorId As Long) As Long
Declare Sub EWSetFindPattern Lib "EWAPI2.DLL" (ByVal pattern As String)
Declare Function EWSetGlobalFlag Lib "EWAPI2.DLL" (ByVal FlagId As Integer, ByVal value As Integer) As Integer
Declare Function EWSetLineAt Lib "EWAPI2.DLL" (ByVal P As String, ByVal index As Long) As Integer
Declare Function EWSetLocalFlag Lib "EWAPI2.DLL" (ByVal FlagId As Integer, ByVal value) As Integer
Declare Sub EWSetModified Lib "EWAPI2.DLL" ()
Declare Function EWSetSearchFlag Lib "EWAPI2.DLL" (ByVal FlagId As Integer, ByVal value) As Integer
Declare Function EWStopSelection Lib "EWAPI2.DLL" (ByVal col As Integer, ByVal row As Long) As Integer
Declare Function EWUpdateSelection Lib "EWAPI2.DLL" (ByVal col As Integer, ByVal row As Long) As Integer
Declare Sub EWWriteMessage Lib "EWAPI2.DLL" (ByVal message As String)
Declare Function EWGetTextWindowHandle Lib "EWAPI2.DLL" () As Integer
Declare Function EWGetInstance Lib "EWAPI2.DLL" () As Integer
Declare Function EWIsModified Lib "EWAPI2.DLL" () As Integer
Declare Function EWGetEditorLocalFlag Lib "EWAPI2.DLL" (ByVal FlagId) As Integer
Declare Function EWSetEditorLocalFlag Lib "EWAPI2.DLL" (ByVal FlagId As Integer, ByVal value) As Integer
Declare Function EWSaveAll Lib "EWAPI2.DLL" () As Integer

' Please see Technical Note #008 before using these functions
Declare Sub EWSetEditor Lib "EWAPI2.DLL" (ByVal EditorId As Long)
Declare Sub EWSetWindowHandle Lib "EWAPI2.DLL" (ByVal h As Integer)

