home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / lxprpas.zip / LPEXAPI.H < prev    next >
Text File  |  1998-04-20  |  5KB  |  112 lines

  1. /*************************************************************
  2. *                                                            *
  3. *  lpexapi.h: include file for external C/C++ LPEX commands. *
  4. *                                                            *
  5. **************************************************************
  6. *                                                            *
  7. *         (C) Copyright IBM Corporation 1993, 1996           *
  8. *                                                            *
  9. *************************************************************/
  10.  
  11. #ifndef LPEXAPI_H
  12. #define LPEXAPI_H
  13.  
  14. #ifdef __cplusplus
  15.    extern "C" {
  16. #endif
  17.  
  18. /*-----------------------------------------------------------------*/
  19. #include "lpexcpat.h"
  20.  
  21. #define _cinit
  22. #define _cterm
  23. /*-----------------------------------------------------------------*/
  24.  
  25. #define MAXLEN   2500                            /* maximum element text size */
  26. #define MAXQUERY 2800                      /* maximum length for query result */
  27.  
  28.  
  29. /* LPEX uses unsigned char throughout */
  30. #ifndef uchr
  31.    #ifdef __cplusplus
  32.    #define uchr char
  33.    #else
  34.    #define uchr unsigned char
  35.    #endif
  36. #endif
  37.  
  38.  
  39. /* LP_COMMAND - execute an LPEX command.  mp2 is MPFROM2SHORT(a, b) */
  40. /* where "a" is either LP_COMMAND_INTERNAL or LP_COMMAND_EXTERNAL,  */
  41. /*   and "b" is either LP_COMMAND_WINDOWED or LP_COMMAND_CURRENT.   */
  42. #ifndef LP_COMMAND
  43. #define LP_COMMAND            0x1002       /* note: keep in sync with lxpm.h! */
  44. #define LP_COMMAND_EXTERNAL ((short)0)
  45. #define LP_COMMAND_INTERNAL ((short)1)
  46. #define LP_COMMAND_WINDOWED ((short)0)
  47. #define LP_COMMAND_CURRENT  ((short)1)
  48. #endif /*LP_COMMAND*/
  49.  
  50. int   __cdecl LpexEntry(uchr*);              /* Command entry point */
  51. int   __cdecl LpexExit(uchr*);               /* Command unlink entry point */
  52. void  __cdecl LpexDocExit(int);              /* Document exit entry point */
  53.  
  54. char* __cdecl LpexProfile(void);             /* pathname for LPEX.ini */
  55. int   __cdecl LpexCommand(const uchr*);      /* run an LPEX command */
  56. int   __cdecl LpexCall(const uchr*, const uchr*);    /* call an LPEX function */
  57. uchr* __cdecl LpexQuery(const uchr*, uchr*); /* query an LPEX item */
  58.  
  59. /* storage allocation/freeing done by LPEX */
  60. uchr* __cdecl LpexAlloc(int);                /* allocate LPEX storage */
  61. int   __cdecl LpexFree(uchr*);               /* free LPEX allocated storage */
  62.  
  63. #define LpexMsg(a)          LpexCall("msg",a)
  64.  
  65. /* the following functions support the user word */
  66. int   __cdecl LpexQueryUserLink(long int scope, void** pObjectPtr);
  67. int   __cdecl LpexSetUserLink(long int scope, void* object);
  68. int   __cdecl LpexFindUserLink(long int scope, void* object);
  69.  
  70. /* valid values of scope: */
  71. #define LPEX_DOCUMENT 1
  72. #define LPEX_VIEW     2
  73. #define LPEX_ELEMENT  3
  74.  
  75. /* the following extend the fonts recognized by GML */
  76. int   __cdecl LpexQueryGMLFonts(uchr*);      /* query special GML fonts  */
  77. int   __cdecl LpexAddGMLFonts(uchr*);        /* add to special GML fonts */
  78.  
  79. /* the following are fast path entry to some common functions */
  80. int   __cdecl LpexNext(const uchr*);         /* NEXT                     */
  81. int   __cdecl LpexPrev(const uchr*);         /* PREV                     */
  82. int   __cdecl LpexInsert(const uchr*);       /* INSERT text              */
  83. int   __cdecl LpexQueryRawText(uchr*);       /* query RAWTEXT            */
  84. int   __cdecl LpexQueryText(uchr*);          /* query CONTENT            */
  85. int   __cdecl LpexSetText(const uchr*);      /* set   CONTENT            */
  86. int   __cdecl LpexQueryFonts(uchr*);         /* query FONTS              */
  87. int   __cdecl LpexSetFonts(const uchr*);     /* set   FONTS              */
  88. int   __cdecl LpexQueryCharModes(uchr*);     /* query MODES              */
  89. int   __cdecl LpexQueryClass(unsigned long*);/* query CLASS              */
  90. int   __cdecl LpexSetClass(unsigned long);   /* set   CLASS              */
  91.  
  92. int   __cdecl LpexQueryElementState(unsigned long*); /* query ELESTATE:          */
  93. #define LPEX_ELE_VISIBLE   (0x80000000)        /*   visible element        */
  94. #define LPEX_ELE_SHOW      (0x40000000)        /*   show element           */
  95. #define LPEX_ELE_PROTECTED (0x20000000)        /*   protected element      */
  96.  
  97. /* The following should be called before and after a modal dialog or */
  98. /* message box is presented to the user.  Pass in TRUE before the    */
  99. /* dialog is brought up and FALSE after the dialog is dismissed.     */
  100. void __cdecl LpexDialogUp(unsigned long);
  101.  
  102. /* Note:  The following is provided *for compatibility */
  103. /* only*.  It may not be available in future releases! */
  104. unsigned long /*HAB*/__cdecl LpexHab(void);  /* obtain the hab           */
  105. void*                __cdecl LpexRock(void); /* obtain the rock pointer  */
  106.  
  107. #ifdef __cplusplus
  108.    }
  109. #endif
  110.  
  111. #endif /* LPEXAPI_H */
  112.