///////////////////////////////////////////////////////////////////////////////
//
// LIBTOOL.H  
//
////////////////////////////////////////////////////////////////////////////////
#ifndef __LIBTOOL_H
#define __LIBTOOL_H

#ifndef __LTDEFINE_H
#include "ltdefine.h"
#endif


interface IObject2DNotifyResult;

#define LIB_FUNC WINAPI
////////////////////////////////////////////////////////////////////////////////
//
//  " ". LT_GRDLG
//
////////////////////////////////////////////////////////////////////////////////
#ifndef __LT_GRDLG_H
#include "LT_GrDlg.h"
#endif

////////////////////////////////////////////////////////////////////////////////
//
//  " " LT_Edit.h
//
////////////////////////////////////////////////////////////////////////////////
#ifndef __LT_EDIT_H
#include "LT_Edit.h"
#endif

////////////////////////////////////////////////////////////////////////////////
//
//  " ". LT_MODEL.h
//
////////////////////////////////////////////////////////////////////////////////
#ifndef __LT_MODEL_H
#include "LT_Model.h"
#endif

////////////////////////////////////////////////////////////////////////////////
//
//  LT_Math.h
//
////////////////////////////////////////////////////////////////////////////////
#ifndef __LT_MATH_H
#include "LT_Math.h"
#endif

////////////////////////////////////////////////////////////////////////////////
//
//   . LT_Attr.h
//
////////////////////////////////////////////////////////////////////////////////
#ifndef __LT_ATTR_H
#include "LT_Attr.h"
#endif

////////////////////////////////////////////////////////////////////////////////
//
//    LT_Spc.h
//
////////////////////////////////////////////////////////////////////////////////
#ifndef __LT_SPC_H
#include "LT_Spc.h"
#endif


extern "C" {

// ----------------------------------------------------------------------------
//   - 2 
//-----------------------------------------------------------------------------
//    .
//-----------------------------------------------------------------------------
int     LIB_FUNC  ReturnResult();


//   - 3
//-----------------------------------------------------------------------------
//    ,    .
//-----------------------------------------------------------------------------
int     LIB_FUNC  ResultNULL();


//   - 4
//-----------------------------------------------------------------------------
//   ,    .
//-----------------------------------------------------------------------------
void    LIB_FUNC  StrResult( LPSTR str,     //  
                             int   limit ); //   str


//   - 791
//-----------------------------------------------------------------------------
//   ,    .
// (Unicode)
//-----------------------------------------------------------------------------
void    LIB_FUNC  StrResultW( LPWSTR str,     //  
                              int    limit ); //   str

#ifdef _UNICODE
#define StrResultT  StrResultW
#else
#define StrResultT  StrResult
#endif // !_UNICODE



//   - 6
//-----------------------------------------------------------------------------
//     (HWND).
//-----------------------------------------------------------------------------
void  * LIB_FUNC  GetHWindow();

//-----------------------------------------------------------------------------
//   (HWND)       Parent  
//    Borland ++ 5.
//-----------------------------------------------------------------------------
void  * LIB_FUNC  GetParentHWindow();

//   - 386
//------------------------------------------------------------------------------
//     
// ---
unsigned long LIB_FUNC ksGetWorkWindowColor();

//   - 124
//-----------------------------------------------------------------------------
//     OWL.    TValidator.
//-----------------------------------------------------------------------------
void  * LIB_FUNC  GetValidator( void *min, void *max, //  
                                unsigned char type ); // 1-char 2-int 3-long 4-float 5-double


//   - 142
//-----------------------------------------------------------------------------
//         .
//-----------------------------------------------------------------------------
void    LIB_FUNC  EnableTaskAccess( int enable ); // 0-, 1-

//   - 142
//-----------------------------------------------------------------------------
//   ( 1 )  ( 0 )      .
//-----------------------------------------------------------------------------
int LIB_FUNC IsEnableTaskAccess();

//   - 238
//-----------------------------------------------------------------------------
//   ,     .
//-----------------------------------------------------------------------------
void    LIB_FUNC  PumpWaitingMessages();

//   - 260
//------------------------------------------------------------------------------
//    
//    Cursor, Placement    
//        
// ---
int  LIB_FUNC ksSetCriticalProcess();

//   - 141
//-----------------------------------------------------------------------------
//         .
//          
// CommandWindowCallBack.
//        NULL,   
// CommandWindow  ,     
//   .      .
//     ,    
//      FALSE.    -1.
//    commands      4.X,
//  "!_1 !_2 ..."
//         (  1),
// ..   "_1"  1.
//    commands   ,   
//     .
//-----------------------------------------------------------------------------
int     LIB_FUNC  CommandWindow( RequestInfo *info ); //   

//   - 906
//-----------------------------------------------------------------------------
//         .
//          
// CommandWindowCallBackW.
//        NULL,   
// CommandWindowW  ,     
//   .      .
//     ,    
//      FALSE.    -1.
//    commands      4.X,
//  "!_1 !_2 ..."
//         (  1),
// ..   "_1"  1.
//    commands   ,   
//     . (Unicode)
//-----------------------------------------------------------------------------
int     LIB_FUNC  CommandWindowW( RequestInfoW *info ); //   

#ifdef _UNICODE
#define CommandWindowT  CommandWindowW
#else
#define CommandWindowT  CommandWindow
#endif // !UNICODE


//   - 17
//-----------------------------------------------------------------------------
//      .
//       
//    CursorCallBack.
//-----------------------------------------------------------------------------
int     LIB_FUNC  Cursor( RequestInfo *info,      //   
												  double *x ,double *y,   //   
													void        *phantom ); //    


//   - 744
//-----------------------------------------------------------------------------
// [11/6/2004]
//      .
//       
//    CursorCallBack.
//-----------------------------------------------------------------------------
int     LIB_FUNC  CursorEx( RequestInfo *info,      //   
												    double *x ,double *y,   //   
													  void   *phantom,        //    
                            LPUNKNOWN processParam ); //  
                            

//   - 908
//-----------------------------------------------------------------------------
// [05/07/2007]
//      .
//       
//    CursorCallBackW. (Unicode)
//-----------------------------------------------------------------------------
int     LIB_FUNC  CursorExW( RequestInfoW *info,      //   
												     double *x ,double *y,   //   
													   void   *phantom,        //    
                             LPUNKNOWN processParam ); //  
 
#ifdef _UNICODE
#define CursorExT  CursorExW
#else
#define CursorExT  CursorEx
#endif // !UNICODE


//   - 18
//------------------------------------------------------------------------------
//        .
//       
//    PlacementCallBack.
//------------------------------------------------------------------------------
int     LIB_FUNC  Placement( RequestInfo *info,      //   
														 double *x, double *y,   //   
														 double      *angle,     //   
														 void        *phantom ); //    



//   - 745
//------------------------------------------------------------------------------
// [11/6/2004]
//        .
//       
//    PlacementCallBack.
//------------------------------------------------------------------------------
int LIB_FUNC PlacementEx( RequestInfo *info,         //            
                          double *x, double *y,      //     
                          double *angl,              //        
                          void * phantom ,           //     
                          LPUNKNOWN processParam );  //  ) {     


//   - 910
//------------------------------------------------------------------------------
// [05/07/2007]
//        .
//       
//    PlacementCallBackW. (Unicode)
//------------------------------------------------------------------------------
int LIB_FUNC PlacementExW( RequestInfoW *info,         //            
                           double *x, double *y,      //     
                           double *angl,              //        
                           void * phantom ,           //     
                           LPUNKNOWN processParam );  //  ) {     

#ifdef _UNICODE
#define PlacementExT  PlacementExW
#else
#define PlacementExT  PlacementEx
#endif // !UNICODE


//   - 165
//-----------------------------------------------------------------------------
//    Cursor  Placement     
//   .       Cursor 
// Placement.       
//  .
//      Cursor    Cursor  
//  .
//  -  0 -  ,
//    0 -   Cursor  Placement.   Esc.
//   ,   ,    
// Cursor  Placement,     ,  
// Cursor  Placement.
//-----------------------------------------------------------------------------
int     LIB_FUNC  ksChangeObjectInLibRequest( RequestInfo *info,     //        
                                              void        *phantom); //    


//   - 911
//-----------------------------------------------------------------------------
//    CursorExW  PlacementExW     
//   .       CursorExW 
// PlacementExW.       
//  .
//      CursorExW    CursorExW  
//  .
//  -  0 -  ,
//    0 -   CursorExW  PlacementExW.   Esc.
//   ,   ,    
// CursorExW  PlacementExW,     ,  
// CursorExW  PlacementExW. (Unicode)
//-----------------------------------------------------------------------------
int     LIB_FUNC  ksChangeObjectInLibRequestW( RequestInfoW *info,     //        
                                               void        *phantom); //    

#ifdef _UNICODE
#define ksChangeObjectInLibRequestT  ksChangeObjectInLibRequestW
#else
#define ksChangeObjectInLibRequestT  ksChangeObjectInLibRequest
#endif // !UNICODE


//   - 166
//-----------------------------------------------------------------------------
// :     ,    
// (Cursor  Placement).
//  1   , 0 - .
//-----------------------------------------------------------------------------
int LIB_FUNC  ksIsCursorOrPlacementDocument( );

//   - 387
//         .
//      -1,    ,  0,
//     1.
// ---
int LIB_FUNC ksIsActiveProcessRunnig ();


//   - 171
//-----------------------------------------------------------------------------
// (show=0)  (show=1) 
//-----------------------------------------------------------------------------
int LIB_FUNC  ksPhantomShowHide( unsigned char show );

//   - 244
//--------------------------------------------------------------------------
//   
//   1 -   ,
// 0 -       .
//--------------------------------------------------------------------------
int LIB_FUNC ksGetCursorPosition( double *x,     //    ,
                                  double *y,
                                  int     type );// type -    :
                                                 // 0 -    1 -   ,

//   - 19
//------------------------------------------------------------------------------
//    .
//   (. LtDefine.h):
// scsSTOPPED_FOR_MENU_COMMAND      ( 1)    "  ".
// scsSTOPPED_FOR_SYSTEM_STOP       ( 0)   .
// scsSTOPPED_FOR_ITSELF            (-1)   SystemControlStop - .
// scsSTOPPED_FOR_START_THIS_LIB    (-2)       .
// scsSTOPPED_FOR_START_ANOTHER_LIB (-3)      .
//------------------------------------------------------------------------------
int LIB_FUNC  SystemControlStart( char *menuCommand ); //   ,
                                                       //    
                                                       //   

//   - 912
//------------------------------------------------------------------------------
//    .
//   (. LtDefine.h):
// scsSTOPPED_FOR_MENU_COMMAND      ( 1)    "  ".
// scsSTOPPED_FOR_SYSTEM_STOP       ( 0)   .
// scsSTOPPED_FOR_ITSELF            (-1)   SystemControlStop - .
// scsSTOPPED_FOR_START_THIS_LIB    (-2)       .
// scsSTOPPED_FOR_START_ANOTHER_LIB (-3)      .
// (Unicode)
//------------------------------------------------------------------------------
int LIB_FUNC  SystemControlStartW( LPWSTR menuCommand ); //   ,
                                                       //    
                                                       //   

#ifdef _UNICODE
#define SystemControlStartT  SystemControlStartW
#else
#define SystemControlStartT  SystemControlStart
#endif // !UNICODE


//   - 20
//-----------------------------------------------------------------------------
//    .
//-----------------------------------------------------------------------------
void    LIB_FUNC  SystemControlStop();


//   - 753
//-----------------------------------------------------------------------------
// 28.12.04
//   SystemControlStart  
//                                  ( 0) -   
// scsSTOPPED_FOR_ITSELF            (-1) -   SystemControlStop,     
// scsSTOPPED_FOR_START_THIS_LIB    (-2) -   ,    SystemControlStart
// scsSTOPPED_FOR_START_THIS_LIB    (-3) -    , 
//                                  (-4) - 
// ---
int  LIB_FUNC ksGetSystemControlStartResult();

//   - 21
// ----------------------------------------------------------------------------
//   
// ----------------------------------------------------------------------------
int     LIB_FUNC  KeepReference( reference r ); //    


//   - 125
//-----------------------------------------------------------------------------
//    ,    ,     .
//       .
//  bufLen    - newName  .
//-----------------------------------------------------------------------------
unsigned int  LIB_FUNC  FullFileName( LPSTR oldName,   //   
                                      LPSTR newName,   //     
                                      unsigned int bufLen ); //    newName


//   - 803
//-----------------------------------------------------------------------------
//    ,    ,     .
//       .
//  bufLen    - newName  . (Unicode)
//-----------------------------------------------------------------------------
unsigned int  LIB_FUNC  FullFileNameW( LPWSTR oldName,   //   
                                       LPWSTR  newName,   //     
                                       unsigned int bufLen ); //    newName

#ifdef _UNICODE
#define FullFileNameT  FullFileNameW
#else
#define FullFileNameT  FullFileName
#endif // !UNICODE


//   - 128
//-----------------------------------------------------------------------------
//         .
//-----------------------------------------------------------------------------
unsigned int  LIB_FUNC  UniqueFileName( char        *buff,      //     
                                        unsigned int bufSize ); //   buff


//   - 913
//-----------------------------------------------------------------------------
//         . (Unicode)
//-----------------------------------------------------------------------------
unsigned int  LIB_FUNC  UniqueFileNameW( LPWSTR       buff,      //     
                                         unsigned int bufSize ); //   buff

#ifdef _UNICODE
#define UniqueFileNameT  UniqueFileNameW
#else
#define UniqueFileNameT  UniqueFileName
#endif // !UNICODE


//   - 129
//-----------------------------------------------------------------------------
//   .
//-----------------------------------------------------------------------------
void LIB_FUNC RemoveUniqueFile( char *fileName );


//   - 914
//-----------------------------------------------------------------------------
//   . (Unicode)
//-----------------------------------------------------------------------------
void LIB_FUNC RemoveUniqueFileW( LPWSTR fileName );


#ifdef _UNICODE
#define RemoveUniqueFileT  RemoveUniqueFileW
#else
#define RemoveUniqueFileT  RemoveUniqueFile
#endif // !UNICODE


//   - 134
//-----------------------------------------------------------------------------
unsigned int  LIB_FUNC  GetRightFileName( char        *fileName,  //    
                                          unsigned int bufSize ); //    fileName

//   - 915
//-----------------------------------------------------------------------------
unsigned int  LIB_FUNC  GetRightFileNameW( LPWSTR       fileName,  //    
                                           unsigned int bufSize ); //    fileName

#ifdef _UNICODE
#define GetRightFileNameT  GetRightFileNameW
#else
#define GetRightFileNameT  GetRightFileName
#endif // !UNICODE


//   - 163
//---------------------------------------------------------------------------
//      
//       4 
//---------------------------------------------------------------------------
double  LIB_FUNC GetTextLength( char * text,            // 
                                unsigned short style ); // , style ==0    

//   - 916
//---------------------------------------------------------------------------
//      
//       4  (Unicode)
//---------------------------------------------------------------------------
double  LIB_FUNC GetTextLengthW( LPWSTR text,            // 
                                 unsigned short style ); // , style ==0    

#ifdef _UNICODE
#define GetTextLengthT  GetTextLengthW
#else
#define GetTextLengthT  GetTextLength
#endif // !UNICODE


//   - 173
//---------------------------------------------------------------------------
//      
//---------------------------------------------------------------------------
double  LIB_FUNC GetTextLengthFromReference( reference pText );  //-    ""

//   - 194
//------------------------------------------------------------------------------------------------
//       (   ltdefine.h)
//  sptSYSTEM_FILES 	-      
//  sptLIBS_FILES 		-      
//  sptTEMP_FILES 	  -       
//  sptCONFIG_FILES 	-       
//  sptINI_FILE 	    -    INI- 
//   buff   NULL  sizeBuff       
//  (  0),    
//        
//      '\' (    
//   - "<drive>:\")
//------------------------------------------------------------------------------------------------
int LIB_FUNC ksSystemPath( char *buff, int sizeBuff, int pathType );

//   - 917
//------------------------------------------------------------------------------------------------
//       (   ltdefine.h)
//  sptSYSTEM_FILES 	-      
//  sptLIBS_FILES 		-      
//  sptTEMP_FILES 	  -       
//  sptCONFIG_FILES 	-       
//  sptINI_FILE 	    -    INI- 
//   buff   NULL  sizeBuff       
//  (  0),    
//        
//      '\' (    
//   - "<drive>:\") (Unicode)
//------------------------------------------------------------------------------------------------
int LIB_FUNC ksSystemPathW( LPWSTR buff, int sizeBuff, int pathType );

#ifdef _UNICODE
#define ksSystemPathT  ksSystemPathW
#else
#define ksSystemPathT  ksSystemPath
#endif // !UNICODE


//   - 200
//------------------------------------------------------------------------------------------------
//            
//       (   <ltdefine.h>)
//  sptSYSTEM_FILES 	-    
//  sptLIBS_FILES 		-    
//  sptTEMP_FILES 	  -     
//  sptCONFIG_FILES 	-     
//  sptINI_FILE 	    -    INI- 
//------------------------------------------------------------------------------------------------
void LIB_FUNC ksGetRelativePathFromSystemPath( char *sourcePath,  //   
                                               char *destBuff,    //()    (    )
                                               int sizeDestBuff,  // 
                                               int pathType );    //   . ksSystemPath

//   - 918
//------------------------------------------------------------------------------------------------
//            
//       (   ltdefine.h)
//  sptSYSTEM_FILES 	-    
//  sptLIBS_FILES 		-    
//  sptTEMP_FILES 	  -     
//  sptCONFIG_FILES 	-     
//  sptINI_FILE 	    -    INI- 
//  (Unicode)
//------------------------------------------------------------------------------------------------
void LIB_FUNC ksGetRelativePathFromSystemPathW( LPWSTR sourcePath,  //   
                                                LPWSTR destBuff,    //()    (    )
                                                int sizeDestBuff,  // 
                                                int pathType );    //   . ksSystemPath
#ifdef _UNICODE
#define ksGetRelativePathFromSystemPathT  ksGetRelativePathFromSystemPathW
#else
#define ksGetRelativePathFromSystemPathT  ksGetRelativePathFromSystemPath
#endif // !UNICODE


//   - 201
//------------------------------------------------------------------------------------------------
//            
//       (   ltdefine.h)
//  sptSYSTEM_FILES 	-    
//  sptLIBS_FILES 		-    
//  sptTEMP_FILES 	  -     
//  sptCONFIG_FILES 	-     
//  sptINI_FILE 	    -    INI- 
//------------------------------------------------------------------------------------------------
void LIB_FUNC ksGetFullPathFromSystemPath( char *relativePath, //    (    )
                                           char *destBuff,     // ()    
                                           int sizeDestBuff,   //  
                                           int pathType );     //    . ksSystemPath

//   - 919
//------------------------------------------------------------------------------------------------
//            
//       (   ltdefine.h)
//  sptSYSTEM_FILES 	-    
//  sptLIBS_FILES 		-    
//  sptTEMP_FILES 	  -     
//  sptCONFIG_FILES 	-     
//  sptINI_FILE 	    -    INI- 
//  (Unicode)
//------------------------------------------------------------------------------------------------
void LIB_FUNC ksGetFullPathFromSystemPathW( LPWSTR relativePath, //    (    )
                                            LPWSTR destBuff,     // ()    
                                            int sizeDestBuff,   //  
                                            int pathType );     //    . ksSystemPath

#ifdef _UNICODE
#define ksGetFullPathFromSystemPathT  ksGetFullPathFromSystemPathW
#else
#define ksGetFullPathFromSystemPathT  ksGetFullPathFromSystemPath
#endif // !UNICODE


//   - 202
//------------------------------------------------------------------------------------------------
//            
//      
//------------------------------------------------------------------------------------------------
void LIB_FUNC ksGetRelativePathFromFullPath( char *mainFilePath,  //    
                                             char *sourcePath,    //    
                                             char *destBuff,      //()     (        )
                                             int sizeDestBuff );  //  
//   - 920
//------------------------------------------------------------------------------------------------
//            
//       (Unicode)
//------------------------------------------------------------------------------------------------
void LIB_FUNC ksGetRelativePathFromFullPathW( LPWSTR mainFilePath,  //    
                                              LPWSTR sourcePath,    //    
                                              LPWSTR destBuff,      //()     (        )
                                              int sizeDestBuff );  //  

#ifdef _UNICODE
#define ksGetRelativePathFromFullPathT  ksGetRelativePathFromFullPathW
#else
#define ksGetRelativePathFromFullPathT  ksGetRelativePathFromFullPath
#endif // !UNICODE


//   - 203
//------------------------------------------------------------------------------------------------
//            
//      
//------------------------------------------------------------------------------------------------
void LIB_FUNC ksGetFullPathFromRelativePath( char *mainFilePath,    //    
                                             char *relativePath,    //    (        )
                                             char *destBuff,        //()     
                                             int sizeDestBuff );    //  

//   - 921
//------------------------------------------------------------------------------------------------
//            
//       (Unicode)
//------------------------------------------------------------------------------------------------
void LIB_FUNC ksGetFullPathFromRelativePathW( LPWSTR mainFilePath,    //    
                                              LPWSTR relativePath,    //    (        )
                                              LPWSTR destBuff,        //()     
                                              int sizeDestBuff );    //  

#ifdef _UNICODE
#define ksGetFullPathFromRelativePathT  ksGetFullPathFromRelativePathW
#else
#define ksGetFullPathFromRelativePathT  ksGetFullPathFromRelativePath
#endif // !UNICODE


//   - 204
//------------------------------------------------------------------------------------------------
//    
//   :
//    5.4 Release 2 Build 1
//  iMajor   = 5
//  iMinor   = 4
//  iRelease = 2
//  iBuild   = 1
//        0,   
//   
//      
//------------------------------------------------------------------------------------------------
unsigned long LIB_FUNC ksGetSystemVersion( int *iMajor,    //  
																	int *iMinor,    //  
                                  int *iRelease,  //    
                                  int *iBuild );  //    

                                  
//   - 205
//------------------------------------------------------------------------------
//     INI-    Registry
//   lpReturnedString = 0  iSize = 0,     ,
//   -     (   0)
//     = 0,          INI-,
//    Registry
//   :
//  lpSection = "Directories"
//  lpKey     = "Sys"
//   :
//  lpReturnedString = "c:\Program Files\Kompas54\Sys"
//  iSize            = 29
// ---
int LIB_FUNC ksGetSystemProfileString( char *lpSection,        //  
																			 char *lpKey,            //  
                                       char *lpReturnedString, //    
                                       int   iSize );          //  

//   - 922
//------------------------------------------------------------------------------
//     INI-    Registry
//   lpReturnedString = 0  iSize = 0,     ,
//   -     (   0)
//     = 0,          INI-,
//    Registry
//   :
//  lpSection = "Directories"
//  lpKey     = "Sys"
//   :
//  lpReturnedString = "c:\Program Files\Kompas54\Sys"
//  iSize            = 29
//  (Unicode)
// ---
int LIB_FUNC ksGetSystemProfileStringW( LPWSTR lpSection,        //  
																			  LPWSTR lpKey,            //  
                                        LPWSTR lpReturnedString, //    
                                        int   iSize );          //  

#ifdef _UNICODE
#define ksGetSystemProfileStringT  ksGetSystemProfileStringW
#else
#define ksGetSystemProfileStringT  ksGetSystemProfileString
#endif // !UNICODE


//   - 362
//------------------------------------------------------------------------------
//    
//   ::WinHelp
//       .   
//    
// ---
void  LIB_FUNC ksOpenHelpFile( char        *file,    //   help-
                               unsigned int command, //  help
                               unsigned int id );    //   

//   - 923
//------------------------------------------------------------------------------
//    
//   ::WinHelp
//       .   
//     (Unicode)
// ---
void  LIB_FUNC ksOpenHelpFileW( LPWSTR       file,    //   help-
                                unsigned int command, //  help
                                unsigned int id );    //   

#ifdef _UNICODE
#define ksOpenHelpFileT  ksOpenHelpFileW
#else
#define ksOpenHelpFileT  ksOpenHelpFile
#endif // !UNICODE


//   - 366
//------------------------------------------------------------------------------
//   
// DIMENTION_OPTIONS    -  param ->  DimensionsOptions
// ARROWFILLING_OPTIONS -  param -> int  1-   0-  
// SHEET_OPTIONS        -  param ->  SheetPar   
// LENGTHUNITS_OPTIONS  -  param -> short ST_MIX_MM - , ST_MIX_SM - , ST_MIX_M - 
// ---
int LIB_FUNC  GetDocOptions( int   optionsType,//   (    
                             void *param,      //    
                             int   sizePar );  //   


//   - 705
//------------------------------------------------------------------------------
//   
// DIMENTION_OPTIONS    -  param ->  DimensionsOptions
// ARROWFILLING_OPTIONS -  param -> int  1-   0-  
// SHEET_OPTIONS        -  param ->  SheetPar   
// LENGTHUNITS_OPTIONS  -  param -> short ST_MIX_MM - , ST_MIX_SM - , ST_MIX_M - 
// ---
int LIB_FUNC  SetDocOptions( int   optionsType,//  
														 void *param,      //    
                             int   sizePar );  //   


//   - 382
//------------------------------------------------------------------------------
//   
// * param -    
// sizePar -   
// optionsType -   (    )
//    1     0   
// ---
int LIB_FUNC  ksSetSysOptions( int optionsType, void *param, int sizePar );


//   - 383
//------------------------------------------------------------------------------
//   
// * param -    
// sizePar -   
// optionsType -   (    )
//    1     0   
// ---
int LIB_FUNC  ksGetSysOptions( int optionsType, void *param, int sizePar );


//   - 412
//------------------------------------------------------------------------------
//    
// fileName -        LIBS
// ---
int LIB_FUNC  ksExecuteLibraryCommand( char *fileName, int command );


//   - 924
//------------------------------------------------------------------------------
//    
// fileName -        LIBS
// (Unicode)
// ---
int LIB_FUNC  ksExecuteLibraryCommandW( LPWSTR fileName, int command );

#ifdef _UNICODE
#define ksExecuteLibraryCommandT  ksExecuteLibraryCommandW
#else
#define ksExecuteLibraryCommandT  ksExecuteLibraryCommand
#endif // !UNICODE


//   - 434
//------------------------------------------------------------------------------
//    :      
//  1 -    0 - 
//         LIBS
//      *.rtw (API), *.lfr(), *.l3d(3D  ) 
// ---
int LIB_FUNC ksIsLibraryEnabled( char * libName );//  


//   - 925
//------------------------------------------------------------------------------
//    :      
//  1 -    0 - 
//         LIBS
//      *.rtw (API), *.lfr(), *.l3d(3D  ) 
//  (Unicode)
// ---
int LIB_FUNC ksIsLibraryEnabledW( LPWSTR libName );//  

#ifdef _UNICODE
#define ksIsLibraryEnabledT  ksIsLibraryEnabledW
#else
#define ksIsLibraryEnabledT  ksIsLibraryEnabled
#endif // !UNICODE


//   - 420
//------------------------------------------------------------------------------
//  
// name -  ; dimValue -  ; high, low - ;
// inMM = 1 - dimValue, high, low -  , 0 -     
// ---
int LIB_FUNC  ksGetQualityDefects( const char* name, double  dimValue,
                                   double*     high, double* low,
                                   unsigned char  inMM );

//   - 926
//------------------------------------------------------------------------------
//  
// name -  ; dimValue -  ; high, low - ;
// inMM = 1 - dimValue, high, low -  , 0 -     
// (Unicode)
// ---
int LIB_FUNC  ksGetQualityDefectsW( LPCWSTR name, double  dimValue,
                                    double*     high, double* low,
                                    unsigned char  inMM );

#ifdef _UNICODE
#define ksGetQualityDefectsT  ksGetQualityDefectsW
#else
#define ksGetQualityDefectsT  ksGetQualityDefects
#endif // !UNICODE


//   - 421
//------------------------------------------------------------------------------
//    
// system - 1 -  , 0 -  
// withLimitation - 0 -   , 1 -    
//  
//      0    
// ---
reference LIB_FUNC  ksCreateQualityIterator( unsigned char system, unsigned char withLimitation );

//   - 422
//------------------------------------------------------------------------------
//   
// ch = 'F' - , ch = 'N' - 
// inMM = 1  - minLimit, maxLimit, high, low -  ,
//        0 -     
// ---
int LIB_FUNC  ksMoveQualityIterator( reference iterator, QualityContensParam* param,
                                     unsigned char inMM, unsigned char ch );

//   - 927
//------------------------------------------------------------------------------
//   
// ch = 'F' - , ch = 'N' - 
// inMM = 1  - minLimit, maxLimit, high, low -  ,
//        0 -      
// (Unicode)
// ---
int LIB_FUNC  ksMoveQualityIteratorW( reference iterator, QualityContensParamW* param,
                                     unsigned char inMM, unsigned char ch );

#ifdef _UNICODE
#define ksMoveQualityIteratorT  ksMoveQualityIteratorW
#else
#define ksMoveQualityIteratorT  ksMoveQualityIterator
#endif // !UNICODE


//   - 423
//------------------------------------------------------------------------------
//  
// name -  
// inMM = 1  - minLimit, maxLimit, high, low -  ,
//        0 -     
// ---
int LIB_FUNC  ksGetQualityContensParam( char* name, QualityContensParam* param,
                                        unsigned char inMM );

//   - 928
//------------------------------------------------------------------------------
//  
// name -  
// inMM = 1  - minLimit, maxLimit, high, low -  ,
//        0 -     
// (Unicode)
// ---
int LIB_FUNC  ksGetQualityContensParamW( LPWSTR name, QualityContensParamW* param,
                                        unsigned char inMM );

#ifdef _UNICODE
#define ksGetQualityContensParamT  ksGetQualityContensParamW
#else
#define ksGetQualityContensParamT  ksGetQualityContensParam
#endif // !UNICODE


//   - 424
//------------------------------------------------------------------------------
//    ,    dimValue   
//  
// names -    
// dimValue, high, low -   
// system - 1 -  , 0 -  
// withLimitation - 0 -   , 1 -    
//  
// ---
int LIB_FUNC  ksGetQualityNames( reference names, double dimValue, double high, double low,
                                 unsigned char system, unsigned char withLimitation );

//   - 268
//------------------------------------------------------------------------------
//   
//    ,   SystemControlStart -   
// .
//        Dll ,
//    ,     LibraryName().
//   1,     - ,  
//   .   0 -       
//      ,    
// ---
int  LIB_FUNC ksSetCurrentLibrary( char * libname, long hModule );


//   - 929
//------------------------------------------------------------------------------
//   
//    ,   SystemControlStart -   
// .
//        Dll ,
//    ,     LibraryName().
//   1,     - ,  
//   .   0 -       
//      ,    
// (Unicode)
// ---
int  LIB_FUNC ksSetCurrentLibraryW( LPWSTR libname, long hModule );

#ifdef _UNICODE
#define ksSetCurrentLibraryT  ksSetCurrentLibraryW
#else
#define ksSetCurrentLibraryT  ksSetCurrentLibrary
#endif // !UNICODE


//   - 425
//------------------------------------------------------------------------------
// 15.01.04 -  ,   ksConvertLangStrEx
//   src  dst     
// ---
int LIB_FUNC  ksConvertLangStr( LPSTR src, LPSTR dst, int dstMaxLen );

//   - 930
//------------------------------------------------------------------------------
// 
// 
// ---
int LIB_FUNC  ksConvertLangStrW( LPWSTR src, LPWSTR dst, int dstMaxLen );

#ifdef _UNICODE
#define ksConvertLangStrT  ksConvertLangStrW
#else
#define ksConvertLangStrT  ksConvertLangStr
#endif // !_UNICODE


//   - 725
//------------------------------------------------------------------------------
//     strID  dst     
// ---
int LIB_FUNC  ksConvertLangStrEx( HINSTANCE hInstance, unsigned int strID, char* dst, int dstMaxLen );


//   - 931
//------------------------------------------------------------------------------
//     strID  dst     
// (Unicode)
// ---
int LIB_FUNC  ksConvertLangStrExW( HINSTANCE hInstance, unsigned int strID, LPWSTR dst, int dstMaxLen );

#ifdef _UNICODE
#define ksConvertLangStrExT  ksConvertLangStrExW
#else
#define ksConvertLangStrExT  ksConvertLangStrEx
#endif // !UNICODE


//   - 426
//------------------------------------------------------------------------------
// 15.01.04 -  ,   ksConvertLangWindowEx
//           
// ---
int LIB_FUNC  ksConvertLangWindow( HWND hWnd );

//   - 726
//------------------------------------------------------------------------------
//           
// ---
int LIB_FUNC  ksConvertLangWindowEx( HWND hWnd, HINSTANCE hInstance, char* dlgID );

//   - 932
//------------------------------------------------------------------------------
//           
// (Unicode)
// ---
int LIB_FUNC  ksConvertLangWindowExW( HWND hWnd, HINSTANCE hInstance, LPWSTR dlgID );

#ifdef _UNICODE
#define ksConvertLangWindowExT  ksConvertLangWindowExW
#else
#define ksConvertLangWindowExT  ksConvertLangWindowEx
#endif // !UNICODE

//   - 427
//------------------------------------------------------------------------------
//       
// ---
HMENU LIB_FUNC  ksConvertLangMenu( HMENU hMenu );


//   - 279
//------------------------------------------------------------------------------
//   2D  (  )
//     RectParam   ,
//     RectParam
// ---
int LIB_FUNC ksReDrawDocPart( RectParam * rect, reference pView );

//   - 437
//------------------------------------------------------------------------------
// /   .
// enable = false -  ( "  "  )
// enable = true  -   (   "  ",
//       enable = false.   
//   -    )
// ---
void LIB_FUNC ksEnableUndo( unsigned char enable );


//   - 1001
//------------------------------------------------------------------------------
// /    Undo
// add = true  -      Undo   
// add = false -     Undo   
//       ,       
//  Undo          1 .
//    -,         .
// ---
void LIB_FUNC ksUndoContainer( unsigned char add );


//   - 281
//------------------------------------------------------------------------------
//    
// pText -    ""
//   :    TextAlign,  -1   
// ---
int LIB_FUNC ksGetTextAlign( reference pText );

//   - 282
//------------------------------------------------------------------------------
//    
// pText -    ""
// align -    TextAlign
//   : 0 -   
// ---
int LIB_FUNC ksSetTextAlign( reference pText, unsigned int align );

//   - 282
//------------------------------------------------------------------------------
//    
// pDoc -   2D   
//   :    IObject2DNotifyResult
// ---
IObject2DNotifyResult * LIB_FUNC ksGetObject2DNotifyResult( reference pDoc );

//   - 734
//-------------------------------------------------------------------------------
//     
// ---
long LIB_FUNC ksGetLookStyle();

//   - 735
//-------------------------------------------------------------------------------
//     
// ---
long LIB_FUNC ksSetLookStyle( long style );

//   - 743
//-----------------------------------------------------------------------------
// [26.5.04]
//    .
// ---
LPDISPATCH LIB_FUNC ksGetExternalInterface();

//   - 734
//-------------------------------------------------------------------------------
//     
// ---
long LIB_FUNC ksGetLookStyle();

//   - 735
//-------------------------------------------------------------------------------
//     
// ---
long LIB_FUNC ksSetLookStyle( long style );


//   - 749
// [09/8/2004] 
//-------------------------------------------------------------------------------
//         
//     0,   
//
// fileName -    
// w -    
// h -    
// ---
double LIB_FUNC ksCalcRasterScale( const char* fileName, double w, double h );

//   - 933
// [05/07/2007] 
//-------------------------------------------------------------------------------
//         
//     0,   
//
// fileName -    
// w -    
// h -    
// (Unicode)
// ---
double LIB_FUNC ksCalcRasterScaleW( LPCWSTR fileName, double w, double h );

#ifdef _UNICODE
#define ksCalcRasterScaleT  ksCalcRasterScaleW
#else
#define ksCalcRasterScaleT  ksCalcRasterScale
#endif // !UNICODE

//   - 771
// [20/12/2005] 
//------------------------------------------------------------------------------
//   3D       
// attach: 1    3D ; 0 -    3D 
//   1,        3D.
//     0
//
// ---
int  LIB_FUNC ksModule3D( unsigned char attach );

//   - 772
// [20/12/2005] 
//-------------------------------------------------------------------------------
//       3D
// ---
int LIB_FUNC ksIsModule3DActive();

//   - 780
// [23/10/2006] 
//------------------------------------------------------------------------------
//       LPUNKNOWN API7, 3D COM, API5(Auto)
//     LPUNKNOWN API7, 3D COM, API5(Auto)
//   obj -  LPUNKNOWN API5(COM  Auto)  API7,  
//   apiNewType -   API, objNewType -    
//       0
// ---
LPUNKNOWN LIB_FUNC ksTransferInterface( LPUNKNOWN obj, long apiNewType, long objNewType );

//   - 956
// [11/9/2007] 
//---------------------------------------------------------------------------------------------------
//
//       LPUNKNOWN API7  - c AddRef
//     obj   doc
//   obj -   
//   doc -   
//       0
//
//---
LPUNKNOWN LIB_FUNC ksTransferReference( reference obj, reference doc );


//   - 785
// [22/11/2006] 
//-----------------------------------------------------------------------------
//   
// commandID -   enum- ProcessTypeEnum  KompasCommandEnum
// post      - true -    PostMessage, false -  SendMessage
// ---
int LIB_FUNC ksExecuteKompasCommand( long commandID, int post );


//   - 787
// [22/11/2006] 
//-----------------------------------------------------------------------------
//    
// ---
int LIB_FUNC ksIsKompasCommandEnable( long commandID );


//   - 788
// [22/11/2006] 
//-----------------------------------------------------------------------------
//     
// ---
int LIB_FUNC ksIsKompasCommandCheck( long commandID );


//   - 789
//-----------------------------------------------------------------------------
//    0 - 
// ---
int LIB_FUNC ksFileNameCompare( char * fileName1, char * fileName2 );


//   - 934
//-----------------------------------------------------------------------------
//    0 -  (Unicode)
// ---
int LIB_FUNC ksFileNameCompareW( LPWSTR fileName1, LPWSTR fileName2 );

#ifdef _UNICODE
#define ksFileNameCompareT  ksFileNameCompareW
#else
#define ksFileNameCompareT  ksFileNameCompare
#endif // !UNICODE


//-----------------------------------------------------------------------------
//    
// ---
void LIB_FUNC ksEnableThemeDialogTexture( HWND hWnd );


//   - 1003
//-----------------------------------------------------------------------------
// \     
// debugMode = 1 -  0 - 
//    
// ---
int LIB_FUNC ksSetDebugMessagesMode( int debugMode );

} //extern "C"


#endif

