home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ctrl4.zip / PMCX.H < prev    next >
Text File  |  1996-08-01  |  6KB  |  154 lines

  1.  
  2. /* pmcx.h       Created:    1993-12-14  Revised:    1995-11-08    */
  3.  
  4. /* PM Control Extensions (PMCX)                        */
  5. /* Definitions Header                            */
  6.  
  7. /* Consult User's Guide for complete description of PM Control          */
  8. /* Extensions                                */
  9.  
  10. /* Copyright ╕ 1989-1996  Prominare Inc.  All Rights Reserved.        */
  11.  
  12. /* --------------------------------------------------------------------    */
  13.  
  14. /* Function Prototypes (32-bit definition)                */
  15. /* -------------------                            */
  16. /*                                    */
  17. /*     Control Initialization:                        */
  18. /*                                    */
  19. /*       BOOL    EXPENTRY XxxxRegister(HAB hAB);                */
  20. /*                                    */
  21. /*     Styles Dialogue Procedures:                    */
  22. /*                                    */
  23. /*       MRESULT EXPENTRY XxxxStyles(HWND hWnd, ULONG    msg,        */
  24. /*                       MPARAM mp1, MPARAM mp2);        */
  25. /*                                    */
  26. /*     Window Procedure:                        */
  27. /*                                    */
  28. /*       MRESULT EXPENTRY XxxxWndProc(HWND hWnd, ULONG msg,        */
  29. /*                    MPARAM mp1, MPARAM mp2);    */
  30. /*                                    */
  31. /*     Control Information Procedure:                    */
  32. /*                                    */
  33. /*       BOOL    EXPENTRY XxxxQuery(PUSERINFO pUserInfo);        */
  34. /*                                    */
  35. /*     Set Page    Procedure:                        */
  36. /*                                    */
  37. /*       BOOL    EXPENTRY XxxxSetPage(HWND hwndControl, HWND hwndPage);    */
  38.  
  39. /* --- Constant    Definitions -------------------------------------------    */
  40.  
  41. #define    CTYPES            1       /* Maximum Number of    User Types    */
  42. #define    CCHCLASS       32       /* Maximum Classname    Length        */
  43. #define    CCHNAME           32       /* Maximum Name Length        */
  44. #define    CCHAUTHOR       64       /* Maximum Author Name Length    */
  45. #define    CCHDESC           32       /* Maximum Type Description Length    */
  46. #define    CCHID           32       /* Maximum ID Symbol    Length        */
  47. #define    CCHTEXTMAX      512       /* Maximum Control Text Length    */
  48.  
  49. #define    UTYPE_PRIVATE  0x0002       /* Type:  Private            */
  50. #define    UTYPE_PUBLIC   0x0004       /* Type:  Public            */
  51.  
  52. #define    USER_CWINDOWWORDS   8UL       /* Control Reserved Memory Size    */
  53.  
  54. #define    QWW_USER  (QWL_USER + 0UL) /* Pointer to User Data        */
  55. #define    QWW_CDATA (QWL_USER + 4UL) /* Pointer to Private Data Pointer    */
  56.  
  57. #define    CUACHK_MNEMONIC       0       /* CUA Check:  Mnemonic        */
  58. #define    CUACHK_CAPS       1       /* CUA Check:  Capitalization    */
  59. #define    CUACHK_ELLIPSIS       2       /* CUA Check:  Ellipsis        */
  60.  
  61. #define    STYLETYPE_BITFLAGS 0x0001  /* Style Type:  Bit Flags        */
  62. #define    STYLETYPE_SEQUENCE 0x0002  /* Style Type:  Sequential        */
  63.  
  64. #define    PMCXOPT_NONE      0x00000000UL
  65. #define    PMCXOPT_REFRESH      0x00000001UL
  66. #define    PMCXOPT_VARICDATA 0x00000002UL
  67. #define    PMCXOPT_STYLECHG  0x00000004UL
  68. #define    PMCXOPT_TABABLE      0x00000008UL
  69. #define    PMCXOPT_HELP      0x00000010UL
  70. #define    PMCXOPT_PAGE      0x00000020UL
  71.  
  72. /************************************************************************/
  73. /************************************************************************/
  74. /*                                    */
  75. /*     PMCX 32-Bit Structure Definitions                */
  76. /*                                    */
  77. /************************************************************************/
  78. /************************************************************************/
  79.  
  80. /* --- User Control Styles Structure ----------------------------------    */
  81.  
  82. typedef    struct _STYLE           /* st */
  83.    {                   /* Size:    8 bytes            */
  84.    ULONG    flStyleMask;       /* Style Flag Mask            */
  85.    ULONG    idStyle;           /* Resource String ID        */
  86.    } STYLE ;
  87.  
  88. /* --- User Control Type Structure ------------------------------------    */
  89.  
  90. typedef    struct _USERTYPE       /* ut */
  91.    {                   /* Size:  348 bytes            */
  92.    LONG        cx;               /* Suggested    Width of Control    */
  93.    LONG        cy;               /* Suggested    Height of Control    */
  94.    ULONG    flStyle;           /* Initial Style Flags        */
  95.    ULONG    flOptions;           /* Options Flag            */
  96.    ULONG    cMaxText;           /* Maximum Text Required        */
  97.    ULONG    idDlg;           /* Dialog ID                */
  98.    ULONG    idReserved;           /* Reserved                */
  99.    ULONG    flStyleType;       /* Style Type            */
  100.    ULONG    cCtlData;           /* Control Data Count        */
  101.    ULONG    ulType;           /* Control Type            */
  102.    ULONG    cMasks;           /* Style Masks Count            */
  103.    CHAR        szDescription[CCHDESC];/* Control Name            */
  104.    STYLE    stMasks[32];       /* Style Masks Array            */
  105.    ULONG    aulReserved[4];       /* Reserved                */
  106.    } USERTYPE ;
  107.  
  108. /* --- User Control Information    Structure -----------------------------    */
  109.  
  110. typedef    struct _USERINFO       /* ui */
  111.    {                   /* Size:  512 bytes            */
  112.    ULONG     ulMajor;           /* Control Version Number:  Major    */
  113.    ULONG     ulMinor;           /* Control Version Number:  Minor    */
  114.    CHAR         szAuthor[CCHAUTHOR];  /* Control Author            */
  115.    CHAR         szClassname[CCHCLASS];/* Classname                */
  116.    CHAR         szName[CCHNAME];       /* Library Name            */
  117.    ULONG     aulReserved[6];       /* Reserved                */
  118.    ULONG     cTypes;           /* Number of    Control    Types Supported    */
  119.    USERTYPE  utDefined[CTYPES];       /* Define User Types    Array        */
  120.    } USERINFO ;
  121.  
  122. typedef    USERINFO *PUSERINFO;
  123.  
  124. /* --- User Control Style Structure -----------------------------------    */
  125.  
  126. typedef    struct _USERSTYLE       /* ust */
  127.    {                   /* Size:  112 bytes            */
  128.    PFN        pfnSetSymbolID;       /* Symbol/ID    Set Function Address    */
  129.    PFN        pfnGetSymbolID;       /* Symbol/ID    Get Function Address    */
  130.    PFN        pfnGetFontClr;       /* Font/Colours Function Address    */
  131.    PFN        pfnCUACheck;       /* CUA Compliance Function Address    */
  132.    PFN        pfnRealloc;           /* Reallocation Function Address    */
  133.    ULONG    flStyle;           /* Style                */
  134.    ULONG    id;               /* ID Value                */
  135.    CHAR        szid[CCHID];       /* ID Symbol                */
  136.    PSZ        pszText;           /* Text Pointer            */
  137.    ULONG    cText;           /* Text Count (Including NULL)    */
  138.    PFN        pfnGetBidi;           /* Bidi Params Function Address    */
  139.    ULONG    aulReserved[8];       /* Reserved                */
  140.    PBYTE    pbCtlData;           /* Variable Control Data Pointer    */
  141.    ULONG    cbCtlData;           /* Control Data Size            */
  142.    BYTE        abCtlData[1];       /* Control Data            */
  143.    } USERSTYLE ;
  144.  
  145. typedef    USERSTYLE *PUSERSTYLE;
  146.  
  147. /* --- Macro Helpers for Setting or Retrieving User Style Pointer ------ */
  148.  
  149. #define    PDATATODLG(hwndClient) ((WinSetWindowPtr(hwndClient, QWL_USER,\
  150.     (PVOID)mp2)))
  151.  
  152. #define    PDATAFROMDLG(hwndClient) (((PUSERSTYLE)WinQueryWindowPtr(hwndClient,\
  153.     QWL_USER)))
  154.