home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / TOOLKIT / WPS / WSFILE / WSFILE.C < prev    next >
Text File  |  1995-03-14  |  56KB  |  1,697 lines

  1.  
  2. /******************************************************************************
  3. *
  4. *  Module Name: WSFILE.C
  5. *
  6. *  OS/2 Work Place Shell Sample Program
  7. *
  8. *  Copyright (C) 1995 IBM Corporation
  9. *
  10. *      DISCLAIMER OF WARRANTIES.  The following [enclosed] code is
  11. *      sample code created by IBM Corporation. This sample code is not
  12. *      part of any standard or IBM product and is provided to you solely
  13. *      for  the purpose of assisting you in the development of your
  14. *      applications.  The code is provided "AS IS", without
  15. *      warranty of any kind.  IBM shall not be liable for any damages
  16. *      arising out of your use of the sample code, even if they have been
  17. *      advised of the possibility of such damages.
  18. *
  19. *  Entry Points:
  20. *
  21. *     Class Methods:
  22. *
  23. *        wsfM_clsQueryModuleHandle
  24. *        wsfM_clsQueryDefaultFileText
  25. *
  26. *     Overridden Class Methods:
  27. *
  28. *        wsfM_wpclsInitData
  29. *        wsfM_wpclsQueryDefaultHelp
  30. *        wsfM_wpclsQueryDefaultView
  31. *        wsfM_wpclsQueryDetailsInfo
  32. *        wsfM_wpclsQueryIconData
  33. *        wsfM_wpclsQueryInstanceFilter
  34. *        wsfM_wpclsQueryStyle
  35. *        wsfM_wpclsQueryTitle
  36. *        wsfM_wpclsUnInitData
  37. *
  38. *     Instance Methods:
  39. *
  40. *        wsf_AddLastWorkerPage
  41. *        wsf_soundAlarm
  42. *        wsf_queryLastWorker
  43. *        wsf_setLastWorker
  44. *
  45. *     Overridden Instance Methods:
  46. *
  47. *        wsf_wpAddSettingsPages
  48. *        wsf_wpFilterPopupMenu
  49. *        wsf_wpInitData
  50. *        wsf_wpMenuItemHelpSelected
  51. *        wsf_wpMenuItemSelected
  52. *        wsf_wpModifyPopupMenu
  53. *        wsf_wpOpen
  54. *        wsf_wpQueryDetailsData
  55. *        wsf_wpRestoreState
  56. *        wsf_wpSaveState
  57. *        wsf_wpUnInitData
  58. *        wsf_wpFormatDragItem
  59. *        wsf_wpSetup
  60. *
  61. *     Non-Method Functions:
  62. *
  63. *        WSFILEInit
  64. *        WSFILEWndProc
  65. *        LastWorkerDlgProc
  66. *
  67. ******************************************************************************/
  68.  
  69. #include <string.h>
  70. #include <stdio.h>
  71. #include <memory.h>
  72. #include <stdlib.h>
  73.  
  74. #define WSFILE_Class_Source
  75. #define M_WSFILE_Class_Source
  76. #include "wsfile.ih"         /* implementation header emitted from wsfile.idl */
  77.  
  78. /*
  79.  * New Method: wpCnrRefreshDetails
  80.  */
  81. #define WPObject_wpCnrRefreshDetails(somSelf) \
  82.     (SOM_Resolve(somSelf, WPObject, wpCnrRefreshDetails) \
  83.         (somSelf))
  84. #define _wpCnrRefreshDetails WPObject_wpCnrRefreshDetails
  85.  
  86. /*
  87.  *   Non-Method function prototypes
  88.  */
  89.  
  90. HWND             WSFILEInit(WSFILE *);
  91. MRESULT EXPENTRY LastWorkerDlgProc( HWND hwnd, ULONG msg,
  92.                                    MPARAM mp1, MPARAM mp2 );
  93. MRESULT EXPENTRY WSFILEWndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 );
  94.  
  95.  
  96. /***************** GLOBAL/STATIC (NON-INSTANCE) DATA SECTION ******************
  97. *****                                                                     *****
  98. *****    This data shouldn't be changed by instance methods or it will    *****
  99. *****    effect all instances!  Any variables that are specific (unique   *****
  100. *****    values) for each instance of this object should be declared as   *****
  101. *****  instance data or dynamically allocated and stored as window data.  *****
  102. *****                                                                     *****
  103. *****      This global data should be declared as class instance data     *****
  104. *****    if it will change after initialization.  In this case, it will   *****
  105. *****                  be accessed through class methods.                 *****
  106. *****                                                                     *****
  107. ******************************************************************************/
  108.  
  109.    const char szWSFILEWindowClass[] =    "WSFILESAMPLE";
  110.    const char szWSFILEInstanceFilter[] = "*.txt";
  111.    const char szHelpLibrary[] =          "wsfile.hlp";
  112.    UCHAR      szWSFILEClassTitle[CCHMAXPATH] = "";
  113.    HMODULE    hmod = NULLHANDLE;
  114.  
  115.    /*
  116.     *   Statics required for FIELDINFO structures needed for DETAILS view are
  117.     *   handled in the three functions:
  118.     *
  119.     *   wsf_wpclsInitData, wsf_wpQueryDetailsData, wsf_wpQueryClassDetailsInfo
  120.     */
  121.  
  122.    #define NUM_WSFILE_FIELDS    1
  123.  
  124.    CLASSFIELDINFO fieldinfo[NUM_WSFILE_FIELDS];      /* structure in wsfile.h */
  125.  
  126.    PCSZ apszWSFILEColTitles[] =
  127.    {
  128.       "Last Worker"           /* details column 1 */
  129.    };
  130.  
  131.  
  132. /*************************  INSTANCE METHODS SECTION  *************************
  133. *****                                                                     *****
  134. *****              Do not put any code in this section unless             *****
  135. *****                   it is an object INSTANCE method                   *****
  136. *****                                                                     *****
  137. ******************************************************************************/
  138. #undef SOM_CurrentClass
  139. #define SOM_CurrentClass SOMInstance
  140.  
  141.  
  142. /*
  143.  *
  144.  *  METHOD: queryLastWorker                                ( ) PRIVATE
  145.  *                                                         (X) PUBLIC
  146.  *  DESCRIPTION:
  147.  *
  148.  *    Query name of last person to work with wsfile
  149.  *
  150.  *  RETURN:
  151.  *
  152.  *    PSZ            name of last person to work on file
  153.  *
  154.  */
  155. SOM_Scope PSZ   SOMLINK wsf_queryLastWorker(WSFILE *somSelf)
  156. {
  157.     WSFILEData *somThis = WSFILEGetData(somSelf);
  158.     WSFILEMethodDebug("WSFILE", "wsf_queryLastWorker");
  159.  
  160.     return _pszLastWorker;
  161. } /* end wsf_queryLastWorker */
  162.  
  163. /*
  164.  *
  165.  * METHOD: setLastWorker                                  ( ) PRIVATE
  166.  *                                                        (X) PUBLIC
  167.  * DESCRIPTION:
  168.  *
  169.  *   Set name of last person to work with wsfile
  170.  *
  171.  * RETURN:
  172.  *
  173.  *   TRUE           Brake is on
  174.  *   FALSE          Brake is off
  175.  *
  176.  */
  177.  
  178. SOM_Scope BOOL   SOMLINK wsf_setLastWorker(WSFILE *somSelf,
  179.                 PSZ pszWorkerName)
  180. {
  181.    BOOL rc = FALSE;
  182.  
  183.    WSFILEData *somThis = WSFILEGetData(somSelf);
  184.    WSFILEMethodDebug("WSFILE", "wsf_setLastWorker");
  185.  
  186.    if (pszWorkerName)
  187.    {
  188.       if (_pszLastWorker)
  189.       {
  190.          _wpFreeMem(somSelf, (PBYTE) _pszLastWorker);
  191.          _pszLastWorker = (PSZ)_wpAllocMem(somSelf, strlen(pszWorkerName) + 1,
  192.                                            NULL);
  193.          strcpy(_pszLastWorker, pszWorkerName);
  194.          _wpCnrRefreshDetails(somSelf);
  195.          rc = TRUE;
  196.       }
  197.    }
  198.    return rc;
  199. } /* end wsf_setLastWorker */
  200.  
  201. /*
  202.  *
  203.  *  METHOD: soundAlarm                                     ( ) PRIVATE
  204.  *                                                         (X) PUBLIC
  205.  *  DESCRIPTION:
  206.  *
  207.  *    Sound an alarm
  208.  *
  209.  *  RETURN:
  210.  *
  211.  *    TRUE           Successful
  212.  *    FALSE          Unsuccessful
  213.  *
  214.  */
  215. SOM_Scope BOOL   SOMLINK wsf_soundAlarm(WSFILE *somSelf)
  216. {
  217.    WSFILEData *somThis = WSFILEGetData(somSelf);
  218.    WSFILEMethodDebug("WSFILE", "wsf_soundAlarm");
  219.  
  220.    DosBeep(100, 50);    /* beep and sleep.... */
  221.    DosSleep(100);
  222.    DosBeep(100, 30);
  223.    DosSleep(100);
  224.    DosBeep(100, 30);
  225.    DosSleep(100);
  226.    DosBeep(100, 50);
  227.    DosSleep(100);
  228.    DosBeep(100, 40);
  229.    DosSleep(300);
  230.    DosBeep(100, 100);
  231.    DosSleep(100);
  232.    DosBeep(100, 100);
  233.  
  234.    return TRUE;
  235. } /* end wsf_soundAlarm */
  236.  
  237. /*
  238.  *
  239.  *  METHOD: AddLastWorkerPage                              ( ) PRIVATE
  240.  *                                                         (X) PUBLIC
  241.  *  DESCRIPTION:
  242.  *
  243.  *    This method adds the Last Worker page to the settings notebook.
  244.  *
  245.  *  RETURN:
  246.  *
  247.  *    0              Unsuccessful
  248.  *    ulPageId       Identifier for the inserted page
  249.  *
  250.  *  HOW TO OVERRIDE:
  251.  *
  252.  *    Method should always be overridden in order to replace or remove
  253.  *    the last worker page from an object which is a descendent of wsfile.
  254.  *    In most cases, an override of this method will not call the parent.
  255.  *
  256.  */
  257. SOM_Scope ULONG   SOMLINK wsf_AddLastWorkerPage(WSFILE *somSelf,
  258.                 HWND hwndNotebook)
  259. {
  260.    WSFILEData *somThis = WSFILEGetData(somSelf);
  261.    PAGEINFO pageinfo;
  262.    WSFILEMethodDebug("WSFILE", "wsf_AddLastWorkerPage");
  263.  
  264.    memset((PCH)&pageinfo, 0, sizeof(PAGEINFO));
  265.    pageinfo.cb                 = sizeof(PAGEINFO);
  266.    pageinfo.hwndPage           = NULLHANDLE;
  267.    pageinfo.usPageStyleFlags   = BKA_MAJOR;
  268.    pageinfo.usPageInsertFlags  = BKA_FIRST;
  269.    pageinfo.pfnwp              = LastWorkerDlgProc;
  270.    pageinfo.resid              = hmod;
  271.    pageinfo.dlgid              = IDD_LASTWORKER;
  272.    pageinfo.pszName            = "LastWorker";
  273.    pageinfo.pCreateParams      = somSelf;
  274.    pageinfo.idDefaultHelpPanel = ID_HELP_LASTWORKER;
  275.    pageinfo.pszHelpLibraryName = (PSZ)szHelpLibrary;
  276.  
  277.    return _wpInsertSettingsPage( somSelf, hwndNotebook, &pageinfo );
  278.  
  279. }   /* end wsf_AddLastWorkerPage() */
  280.  
  281.  
  282. /*
  283.  *
  284.  *  OVERRIDE: wpInitData                                   ( ) PRIVATE
  285.  *                                                         (X) PUBLIC
  286.  *  DESCRIPTION:
  287.  *
  288.  *    Initialize our state variables. Allocate any extra memory that
  289.  *    we might need.
  290.  *
  291.  */
  292. SOM_Scope void SOMLINK wsf_wpInitData(WSFILE *somSelf)
  293. {
  294.    WSFILEData *somThis = WSFILEGetData(somSelf);
  295.    WSFILEMethodDebug("WSFILE", "wsf_wpInitData");
  296.  
  297.    parent_wpInitData(somSelf);
  298.  
  299.    _pszLastWorker = (PSZ)_wpAllocMem(somSelf, CCHMAXPATH + 1, NULL);
  300.    if (_pszLastWorker)
  301.    {
  302.       strcpy(_pszLastWorker, DEFAULT_LASTWORKER);
  303.    }
  304. }   /* end wsf_wpInitData() */
  305.  
  306. /*
  307.  *
  308.  *  OVERRIDE: wpUnInitData                                 ( ) PRIVATE
  309.  *                                                         (X) PUBLIC
  310.  *  DESCRIPTION:
  311.  *
  312.  *    Clear up memory that was allocated on wpInitData.
  313.  *
  314.  */
  315. SOM_Scope void   SOMLINK wsf_wpUnInitData(WSFILE *somSelf)
  316. {
  317.    WSFILEData *somThis = WSFILEGetData(somSelf);
  318.    WSFILEMethodDebug("WSFILE", "wsf_wpUnInitData");
  319.  
  320.    if (_pszLastWorker)
  321.    {
  322.       _wpFreeMem(somSelf, (PBYTE)_pszLastWorker);
  323.    }
  324.    parent_wpUnInitData(somSelf);
  325.  
  326. }   /* end wsf_wpUnInitData() */
  327.  
  328.  
  329. /*
  330.  *
  331.  *  METHOD: wpSaveState                                    ( ) PRIVATE
  332.  *                                                         (X) PUBLIC
  333.  *  DESCRIPTION:
  334.  *
  335.  *    Save our instance variable (last worker)
  336.  *
  337.  */
  338. SOM_Scope BOOL SOMLINK wsf_wpSaveState(WSFILE *somSelf)
  339. {
  340.    WSFILEData *somThis = WSFILEGetData(somSelf);
  341.    WSFILEMethodDebug("WSFILE", "wsf_wpSaveState");
  342.  
  343.    _wpSaveString( somSelf, szWSFILEClassTitle,
  344.                   IDKEY_LASTWORKER, _pszLastWorker);
  345.  
  346.    return parent_wpSaveState(somSelf);
  347.  
  348. }   /* end wsf_wpSaveState() */
  349.  
  350. /*
  351.  *
  352.  *  METHOD: wpRestoreState                                 ( ) PRIVATE
  353.  *                                                         (X) PUBLIC
  354.  *  DESCRIPTION:
  355.  *
  356.  *    Retrieve our saved instance variable (last worker)
  357.  *
  358.  */
  359. SOM_Scope BOOL SOMLINK wsf_wpRestoreState(WSFILE *somSelf, ULONG ulReserved)
  360. {
  361.    ULONG cbString;
  362.    WSFILEData *somThis = WSFILEGetData(somSelf);
  363.    WSFILEMethodDebug("WSFILE", "wsf_wpRestoreState");
  364.  
  365.    _wpRestoreString( somSelf, szWSFILEClassTitle,
  366.                       IDKEY_LASTWORKER, _pszLastWorker, &cbString );
  367.  
  368.    return parent_wpRestoreState(somSelf, ulReserved);
  369. }   /* wsf_wpRestoreState() */
  370.  
  371.  
  372. /*
  373.  *
  374.  *  METHOD: wpAddSettingsPages                             ( ) PRIVATE
  375.  *                                                         (X) PUBLIC
  376.  *  DESCRIPTION:
  377.  *
  378.  *    Add our own settings page to let the user modify the Last Worker's name
  379.  *
  380.  */
  381. SOM_Scope BOOL SOMLINK wsf_wpAddSettingsPages(WSFILE *somSelf, HWND hwndNotebook)
  382. {
  383.    WSFILEData *somThis = WSFILEGetData(somSelf);
  384.    WSFILEMethodDebug("WSFILE", "wsf_wpAddSettingsPages");
  385.  
  386.    if (parent_wpAddSettingsPages(somSelf, hwndNotebook)
  387.              && _AddLastWorkerPage(somSelf, hwndNotebook))
  388.    {
  389.       return TRUE;
  390.    }
  391.    else
  392.    {
  393.        DebugBox("wsf_wpAddSettingsPages", " Failed to add a settings page.");
  394.        return FALSE;
  395.    }
  396. }   /* wsf_wpAddSettingsPages() */
  397.  
  398. /*
  399.  *
  400.  *  METHOD: wpFilterPopupMenu                              ( ) PRIVATE
  401.  *                                                         (X) PUBLIC
  402.  *  DESCRIPTION:
  403.  *
  404.  *    Filter out any options from the context that don't apply (we take
  405.  *    out "create shadow"
  406.  *
  407.  *  HOW TO OVERRIDE:
  408.  *
  409.  *    No restrictions.
  410.  *
  411.  */
  412. SOM_Scope ULONG SOMLINK wsf_wpFilterPopupMenu(WSFILE *somSelf,
  413.                                               ULONG ulFlags,
  414.                                               HWND hwndCnr,
  415.                                               BOOL fMultiSelect)
  416. {
  417.    WSFILEData *somThis = WSFILEGetData(somSelf);
  418.    WSFILEMethodDebug("WSFILE", "wsf_wpFilterPopupMenu");
  419.  
  420.     /*
  421.      *   This method allows you to filter which menus to include in the
  422.      *   popup menu.  Note: wpclsQueryStyle is overridden to disallow
  423.      *   linking (creating shadow) as well.
  424.      */
  425.    return (parent_wpFilterPopupMenu(somSelf, ulFlags, hwndCnr,
  426.                     fMultiSelect) & ~CTXT_LINK );
  427.  
  428. }   /* end wsf_wpFilterPopupMenu() */
  429.  
  430. /*
  431.  *
  432.  *  METHOD: wpModifyPopupMenu                              ( ) PRIVATE
  433.  *                                                         (X) PUBLIC
  434.  *  DESCRIPTION:
  435.  *
  436.  *    Add our extra options to the context menu
  437.  *
  438.  */
  439. SOM_Scope BOOL SOMLINK wsf_wpModifyPopupMenu(WSFILE *somSelf,
  440.                                              HWND hwndMenu,
  441.                                              HWND hwndCnr,
  442.                                              ULONG iPosition)
  443. {
  444.    WSFILEData *somThis = WSFILEGetData(somSelf);
  445.    WSFILEMethodDebug("WSFILE", "wsf_wpModifyPopupMenu");
  446.  
  447.     /*
  448.      *   Put in our special "open wsfile" submenu item under the "open" menu
  449.      */
  450.    _wpInsertPopupMenuItems( somSelf, hwndMenu, 0,
  451.                                hmod, ID_OPENMENU, WPMENUID_OPEN);
  452.     /*
  453.      *   insert a "beep horn" menu item at the end of the list.
  454.      */
  455.    _wpInsertPopupMenuItems( somSelf, hwndMenu, iPosition,
  456.                                hmod, ID_ALARMMENU, 0 );
  457.  
  458.    return parent_wpModifyPopupMenu(somSelf, hwndMenu, hwndCnr, iPosition);
  459. }   /* end wsf_wpModifyPopupMenu() */
  460.  
  461. /*
  462.  *
  463.  *  METHOD: wpMenuItemSelected                             ( ) PRIVATE
  464.  *                                                         (X) PUBLIC
  465.  *  DESCRIPTION:
  466.  *
  467.  *    Process the extra menu options that we added.
  468.  *
  469.  */
  470. SOM_Scope BOOL SOMLINK wsf_wpMenuItemSelected(WSFILE *somSelf,
  471.                                               HWND hwndFrame,
  472.                                               ULONG MenuId)
  473. {
  474.    WSFILEData *somThis = WSFILEGetData(somSelf);
  475.    WSFILEMethodDebug("WSFILE", "wsf_wpMenuItemSelected");
  476.  
  477.     /*
  478.      *   Which of our menu items was selected?
  479.      */
  480.    switch( MenuId )
  481.    {
  482.       case IDM_OPENWSFILE:
  483.          /*
  484.           *   We could call wpOpen here, but, if the object is already opened,
  485.           *   the following API determines whether the object should be
  486.           *   resurfaced, or if multiple views are desired.
  487.           */
  488.          _wpViewObject(somSelf, NULLHANDLE, OPEN_WSFILE, 0);
  489.          break;
  490.  
  491.        case IDM_SOUNDALARM:
  492.           _soundAlarm(somSelf);
  493.           break;
  494.  
  495.        default:
  496.           return parent_wpMenuItemSelected(somSelf, hwndFrame, MenuId);
  497.           break;
  498.     }
  499.     return TRUE;                                          /* we processed it */
  500. }   /* end wsf_wpMenuItemSelected() */
  501.  
  502. /*
  503.  *
  504.  *  METHOD: wpMenuItemHelpSelected                         ( ) PRIVATE
  505.  *                                                         (X) PUBLIC
  506.  *  DESCRIPTION:
  507.  *
  508.  *    Process help for the extra menu options that we added.
  509.  *
  510.  */
  511. SOM_Scope BOOL SOMLINK wsf_wpMenuItemHelpSelected(WSFILE *somSelf, ULONG MenuId)
  512. {
  513.    WSFILEData *somThis = WSFILEGetData(somSelf);
  514.    WSFILEMethodDebug("WSFILE", "wsf_wpMenuItemHelpSelected");
  515.  
  516.    /* Which of our menu items was selected?   */
  517.    switch( MenuId )
  518.    {
  519.       case IDM_SOUNDALARM:
  520.  
  521.          return _wpDisplayHelp(somSelf, ID_HELP_SOUNDALARM, (PSZ)szHelpLibrary);
  522.          break;
  523.  
  524.       case IDM_OPENWSFILE:
  525.  
  526.          return _wpDisplayHelp(somSelf, ID_HELP_OPENWSFILE, (PSZ)szHelpLibrary);
  527.          break;
  528.  
  529.       default:
  530.          break;
  531.    }
  532.  
  533.    return parent_wpMenuItemHelpSelected(somSelf, MenuId);
  534.  
  535. }   /* end wsf_wpMenuItemHelpSelected() */
  536.  
  537. /*
  538.  *
  539.  *  METHOD: wpQueryDetailsData                             ( ) PRIVATE
  540.  *                                                         (X) PUBLIC
  541.  *  DESCRIPTION:
  542.  *
  543.  *    Returns the wsfile specific data for the details view of this object.
  544.  *    Sets the pointer (*ppDetailsData) to the beginning of the buffer
  545.  *    into which the data is written.
  546.  *
  547.  */
  548. SOM_Scope ULONG SOMLINK wsf_wpQueryDetailsData(WSFILE *somSelf,
  549.                 PVOID *ppDetailsData,
  550.                 PULONG pcp)
  551. {
  552.    PWSFILEDETAILS pWSFILEDetails;
  553.    PBYTE       pSize;
  554.    WSFILEData *somThis = WSFILEGetData(somSelf);
  555.    WSFILEMethodDebug("WSFILE", "wsf_wpQueryDetailsData");
  556.  
  557.    parent_wpQueryDetailsData(somSelf, ppDetailsData, pcp);
  558.  
  559.    if (ppDetailsData)                                          /* query data */
  560.    {
  561.       pWSFILEDetails                  = (PWSFILEDETAILS) *ppDetailsData;
  562.       pWSFILEDetails->pszLastWorker   = _queryLastWorker(somSelf);
  563.  
  564.       /* point to buffer location after our details data */
  565.       *ppDetailsData = ((PBYTE)(*ppDetailsData)) + sizeof(*pWSFILEDetails);
  566.  
  567.    }   /* end if (ppDetailsData) */
  568.    else                                                /* query size of data */
  569.    {
  570.       *pcp += sizeof(*pWSFILEDetails);     /* caller is querying size of buffer */
  571.    }
  572.  
  573.    return TRUE;
  574. }   /* end wsf_wpQueryDetailsData() */
  575.  
  576. /*
  577.  *
  578.  *   METHOD: wpOpen                                         ( ) PRIVATE
  579.  *                                                          (X) PUBLIC
  580.  *   DESCRIPTION:
  581.  *
  582.  *     Opens the wsfile window.
  583.  *
  584.  */
  585. SOM_Scope HWND SOMLINK wsf_wpOpen(WSFILE *somSelf, HWND hwndCnr, ULONG ulView,
  586.                                   ULONG param)
  587. {
  588.    WSFILEData *somThis = WSFILEGetData(somSelf);
  589.    WSFILEMethodDebug("WSFILE", "wsf_wpOpen");
  590.  
  591.    switch (ulView)
  592.    {
  593.       case OPEN_WSFILE:
  594.  
  595.           /*
  596.            *   Create a basic Frame and Client window for this instance.
  597.            */
  598.          return WSFILEInit(somSelf);
  599.  
  600.       default:
  601.          return parent_wpOpen(somSelf, hwndCnr, ulView, param);
  602.  
  603.    }   /* end switch (ulView) */
  604.  
  605. }   /* end wsf_wpOpen() */
  606.  
  607.  
  608. /*
  609.  *
  610.  *  METHOD: wpSetup                                        ( ) PRIVATE
  611.  *                                                         (X) PUBLIC
  612.  *  DESCRIPTION:
  613.  *
  614.  *    Specify Setup strings and do some initialization.  This method is
  615.  *    invoked once an object is completely created, as well as on demand.
  616.  *
  617.  *  New Setup Strings parsed and processed by this override:
  618.  *
  619.  *             SOUND=(YES/NO)   YES will invoke _soundAlarm method
  620.  *                              NO  will do nothing
  621.  *
  622.  *  Note:  We're also overriding this method to write some default data to the
  623.  *         object's real filename.  This will give us something to look at
  624.  *         if the user drag/drops us on an editor or selects the open/editor
  625.  *         view.
  626.  */
  627. SOM_Scope BOOL   SOMLINK wsf_wpSetup(WSFILE *somSelf, PSZ pszSetupString)
  628. {
  629.    WSFILEData *somThis = WSFILEGetData(somSelf);
  630.    ULONG  cbBytesWritten;        /* pointer to variable receiving byte count */
  631.    APIRET rc;
  632.    BOOL   fSuccess;
  633.    HFILE  hf;                        /* pointer to variable for file handle */
  634.    ULONG  ulAction;                  /* pointer to variable for action taken */
  635.    CHAR   szObjectFilename[CCHMAXPATH];      /* buffer for wpQueryRealName() */
  636.    ULONG  cb  = sizeof(szObjectFilename);
  637.    PSZ    pszDefaultText;
  638.    BOOL   rcParentCall;
  639.    CHAR   szValue[CCHMAXPATH + 1];
  640.    ULONG  cbBuffer;
  641.  
  642.    WSFILEMethodDebug("WSFILE", "wsf_wpSetup");
  643.  
  644.    /*
  645.     *   When the object is created from scratch, put some default
  646.     *   text into the file on the hard disk
  647.     */
  648.  
  649.    fSuccess = _wpQueryRealName(      /* query full-pathname of object's file */
  650.       somSelf,                                     /* pointer to this object */
  651.       szObjectFilename,                                     /* return buffer */
  652.       &cb,                                                  /* sizeof buffer */
  653.       TRUE);                            /* request fully qualified pathname? */
  654.  
  655.    if (fSuccess)
  656.    {
  657.       rc =
  658.       DosOpen((PSZ)szObjectFilename, &hf, &ulAction,
  659.          0UL,                           /* file size if created or truncated */
  660.          FILE_NORMAL,                                      /* file attribute */
  661.          FILE_OPEN             /* action taken if file exists/does not exist */
  662.             | FILE_CREATE,
  663.          OPEN_ACCESS_READWRITE                          /* open mode of file */
  664.             | OPEN_SHARE_DENYNONE,
  665.          (PEAOP2)NULL);      /* pointer to structure for extended attributes */
  666.  
  667.       if (rc)
  668.       {
  669.          CHAR ach[10];
  670.  
  671.          _ltoa(rc, ach, 10);
  672.          DebugBox("wsf_wpSetup:DosOpen failed rc =", ach);
  673.       }
  674.       else
  675.       {
  676.          pszDefaultText = _clsQueryDefaultFileText(_WSFILE);
  677.          DosWrite(hf, pszDefaultText, strlen(pszDefaultText), &cbBytesWritten);
  678.          DosClose(hf);
  679.       }
  680.    }   /* end if (fSuccess) */
  681.  
  682.    rcParentCall = parent_wpSetup(somSelf, pszSetupString);
  683.  
  684.    /*
  685.     *  Now that parent has processed all its setup strings, we'll take a
  686.     *  look for setup strings that we understand.
  687.     */
  688.    cbBuffer = CCHMAXPATH;
  689.    if (_wpScanSetupString(somSelf, pszSetupString, "SOUND", szValue, &cbBuffer))
  690.    {
  691.       if ((szValue[0] == 'Y') && (szValue[1] == 'E') && (szValue[2] == 'S'))
  692.       {
  693.          _soundAlarm(somSelf);
  694.       }
  695.    }
  696.  
  697.    return rcParentCall;
  698. }   /* end wsf_wpSetup() */
  699.  
  700.  
  701. /*
  702.  * METHOD: wpFormatDragItem                              ( ) PRIVATE
  703.  *                                                       (X) PUBLIC
  704.  * DESCRIPTION:
  705.  *
  706.  *   Specify a unique RMF that will only be understood by instances
  707.  *   of class WSFOLDER.  (see _wpDragOver and _wpDrop overrides in
  708.  *   wsfolder.c).
  709.  */
  710. SOM_Scope BOOL   SOMLINK wsf_wpFormatDragItem(WSFILE *somSelf,
  711.                 PDRAGITEM pdrgItem)
  712. {
  713. /*  WSFILEData *somThis = WSFILEGetData(somSelf); */
  714.    WSFILEMethodDebug("WSFILE", "wsf_wpFormatDragItem");
  715.  
  716.    parent_wpFormatDragItem(somSelf, pdrgItem);
  717.  
  718.     /* We do NOT want to really let the workplace shell render
  719.      * our object, so change the rendering mechanism and format
  720.      * to be uniquely ours.
  721.      */
  722.    DrgDeleteStrHandle(pdrgItem->hstrRMF);
  723.  
  724.    pdrgItem->hstrRMF = DrgAddStrHandle("<DRM_OUROWNSPECIAL,DRF_OBJECT>");
  725.  
  726.    return TRUE;
  727. }
  728.  
  729.  
  730. /**************************  CLASS METHODS SECTION  ***************************
  731. *****                                                                     *****
  732. *****              Do not put any code in this section unless             *****
  733. *****                     it is an object CLASS method                    *****
  734. *****                                                                     *****
  735. ******************************************************************************/
  736. #undef SOM_CurrentClass
  737. #define SOM_CurrentClass SOMMeta
  738.  
  739.  
  740. /*
  741.  *
  742.  *  METHOD: clsQueryModuleHandle                           ( ) PRIVATE
  743.  *                                                         (X) PUBLIC
  744.  *  DESCRIPTION:
  745.  *
  746.  *    This method returns the module handle of this class.  If this is the
  747.  *    first invocation, DosQueryModuleHandle is called to save the handle
  748.  *    for future invocations.
  749.  *
  750.  *  RETURN:
  751.  *
  752.  *    0              Unsuccessful
  753.  *    non-zero       module handle
  754.  *
  755.  */
  756. SOM_Scope HMODULE   SOMLINK wsfM_clsQueryModuleHandle(M_WSFILE *somSelf)
  757. {
  758.    APIRET rc;
  759.  
  760.     /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  761.    M_WSFILEMethodDebug("M_WSFILE", "wsfM_clsQueryModuleHandle");
  762.  
  763.    /*
  764.     *   Make sure we already have module handle
  765.     */
  766.  
  767.    if (hmod == NULLHANDLE)
  768.    {
  769.       zString zsPathName;
  770.        /*
  771.         *   Retrieve registered pathname of our module (DLL) and query the
  772.         *   module handle.
  773.         */
  774.       zsPathName = _somLocateClassFile( SOMClassMgrObject,
  775.                                         SOM_IdFromString("WSFILE"),
  776.                                         WSFILE_MajorVersion,
  777.                                         WSFILE_MinorVersion);
  778.       rc = DosQueryModuleHandle( zsPathName, &hmod);
  779.       if (rc)
  780.       {
  781.          DebugBox("wsfM_wpclsInitData", "Failed to load module");
  782.          return;
  783.       }
  784.    }   /* end if (hmod == NULLHANDLE) */
  785.  
  786.    return hmod;
  787. }   /* end wsfM_clsQueryModuleHandle() */
  788.  
  789.  
  790.  
  791. /*
  792.  *
  793.  *  METHOD: clsQueryDefaultFileText                        ( ) PRIVATE
  794.  *                                                         (X) PUBLIC
  795.  *  DESCRIPTION:
  796.  *
  797.  *    This method returns some default text to stuff in an empty WSFILE.
  798.  *
  799.  *  RETURN:
  800.  *
  801.  *    PSZ
  802.  *
  803.  */
  804. SOM_Scope PSZ   SOMLINK wsfM_clsQueryDefaultFileText(M_WSFILE *somSelf)
  805. {
  806.     /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  807.    M_WSFILEMethodDebug("M_WSFILE", "wsfM_clsQueryDefaultFileText");
  808.  
  809.    return (PSZ)"This is an empty file of class WSFILE";
  810. } /* end wsfM_clsQueryDefaultFileText */
  811.  
  812. /*
  813.  *
  814.  *  METHOD: wpclsQueryStyle                                ( ) PRIVATE
  815.  *                                                         (X) PUBLIC
  816.  *  DESCRIPTION:
  817.  *
  818.  *     The wpclsQueryStyle method is called to allow the class object
  819.  *     to specify the default object class style for its instances.
  820.  *
  821.  *  REMARKS:
  822.  *
  823.  *     This method can be called at any time in order to determine the
  824.  *     default style for instances of this class.
  825.  *
  826.  *     This method should be overridden in order to modify the default
  827.  *     object style for instances of this class.
  828.  *
  829.  */
  830. SOM_Scope ULONG   SOMLINK wsfM_wpclsQueryStyle(M_WSFILE *somSelf)
  831. {
  832.     /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  833.     M_WSFILEMethodDebug("M_WSFILE", "wsfM_wpclsQueryStyle");
  834.  
  835.     /*
  836.      *   Modify style bits as described in programming reference.  This
  837.      *   particular style (link) is also disabled in wpFilterPopupMenu()
  838.      */
  839.    return (parent_wpclsQueryStyle(somSelf) | CLSSTYLE_NEVERLINK );
  840. }
  841.  
  842. /*
  843.  *
  844.  *  METHOD: wpclsInitData                                  ( ) PRIVATE
  845.  *                                                         (X) PUBLIC
  846.  *  DESCRIPTION:
  847.  *
  848.  *    Initialize the class data
  849.  *
  850.  */
  851. SOM_Scope void SOMLINK wsfM_wpclsInitData(M_WSFILE *somSelf)
  852. {
  853.     /* M_WSFILEData *somThis  = M_WSFILEGetData(somSelf); */
  854.     ULONG rc, i;
  855.     PCLASSFIELDINFO pCFI;
  856.     M_WSFILEMethodDebug("M_WSFILE", "wsfM_wpclsInitData");
  857.  
  858.     /*
  859.      *   Call the parent class method first
  860.      */
  861.     parent_wpclsInitData(somSelf);
  862.  
  863.     /*
  864.      *   Get class title
  865.      */
  866.     if (!WinLoadString(WinQueryAnchorBlock(HWND_DESKTOP),
  867.                        _clsQueryModuleHandle(somSelf),
  868.                        ID_TITLE,
  869.                        sizeof(szWSFILEClassTitle), szWSFILEClassTitle))
  870.        /* Load string failed: use the parent's string */
  871.        strcpy(szWSFILEClassTitle, parent_wpclsQueryTitle(somSelf));
  872.  
  873.    /*
  874.     *   Initialize everything needed for the CLASSFIELDINFO structures
  875.     *   for the WSFILE object class
  876.     */
  877.  
  878.    for (i = 0, pCFI = fieldinfo; i < NUM_WSFILE_FIELDS; i++, pCFI++)
  879.    {
  880.       memset((PCH) pCFI, 0, sizeof(CLASSFIELDINFO));               /* zeroes */
  881.  
  882.       pCFI->cb        = sizeof(CLASSFIELDINFO);
  883.       pCFI->flData    = CFA_RIGHT | CFA_SEPARATOR | CFA_FIREADONLY;
  884.       pCFI->flTitle   = CFA_CENTER | CFA_SEPARATOR | CFA_HORZSEPARATOR |
  885.                         CFA_STRING | CFA_FITITLEREADONLY;
  886.       pCFI->pNextFieldInfo = pCFI + 1;       /* point to next CLASSFIELDINFO */
  887.       pCFI->pTitleData = (PVOID) apszWSFILEColTitles[i];
  888.       pCFI->flCompare  = COMPARE_SUPPORTED | SORTBY_SUPPORTED;
  889.  
  890.       switch (i)
  891.       {
  892.          case INDEX_LASTWORKER:
  893.  
  894.             pCFI->flData           |= CFA_STRING;
  895.             pCFI->offFieldData      = (ULONG)(FIELDOFFSET(WSFILEDETAILS, pszLastWorker));
  896.             pCFI->ulLenFieldData    = sizeof(PSZ);
  897.             pCFI->DefaultComparison = CMP_EQUAL;
  898.  
  899.             break;
  900.  
  901.       }   /* end switch(i) */
  902.  
  903.    }   /* end for (i=0, pCFI=fieldinfo; i < NUM_WSFILE_FIELDS; i++, pCFI++)  */
  904.  
  905.    fieldinfo[NUM_WSFILE_FIELDS-1].pNextFieldInfo = NULL;  /* end linked list */
  906.  
  907. }   /* end wsfM_ wpclsInitData() */
  908.  
  909. /*
  910.  *
  911.  *  METHOD: wpclsUnInitData                                ( ) PRIVATE
  912.  *                                                         (X) PUBLIC
  913.  *  DESCRIPTION:
  914.  *
  915.  *    Free any class data
  916.  *
  917.  */
  918. SOM_Scope void SOMLINK wsfM_wpclsUnInitData(M_WSFILE *somSelf)
  919. {
  920.    /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  921.    M_WSFILEMethodDebug("M_WSFILE", "wsfM_wpclsUnInitData");
  922.  
  923.    /* nothing to free... */
  924.    parent_wpclsUnInitData(somSelf);
  925.  
  926. }   /* end wsfM_wpclsUnInitData() */
  927.  
  928. /*
  929.  *
  930.  *  METHOD: wpclsQueryTitle                                ( ) PRIVATE
  931.  *                                                         (X) PUBLIC
  932.  *  DESCRIPTION:
  933.  *
  934.  *    Return the string "WSfile".
  935.  *
  936.  */
  937. SOM_Scope PSZ SOMLINK wsfM_wpclsQueryTitle(M_WSFILE *somSelf)
  938. {
  939.    /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  940.    M_WSFILEMethodDebug("M_WSFILE", "wsfM_wpclsQueryTitle");
  941.  
  942.     /*
  943.      *   Return the class title for a wsfile
  944.      */
  945.  
  946.    if (*szWSFILEClassTitle )
  947.       return szWSFILEClassTitle;
  948.    else
  949.       return parent_wpclsQueryTitle(somSelf);
  950. }   /* end wsfM_wpclsQueryTitle() */
  951.  
  952. /*
  953.  *
  954.  *  METHOD: wpclsQueryIconDdata                            ( ) PRIVATE
  955.  *                                                         (X) PUBLIC
  956.  *  DESCRIPTION:
  957.  *
  958.  *    Return the class icon
  959.  *
  960.  */
  961. SOM_Scope ULONG SOMLINK wsfM_wpclsQueryIconData(M_WSFILE *somSelf,
  962.                   PICONINFO pIconInfo)
  963. {
  964.    /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  965.    APIRET rc;
  966.    M_WSFILEMethodDebug("M_WSFILE", "wsfM_wpclsQueryIconData");
  967.  
  968.    if (pIconInfo)
  969.    {
  970.       /*
  971.        *   fill in icon information
  972.        */
  973.       pIconInfo->fFormat = ICON_RESOURCE;
  974.       pIconInfo->hmod    = _clsQueryModuleHandle(somSelf);
  975.       pIconInfo->resid   = ID_ICON;
  976.    }
  977.    return sizeof(ICONINFO);
  978. }   /* end wsfM_wpclsQueryIconData() */
  979.  
  980. /*
  981.  *
  982.  *  METHOD: wpclsQueryDefaultHelp                          ( ) PRIVATE
  983.  *                                                         (X) PUBLIC
  984.  *  DESCRIPTION:
  985.  *
  986.  *    Process input from the extra menu option that we added.
  987.  *
  988.  */
  989. SOM_Scope BOOL SOMLINK wsfM_wpclsQueryDefaultHelp(M_WSFILE *somSelf,
  990.                 PULONG pHelpPanelId,
  991.                 PSZ pszHelpLibrary)
  992. {
  993.  /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  994.     M_WSFILEMethodDebug("M_WSFILE", "wsfM_wpclsQueryDefaultHelp");
  995.  
  996.     if (pHelpPanelId)                           /* set default help panel id */
  997.        *pHelpPanelId   = ID_HELP_DEFAULT;
  998.  
  999.     if (pszHelpLibrary)                                /* copy help filename */
  1000.        strcpy(pszHelpLibrary, szHelpLibrary);
  1001.  
  1002.     return TRUE;
  1003.  
  1004. }   /* end wsfM_wpclsQueryDefaultHelp() */
  1005.  
  1006. /*
  1007.  *
  1008.  *  METHOD: wpclsQueryDefaultView                          ( ) PRIVATE
  1009.  *                                                         (X) PUBLIC
  1010.  *  DESCRIPTION:
  1011.  *
  1012.  *    Returns the default view for a new instance of this object.
  1013.  *
  1014.  *  REMARKS:
  1015.  *
  1016.  *    Tell the system what our default open view is...
  1017.  *
  1018.  */
  1019. SOM_Scope ULONG SOMLINK wsfM_wpclsQueryDefaultView(M_WSFILE *somSelf)
  1020. {
  1021.  /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  1022.    M_WSFILEMethodDebug("M_WSFILE", "wsfM_wpclsQueryDefaultView");
  1023.  
  1024.    return OPEN_WSFILE;
  1025. }   /* end wsfM_wpclsQueryDefaultView() */
  1026.  
  1027. /*
  1028.  *
  1029.  *  METHOD: wpclsQueryDetailsInfo                          ( ) PRIVATE
  1030.  *                                                         (X) PUBLIC
  1031.  *  DESCRIPTION:
  1032.  *
  1033.  *    Appends the wsfile specific chain of FIELDINFO structures describing the
  1034.  *    details data of this object to *ppClassFieldInfo (if ppClassFieldInfo
  1035.  *    is NON-NULL).  In this case it also sets *ppClassFieldInfo to the
  1036.  *    head of the linked list.
  1037.  *
  1038.  *    Adds the number of bytes required by the details data for wsfile to *pSize
  1039.  *    (if pSize is NON-NULL).
  1040.  *
  1041.  *  REMARKS:
  1042.  *
  1043.  *    Add details data for this object.
  1044.  *
  1045.  */
  1046. SOM_Scope ULONG SOMLINK wsfM_wpclsQueryDetailsInfo(M_WSFILE *somSelf,
  1047.                 PCLASSFIELDINFO *ppClassFieldInfo,
  1048.                 PULONG pSize)
  1049. {
  1050.    /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  1051.    ULONG           cParentColumns;
  1052.    PCLASSFIELDINFO pCFI;
  1053.    ULONG           i;
  1054.  
  1055.    M_WSFILEMethodDebug("M_WSFILE", "wsfM_wpclsQueryDetailsInfo");
  1056.  
  1057.    /*
  1058.     *   Always call the parent method first to retrieve number of details
  1059.     *   columns and parent's data already defined in details buffer.
  1060.     */
  1061.  
  1062.    cParentColumns =
  1063.    parent_wpclsQueryDetailsInfo(somSelf, ppClassFieldInfo, pSize);
  1064.  
  1065.    /*
  1066.     *   If pSize is non-NULL, we must add the size of our details column
  1067.     *   data structure.
  1068.     */
  1069.  
  1070.    if (pSize)
  1071.       *pSize += sizeof(WSFILEDETAILS);                           /* adjust size */
  1072.  
  1073.    /*
  1074.     *   If the request was for the chained fieldinfo structures
  1075.     *   (ppClassFieldInfo is non-NULL), link them in
  1076.     *
  1077.     *   eventually the chain will look like
  1078.     *
  1079.     *   Grandad - Dad - Me - Kid - Grandkid
  1080.     *
  1081.     *   I will be getting the pointer to the beginning of the chain
  1082.     *
  1083.     *   If the beginning of the chain is 0, I will assign the address
  1084.     *   of ws first CLASSFIELDINFO structure to *ppClassFieldInfo.
  1085.     *   Otherwise *pp points to the first column description in the
  1086.     *   chain.  We need to walk the chain and link our CLASSFIELDINFO
  1087.     *   structures at the end.
  1088.     */
  1089.  
  1090.    if (ppClassFieldInfo)
  1091.    {
  1092.       /*
  1093.        *   Find the last link in the chain;  Then link our CLASSFIELDINFO
  1094.        *   structures to the chain.
  1095.        */
  1096.  
  1097.       if (*ppClassFieldInfo)
  1098.       {
  1099.          pCFI = *ppClassFieldInfo;
  1100.          for (i = 0; i < cParentColumns; i++)
  1101.             if (pCFI->pNextFieldInfo)
  1102.                pCFI = pCFI->pNextFieldInfo;
  1103.  
  1104.          pCFI->pNextFieldInfo = fieldinfo;
  1105.       }
  1106.       else
  1107.          *ppClassFieldInfo = fieldinfo;
  1108.    }
  1109.    return (ULONG)(cParentColumns + NUM_WSFILE_FIELDS);
  1110.  
  1111. }   /* end wsfM_wpclsQueryDetailsInfo() */
  1112.  
  1113. /*
  1114.  *
  1115.  *  METHOD: wpclsQueryInstanceFilter                       ( ) PRIVATE
  1116.  *                                                         (X) PUBLIC
  1117.  *  DESCRIPTION:
  1118.  *
  1119.  *     The wpclsQueryInstanceFilter method is called to allow the class
  1120.  *     object to specify the file title filters for instances of its
  1121.  *     class.
  1122.  *
  1123.  *  REMARKS:
  1124.  *
  1125.  *     A pointer to a string containing file title filter(s).  This
  1126.  *     string can contain several file title filters separated by a
  1127.  *     comma.  Example: "*.TXT, *.DOC"
  1128.  *
  1129.  *  Note:  Overriding this method will cause any data file with the extension
  1130.  *         ".txt" to become a data object of the class "WSFILE."
  1131.  *
  1132.  */
  1133. SOM_Scope PSZ   SOMLINK wsfM_wpclsQueryInstanceFilter(M_WSFILE *somSelf)
  1134. {
  1135.     /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  1136.     M_WSFILEMethodDebug("M_WSFILE", "wsfM_wpclsQueryInstanceFilter");
  1137.  
  1138.     return (PSZ)szWSFILEInstanceFilter;
  1139. }
  1140.  
  1141.  
  1142. /**************************  ORDINARY CODE SECTION  ***************************
  1143. *****                                                                     *****
  1144. *****                  Any non-method code should go here.                *****
  1145. *****                                                                     *****
  1146. ******************************************************************************/
  1147. #undef SOM_CurrentClass
  1148.  
  1149.  
  1150. /***************************************************************************
  1151. *                                                                          *
  1152. *       ROUTINE:    WSFILEInit ( )                                         *
  1153. *                                                                          *
  1154. *       DESCRIPTION:    WSFILE Initialization                              *
  1155. *                                                                          *
  1156. *       RETURNS:    Handle of wsfile frame window, NULL if error           *
  1157. *                                                                          *
  1158. ***************************************************************************/
  1159. HWND WSFILEInit(WSFILE *somSelf)
  1160. {
  1161.    HWND hwndFrame = NULLHANDLE;                       /* Frame window handle */
  1162.    HWND hwndClient = NULLHANDLE;
  1163.    PWINDOWDATA pWindowData;
  1164.    BOOL fSuccess;
  1165.    SWCNTRL    swcEntry;                                      /* Switch Entry */
  1166.    FRAMECDATA flFrameCtlData;                              /* Frame Ctl Data */
  1167.    HAB hab = WinQueryAnchorBlock(HWND_DESKTOP);    /* PM anchor block handle */
  1168.  
  1169.    if (!WinRegisterClass(hab, (PSZ)szWSFILEWindowClass, (PFNWP)WSFILEWndProc,
  1170.                          CS_SIZEREDRAW | CS_SYNCPAINT, sizeof(pWindowData)))
  1171.    {
  1172.       DebugBox("WSFILEInit", "Failure in WinRegisterClass");
  1173.       return NULLHANDLE;
  1174.    }
  1175.  
  1176.    /*
  1177.     *   Allocate some instance specific data in Window words of Frame window.
  1178.     *   This will ensure our window procedure can use this object's methods
  1179.     *   (our window proc isn't passed a * somSelf pointer).
  1180.     */
  1181.    pWindowData = (PWINDOWDATA)_wpAllocMem(somSelf, sizeof(*pWindowData), NULL);
  1182.  
  1183.    if (!pWindowData)
  1184.    {
  1185.       DebugBox("WSFILEInit", "wpAllocMem failed to allocate pWindowData");
  1186.       return NULLHANDLE;
  1187.    }
  1188.  
  1189.    memset((PVOID) pWindowData, 0, sizeof(*pWindowData));
  1190.    pWindowData->cb = sizeof(*pWindowData);             /* first field = size */
  1191.    pWindowData->somSelf = somSelf;
  1192.  
  1193.    /* Create a frame window
  1194.     */
  1195.    flFrameCtlData.cb            = sizeof( flFrameCtlData );
  1196.    flFrameCtlData.flCreateFlags = FCF_SIZEBORDER | FCF_TITLEBAR | FCF_SYSMENU |
  1197.                                   FCF_MINMAX;
  1198.    flFrameCtlData.hmodResources = hmod;
  1199.    flFrameCtlData.idResources   = ID_ICON;
  1200.  
  1201.    hwndFrame =                                        /* create frame window */
  1202.    WinCreateWindow(
  1203.       HWND_DESKTOP,               /* parent-window handle                    */
  1204.       WC_FRAME,                   /* pointer to registered class name        */
  1205.       _wpQueryTitle(somSelf),     /* pointer to window text                  */
  1206.       0UL,                        /* window style                            */
  1207.       0L, 0L, 0L, 0L,             /* position of window                      */
  1208.       NULLHANDLE,                 /* owner-window handle                     */
  1209.       HWND_TOP,                   /* handle to sibling window                */
  1210.       ID_FRAME,                   /* window identifier                       */
  1211.       (PVOID) &flFrameCtlData,    /* pointer to buffer                       */
  1212.       NULL);                      /* pointer to structure with pres. params. */
  1213.  
  1214.    if (!hwndFrame)
  1215.    {
  1216.       DebugBox("WSFILEInit", "Failure in WinCreateWindow");
  1217.       return NULLHANDLE;
  1218.    }
  1219.    hwndClient =         /* use WinCreateWindow so we can pass pres params */
  1220.    WinCreateWindow(
  1221.       hwndFrame,               /* parent-window handle                    */
  1222.       (PSZ)szWSFILEWindowClass,/* pointer to registered class name        */
  1223.       (PSZ)NULL,               /* pointer to window text                  */
  1224.       0UL,                     /* window style                            */
  1225.       0L, 0L, 0L, 0L,          /* position of window                      */
  1226.       hwndFrame,               /* owner-window handle                     */
  1227.       HWND_TOP,                /* handle to sibling window                */
  1228.       FID_CLIENT,              /* window identifier                       */
  1229.       pWindowData,             /* pointer to buffer                       */
  1230.       NULL);                   /* pointer to structure with pres. params. */
  1231.  
  1232.    if (!hwndClient)
  1233.    {
  1234.       WinDestroyWindow(hwndFrame);
  1235.       return NULLHANDLE;
  1236.    }
  1237.  
  1238.    WinSendMsg(hwndFrame, WM_SETICON, MPFROMP(_wpQueryIcon(somSelf)), MPVOID);
  1239.    WinSetWindowText(WinWindowFromID(hwndFrame, FID_TITLEBAR),
  1240.                     _wpQueryTitle(somSelf));
  1241.  
  1242.    /*
  1243.     * Restore the Window Position
  1244.     */
  1245.    fSuccess = WinRestoreWindowPos( szWSFILEClassTitle,      /* class title */
  1246.                                    _wpQueryTitle(somSelf),  /* object title */
  1247.                                    hwndFrame);
  1248.  
  1249.    if (!fSuccess)
  1250.    {
  1251.     SWP        swp;
  1252.  
  1253.       /*
  1254.        * Get the dimensions and the shell's suggested
  1255.        * location for the window.
  1256.        */
  1257.       WinQueryTaskSizePos(hab, 0, &swp);
  1258.  
  1259.       /* Set the frame window position  */
  1260.       swp.fl = SWP_SIZE|SWP_MOVE|SWP_RESTORE|SWP_ZORDER;
  1261.       WinSetWindowPos(hwndFrame, HWND_TOP, swp.x, swp.y, swp.cx, swp.cy, swp.fl);
  1262.    }
  1263.  
  1264.    WinShowWindow(hwndFrame, TRUE);
  1265.    return hwndFrame;                                              /* success */
  1266.  
  1267. }   /* end WSFILEInit() */
  1268.  
  1269.  
  1270. /******************************************************************************
  1271. *
  1272. *   WSFILEWndProc()
  1273. *
  1274. *   DESCRIPTION: WSFILE Window Procedure
  1275. *
  1276. ******************************************************************************/
  1277. MRESULT EXPENTRY WSFILEWndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
  1278. {
  1279.   PWINDOWDATA pWindowData;
  1280.   HWND     hwndFrame;
  1281.   BOOL     fSuccess;
  1282.  
  1283.    hwndFrame = WinQueryWindow(hwnd, QW_PARENT);
  1284.  
  1285.    switch( msg )
  1286.    {
  1287.       case WM_CREATE:
  1288.  
  1289.         pWindowData = (PWINDOWDATA)mp1;
  1290.  
  1291.         if (pWindowData == NULL)
  1292.         {
  1293.            DebugBox("WSFILEWndProc:WM_CREATE", "couldn't get window words");
  1294.            return FALSE;
  1295.         }
  1296.         /*
  1297.          *   Fill in the class view/usage details and window specific data
  1298.          *   for this instance.
  1299.          */
  1300.         pWindowData->UseItem.type    = USAGE_OPENVIEW;
  1301.         pWindowData->ViewItem.view   = OPEN_WSFILE;
  1302.         pWindowData->ViewItem.handle = hwndFrame;
  1303.  
  1304.         /*
  1305.          *   Set window pointer with object pointer and instance view info.
  1306.          *   Then add view to the in-use list so wpSwitchTo works.
  1307.          */
  1308.         WinSetWindowPtr(hwnd, QWL_USER, pWindowData);
  1309.         _wpAddToObjUseList(pWindowData->somSelf, &pWindowData->UseItem);
  1310.         _wpRegisterView(pWindowData->somSelf, hwndFrame,
  1311.                         _wpQueryTitle(pWindowData->somSelf));
  1312.         WinSetFocus( HWND_DESKTOP, hwndFrame);
  1313.         break;
  1314.  
  1315.       case WM_COMMAND:
  1316.  
  1317.         break;
  1318.  
  1319.       case WM_PAINT:
  1320.          pWindowData = (PWINDOWDATA)WinQueryWindowPtr(hwnd, QWL_USER);
  1321.  
  1322.          if (pWindowData == NULL)
  1323.          {
  1324.             DebugBox("WSFILEWndProc:WM_PAINT", "couldn't get window words");
  1325.             return FALSE;
  1326.          }
  1327.          else
  1328.          {
  1329.           HPS    hps;
  1330.           RECTL  rectl;
  1331.  
  1332.            hps = WinBeginPaint( hwnd, (HPS)NULLHANDLE, &rectl);
  1333.            WinFillRect( hps, &rectl, SYSCLR_WINDOW);
  1334.            WinDrawPointer(hps, 50, 50,
  1335.                           _wpQueryIcon(pWindowData->somSelf), DP_NORMAL);
  1336.            WinEndPaint( hps );
  1337.          }
  1338.          break;
  1339.  
  1340.       case WM_CLOSE:
  1341.          {
  1342.             HAB hab = WinQueryAnchorBlock(HWND_DESKTOP);
  1343.  
  1344.             pWindowData = (PWINDOWDATA)WinQueryWindowPtr(hwnd, QWL_USER);
  1345.  
  1346.             if (pWindowData == NULL)
  1347.             {
  1348.                DebugBox("WSFILEWndProc:WM_CLOSE", "couldn't get window words");
  1349.                return FALSE;
  1350.             }
  1351.             /*
  1352.              * Restore the Window Position
  1353.              */
  1354.             fSuccess = WinStoreWindowPos(szWSFILEClassTitle,
  1355.                                          _wpQueryTitle(pWindowData->somSelf),
  1356.                                          hwndFrame);
  1357.             _wpDeleteFromObjUseList(pWindowData->somSelf, &pWindowData->UseItem);
  1358.             _wpFreeMem(pWindowData->somSelf, (PBYTE)pWindowData);
  1359.  
  1360.             WinPostMsg(hwnd, WM_QUIT, MPVOID, MPVOID);
  1361.             WinDestroyWindow(hwndFrame);
  1362.          }
  1363.          break;
  1364.  
  1365.       default:
  1366.          return WinDefWindowProc( hwnd, msg, mp1, mp2 );
  1367.    }
  1368.    return FALSE;
  1369.  
  1370. }   /* end WSFILEWndProc() */
  1371.  
  1372. /******************************************************************************
  1373. *
  1374. *   LastWorkerDlgProc()
  1375. *
  1376. *   DESCRIPTION: Dialog Procedure for LastWorker settings page
  1377. *
  1378. ******************************************************************************/
  1379. MRESULT EXPENTRY LastWorkerDlgProc(HWND hwndDlg, ULONG msg,
  1380.                                   MPARAM mp1, MPARAM mp2)
  1381. {
  1382.    LASTWORKERDLGDATA *pLastWorkerDlgData;
  1383.  
  1384.    switch (msg)
  1385.    {
  1386.       case WM_INITDLG:          /* 0x003b */
  1387.       {
  1388.          PSZ       pszTemp;
  1389.  
  1390.          /*
  1391.           *   Store some instance specific data in Window words of this dialog.
  1392.           *   This will ensure our dialog procedure can access this objects
  1393.           *   data (our dialog proc isn't always passed a *somSelf pointer).
  1394.           */
  1395.          pLastWorkerDlgData =
  1396.             (PLASTWORKERDLGDATA)_wpAllocMem((WSFILE *)mp2,
  1397.                                             sizeof(*pLastWorkerDlgData), NULL);
  1398.          if (pLastWorkerDlgData)
  1399.          {
  1400.             memset((PVOID) pLastWorkerDlgData, 0, sizeof(*pLastWorkerDlgData));
  1401.             pLastWorkerDlgData->cb = sizeof(*pLastWorkerDlgData);
  1402.             pLastWorkerDlgData->somSelf = (WSFILE *)mp2;   /* pointer to this object */
  1403.             pszTemp = _queryLastWorker(pLastWorkerDlgData->somSelf);
  1404.             if (pszTemp)
  1405.             {
  1406.                pLastWorkerDlgData->PrevWorker =
  1407.                                   (PSZ)_wpAllocMem(pLastWorkerDlgData->somSelf,
  1408.                                   CCHMAXPATH + 1, NULL);
  1409.                if (pLastWorkerDlgData->PrevWorker)
  1410.                {
  1411.                   strcpy(pLastWorkerDlgData->PrevWorker, pszTemp);
  1412.                }
  1413.             }
  1414.  
  1415.             pLastWorkerDlgData->restorePrevWorker =
  1416.                         (PSZ) _wpAllocMem(pLastWorkerDlgData->somSelf,
  1417.                                            CCHMAXPATH + 1, NULL);
  1418.             if (pLastWorkerDlgData->restorePrevWorker)
  1419.             {
  1420.                strcpy(pLastWorkerDlgData->restorePrevWorker,
  1421.                       pLastWorkerDlgData->PrevWorker);
  1422.             }
  1423.          }
  1424.          else
  1425.          {
  1426.             DebugBox("LastWorkerDlgProc:WM_INITDLG", "Couldn't allocate window words");
  1427.             break;
  1428.          }
  1429.  
  1430.          WinSetWindowPtr(hwndDlg, QWL_USER, pLastWorkerDlgData);
  1431.  
  1432.          /* set the text limit on the entry field
  1433.           */
  1434.          WinSendDlgItemMsg( hwndDlg, IDC_LASTWORKER, EM_SETTEXTLIMIT,
  1435.                             MPFROMSHORT( 0x1000-1 ), 0 );
  1436.  
  1437.          /* set the name into the entry field
  1438.           */
  1439.          WinSetWindowText( WinWindowFromID( hwndDlg, IDC_LASTWORKER ),
  1440.                            _queryLastWorker( (WSFILE *)mp2) );
  1441.  
  1442.          return (MRESULT)FALSE;
  1443.       }   /* end case WM_INITDLG: */
  1444.  
  1445.       case WM_DESTROY:             /* 0x0002 */
  1446.       {
  1447.          WSFILE *pObject;
  1448.  
  1449.          pLastWorkerDlgData = WinQueryWindowPtr(hwndDlg, QWL_USER);
  1450.          if (pLastWorkerDlgData == NULL)
  1451.          {
  1452.             DebugBox("LastWorkerDlgProc:WM_DESTROY", "couldn't get window words");
  1453.             break;
  1454.          }
  1455.  
  1456.          if (pLastWorkerDlgData->PrevWorker)
  1457.          {
  1458.             _wpFreeMem(pLastWorkerDlgData->somSelf,
  1459.                        (PBYTE) pLastWorkerDlgData->PrevWorker);
  1460.          }
  1461.  
  1462.          if (pLastWorkerDlgData->restorePrevWorker)
  1463.          {
  1464.             _wpFreeMem(pLastWorkerDlgData->somSelf,
  1465.                        (PBYTE) pLastWorkerDlgData->restorePrevWorker);
  1466.          }
  1467.  
  1468.          pObject = pLastWorkerDlgData->somSelf;
  1469.          _wpFreeMem(pObject, (PBYTE)pLastWorkerDlgData);
  1470.          return WinDefDlgProc(hwndDlg, msg, mp1, mp2);
  1471.       }
  1472.  
  1473.       case WM_COMMAND:           /* 0x0020 */
  1474.  
  1475.          pLastWorkerDlgData = WinQueryWindowPtr(hwndDlg, QWL_USER);
  1476.          if (pLastWorkerDlgData == NULL)
  1477.          {
  1478.             DebugBox("LastWorkerDlgProc:WM_COMMAND", "couldn't get window words");
  1479.             break;
  1480.          }
  1481.  
  1482.          switch (SHORT1FROMMP(mp1))
  1483.          {
  1484.             case ID_UNDO:                   /* 0x0321 */
  1485.                if (pLastWorkerDlgData->restorePrevWorker)
  1486.                {
  1487.                   _setLastWorker(pLastWorkerDlgData->somSelf,
  1488.                                  pLastWorkerDlgData->restorePrevWorker);
  1489.  
  1490.                   if (pLastWorkerDlgData->PrevWorker)
  1491.                   {
  1492.                      strcpy(pLastWorkerDlgData->PrevWorker,
  1493.                             pLastWorkerDlgData->restorePrevWorker);
  1494.                   }
  1495.                   WinSetWindowText( WinWindowFromID( hwndDlg, IDC_LASTWORKER ),
  1496.                                     pLastWorkerDlgData->restorePrevWorker);
  1497.                }
  1498.                break;
  1499.  
  1500.             case ID_DEFAULT:             /* 0x0322 */
  1501.                /*
  1502.                 *   preserve previous values
  1503.                 */
  1504.                _setLastWorker(pLastWorkerDlgData->somSelf, DEFAULT_LASTWORKER);
  1505.  
  1506.                if (pLastWorkerDlgData->PrevWorker)
  1507.                {
  1508.                   strcpy(pLastWorkerDlgData->PrevWorker, DEFAULT_LASTWORKER);
  1509.                }
  1510.  
  1511.                WinSetWindowText( WinWindowFromID( hwndDlg, IDC_LASTWORKER ),
  1512.                                  pLastWorkerDlgData->PrevWorker);
  1513.  
  1514.                break;
  1515.  
  1516.             case ID_HELP:         /* 0x0323 */
  1517.  
  1518.                break;
  1519.  
  1520.          }   /* end switch (SHORT1FROMMP(mp1)) */
  1521.  
  1522.          return (MRESULT)TRUE;
  1523.  
  1524.       case WM_CONTROL:          /* 0x0030 */
  1525.       {
  1526.          pLastWorkerDlgData = WinQueryWindowPtr(hwndDlg, QWL_USER);
  1527.          if (pLastWorkerDlgData == NULL)
  1528.          {
  1529.             DebugBox("LastWorkerDlgProc:WM_CONTROL", "couldn't get window words");
  1530.             break;
  1531.          }
  1532.  
  1533.          switch (SHORT1FROMMP(mp1))
  1534.          {
  1535.          case IDC_LASTWORKER:
  1536.             if (SHORT2FROMMP(mp1) == EN_CHANGE)
  1537.             {
  1538.                CHAR newworker[CCHMAXPATH + 1];
  1539.  
  1540.                WinQueryWindowText( WinWindowFromID( hwndDlg, IDC_LASTWORKER),
  1541.                                    CCHMAXPATH + 1, newworker );
  1542.                _setLastWorker(pLastWorkerDlgData->somSelf, newworker);
  1543.                if (pLastWorkerDlgData->PrevWorker)
  1544.                {
  1545.                   strcpy(pLastWorkerDlgData->PrevWorker, newworker);
  1546.                }
  1547.             }
  1548.  
  1549.             return (MRESULT)TRUE;
  1550.          }
  1551.          break;
  1552.  
  1553.       }   /* end case WM_CONTROL: */
  1554.  
  1555.    }   /* end switch (msg) */
  1556.  
  1557.    return WinDefDlgProc(hwndDlg, msg, mp1, mp2);
  1558.  
  1559. }   /* end LastWorkerDlgProc() */
  1560.  
  1561.  
  1562. /********************************  END wsfile.c  ********************************/
  1563.  
  1564.  
  1565.  
  1566.  
  1567. /*
  1568.  *
  1569.  * METHOD: clsQueryModuleHandle                           ( ) PRIVATE
  1570.  *                                                        (X) PUBLIC
  1571.  * DESCRIPTION:
  1572.  *
  1573.  *   This method returns the module handle of this class.  If this is the
  1574.  *   first invocation, DosQueryModuleHandle is called to save the handle
  1575.  *   for future invocations.
  1576.  *
  1577.  * RETURN:
  1578.  *
  1579.  *   0              Unsuccessful
  1580.  *   non-zero       module handle
  1581.  *
  1582.  */
  1583.  
  1584. SOM_Scope HMODULE  SOMLINK wsf_clsQueryModuleHandle(M_WSFILE *somSelf)
  1585. {
  1586.    /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  1587.    M_WSFILEMethodDebug("M_WSFILE", "wsf_clsQueryModuleHandle");
  1588.  
  1589.    /* Return statement to be customized: */
  1590.    return;
  1591. }
  1592.  
  1593. /*
  1594.  *
  1595.  * METHOD: clsQueryDefaultFileText                        ( ) PRIVATE
  1596.  *                                                        (X) PUBLIC
  1597.  * DESCRIPTION:
  1598.  *
  1599.  *   This method returns some default text to stuff in an empty WSFILE.
  1600.  *
  1601.  * RETURN:
  1602.  *
  1603.  *   PSZ
  1604.  *
  1605.  */
  1606.  
  1607. SOM_Scope PSZ  SOMLINK wsf_clsQueryDefaultFileText(M_WSFILE *somSelf)
  1608. {
  1609.     /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  1610.     M_WSFILEMethodDebug("M_WSFILE", "wsf_clsQueryDefaultFileText");
  1611.  
  1612.     /* Return statement to be customized: */
  1613.     return;
  1614. }
  1615.  
  1616. SOM_Scope void  SOMLINK wsf_wpclsInitData(M_WSFILE *somSelf)
  1617. {
  1618.    /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  1619.    M_WSFILEMethodDebug("M_WSFILE", "wsf_wpclsInitData");
  1620.  
  1621.    M_WSFILE_parent_M_WPDataFile_wpclsInitData(somSelf);
  1622. }
  1623.  
  1624. SOM_Scope void  SOMLINK wsf_wpclsUnInitData(M_WSFILE *somSelf)
  1625. {
  1626.    /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  1627.    M_WSFILEMethodDebug("M_WSFILE", "wsf_wpclsUnInitData");
  1628.  
  1629.    M_WSFILE_parent_M_WPDataFile_wpclsUnInitData(somSelf);
  1630. }
  1631.  
  1632. SOM_Scope PSZ  SOMLINK wsf_wpclsQueryTitle(M_WSFILE *somSelf)
  1633. {
  1634.    /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  1635.    M_WSFILEMethodDebug("M_WSFILE", "wsf_wpclsQueryTitle");
  1636.  
  1637.    return M_WSFILE_parent_M_WPDataFile_wpclsQueryTitle(somSelf);
  1638. }
  1639.  
  1640. SOM_Scope ULONG  SOMLINK wsf_wpclsQueryIconData(M_WSFILE *somSelf,
  1641.                                                 PICONINFO pIconInfo)
  1642. {
  1643.    /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  1644.    M_WSFILEMethodDebug("M_WSFILE", "wsf_wpclsQueryIconData");
  1645.  
  1646.    return M_WSFILE_parent_M_WPDataFile_wpclsQueryIconData(somSelf, pIconInfo);
  1647. }
  1648.  
  1649. SOM_Scope BOOL  SOMLINK wsf_wpclsQueryDefaultHelp(M_WSFILE *somSelf,
  1650.                                                   PULONG pHelpPanelId,
  1651.                                                   PSZ pszHelpLibrary)
  1652. {
  1653.    /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  1654.    M_WSFILEMethodDebug("M_WSFILE", "wsf_wpclsQueryDefaultHelp");
  1655.  
  1656.    return M_WSFILE_parent_M_WPDataFile_wpclsQueryDefaultHelp(somSelf,
  1657.                                                              pHelpPanelId,
  1658.                                                              pszHelpLibrary);
  1659. }
  1660.  
  1661. SOM_Scope ULONG  SOMLINK wsf_wpclsQueryDefaultView(M_WSFILE *somSelf)
  1662. {
  1663.    /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  1664.    M_WSFILEMethodDebug("M_WSFILE", "wsf_wpclsQueryDefaultView");
  1665.  
  1666.    return M_WSFILE_parent_M_WPDataFile_wpclsQueryDefaultView(somSelf);
  1667. }
  1668.  
  1669. SOM_Scope ULONG  SOMLINK wsf_wpclsQueryDetailsInfo(M_WSFILE *somSelf,
  1670.                                             PCLASSFIELDINFO *ppClassFieldInfo,
  1671.                                             PULONG pSize)
  1672. {
  1673.    /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  1674.    M_WSFILEMethodDebug("M_WSFILE", "wsf_wpclsQueryDetailsInfo");
  1675.  
  1676.    return M_WSFILE_parent_M_WPDataFile_wpclsQueryDetailsInfo(somSelf,
  1677.                                                              ppClassFieldInfo,
  1678.                                                              pSize);
  1679. }
  1680.  
  1681. SOM_Scope PSZ  SOMLINK wsf_wpclsQueryInstanceFilter(M_WSFILE *somSelf)
  1682. {
  1683.    /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  1684.    M_WSFILEMethodDebug("M_WSFILE", "wsf_wpclsQueryInstanceFilter");
  1685.  
  1686.    return M_WSFILE_parent_M_WPDataFile_wpclsQueryInstanceFilter(somSelf);
  1687. }
  1688.  
  1689. SOM_Scope ULONG  SOMLINK wsf_wpclsQueryStyle(M_WSFILE *somSelf)
  1690. {
  1691.    /* M_WSFILEData *somThis = M_WSFILEGetData(somSelf); */
  1692.    M_WSFILEMethodDebug("M_WSFILE", "wsf_wpclsQueryStyle");
  1693.  
  1694.    return M_WSFILE_parent_M_WPDataFile_wpclsQueryStyle(somSelf);
  1695. }
  1696. /***************************** END OF wsfile.c ********************************/
  1697.