home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / EDITOR / LXMIN2 / LPEXAPI.H < prev    next >
Text File  |  1995-05-11  |  4KB  |  104 lines

  1. /*************************************************************
  2. *                                                            *
  3. *  LPEXAPI.H: Include file for external C/C++ LPEX commands. *
  4. *                                                            *
  5. **************************************************************
  6. *                                                            *
  7. *          (C) Copyright IBM Corporation 1993-1995           *
  8. *                                                            *
  9. *************************************************************/
  10.  
  11. #ifdef __cplusplus
  12.    extern "C" {
  13. #endif
  14.  
  15. #ifndef LPEXAPI_H
  16. #define LPEXAPI_H
  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. #ifndef uchr
  29.    #ifdef __cplusplus
  30.    #define uchr char
  31.    #else
  32.    #define uchr unsigned char           /* LPEX uses unsigned char throughout */
  33.    #endif
  34. #endif
  35.  
  36. /* LP_COMMAND - execute an LPEX command.  mp2 is MPFROM2SHORT(a, b) */
  37. /* where "a" is either LP_COMMAND_INTERNAL or LP_COMMAND_EXTERNAL,  */
  38. /*   and "b" is either LP_COMMAND_WINDOWED or LP_COMMAND_CURRENT.   */
  39. #ifndef LP_COMMAND
  40. #if defined( WM_USER )
  41. #define LP_COMMAND        (WM_USER + 4)   
  42. #endif
  43. #define LP_COMMAND_EXTERNAL ((short)0) 
  44. #define LP_COMMAND_INTERNAL ((short)1) 
  45. #define LP_COMMAND_WINDOWED ((short)0) 
  46. #define LP_COMMAND_CURRENT  ((short)1)
  47. #endif
  48.  
  49. int     LpexEntry(uchr *);                     /* Command entry point */
  50. int     LpexExit(uchr *);                      /* Command unlink exit point */
  51.  
  52. int     LpexCommand(const uchr *);             /* run an LPEX command */
  53. int     LpexCall(const uchr *, const uchr *);  /* call an LPEX function */
  54. uchr *  LpexQuery(const uchr *, uchr *);       /* query an LPEX item */
  55.  
  56. /* all storage allocation/freeing to be done by LPEX */
  57. uchr *  LpexAlloc(int);                        /* allocate LPEX storage */
  58. int     LpexFree(uchr *);                      /* free LPEX allocated storage */
  59.  
  60. #define LpexMsg(a)          LpexCall("msg",a)
  61.  
  62. /* the following functions support the user word */
  63. int     LpexQueryUserLink(long int scope,void **pObjectPtr);
  64. int     LpexSetUserLink(long int scope, void *object);
  65. int     LpexFindUserLink(long int scope,void *object);
  66.  
  67. /* valid values of scope: */
  68. #define LPEX_DOCUMENT 1
  69. #define LPEX_VIEW     2
  70. #define LPEX_ELEMENT  3
  71.  
  72. /* the following extend the fonts recognised by GML */
  73. int     LpexQueryGMLFonts(uchr *);             /* query special GML fonts */
  74. int     LpexAddGMLFonts(uchr *);               /* add to special GML fonts */
  75.  
  76. /* the following are fast path entry to some common functions */
  77. int     LpexNext(const uchr *);                /* NEXT          */
  78. int     LpexPrev(const uchr *);                /* PREV          */
  79. int     LpexInsert(const uchr *);              /* INSERT text   */
  80. int     LpexQueryRawText(uchr *);              /* query RAWTEXT */
  81. int     LpexQueryText(uchr *);                 /* query CONTENT */
  82. int     LpexSetText(const uchr *);             /* set   CONTENT */
  83. int     LpexQueryFonts(uchr *);                /* query FONTS   */
  84. int     LpexSetFonts(const uchr *);            /* set   FONTS   */
  85. int     LpexQueryCharModes(uchr *);            /* query MODES   */
  86. int     LpexQueryClass(unsigned long *);       /* query CLASS   */
  87. int     LpexSetClass(unsigned long);           /* set   CLASS   */
  88.  
  89. int     LpexQueryElementState(unsigned long *);/* query ELESTATE:     */
  90. #define LPEX_ELE_VISIBLE   (0x80000000)        /*   visible element   */
  91. #define LPEX_ELE_SHOW      (0x40000000)        /*   show element      */
  92. #define LPEX_ELE_PROTECTED (0x20000000)        /*   protected element */
  93.  
  94. /* Note:  The following is provided *for compatibility */
  95. /* only*.  It may not be available in future releases! */
  96. HAB     LpexHab(void);                         /* obtain the hab */
  97. void*   LpexRock(void);                        /* obtain the rock pointer */
  98.  
  99. #endif /* LPEXAPI_H */ 
  100.  
  101. #ifdef __cplusplus
  102.    }
  103. #endif
  104.