////////////////////////////////////////////////////////////////////////////////
//
//   LT_Edit.h
//
////////////////////////////////////////////////////////////////////////////////
#ifndef __LT_EDIT_H
#define __LT_EDIT_H

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

#ifndef __LIB_FUNC__
#define __LIB_FUNC__
#define LIB_FUNC WINAPI
#endif

interface IParametrizationParam;

extern "C" {

//   - 23
//-----------------------------------------------------------------------------
//      ref  :
//   ,     , 
//    .
//      ,  
//  userPars      (   ,
//  ).
//  size -   userPars.
//    fileName=0, libName=0, number=-1  
//      ,   SetMacroParam.
//  1   , 0   .
//-----------------------------------------------------------------------------
int     LIB_FUNC  SetMacroParam( reference    ref,       //   
																 void        *userPars,  //     
																 unsigned int size,      //    
																 char        *fileName,  //   ,     
																 char        *libName,   //  ,     
																 int          number  ); //   



//   - 271
//--------------------------------------------------------------------------
//      
//    ,  ,    ,
//      
//  value -     size,      
//      
//   1-    0-  
//  paramType -  ,      
//  #define MP_DBL_CLICK_OFF  0x01 //>0     
//  #define MP_HOTPOINTS      0x02 //>0  hot  
//  #define MP_EXTERN_EDIT    0x04 //>0   
//--------------------------------------------------------------------------
extern "C" int LIB_FUNC ksSetMacroParam( reference    ref,       //   
																         void        *userPars,  //     
																         unsigned int size,      //    
																         char        *fileName,  //   ,     
																         char        *libName,   //  ,     
																         int          number,   //   
                                         unsigned char paramType ); // ,   


//   - 859
//--------------------------------------------------------------------------
//      
//    ,  ,    ,
//      
//  value -     size,      
//      
//   1-    0-  
//  paramType -  ,      
//  #define MP_DBL_CLICK_OFF  0x01 //>0     
//  #define MP_HOTPOINTS      0x02 //>0  hot  
//  #define MP_EXTERN_EDIT    0x04 //>0   
//  (Unicode)
//--------------------------------------------------------------------------
extern "C" int LIB_FUNC ksSetMacroParamW( reference     ref,       //   
																          void         *userPars,  //     
																          unsigned int  size,      //    
																          LPWSTR        fileName,  //   ,     
																          LPWSTR        libName,   //  ,     
																          int           number,   //   
                                          unsigned char paramType ); // ,   


#ifdef _UNICODE
#define ksSetMacroParamT  ksSetMacroParamW
#else
#define ksSetMacroParamT  ksSetMacroParam
#endif // !UNICODE


//   - 22
//-----------------------------------------------------------------------------
//    ( SetMacroParam)  
//    c  ref.
//  ref=0   ,   
//    (  ).
//      userPars  size, 
//     SetMacroParam.
//  1   , 0   .
//-----------------------------------------------------------------------------
int     LIB_FUNC  GetMacroParam( reference    ref,      //   
                                 void        *userPars, //     
																 unsigned int size );   //    

//   - 262
//------------------------------------------------------------------------------
//    c  ref  :
//   ,     , 
//    .
//  ref=0    ,  
//     (  ).
//   NULL  fileName, libName, number   
// fileNameSize, libNameSize    -   .
//  1   , 0   .
// ---
int     LIB_FUNC  ksGetMacroEditParam( reference    ref,          //   
                                       char*        fileName,     //      
                                       unsigned int fileNameSize, //  a   
                                       char*        libName,      //     
                                       unsigned int libNameSize,  //  a  
                                       int*         number );     //    a  

//   - 860
//------------------------------------------------------------------------------
//    c  ref  :
//   ,     , 
//    .
//  ref=0    ,  
//     (  ).
//   NULL  fileName, libName, number   
// fileNameSize, libNameSize    -   .
//  1   , 0   . (Unicode)
// ---
int     LIB_FUNC  ksGetMacroEditParamW( reference    ref,          //   
                                        LPWSTR       fileName,     //      
                                        unsigned int fileNameSize, //  a   
                                        LPWSTR       libName,      //     
                                        unsigned int libNameSize,  //  a  
                                        int*         number );     //    a  


#ifdef _UNICODE
#define ksGetMacroEditParamT  ksGetMacroEditParamW
#else
#define ksGetMacroEditParamT  ksGetMacroEditParam
#endif // !UNICODE


//   - 250
//------------------------------------------------------------------------------
//       c  ref.
//  ref=0   ,   
//    (  ).
// ---
int     LIB_FUNC  GetMacroParamSize( reference ref );

//   - 24
//--------------------------------------------------------------------------
//      -    
//  0-   
//--------------------------------------------------------------------------
reference LIB_FUNC  EditMacroMode();


//   - 197
//---------------------------------------------------------------------------
//  , ,      .
// (        )
//           .
//      
//   1   , 0 -   .
//---------------------------------------------------------------------------
int  LIB_FUNC ksAddObjectToMacro( reference macro, //  
                                  reference obj ); //   

//   - 275
//------------------------------------------------------------------------------
//     macro (    ),
//     gr,     
//   1   , 0 -   .
// ---
int LIB_FUNC ksUpdateMacro( reference macro, reference gr );


//   - 25
//-----------------------------------------------------------------------------
//       ref ( , , , ).
//  1   , 0   .
//-----------------------------------------------------------------------------
int     LIB_FUNC  DeleteObj( reference ref );

//   - 26
//-----------------------------------------------------------------------------
//     ref ( , , , ).
//   dx,dy -    .
//  1   , 0   .
//-----------------------------------------------------------------------------
int     LIB_FUNC  MoveObj( reference ref,          //   
                           double dx, double dy ); //  


//   - 27
//-----------------------------------------------------------------------------
//     ref ( , , , )
//     x,y (   ).
//  1   , 0   .
//-----------------------------------------------------------------------------
int     LIB_FUNC  RotateObj( reference ref,      //   
														 double x, double y, //  
														 double angle );     //    

//   - 28
//-----------------------------------------------------------------------------
//     ref ( , , , )
//     (.  Mtr  DeleteMtr ).
//  1   , 0   .
//-----------------------------------------------------------------------------
int     LIB_FUNC  TransformObj( reference ref );


//   - 29
//-----------------------------------------------------------------------------
//  (light=1)   (light=0)   
//   ref ( , , , ).
//  1   , 0   .
//-----------------------------------------------------------------------------
int     LIB_FUNC  LightObj( reference ref,         //   
														unsigned char light ); //  


//   - 156
//-----------------------------------------------------------------------------
//   (copy=0)    ref ( , ,
// , )        (copy=1).
//       .
//  1   , 0   .
//-----------------------------------------------------------------------------
int     LIB_FUNC  SymmetryObj( reference ref,         //   
                               double x1, double y1,  //   
                               double x2, double y2,  //   
                               unsigned char copy  ); //  

//   - 217
//--------------------------------------------------------------------------
//   (copy=0)    ref ( , ,
// , )        (copy=1).
//       .
//          ,
// 0   .
//--------------------------------------------------------------------------
reference LIB_FUNC ksSymmetryObj( reference ref,         //   
                                  double x1, double y1,  //   
                                  double x2, double y2,  //   
                                  unsigned char copy  ); //  

//   - 157
//-----------------------------------------------------------------------------
//     ref ( , , , )  
//          
//  .
//       .
//  1   , 0   .
//-----------------------------------------------------------------------------
int     LIB_FUNC  CopyObj( reference ref,                //   
                           double xOld,  double yOld,    //   
                           double xNew,  double yNew,    //    
                           double scale, double angle ); //      

//   - 216
//--------------------------------------------------------------------------
//     ref ( , , , )  
//          
//  .
//          , 0
//   .
//       .
//--------------------------------------------------------------------------
reference LIB_FUNC ksCopyObj( reference ref,                //   
                              double xOld,  double yOld,    //   
                              double xNew,  double yNew,    //    
                              double scale, double angle ); //      

//   - 721
//--------------------------------------------------------------------------
//     ref ( , , , )  
//          
//  .
//          , 0
//   .
//       .
//--------------------------------------------------------------------------
reference LIB_FUNC ksCopyObjEx( CopyObjectParam * param  );

//   - 354
//-----------------------------------------------------------------------------
//    ,     .
//   c      ,   
//   : Cursor, Placement, CommandWindow, ksEditViewObject.
//       0.
// type      [LINESEG_OBJ ...MULTITEXTLEADER] (ltdefine.h)
//-----------------------------------------------------------------------------
reference LIB_FUNC  ksCreateViewObject( unsigned short type );


//   - 355
//-----------------------------------------------------------------------------
//        ref.
//   c      ,   
//   : Cursor, Placement, CommandWindow, ksCreateViewObject.
//  1 -  , 0 - .
//-----------------------------------------------------------------------------
int     LIB_FUNC  ksEditViewObject( reference ref );


//   - 304
//-----------------------------------------------------------------------------
//      ref.
// parType   [ALLPARAM ... DIM_VALUE] . ltdefine.h
//  1   , 0   .
//-----------------------------------------------------------------------------
int     LIB_FUNC  SetObjParam( reference ref,   //   
															 void *param,     //    
															 int   parSize,   //   
															 int   parType ); //     


//   - 305
//-----------------------------------------------------------------------------
//      ref.
// parType   [ALLPARAM ... DIM_VALUE] . ltdefine.h
//    [LINESEG_OBJ ...ANNTEXT_OBJ] (ltdefine.h)   ,
// 0   .
//-----------------------------------------------------------------------------
int     LIB_FUNC  GetObjParam( reference ref,   //    
															 void *param,     //    
															 int   parSize,   //   
															 int   parType ); //     

//   - 325
//-----------------------------------------------------------------------------
//       styleId.
//   :    type=CURVE_STYLE   , param -    CurveStyleParam.
//   :    type=CURVE_STYLE_EX, param -    CurveStyleParam.
//   :    type=TEXT_STYLE    , param -    TextStyleParam.
//   : type=HATCH_STYLE   , param -    HatchStyleParam.
//   1   ; 0 -   ,   
//  param      .
//-----------------------------------------------------------------------------
int     LIB_FUNC  GetStyleParam( unsigned char  type,   //  
                                 unsigned short styleId,//  
                                 void          *param,  //     
                                 unsigned int   size ); //   


//   - 326
//-----------------------------------------------------------------------------
//       (type=CURVE_STYLE)   (type=TEXT_STYLE).
//   copy = 0 -   :
//   : type=CURVE_STYLE   , param -    CurveStyleParam.
//   : type=CURVE_STYLE_EX, param -    CurveStyleParam.
//   : type=TEXT_STYLE    , param -    TextStyleParam.
//   : type=HATCH_STYLE   , param -    HatchStyleParam.
//   copy = 1 -    :
//          param -    LibStyle.
//       , 0   .
//-----------------------------------------------------------------------------
unsigned short LIB_FUNC AddStyle( unsigned char type,  //  
                                  void         *param, //     
                                  unsigned int  size,  //   
                                  unsigned char copy ); // 0 -   1-   

//   - 406
//-------------------------------------------------------------------------------------
// ,      
//   copy = 0 -   :
//   : type=CURVE_STYLE   , param -    CurveStyleParam.
//   : type=CURVE_STYLE_EX, param -    CurveStyleParam.
//   : type=TEXT_STYLE    , param -    TextStyleParam.
//   : type=HATCH_STYLE   , param -    HatchStyleParam.
//   copy = 1 -    :
//          param -    LibStyle.
//   1,     , 0 -  
//-------------------------------------------------------------------------------------
int LIB_FUNC ksIsStyleInDocument( unsigned char  type,  //  
                                  void          *param, //     
                                  unsigned int   size,  //   
                                  unsigned char  copy );// 0 -   1-   

//   - 407
//-------------------------------------------------------------------------------------
//     
//   : type=CURVE_STYLE   , param -    CurveStyleParam.
//   : type=CURVE_STYLE_EX, param -    CurveStyleParam.
//   : type=TEXT_STYLE    , param -    TextStyleParam.
//   : type=HATCH_STYLE   , param -    HatchStyleParam.
//   copy = 1 -    :
//          param -    LibStyle.
//   1,     , 0 -  
//-------------------------------------------------------------------------------------
int LIB_FUNC ksDeleteStyleFromDocument( unsigned char  type,  //  
                                        void          *param,   //     
                                        unsigned int   size,  //   
                                        unsigned char  flag );// 0 -   1-   

//   - 371
//------------------------------------------------------------------------------
//       LIBRARY_STYLE_ARR -
//    ,     .
//     0.
// libraryType   [CURVE_STYLE_LIBRARY...SPC_LAYOUT_STYLE_LIBRARY]
// ---
reference LIB_FUNC ksGetLibraryStylesArray( char         *libraryName,   //    
                                            unsigned char libraryType ); //   

//   - 861
//------------------------------------------------------------------------------
//       LIBRARY_STYLE_ARR -
//    ,     .
//     0.
// libraryType   [CURVE_STYLE_LIBRARY...SPC_LAYOUT_STYLE_LIBRARY]
// ---
reference LIB_FUNC ksGetLibraryStylesArrayW( LPWSTR        libraryName,   //    
                                             unsigned char libraryType ); //   


#ifdef _UNICODE
#define ksGetLibraryStylesArrayT  ksGetLibraryStylesArrayW
#else
#define ksGetLibraryStylesArrayT  ksGetLibraryStylesArray
#endif // !UNICODE


//   - 30
//-----------------------------------------------------------------------------
// ,      ref.
//   1 -  , 0 - .
//-----------------------------------------------------------------------------
int     LIB_FUNC  ExistObj( reference ref );


//   - 31
//-----------------------------------------------------------------------------
//  ,    .
// limit -     .
//         ,
// 0   .
//-----------------------------------------------------------------------------
reference LIB_FUNC  FindObj( double x, double y, //  
                             double limit );     //  


//   - 154
//--------------------------------------------------------------------------
//    .
//      .
//  1-   , 0   .
//--------------------------------------------------------------------------
int       LIB_FUNC  GetObjGabaritRect( reference p,     //  
                                       RectParam *par); //  
//   - 161
//--------------------------------------------------------------------------
//    CK    CK 
//--------------------------------------------------------------------------
int       LIB_FUNC  ViewToSheet( double x, double y,           // 
                                 double *outX, double *outY ); // 
//   - 162
//--------------------------------------------------------------------------
//    CK   CK  
//--------------------------------------------------------------------------
int       LIB_FUNC  SheetToView( double x, double y,          // 
                                 double *outX, double *outY );// 

//   - 32
//--------------------------------------------------------------------------
//    .
//     .
//      ,      .
//          .
//          StoreTmpGroup,
//          .
//--------------------------------------------------------------------------
reference LIB_FUNC NewGroup( unsigned char _tmp );  //  0 -  1 -  

//   - 33
//--------------------------------------------------------------------------
//   .
//   , , ,    
//   NewGroup  EndGroup   .
//    ,   .
//--------------------------------------------------------------------------
void      LIB_FUNC EndGroup();

//   - 34
//--------------------------------------------------------------------------
//    g.
//    -  .  g = 0,   .
//--------------------------------------------------------------------------
int       LIB_FUNC ClearGroup( reference g );  //  

//   - 263
//--------------------------------------------------------------------------
//    g.  g = 0,   .
// deleteTmp = 1 ->   .
//--------------------------------------------------------------------------
int LIB_FUNC ksClearGroup( reference g, unsigned char deleteTmp );


//   - 35
//--------------------------------------------------------------------------
//    p   g.
//     - .  g = 0,  
//--------------------------------------------------------------------------
int       LIB_FUNC ExcludeObjGroup( reference g,   // 
																		reference p ); //   

//   - 36
//--------------------------------------------------------------------------
//   p   g.   g = 0,  
//--------------------------------------------------------------------------
int       LIB_FUNC AddObjGroup( reference g,      // 
																reference p );    //   

//   - 37
//--------------------------------------------------------------------------
//     g   .    
//   ,   .
//--------------------------------------------------------------------------
int       LIB_FUNC StoreTmpGroup( reference g );  // 


//   - 38
//--------------------------------------------------------------------------
//   g    .  g = 0,  .
//--------------------------------------------------------------------------
int       LIB_FUNC SaveGroup( reference g,  // 
															char *name ); //  


//   - 862
//--------------------------------------------------------------------------
//   g    .  g = 0,  .
// (Unicode)
//--------------------------------------------------------------------------
int       LIB_FUNC SaveGroupW( reference g,  // 
															 LPWSTR name ); //  


#ifdef _UNICODE
#define SaveGroupT  SaveGroupW
#else
#define SaveGroupT  SaveGroup
#endif // !UNICODE


//   - 39
//--------------------------------------------------------------------------
//    .    .
//--------------------------------------------------------------------------
reference LIB_FUNC GetGroup( char *name );  // 


//   - 863
//--------------------------------------------------------------------------
//    .    .
//--------------------------------------------------------------------------
reference LIB_FUNC GetGroupW( LPWSTR name );  // 

#ifdef _UNICODE
#define GetGroupT  GetGroupW
#else
#define GetGroupT  GetGroup
#endif // !UNICODE


//   - 40
//--------------------------------------------------------------------------
//     g.
// selectMode=1 -  ;
// selectMode=2 - ;
// selectMode=3 -  ;
//  -     .
//--------------------------------------------------------------------------
int       LIB_FUNC SelectGroup( reference g,               // 
																unsigned char selectMode,  // 
																double xmin, double ymin,  //  -
																double xmax, double ymax );//  -
//   - 41
//---------------------------------------------------------------------------
//         g .
// 1-   0- .  g = 0,  
//---------------------------------------------------------------------------
int        LIB_FUNC ExistGroupObj( reference g );

//   - 239
//------------------------------------------------------------------------------
//    clip        
//  1      0   
// ---
int LIB_FUNC ksWriteGroupToClip( reference g,         //   
                                 unsigned char copy ); // 1 -  ; 0 -     

//   - 240
//------------------------------------------------------------------------------
//    clip      .
//     .     clip ,
//  .
//          0   
// ---
reference LIB_FUNC ksReadGroupFromClip();

//   - 249
//////////////////////////////////////////////////////////////////////////
//       
//   0 -   
//                    1 -   (   )
//                    2 -   (   )
//                   -1 -   (  size     ,    )
//---
int LIB_FUNC ksGetGroupName( reference gr,             //   
                             char *name, int size );   //        

//   - 864
//------------------------------------------------------------------------------
//       
//   0 -   
//                    1 -   (   )
//                    2 -   (   )
//                   -1 -   (  size     ,    )
// (Unicode)
//---
int LIB_FUNC ksGetGroupNameW( reference gr,             //   
                              LPWSTR name, int size );   //        


#ifdef _UNICODE
#define ksGetGroupNameT  ksGetGroupNameW
#else
#define ksGetGroupNameT  ksGetGroupName
#endif // !UNICODE


//   - 285
//------------------------------------------------------------------------------
//       ( ,  ,
// , ,  )    (   
//   3-)
//  1     0   
// ---
long  LIB_FUNC ksDestroyObjects( reference p );  //  , ,   

//   - 59
//---------------------------------------------------------------------------
//    .
//     .   
//    ,    .
//   ,    Mtr  DeleteMtr, 
//     .
//---------------------------------------------------------------------------
int       LIB_FUNC Mtr( double x, double y, //   
												double angle,       //     .
												double scale );     //   

//   - 248
//---------------------------------------------------------------------------
//    .
//     .   
//    ,    .
//   ,    ksMtr  DeleteMtr, 
//     .
//---------------------------------------------------------------------------
int       LIB_FUNC ksMtr( double x, double y,   //   
												  double angle,         //     .
												  double scaleX,        //      
												  double scaleY );      //      Y

//   - 160
//---------------------------------------------------------------------------
//         rotateMtr 
//     moveArr
//   ,    MtrForIGES  DeleteMtr, 
//     .
//---------------------------------------------------------------------------
int       LIB_FUNC MtrForIGES( double rotateMtr[2][2],  double moveArr[2] );

//   - 60
//---------------------------------------------------------------------------
//    .
//---------------------------------------------------------------------------
int       LIB_FUNC DeleteMtr();


//   - 100
//----------------------------------------------------------------------
// C     .
//    , , ,  - parent  (0).
//----------------------------------------------------------------------
reference LIB_FUNC CreateIterator( int tipSearch,    //  
                                  reference parent ); //  (   ,  ,  )

//   - 101
//----------------------------------------------------------------------
//    .
//----------------------------------------------------------------------
reference LIB_FUNC MoveIterator( reference iterator,    //  
                                 unsigned char ch );    //  'F'/'N'  - /

//   - 102
//----------------------------------------------------------------------
//      .
//  obj = 0,         .
//  obj != 0,      , , , , 
//      .
//  obj != 0,     , 
//      .
//----------------------------------------------------------------------
reference LIB_FUNC CreateAttrIterator( reference obj,     //     0
                                       unsigned int key1, //
                                       unsigned int key2, //       0
                                       unsigned int key3, //
                                       unsigned int key4, //
                                       double numb );     //         0

//   - 103
//----------------------------------------------------------------------
//    .     .
//           ,
//  pObj -      .
//  pObj = NULL, pObj  .
//----------------------------------------------------------------------
reference LIB_FUNC MoveAttrIterator( reference iterator,  //   
                                     unsigned char ch,    //   'F'/'N'
                                     reference * pObj );  //   
//   - 104
//----------------------------------------------------------------------
//      .
//----------------------------------------------------------------------
int       LIB_FUNC DeleteIterator( reference iterator ); //  


//   - 86
//--------------------------------------------------------------------------
//      .
// tip = [CHAR_STR_ARR ...CHAR_STR_ARR_W] . ldefin2d.h
//--------------------------------------------------------------------------
reference  LIB_FUNC CreateArray( int tip,         // 
                                 DeleteFunc  f ); //    USER_ARR


//   - 87
//--------------------------------------------------------------------------
//      .
//--------------------------------------------------------------------------
int        LIB_FUNC DeleteArray( reference p ); //   

//   - 88
//--------------------------------------------------------------------------
//  .
//--------------------------------------------------------------------------
int        LIB_FUNC ClearArray( reference p );  //   

//   - 89
//--------------------------------------------------------------------------
//         
//  .
//--------------------------------------------------------------------------
int        LIB_FUNC GetArrayCount( reference p ); //   

//   - 90
//--------------------------------------------------------------------------
//    .
//--------------------------------------------------------------------------
int        LIB_FUNC AddArrayItem( reference p,   //   
																	int numb,      //        
																								 //   numb =-1    
																	void * value,  //    
																	int size );    //   


//   - 91
//--------------------------------------------------------------------------
//    .
//--------------------------------------------------------------------------
int        LIB_FUNC ExcludeArrayItem( reference p,  //   
																			int numb);    //    (    0 )


//   - 92
//--------------------------------------------------------------------------
//      .
//--------------------------------------------------------------------------
int        LIB_FUNC GetArrayItem( reference p, //   
																	int numb,    //    (    0 )
																	void * value,//    
																	int size );  //   
//   - 93
//--------------------------------------------------------------------------
//        .
//--------------------------------------------------------------------------
int        LIB_FUNC GetUserArrayItem( reference p,        //   
                                      int numb,        //   
																			void ** value  );//     

//   - 94
//--------------------------------------------------------------------------
//      .
//--------------------------------------------------------------------------
int        LIB_FUNC SetArrayItem( reference p,  //   
																	int numb,     //    (    0 )
																	void * value, //    
																	int size );   //   
//   - 95
//--------------------------------------------------------------------------
//   .
//--------------------------------------------------------------------------
int        LIB_FUNC GetArrayType ( reference p ); //   

//   - 313
//--------------------------------------------------------------------------
//      - , , .
//            .
//     ( p-    ,
// type -   ,   1 )
//      .
//--------------------------------------------------------------------------
reference  LIB_FUNC DecomposeObj( reference p,        //  
                                unsigned char level,  //  0 - ,,,;
                                                      //                  1 - ,,; 2-, , 
                                                      //                  4 - ,,,( );
                                                      //                  5 - , , ,     
                                                      //                  6 -    
                                double arrow,         // 
                                unsigned char type);  // 0 -      1-   

//   - 357
//--------------------------------------------------------------------------
//        Decompose
//  arr == 0    count == 0    
//--------------------------------------------------------------------------
int LIB_FUNC ksLoadNonDecomposSpecSymbols( int * arr, unsigned int count );

//   - 146
//--------------------------------------------------------------------------
//     .
//  p = 0,         .
//--------------------------------------------------------------------------
long       LIB_FUNC GetViewObjCount( reference p ); //  

//   - 149
//--------------------------------------------------------------------------
//    .
//      ,  
//    InsertFragment, DeleteObj.
//  fileName -    .
//   fileName    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//    ,  -   ).    
//       .
//       -   
//   .
//--------------------------------------------------------------------------
reference  LIB_FUNC FragmentDefinition( char * fileName,          //  
                                        char * comment,           // 
                                        unsigned char insertType);//  -   
                                                                 // 0-   , 1- 

//   - 865
//--------------------------------------------------------------------------
//    .
//      ,  
//    InsertFragment, DeleteObj.
//  fileName -    .
//   fileName    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//    ,  -   ).    
//       .
//       -   
//   . (Unicode)
//--------------------------------------------------------------------------
reference  LIB_FUNC FragmentDefinitionW( LPWSTR fileName,          //  
                                         LPWSTR comment,           // 
                                         unsigned char insertType);//  -   
                                                                 // 0-   , 1- 

#ifdef _UNICODE
#define FragmentDefinitionT  FragmentDefinitionW
#else
#define FragmentDefinitionT  FragmentDefinition
#endif // !UNICODE


//   - 150
//--------------------------------------------------------------------------
//   .
//         
//   .
//      " ".
//--------------------------------------------------------------------------
reference  LIB_FUNC InsertFragment( reference p,              //    
                                    unsigned char curentLayer,//    0 -    1-   
                                    PlacementParam * par );   // 

//   - 287
//--------------------------------------------------------------------------
//          
//         
//   .
//      " ".
//--------------------------------------------------------------------------
reference  LIB_FUNC ksInsertFragmentEx( reference p,              //    
                                        unsigned char curentLayer,//    0 -    1-   
                                        PlacementParam * par,     // 
                                        unsigned char    scaleProjLinesSize ); //       

//   - 151
//--------------------------------------------------------------------------
//        .
//     1   , 0 -   .
//  fileName -    .
//   fileName    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//    ,  -   ).    
//     
//--------------------------------------------------------------------------
int         LIB_FUNC ReadFragment( char *fileName,            //  
                                   unsigned char curentLayer, //    0 -    1-   
                                   PlacementParam * par );    // 


//   - 866
//--------------------------------------------------------------------------
//        .
//     1   , 0 -   .
//  fileName -    .
//   fileName    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//    ,  -   ).    
//     
//  (Unicode)
//--------------------------------------------------------------------------
int         LIB_FUNC ReadFragmentW( LPWSTR fileName,            //  
                                    unsigned char curentLayer, //    0 -    1-   
                                    PlacementParam * par );    // 

#ifdef _UNICODE
#define ReadFragmentT  ReadFragmentW
#else
#define ReadFragmentT  ReadFragment
#endif // !UNICODE


//   - 226
//   08.04.2002
//--------------------------------------------------------------------------
//       .
//           ,
//   0 -   .
//  fileName -    .
//   fileName    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//    ,  -   ).    
//     
//--------------------------------------------------------------------------
reference LIB_FUNC ksReadFragmentToGroup( char    *fileName,          //  
                                          unsigned char  curentLayer, //     0 -    1-   
                                          PlacementParam *par );      //  


//   292
//--------------------------------------------------------------------------
//       .
//           ,
//   0 -   .
//  fileName -    .
//   fileName    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//    ,  -   ).    
//     
//  scaleProjLinesSize -       
//--------------------------------------------------------------------------
reference LIB_FUNC ksReadFragmentToGroupEx( char*           fileName,    //  
                                            unsigned char   curentLayer, //     0 -    1-   
                                            PlacementParam* par,         //  
                                            unsigned char   scaleProjLinesSize ); //       


//   868
//--------------------------------------------------------------------------
//       .
//           ,
//   0 -   .
//  fileName -    .
//   fileName    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//    ,  -   ).    
//     
//  scaleProjLinesSize -       
//  (Unicode)
//--------------------------------------------------------------------------
reference LIB_FUNC ksReadFragmentToGroupExW( LPWSTR          fileName,    //  
                                             unsigned char   curentLayer, //     0 -    1-   
                                             PlacementParam* par,         //  
                                             unsigned char   scaleProjLinesSize ); //       

#ifdef _UNICODE
#define ksReadFragmentToGroupExT  ksReadFragmentToGroupExW
#else
#define ksReadFragmentToGroupExT  ksReadFragmentToGroupEx
#endif // !UNICODE


//   - 170
//----------------------------------------------------------------------------------------------
//    
//   gr = 0 -  
//----------------------------------------------------------------------------------------------
int         LIB_FUNC WriteFragment( reference gr,            //  
                                       char * filename,         //  
                                       char *comment,           //  
                                       double xb, double yb  ); // 

//   - 869
//----------------------------------------------------------------------------------------------
//    
//   gr = 0 -   (Unicode)
//----------------------------------------------------------------------------------------------
int         LIB_FUNC WriteFragmentW( reference gr,            //  
                                       LPWSTR  filename,         //  
                                       LPWSTR  comment,           //  
                                       double  xb, double yb  ); // 


#ifdef _UNICODE
#define WriteFragmentT  WriteFragmentW
#else
#define WriteFragmentT  WriteFragment
#endif // !UNICODE


//   - 152
//--------------------------------------------------------------------------
//      .    
//  .     
//--------------------------------------------------------------------------
int         LIB_FUNC LocalFragmentDefinition( char * comment ); // 


//   - 870
//--------------------------------------------------------------------------
//      .    
//  .      (Unicode)
//--------------------------------------------------------------------------
int         LIB_FUNC LocalFragmentDefinitionW( LPWSTR comment ); // 

#ifdef _UNICODE
#define LocalFragmentDefinitionT  LocalFragmentDefinitionW
#else
#define LocalFragmentDefinitionT  LocalFragmentDefinition
#endif // !UNICODE


//   - 153
//--------------------------------------------------------------------------
//       , 
//    LocalFragmentDefinition  CloseLocalFragmentDefinition,
//   .
//     ,  
//   InsertFragment, DeleteObj.
//--------------------------------------------------------------------------
reference  LIB_FUNC  CloseLocalFragmentDefinition( );

//   - 196
//----------------------------------------------------------------------------------------------
//         
//  frwName   -    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//   ,  -      ).
//       .  .
//  Enter -   . Esc - .
//   3 - , 2 - , 1-   , 0 - .
//----------------------------------------------------------------------------------------------
int LIB_FUNC ksChoiceFragmentFromLib( char * frwLibFile,    //    
                                      char * frwName,       //  
                                      unsigned int size );  //   frwName

//   - 871
//----------------------------------------------------------------------------------------------
//         
//  frwName   -    "c:\_f\gr\lib1.lfr|||"
//  ( c:\_f\gr\lib1.lfr -    , |||- , 
//   ,  -      ).
//       .  .
//  Enter -   . Esc - .
//   3 - , 2 - , 1-   , 0 - .
//  (Unicode)
//----------------------------------------------------------------------------------------------
int LIB_FUNC ksChoiceFragmentFromLibW( LPWSTR frwLibFile,    //    
                                       LPWSTR frwName,       //  
                                       unsigned int size );  //   frwName

#ifdef _UNICODE
#define ksChoiceFragmentFromLibT  ksChoiceFragmentFromLibW
#else
#define ksChoiceFragmentFromLibT  ksChoiceFragmentFromLib
#endif // !UNICODE


//   - 198
//----------------------------------------------------------------------------------------------
//   
// libName   -     "c:\_f\gr\lib1.lfr|||"
// ( c:\_f\gr\lib1.lfr -    , |||- , 
//  ,  -   ).
// type = -1 -    0 -   ,
//         1 - ,               2 -  ,
//         3 -    
//         4 -    -  6 -  !!!!!!!!!!
//         5 -   
//         7 -      "c:\_f\gr\lib1.lfr|||"   
//----------------------------------------------------------------------------------------------
int LIB_FUNC ksFragmentLibrary(  char * libName,        //   
                                 int type );  //   


//   - 872
//----------------------------------------------------------------------------------------------
//   
// libName   -     "c:\_f\gr\lib1.lfr|||"
// ( c:\_f\gr\lib1.lfr -    , |||- , 
//  ,  -   ).
// type = -1 -    0 -   ,
//         1 - ,               2 -  ,
//         3 -    
//         4 -    -  6 -  !!!!!!!!!!
//         5 -   
//         7 -      "c:\_f\gr\lib1.lfr|||"   
// (Unicode)
//----------------------------------------------------------------------------------------------
int LIB_FUNC ksFragmentLibraryW(  LPWSTR libName,        //   
                                  int type );  //   

#ifdef _UNICODE
#define ksFragmentLibraryT  ksFragmentLibraryW
#else
#define ksFragmentLibraryT  ksFragmentLibrary
#endif // !UNICODE


//   - 199
//----------------------------------------------------------------------------------------------
//       frwName      libName
// libName   -     "c:\_f\gr\lib1.lfr|||"
// ( c:\_f\gr\lib1.lfr -    , |||- , 
//  ,  -   ).
//----------------------------------------------------------------------------------------------
int LIB_FUNC ksAddFragmentToLibrary ( char * libName,   //    
                                      char * frwName ); //   

//   - 873
//----------------------------------------------------------------------------------------------
//       frwName      libName
// libName   -     "c:\_f\gr\lib1.lfr|||"
// ( c:\_f\gr\lib1.lfr -    , |||- , 
//  ,  -   ).
// (Unicode)
//----------------------------------------------------------------------------------------------
int LIB_FUNC ksAddFragmentToLibraryW ( LPWSTR libName,   //    
                                       LPWSTR frwName ); //   

#ifdef _UNICODE
#define ksAddFragmentToLibraryT  ksAddFragmentToLibraryW
#else
#define ksAddFragmentToLibraryT  ksAddFragmentToLibrary
#endif // !UNICODE


//   - 215
//----------------------------------------------------------------------------------------------
//          ,
//  1    0   
//----------------------------------------------------------------------------------------------
int LIB_FUNC ksCheckFragmentLibrary( char * libName,                   //    
                                     unsigned char possibleMessage );  // 1 - ,     0 -  


//   - 874
//----------------------------------------------------------------------------------------------
//          ,
//  1    0    (Unicode)
//----------------------------------------------------------------------------------------------
int LIB_FUNC ksCheckFragmentLibraryW( LPWSTR libName,                   //    
                                      unsigned char possibleMessage );  // 1 - ,     0 -  

#ifdef _UNICODE
#define ksCheckFragmentLibraryT  ksCheckFragmentLibraryW
#else
#define ksCheckFragmentLibraryT  ksCheckFragmentLibrary
#endif // !UNICODE


//   - 242
//------------------------------------------------------------------------------
//         frwName   
// frwName   -    "c:\_f\gr\lib1.lfr|||"
// ( c:\_f\gr\lib1.lfr -    , |||- , 
//  ,  -      ).
//    0  -    
//                    -1 -  
//                     1      
// ---
int LIB_FUNC ksExistFragmentInLibrary( char *frwName );


//   - 875
//------------------------------------------------------------------------------
//         frwName   
// frwName   -    "c:\_f\gr\lib1.lfr|||"
// ( c:\_f\gr\lib1.lfr -    , |||- , 
//  ,  -      ).
//    0  -    
//                    -1 -  
//                     1      
// (Unicode)
// ---
int LIB_FUNC ksExistFragmentInLibraryW( LPWSTR frwName );

#ifdef _UNICODE
#define ksExistFragmentInLibraryT  ksExistFragmentInLibraryW
#else
#define ksExistFragmentInLibraryT  ksExistFragmentInLibrary
#endif // !UNICODE


//   - 297
//---------------------------------------------------------------------------
//         
// 
// libName -     , , 
//---------------------------------------------------------------------------
int LIB_FUNC ksGetLibraryTreeStruct( char * libName, TreeNodeParam * root );


//   - 876
//---------------------------------------------------------------------------
//         
// 
// libName -     , , 
// (Unicode)
//---------------------------------------------------------------------------
int LIB_FUNC ksGetLibraryTreeStructW( LPWSTR libName, TreeNodeParamW * root );

#ifdef _UNICODE
#define ksGetLibraryTreeStructT  ksGetLibraryTreeStructW
#else
#define ksGetLibraryTreeStructT  ksGetLibraryTreeStruct
#endif // !UNICODE


//   - 155
// -------------------------------------------------------------------------
//   .     .
//     ,  ,   
//  .
// -------------------------------------------------------------------------
int        LIB_FUNC ReleaseReference( reference p );  //  

// ------------------------------------------------------------------------
//  :  
// ------------------------------------------------------------------------

//   - 96
//----------------------------------------------------------------------
//   -  .
//    (     ).
//    .      0   .
//----------------------------------------------------------------------
reference LIB_FUNC CreateDocument ( DocumentParam * par );//  


//   - 801
//----------------------------------------------------------------------
//   -  .
//    (     ).
//    .      0   .
//----------------------------------------------------------------------
reference LIB_FUNC CreateDocumentW ( DocumentParamW * par );//  


#ifdef _UNICODE
#define CreateDocumentT  CreateDocumentW
#else
#define CreateDocumentT  CreateDocument
#endif // !UNICODE

//   - 706
//----------------------------------------------------------------------
//   
//    (     )
//    
//    
//----------------------------------------------------------------------
reference LIB_FUNC CreateTextDocument ( TextDocumentParam * par ); //   

//   - 877
//----------------------------------------------------------------------
//   
//    (     )
//    
//     (Unicode)
//----------------------------------------------------------------------
reference LIB_FUNC CreateTextDocumentW ( TextDocumentParamW * par ); //   

#ifdef _UNICODE
#define CreateTextDocumentT  CreateTextDocumentW
#else
#define CreateTextDocumentT  CreateTextDocument
#endif // !UNICODE


//   - 97
//----------------------------------------------------------------------
//    (, , , 3d ).
//  : 0 -  ,  1 -  
//   3 -       
//   4 -        
//   .     .
//      0   .
//----------------------------------------------------------------------
reference LIB_FUNC OpenDocument   ( char *nameDoc,        //-  
                                    unsigned char regim );// 0 -  ,
                                                          // 1 -  

//   - 878
//----------------------------------------------------------------------
//    (, , , 3d ).
//  : 0 -  ,  1 -  
//   3 -       
//   4 -        
//   .     .
//      0   . (Unicode)
//----------------------------------------------------------------------
reference LIB_FUNC OpenDocumentW   ( LPWSTR nameDoc,       //-  
                                     unsigned char regim );// 0 -  ,
                                                           // 1 -  

#ifdef _UNICODE
#define OpenDocumentT  OpenDocumentW
#else
#define OpenDocumentT  OpenDocument
#endif // !UNICODE


//   - 98
//----------------------------------------------------------------------
//   .
//  1     0   .
//    .  fileName - NULL,    
// .        NULL  .
//  sheet = 0   .
//----------------------------------------------------------------------
int       LIB_FUNC SaveDocument ( reference sheet,     //  
                                   char * fileName );  //      Safe as...  NULL


//   - 755
//----------------------------------------------------------------------
// [31.03.2005]
//   
//  1     0   
//    
//  fileName - NULL -      
//        NULL  
//  sheet=0   
// saveMode = -1 -   
//             0 -   
//             1 -    5.11
//----------------------------------------------------------------------
int LIB_FUNC SaveDocumentEx ( reference sheet, char * fileName, int saveMode );


//   - 880
//----------------------------------------------------------------------
// [04.07.2007]
//   
//  1     0   
//    
//  fileName - NULL -      
//        NULL  
//  sheet=0   
// saveMode = -1 -   
//             0 -   
//             1 -    5.11
// (Unicode)
//----------------------------------------------------------------------
int LIB_FUNC SaveDocumentExW ( reference sheet, LPWSTR fileName, int saveMode );

#ifdef _UNICODE
#define SaveDocumentExT  SaveDocumentExW
#else
#define SaveDocumentExT  SaveDocumentEx
#endif // !UNICODE


//   - 700 
//----------------------------------------------------------------------
//      
//  1     0   
//    
//  sheet=0   
//----------------------------------------------------------------------
int LIB_FUNC ksSaveAsToRasterFormat ( reference sheet,           //  
                                      char * fileName,            //   
                                      RasterFormatParam * par );  //      

//   - 881 
//----------------------------------------------------------------------
//      
//  1     0   
//    
//  sheet=0    (Unicode)
//----------------------------------------------------------------------
int LIB_FUNC ksSaveAsToRasterFormatW ( reference sheet,           //  
                                       LPWSTR fileName,            //   
                                       RasterFormatParamW * par );  //      
  
#ifdef _UNICODE
#define ksSaveAsToRasterFormatT  ksSaveAsToRasterFormatW
#else
#define ksSaveAsToRasterFormatT  ksSaveAsToRasterFormat
#endif // !UNICODE

  
//   - 706 
//----------------------------------------------------------------------
//        
//  1     0   
//    
//  sheet=0   
//----------------------------------------------------------------------
int LIB_FUNC ksSaveAsToUncompressedRasterFormat
                                    ( reference sheet,           //  
                                      char * fileName,            //   
                                      RasterFormatParam * par );  //      

//   - 882 
//----------------------------------------------------------------------
//        
//  1     0   
//    
//  sheet=0    (Unicode)
//----------------------------------------------------------------------
int LIB_FUNC ksSaveAsToUncompressedRasterFormatW
                                    ( reference sheet,           //  
                                      LPWSTR fileName,            //   
                                      RasterFormatParamW * par );  //      

#ifdef _UNICODE
#define ksSaveAsToUncompressedRasterFormatT  ksSaveAsToUncompressedRasterFormatW
#else
#define ksSaveAsToUncompressedRasterFormatT  ksSaveAsToUncompressedRasterFormat
#endif // !UNICODE
  
//   - 99
//----------------------------------------------------------------------
//   .  1     0   .
//      ,   .
//  sheet = 0,    .
//----------------------------------------------------------------------
int       LIB_FUNC CloseDocument ( reference sheet );  //  

//   - 234
//-------------------------------------------------------------------------------
//   
//          0   
//-------------------------------------------------------------------------------
reference LIB_FUNC ksGetCurrentDocument( unsigned char type ); // 0 -  
                                                               // 1 -   
                                                               // 2 -  
                                                               // 3 - 3d 
                                                               // 4 -  

//   - 718
//-----------------------------------------------------------------------------
//  2D 
//      .        , 
//    .
//         ,     .
//  sheet == 0   .
//   1   , 0 -   
// ---
int LIB_FUNC ksRebuildDocument( reference sheet ); //   2D  -

//   - 130
//-------------------------------------------------------------------------------
//    .    .
//   .  TextLine,   
//  OpenTechnicalDemand   CloseTechnicalDemand,   .
//   ,     ,  
//     .    
//   .
//  CloseTechnicalDemand     .
//-------------------------------------------------------------------------------
int       LIB_FUNC OpenTechnicalDemand( reference  pGab,       //      0
                                        unsigned short style); //      0 -  
//   - 131
//-------------------------------------------------------------------------------
//    " ".
//     .
//-------------------------------------------------------------------------------
reference       LIB_FUNC CloseTechnicalDemand( );

//   - 136
//--------------------------------------------------------------------------------
//     "".    .
//      ColumnNumber   TextLine,   
//  OpenStamp   CloseStamp,  .
//  ColumnNumber    ,   c.
//          .
//  CloseStamp    .
//--------------------------------------------------------------------------------
int       LIB_FUNC OpenStamp();


//   - 760
//--------------------------------------------------------------------------------
//     "".   .
//      ColumnNumber   TextLine,   
//  OpenStamp   CloseStamp,  .
//  ColumnNumber    ,   c.
//          .
//  CloseStamp    .
//  sheetNumb -  ,   1 
// [20.06.2005]
//---------------------------------------------------------------------------
int  LIB_FUNC OpenStampEx( int sheetNumb );


//   - 137
//--------------------------------------------------------------------------------
//     "".   .
//--------------------------------------------------------------------------------
reference       LIB_FUNC CloseStamp( );

//   - 138
//---------------------------------------------------------------------------
//   .
//      , ,  ,
//     
//---------------------------------------------------------------------------
int       LIB_FUNC ColumnNumber( unsigned int numb );

//   - 139
//---------------------------------------------------------------------------
//    - .    .
//  numb = 0,   .    -  .
//---------------------------------------------------------------------------
int       LIB_FUNC ClearStamp( unsigned int numb );

//   - 761
//---------------------------------------------------------------------------
//    - .   .
//  numb = 0,   .    -  .
// [20.06.2005]
//---------------------------------------------------------------------------
int       LIB_FUNC ClearStampEx( int sheetNumb, unsigned int numb );



//   - 179
//---------------------------------------------------------------------------
//    ,     
//         ColumnNumber,    
// 
//         - TEXT_LINE_ARR
//  0,        
//                      OpenStamp( );
//   numb != NULL -                      GetStampColumnText(...);
//                 CloseStamp( );
//---------------------------------------------------------------------------
reference  LIB_FUNC GetStampColumnText( unsigned int *numb );

//   - 235
//---------------------------------------------------------------------------
//                                      OpenStamp( );
//                 SetStampColumnText(...);
//  1     0                CloseStamp( );
//---------------------------------------------------------------------------
int  LIB_FUNC SetStampColumnText( unsigned int numb,     // 
                                  reference textArr );   //    - TEXT_LINE_ARR

//   - 731
//---------------------------------------------------------------------------
//     
// material -  ,     (TEXT_LINE_ARR)
// density  - 
//  1     0                
//---------------------------------------------------------------------------
int LIB_FUNC ksSetMaterialParam( reference material, double density );

//   - 324
//-------------------------------------------------------------------------------
//     ,    :
// t=0 - ,        
// t=1 - ,
// t=2 - 
// t=3 - 
// t=4 -  ;   
// t=5 - 
// t=6 -     
//-------------------------------------------------------------------------------
reference  LIB_FUNC GetReferenceDocumentPart( unsigned char t );

//   - 762
//-------------------------------------------------------------------------------
//    
//    :
// t=0 - ,                 sheetNumb -  ,   1 
// t=1 - ,   sheetNumb -  
// t=2 -  sheetNumb -  
// t=3 -                sheetNumb -  
// t=4 -  ;    sheetNumb -  ,   1; 0 -    
// t=5 -               sheetNumb -  
// t=6 -          sheetNumb -  ,   1 
// [20.06.2005]
//-------------------------------------------------------------------------------
reference  LIB_FUNC GetReferenceDocumentPartEx( unsigned char t, int sheetNumb );


//   - 76
//--------------------------------------------------------------------------
//  .   .    .
//   *number = 0,       .
//  *number = n,     n.   n ,
//    ( reference = 0) - .
//--------------------------------------------------------------------------
reference LIB_FUNC CreateSheetView( ViewParam * par, //    
																		int * number );  // 

//   - 792
//--------------------------------------------------------------------------
//  .   .    .
//   *number = 0,       .
//  *number = n,     n.   n ,
//    ( reference = 0) - .
//--------------------------------------------------------------------------
reference LIB_FUNC CreateSheetViewW( ViewParamW * par, //    
																		 int * number );   // 

#ifdef _UNICODE
#define CreateSheetViewT  CreateSheetViewW
#else
#define CreateSheetViewT  CreateSheetView
#endif // !_UNICODE


//   - 710
//--------------------------------------------------------------------------
//     
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
reference LIB_FUNC ksCreateSheetArbitraryView( AssociationViewParam *par, //  
                                               int *number );             //  

//   - 793
//--------------------------------------------------------------------------
//     
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
reference LIB_FUNC ksCreateSheetArbitraryViewW( AssociationViewParamW *par, //  
                                                int *number );              //  

#ifdef _UNICODE
#define ksCreateSheetArbitraryViewT  ksCreateSheetArbitraryViewW
#else
#define ksCreateSheetArbitraryViewT  ksCreateSheetArbitraryView
#endif // !_UNICODE

//   - 711
//--------------------------------------------------------------------------
//    
//  1   , 0   
//--------------------------------------------------------------------------
int LIB_FUNC ksCreateSheetStandartViews( AssociationViewParam * par, //  
                                         unsigned int   bitVector,   //     VIEW_FRONT...VIEW_ISO,   
                                         double         dx,          //     
                                         double         dy );        //     

//   - 794
//--------------------------------------------------------------------------
//    
//  1   , 0   
//--------------------------------------------------------------------------
int LIB_FUNC ksCreateSheetStandartViewsW( AssociationViewParamW * par,//  
                                          unsigned int   bitVector,   //     VIEW_FRONT...VIEW_ISO,   
                                          double         dx,          //     
                                          double         dy );        //     

#ifdef _UNICODE
#define ksCreateSheetStandartViewsT  ksCreateSheetStandartViewsW
#else
#define ksCreateSheetStandartViewsT  ksCreateSheetStandartViews
#endif // !_UNICODE


//   - 712
//--------------------------------------------------------------------------
//    
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
reference LIB_FUNC ksCreateSheetProjectionView( AssociationViewParam * par, //  
                                                int *number,                //           
                                                reference view );           //   

//   - 795
//--------------------------------------------------------------------------
//    
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
reference LIB_FUNC ksCreateSheetProjectionViewW( AssociationViewParamW * par,//  
                                                 int *number,                //           
                                                 reference view );           //   

#ifdef _UNICODE
#define ksCreateSheetProjectionViewT  ksCreateSheetProjectionViewW
#else
#define ksCreateSheetProjectionViewT  ksCreateSheetProjectionView
#endif // !_UNICODE


//   - 713
//--------------------------------------------------------------------------
//     
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
reference LIB_FUNC ksCreateSheetArrowView( AssociationViewParam * par, //   
                                           int * number,               //           
                                           reference obj );            //    " "

//   - 796
//--------------------------------------------------------------------------
//     
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
reference LIB_FUNC ksCreateSheetArrowViewW( AssociationViewParamW * par, //   
                                            int * number,                //           
                                            reference obj );             //    " "

#ifdef _UNICODE
#define ksCreateSheetArrowViewT  ksCreateSheetArrowViewW
#else
#define ksCreateSheetArrowViewT  ksCreateSheetArrowView
#endif // !_UNICODE

//   - 714
//--------------------------------------------------------------------------
//    \
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
reference LIB_FUNC ksCreateSheetSectionView( AssociationViewParam * par,  //   
                                             int * number,                //           
                                             reference obj );             //     

//   - 797
//--------------------------------------------------------------------------
//    \
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
reference LIB_FUNC ksCreateSheetSectionViewW( AssociationViewParamW * par, //   
                                              int * number,                //           
                                              reference obj );             //     

#ifdef _UNICODE
#define ksCreateSheetSectionViewT  ksCreateSheetSectionViewW
#else
#define ksCreateSheetSectionViewT  ksCreateSheetSectionView
#endif // !_UNICODE

//   - 715
//--------------------------------------------------------------------------
//     
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
reference LIB_FUNC ksCreateSheetRemoteView( AssociationViewParam * par, //   
                                            int * number,               //           
                                            reference obj );            //    "  "


//   - 798
//--------------------------------------------------------------------------
//     
//   *number = 0,       .
//  *number=n;     n ,   n 
//      reference=0 - 
//   ,    
//--------------------------------------------------------------------------
reference LIB_FUNC ksCreateSheetRemoteViewW( AssociationViewParamW * par, //   
                                             int * number,                //           
                                             reference obj );             //    "  "
 
#ifdef _UNICODE
#define ksCreateSheetRemoteViewT  ksCreateSheetRemoteViewW
#else
#define ksCreateSheetRemoteViewT  ksCreateSheetRemoteView
#endif // !_UNICODE

//   - 758
//-------------------------------------------------------------------------------
//   .   : SAFEARRAY double (VT_ARRAY | VT_R8)
//     16 ,     44.
// ---
VARIANT LIB_FUNC ksAssociationViewMatrix3D( reference view );


//   - 759
//-------------------------------------------------------------------------------
//   3D     
//  1 -   , 0 -   
// ---
int LIB_FUNC ksPoint3DToAssociationView( reference view,                      //    
                                         double x3D, double y3D, double z3D,  //  3D  
                                         double * x2D, double * y2D );        //  -    

//   - 77
//--------------------------------------------------------------------------
//         .
//    c   ,   0.
//--------------------------------------------------------------------------
reference LIB_FUNC GetViewReference( int number );

//   - 78
//--------------------------------------------------------------------------
//        ;
//       -1.      0.
//  p- ,     .
//  p = 0 -     
//--------------------------------------------------------------------------
int       LIB_FUNC GetViewNumber( reference p ); // p  -     

//   - 79
//--------------------------------------------------------------------------
//    ,    .    .
//   1   , 0    .
//--------------------------------------------------------------------------
reference LIB_FUNC OpenView( int number );   //number -  

//   - 127
//--------------------------------------------------------------------------
//       0  .
//--------------------------------------------------------------------------
int       LIB_FUNC NewViewNumber( );

//   - 80
//--------------------------------------------------------------------------
//    .      , 
//  .
//--------------------------------------------------------------------------
reference LIB_FUNC Layer(int n);             //n -  

//   - 81
//--------------------------------------------------------------------------
//        .
//      -1.      0.
//  p - ,     .
//  p = 0 -     
//--------------------------------------------------------------------------
int       LIB_FUNC GetLayerNumber( reference p );//p -     

//   - 82
//--------------------------------------------------------------------------
//          .
//    c   ,   0.
//--------------------------------------------------------------------------
reference LIB_FUNC GetLayerReference( int  number ); //number -  

//   - 172
//--------------------------------------------------------------------------------------------
//    .       
//   (    )
//   1   , 0 - 
//--------------------------------------------------------------------------------------------
int       LIB_FUNC  ChangeObjectLayer( reference obj, //  
                                       int number );  //-  ,   

//   - 221
//------------------------------------------------------------------------------
//          
//  docsArr -    ,   
//    1     0  .
// ---
int LIB_FUNC ksPrintPreviewWindow( reference docsArr,   //    CHAR_STR_ARR  CHAR_STR_ARR_W
                                   int       inquiry ); // 1 -  docsArr = 0       
                                                        // 0 -  



//   - 222
//------------------------------------------------------------------------------
//  -     
// ---
int LIB_FUNC ksDrawKompasDocument( void * HWindow,       //  
                                   LPSTR  docFileName ); //    


//   - 799
//------------------------------------------------------------------------------
//  -      ( Unicode )
// ---
int LIB_FUNC ksDrawKompasDocumentW( void * HWindow,       //  
                                    LPWSTR docFileName ); //    

#ifdef _UNICODE
#define ksDrawKompasDocumentT  ksDrawKompasDocumentW
#else
#define ksDrawKompasDocumentT  ksDrawKompasDocument
#endif // !_UNICODE


//   - 719
//------------------------------------------------------------------------------
//  -     
// ---
int LIB_FUNC ksDrawKompasDocumentByReference( void *HWindow,     //  
                                              reference pDoc );  //   

//   - 241
//------------------------------------------------------------------------------
//       
// ---
int  LIB_FUNC ksDrawKompasGroup ( void     *HWindow, //  
                                  reference gr );    // 


//   - 957
//------------------------------------------------------------------------------
//       
// ---
int  LIB_FUNC ksDrawKompasText( void  *HWindow, //  
                                LPSTR text );   // 

//   - 958
//------------------------------------------------------------------------------
//       
// ---
int  LIB_FUNC ksDrawKompasTextW( void  *HWindow, //  
                                 LPWSTR text );  // 


#ifdef _UNICODE
#define ksDrawKompasTextT  ksDrawKompasTextW
#else
#define ksDrawKompasTextT  ksDrawKompasText
#endif // !_UNICODE


//   - 227
//------------------------------------------------------------------------------
//  ,  ,    *.tbl
// ---
reference  LIB_FUNC ksReadTableFromFile( LPSTR tblFileName ); //     

//   - 802
//------------------------------------------------------------------------------
//  ,  ,    *.tbl
// ---
reference  LIB_FUNC ksReadTableFromFileW( LPWSTR tblFileName ); //     

#ifdef _UNICODE
#define ksReadTableFromFileT  ksReadTableFromFileW
#else
#define ksReadTableFromFileT  ksReadTableFromFile
#endif // !_UNICODE


//   - 374
//------------------------------------------------------------------------------
//    ,   ,
//   .
//   c      ,   
//   : Cursor, Placement, CommandWindow, ksEditViewObject.
//       0   
// ---
reference LIB_FUNC ksViewGetObjectArea();




//   - 232
//------------------------------------------------------------------------------
//      
//     .
//       VariableParam  0   
// ---
reference LIB_FUNC ksGetDocVariableArray( reference p ); //     


//   - 233
//------------------------------------------------------------------------------
//          
//     .
//  1     0   
// ---
int LIB_FUNC ksSetDocVariableArray( reference obj,             //      
                                    reference arr,             //     VARIABLE_ARR
                                    unsigned char setNote  );  // 0 -    1  


//   - 397
//------------------------------------------------------------------------------
//   .
//   1    0   
// ---
int LIB_FUNC ksSetObjConstraint( reference obj, ConstraintParam *par );


//   - 399
//------------------------------------------------------------------------------
//   ,   .
//        ConstraintParam.
//         0
// ---
reference LIB_FUNC ksGetObjConstraints( reference obj );//   


//   - 403
//------------------------------------------------------------------------------
//   .
//   1    0   
// ---
int LIB_FUNC ksDestroyObjConstraint( reference obj, ConstraintParam *par );

//   - 255
//--------------------------------------------------------------------------
//       -  
//  m = 0 -  
// angl -     OX     
//      1,    - 0
//      (    SetMacroPlacement ) - 
//  -1
//--------------------------------------------------------------------------
int LIB_FUNC GetMacroPlacement( reference macro, double *x, double *y, double *angl );

//   - 730
//--------------------------------------------------------------------------
//    GetMacroPlacement,         
// sheetParam = 1 -     
// sheetParam = 0 - 
//--------------------------------------------------------------------------
int LIB_FUNC ksGetMacroPlacement( reference macro, double *x, double *y, 
                                  double *angl, unsigned char sheetParam );

//   - 994
//--------------------------------------------------------------------------
//    ksGetMacroPlacement,       
// *mirrorSymmetry = 0 -   
// *mirrorSymmetry = 1 -      
// mirrorSymmetry = NULL -  
//--------------------------------------------------------------------------
int LIB_FUNC ksGetMacroPlacementEx( reference macro, double *x, double *y, 
                                    double *angl, unsigned char sheetParam, 
                                    unsigned char * mirrorSymmetry );   //   

//   - 256
//--------------------------------------------------------------------------
//       -   
// angl -     OX     
// relativ = 1 - (x, y, angl) -    ..  
// relativ = 0 - (x, y, angl) -    .. 
//--------------------------------------------------------------------------
int LIB_FUNC SetMacroPlacement( reference macro, double x, double y, double angl, int relativ );

//   - 995
//--------------------------------------------------------------------------
//    SetMacroPlacement,       
// mirrorSymmetry = 0 -   
// mirrorSymmetry = 1 -      
// mirrorSymmetry   . ksGetMacroPlacementEx
//--------------------------------------------------------------------------
int LIB_FUNC ksSetMacroPlacementEx( reference macro, double x, double y, double angl, int relative, 
                                    char mirrorSymmetry ); //   

//   - 409
//------------------------------------------------------------------------------
//     ()   .
//  :
//  0  -  (   ,      );
//  -1 -       ;
//  1  -  .
// ---
int LIB_FUNC ksGetZona( double x, double y,   //x,y -     ;
                        LPSTR  zona,          //   ;
                        int    size );        //  

//   - 
//------------------------------------------------------------------------------
//     ()   .
//  :
//  0  -  (   ,      );
//  -1 -       ;
//  1  -  .
// ---
int LIB_FUNC ksGetZonaW( double x, double y,   //x,y -     ;
                         LPWSTR zona,          //   ;
                         int    size );        //  

#ifdef _UNICODE
#define ksGetZonaT  ksGetZonaW
#else
#define ksGetZonaT  ksGetZona
#endif // !_UNICODE


//   - 261
//------------------------------------------------------------------------------
//     (      )  
//    grRegion.
// grClear  -  ,     0 -     
// GrRegion -  ,   
// ---
int LIB_FUNC ksClearRegion( reference grClear, reference grRegion, unsigned char inside  );

//   - 333
//------------------------------------------------------------------------------------------------
//        ,   
//      x1,y1, x2,y2 .     
//------------------------------------------------------------------------------------------------
int LIB_FUNC  ksZoom ( double x1, double y1, double x2, double y2 );

//   - 334
//------------------------------------------------------------------------------------------------
//        ,    
//    .     
//------------------------------------------------------------------------------------------------
int  LIB_FUNC ksZoomScale ( double x, double y, double scale );

//   - 335
//------------------------------------------------------------------------------------------------
//   / ""       
//------------------------------------------------------------------------------------------------
int LIB_FUNC ksZoomPrevNextOrAll ( unsigned char type );//0-  Zoom,1-  Zoom,2- 

//   - 385
//------------------------------------------------------------------------------
//        
// ---
int LIB_FUNC ksGetZoomScale ( double *x, double *y, double *scale ); //      

//   - 337
//------------------------------------------------------------------------------------------------
//        
//------------------------------------------------------------------------------------------------
int LIB_FUNC ksRefreshActiveWindow ( );

//   - 438
//------------------------------------------------------------------------------
//        
//  1           
// ---
int LIB_FUNC IsVisibleOrHiddenArraysInObject( reference obj );

//   - 439
//------------------------------------------------------------------------------
//  1       .
// ---
int LIB_FUNC IsObjFromAssociativeView( reference obj );


//   - 440
//------------------------------------------------------------------------------
//  1     
// ---
int LIB_FUNC IsGeomObject( reference obj );

//   - 280
//------------------------------------------------------------------------------
//       
// ---
double LIB_FUNC ksGetCursorLimit();

//   - 295
//-----------------------------------------------------------------------------
//       .
//      ,    .
// deleteOldCurve - true  curve    ,
//                  false  curve     .
//      ,  0   .
//-----------------------------------------------------------------------------
reference LIB_FUNC ksTrimCurve( reference curve,          // 
															  double x1, double y1,     //  
																double x2, double y2,     //  
                                double x3, double y3,     //  
                                unsigned char deleteOldCurve );    //    

//   - 299
//-------------------------------------------------------------------------------
//  .
// fileName -     ,
// toFile   -      (*.prn,  ..),  NULL   
//               ,
// scale    - ,     
//   0   .
// ---
int LIB_FUNC ksPrintKompasDocument( const char * fileName, const char * toFile, double scale );


//   - 883
//-------------------------------------------------------------------------------
//  .
// fileName -     ,
// toFile   -      (*.prn,  ..),  NULL   
//               ,
// scale    - ,     
//   0   . (Unicode)
// ---
int LIB_FUNC ksPrintKompasDocumentW( LPCWSTR fileName, LPCWSTR toFile, double scale );

#ifdef _UNICODE
#define ksPrintKompasDocumentT  ksPrintKompasDocumentW
#else
#define ksPrintKompasDocumentT  ksPrintKompasDocument
#endif // !UNICODE


//   - 981
//-------------------------------------------------------------------------------
//  .
// fileName -     ,
// toFile   -      (*.prn,  ..),  NULL   
//               ,
// scale    - ,     
// fKompasPrint = 1 true   , 0 -   Windows
//   0   .
// ---
int LIB_FUNC ksPrintKompasDocumentEx( const char * fileName, const char * toFile, double scale, int fKompasPrinter );


//   - 982
//-------------------------------------------------------------------------------
//  .
// fileName -     ,
// toFile   -      (*.prn,  ..),  NULL   
//               ,
// scale    - ,     
// fKompasPrint = 1 true   , 0 -   Windows
//   0   . (Unicode)
// ---
int LIB_FUNC ksPrintKompasDocumentExW( LPCWSTR fileName, LPCWSTR toFile, double scale, int fKompasPrinter );

#ifdef _UNICODE
#define ksPrintKompasDocumentExT  ksPrintKompasDocumentExW
#else
#define ksPrintKompasDocumentExT  ksPrintKompasDocumentEx
#endif // !UNICODE



//   - 702
//-------------------------------------------------------------------------------
//            
//   ,  ,      
//  /   -
//   0   .
//-------------------------------------------------------------------------------
double LIB_FUNC ksGetLeaderShelfLength( reference p,          //  
                                       double *x, double *y ); //  
   

//   - 954
//-------------------------------------------------------------------------------
//          
//   ,  ,      
//  /   -  
//-------------------------------------------------------------------------------
int LIB_FUNC ksGetShelfPoint( reference p, int index, double *x, double *y, int paramType );


//   - 716
//-------------------------------------------------------------------------------
//   
//     DocType "ldefin2d.h"     0   
// ---
int LIB_FUNC ksGetDocumentType( reference doc );

//   - 722
//-------------------------------------------------------------------------------
//     DocType "ldefin2d.h"     
// 0   
//-------------------------------------------------------------------------------
int LIB_FUNC ksGetDocumentTypeByName( char * fileName );


//   - 884
//-------------------------------------------------------------------------------
//     DocType "ldefin2d.h"     
// 0    (Unicode)
//-------------------------------------------------------------------------------
int LIB_FUNC ksGetDocumentTypeByNameW( LPWSTR fileName );


#ifdef _UNICODE
#define ksGetDocumentTypeByNameT  ksGetDocumentTypeByNameW
#else
#define ksGetDocumentTypeByNameT  ksGetDocumentTypeByName
#endif // !UNICODE


//   - 725
//-----------------------------------------------------------------------------
//     COM
// ifType      -    ksNotifyType
// object      -   
// pContainer  -    ,  
// ---
int LIB_FUNC ksConnectionAdvise ( NotifyConnectionParam * param, LPUNKNOWN object );

//   - 726
//-----------------------------------------------------------------------------
//      COM
// ifType      -    ksNotifyType
// pContainer  -    ,  
// ---
int LIB_FUNC ksConnectionUnadvise ( NotifyConnectionParam * param );

//-------------------------------------------------------------------------------
//   
// group -  ,
// obj - ,    
// orderType -     /*ChangeOrderType*/
//  1   ,  0 -   
// ---
int LIB_FUNC ksChangeObjectsOrder( reference group, reference obj, int orderType );

//   - 736
// [17/5/2004] 
//-------------------------------------------------------------------------------
//     
//     
//  :
// 1 -    , 0 - 
//  :
// doc -   
// ---
long LIB_FUNC ksGetOrthoMode( reference doc );

//   - 737
// [17/5/2004] 
//-------------------------------------------------------------------------------
//    
//     
//  :
// 1   , 0 -   
//  :
// doc -   
// orthoMode -    ( 1 - , 0 -  )
// ---
long LIB_FUNC ksSetOrthoMode( reference doc, long orthoMode );

//   - 741
// [26/5/2004] 
//-----------------------------------------------------------------------------
//     DblClick    
//  :
// 1 -   DblClick , 0 - 
//  :
// ref -   
// ---
extern "C" long LIB_FUNC ksGetMacroWaitDblClickEdit( reference ref );

//   - 742
// [26/5/2004] 
//-------------------------------------------------------------------------------
//    DblClick    
//  :
// 1 -   , 0 -   
//  :
// ref -   
// waitDblClick -   DblClick ( 1 - , 0 -  )
// ---
extern "C" long LIB_FUNC ksSetMacroWaitDblClickEdit( reference ref, long waitDblClick );

//   - 751
// [24/8/2004] 
//-------------------------------------------------------------------------------
//     
// ---
IParametrizationParam* LIB_FUNC ksGetParametrizationParam();

//   - 740
// [24/8/2004] 
//-----------------------------------------------------------------------------
//  
//  group = 0,   .
//         [0..10] 
//       [0..10] 
//   1     0   
//--- 
int LIB_FUNC ksParametrizeObjects( reference group,                //        
                                   IParametrizationParam* param ); //  

// [20.06.2005]
//   - 763
//-------------------------------------------------------------------------------------------------
//      
//  pDoc = 0 -   
//-------------------------------------------------------------------------------------------------
int LIB_FUNC ksGetDocumentPagesCount( reference pDoc );

// [08.08.2008]
//   - 985
//-------------------------------------------------------------------------------------------------
//      
// fileName -         .
//-------------------------------------------------------------------------------------------------
#ifndef __VIEWER_VERSION__
int LIB_FUNC ksLibDocumentInsertProc( LPSTR fileName );
#endif // __VIEWER_VERSION__

// [08.08.2008]
//   - 986
//-------------------------------------------------------------------------------------------------
//      
// fileName -         .
//  (Unicode)
//-------------------------------------------------------------------------------------------------
#ifndef __VIEWER_VERSION__
int LIB_FUNC ksLibDocumentInsertProcW( LPWSTR fileName );
#endif // __VIEWER_VERSION__

#ifdef _UNICODE
#define ksLibDocumentInsertProcT  ksLibDocumentInsertProcW
#else
#define ksLibDocumentInsertProcT  ksLibDocumentInsertProc
#endif // !UNICODE


//   - 999
//----------------------------------------------------------------------------------------------
//    .
// from -   ,    
// to   -   ,    
// gr   -    
//
//       to
// 
//----------------------------------------------------------------------------------------------
#ifndef __VIEWER_VERSION__
  reference LIB_FUNC CopyGroupToDocument( reference gr, reference from, reference to );
#endif // __VIEWER_VERSION__

} // extern "C"

#endif // __LT_EDIT_H
