home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * This file was generated by the SOM Compiler.
- * Generated using:
- * SOM incremental update: 2.7
- */
-
- /******************************************************************************
- *
- * Module Name: DRAGFOLD.C
- *
- * OS/2 Work Place Shell IDL File BETA Sample Program
- *
- * Copyright (C) 1993 IBM Corporation
- *
- * DISCLAIMER OF WARRANTIES. The following [enclosed] code is
- * sample code created by IBM Corporation. This sample code is not
- * part of any standard or IBM product and is provided to you solely
- * for the purpose of assisting you in the development of your
- * applications. The code is provided "AS IS", without
- * warranty of any kind. IBM shall not be liable for any damages
- * arising out of your use of the sample code, even if they have been
- * advised of the possibility of such damages. *
- *
- ******************************************************************************/
-
-
- #define INCL_DOS
- #define INCL_PM
- #include <os2.h>
-
- #define DRAGFOLD_Class_Source
- #include "dragfold.ih"
-
-
- /*
- * SOM_Scope MRESULT SOMLINK dragf_wpDragOver(DRAGFOLD *somSelf,
- * HWND hwndCnr,
- * PDRAGINFO pdrgInfo)
- *
- * When an object is dragged over an object of class DRAGFOLD, it will
- * go through the DRAGINFO structure and check to see if the DRAGITEMs
- * indicate the special RMF for the DRAGEXAM class, if so, then we will
- * indicate that we will accept the drop
- */
-
- SOM_Scope MRESULT SOMLINK dragf_wpDragOver(DRAGFOLD *somSelf,
- HWND hwndCnr, PDRAGINFO pdrgInfo)
- {
- MRESULT mr;
- PDRAGITEM pDragItem;
- ULONG i;
- ULONG ulOurs = 0;
-
- /* DRAGFOLDData *somThis = DRAGFOLDGetData(somSelf); */
- DRAGFOLDMethodDebug("DRAGFOLD","dragf_wpDragOver");
-
- /* go through all the dragitems one by one */
- for (i = 0; i < pdrgInfo->cditem ; i++)
- {
- pDragItem = DrgQueryDragitemPtr(pdrgInfo,i);
-
- /* if this dragitem indicates the special RMF, then keep a count */
- if (DrgVerifyRMF(pDragItem,"DRM_OUROWNSPECIAL","DRF_OBJECT"))
- {
- ulOurs++;
- }
- }
-
- /* if after processing all the dragitems in the draginfo structure,
- * accept the drop based on the following criteria:
- */
- if (ulOurs == 0)
- {
- /* if none used the special RMF, just pass it on through */
- mr = (parent_wpDragOver(somSelf,hwndCnr,pdrgInfo));
- }
- else
- {
- /* if they ALL used the special RMF, then indicate that a drop
- * is ok
- */
- if (ulOurs == pdrgInfo->cditem)
- {
- mr = MRFROM2SHORT(DOR_DROP,
- (SHORT)((pdrgInfo->usOperation == DO_DEFAULT)
- ? DO_MOVE : pdrgInfo->usOperation));
- }
- else
- {
- /* otherwise, we don't know quite how to handle a mixture
- * of items, so we'll just say they can't be dropped
- */
- mr = MRFROM2SHORT(DOR_NEVERDROP,DO_DEFAULT);
- }
- }
- return mr;
- }
-
-
- /*
- * SOM_Scope MRESULT SOMLINK dragf_wpDrop(DRAGFOLD *somSelf,
- * HWND hwndCnr,
- * PDRAGINFO pdrgInfo,
- * PDRAGITEM pdrgItem)
- *
- * If a drop does occur, we want to make sure that the special
- * RMF is removed from the dragitem(s) and replaced with one the
- * parent will understand, and we'll let them actually handle the
- * drop.
- */
-
- SOM_Scope MRESULT SOMLINK dragf_wpDrop(DRAGFOLD *somSelf, HWND hwndCnr,
- PDRAGINFO pdrgInfo, PDRAGITEM pdrgItem)
- {
- ULONG i;
- PDRAGITEM pDragItem;
-
- /* DRAGFOLDData *somThis = DRAGFOLDGetData(somSelf); */
- DRAGFOLDMethodDebug("DRAGFOLD","dragf_wpDrop");
-
- /* look at each dragitem */
- for (i = 0; i < pdrgInfo->cditem ; i++)
- {
- pDragItem = DrgQueryDragitemPtr(pdrgInfo,i);
-
- if (DrgVerifyRMF(pDragItem,"DRM_OUROWNSPECIAL","DRF_OBJECT"))
- {
- /* change the RMF to something the WPSH classes understand */
- DrgDeleteStrHandle(pDragItem->hstrRMF);
- pDragItem->hstrRMF = DrgAddStrHandle("<DRM_OBJECT,DRF_OBJECT>");
- }
- }
-
- /* let the parent handle drop processing since we've already
- * arbitrated who was allowed to be dropped in wpDragOver
- */
- return (parent_wpDrop(somSelf,hwndCnr,pdrgInfo,pdrgItem));
- }
-