home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / drgwps.zip / drgagent.c < prev    next >
C/C++ Source or Header  |  1993-08-08  |  4KB  |  133 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: drgagent.c.
  5.  * Generated using:
  6.  *     SOM Precompiler spc: 1.22
  7.  *     SOM Emitter emitc: 1.24
  8.  */
  9.  
  10. #pragma info( none )
  11. #define DrgAgent_Class_Source
  12. #include "DrgAgent.ih"
  13. #pragma info( restore )
  14.  
  15. #include "common.h"
  16.  
  17. int  _CRT_init( void );
  18. void _CRT_term( void );
  19.  
  20. HMODULE hmodUs = 0;
  21.  
  22. ULONG APIENTRY _DLL_InitTerm( ULONG ulHMod, ULONG fl )
  23. {
  24.     if( fl )                        // Termination time if non-zero
  25.     {
  26.         _CRT_term();
  27.     }
  28.     else
  29.     {
  30.         if( _CRT_init() == -1 )     // -1 means not successful
  31.             return 0;               // 0 means initialization failed
  32.  
  33.         hmodUs = ulHMod;            // The whole purpose for this init routine
  34.     }
  35.  
  36.     return 1;                       // non-zero indicates init successful
  37. }
  38.  
  39. SOM_Scope MRESULT   SOMLINK Agent_wpDraggedOverObject(DrgAgent *somSelf,
  40.         WPObject *DraggedOverObject)
  41. {
  42.     DrgAgentData *somThis = DrgAgentGetData(somSelf);
  43.     DrgAgentMethodDebug("DrgAgent","Agent_wpDraggedOverObject");
  44.  
  45.     // Allow all drops.
  46.  
  47.     parent_wpDraggedOverObject( somSelf, DraggedOverObject );
  48.  
  49.     return MRFROM2SHORT( DOR_DROP, DO_COPY );
  50. }
  51.  
  52.  
  53. SOM_Scope BOOL   SOMLINK Agent_wpDroppedOnObject(DrgAgent *somSelf,
  54.         WPObject *DroppedOnObject)
  55. {
  56.     DrgAgentData *somThis = DrgAgentGetData(somSelf);
  57.     DrgAgentMethodDebug("DrgAgent","Agent_wpDroppedOnObject");
  58.  
  59.     // Tell the object window that we were dropped on.
  60.  
  61.     parent_wpDroppedOnObject( somSelf, DroppedOnObject );
  62.  
  63.     return (BOOL) WinSendMsg( _hwndComm, UM_DROP, MPFROMP( DroppedOnObject ),
  64.                               NULL );
  65. }
  66.  
  67. #undef SOM_CurrentClass
  68. #define SOM_CurrentClass SOMMeta
  69. SOM_Scope ULONG   SOMLINK AgentCls_wpclsQueryIconData(M_DrgAgent *somSelf,
  70.         PICONINFO pIconInfo)
  71. {
  72.     /* M_DrgAgentData *somThis = M_DrgAgentGetData(somSelf); */
  73.     M_DrgAgentMethodDebug("M_DrgAgent","AgentCls_wpclsQueryIconData");
  74.  
  75.     SOM_TraceLevel = 2;
  76.  
  77.     if( pIconInfo )
  78.     {
  79.         pIconInfo->hmod    = hmodUs;
  80.         pIconInfo->resid   = IID_DEFICON;
  81.         pIconInfo->fFormat = ICON_RESOURCE;
  82.     }
  83.  
  84.     return sizeof( *pIconInfo );
  85. }
  86.  
  87. SOM_Scope ULONG   SOMLINK AgentCls_wpclsQueryStyle(M_DrgAgent *somSelf)
  88. {
  89.     /* M_DrgAgentData *somThis = M_DrgAgentGetData(somSelf); */
  90.     M_DrgAgentMethodDebug("M_DrgAgent","AgentCls_wpclsQueryStyle");
  91.  
  92.     return (parent_wpclsQueryStyle(somSelf) |
  93.         CLSSTYLE_NEVERTEMPLATE | CLSSTYLE_NEVERPRINT);
  94. }
  95.  
  96. SOM_Scope PSZ   SOMLINK AgentCls_wpclsQueryTitle(M_DrgAgent *somSelf)
  97. {
  98.     /* M_DrgAgentData *somThis = M_DrgAgentGetData(somSelf); */
  99.     M_DrgAgentMethodDebug("M_DrgAgent","AgentCls_wpclsQueryTitle");
  100.  
  101.     return CLASS_TITLE;
  102. }
  103.  
  104. #undef SOM_CurrentClass
  105. #define SOM_CurrentClass SOMMeta
  106. SOM_Scope void   SOMLINK AgentCls_wpclsInitData(M_DrgAgent *somSelf)
  107. {
  108.     /* M_DrgAgentData *somThis = M_DrgAgentGetData(somSelf); */
  109.     M_DrgAgentMethodDebug("M_DrgAgent","AgentCls_wpclsInitData");
  110.  
  111.     // Create the object window used to communicate with the PM window
  112.  
  113.     CommwinCreate( somSelf );
  114.  
  115.     parent_wpclsInitData(somSelf);
  116. }
  117.  
  118. SOM_Scope void   SOMLINK AgentCls_wpclsUnInitData(M_DrgAgent *somSelf)
  119. {
  120.     /* M_DrgAgentData *somThis = M_DrgAgentGetData(somSelf); */
  121.     M_DrgAgentMethodDebug("M_DrgAgent","AgentCls_wpclsUnInitData");
  122.  
  123.     // Destroy the object window
  124.  
  125.     CommwinDestroy();
  126.  
  127.     // Let the window be destroyed before the parent calls DosFreeModule on us
  128.  
  129.     DosSleep( 2500 );
  130.  
  131.     parent_wpclsUnInitData(somSelf);
  132. }
  133.