using new nsIScriptableRegion interface.

This commit is contained in:
pinkerton%netscape.com 1999-08-30 21:54:33 +00:00
Родитель f8d4e75cb4
Коммит c3917762df
6 изменённых файлов: 13 добавлений и 9 удалений

Просмотреть файл

@ -68,7 +68,7 @@ nsDragService::~nsDragService()
// Do all the work to kick it off.
//
NS_IMETHODIMP
nsDragService :: InvokeDragSession (nsISupportsArray * aTransferableArray, nsIRegion * aDragRgn, PRUint32 aActionType)
nsDragService :: InvokeDragSession (nsISupportsArray * aTransferableArray, nsIScriptableRegion * aDragRgn, PRUint32 aActionType)
{
DragReference theDragRef;
OSErr result = ::NewDrag(&theDragRef);
@ -130,8 +130,12 @@ nsDragService :: InvokeDragSession (nsISupportsArray * aTransferableArray, nsIRe
// the region we're given is null, create our own placeholder.
//
void
nsDragService :: BuildDragRegion ( nsIRegion* inRegion, Point inGlobalMouseLoc, RgnHandle ioDragRgn )
nsDragService :: BuildDragRegion ( nsIScriptableRegion* inRegion, Point inGlobalMouseLoc, RgnHandle ioDragRgn )
{
nsCOMPtr<nsIRegion> holder ( do_QueryInterface(inRegion) );
if ( !holder )
return;
// create the drag region. Pull out the native mac region from the nsIRegion we're
// given, copy it, inset it one pixel, and subtract them so we're left with just an
// outline. Too bad we can't do this with gfx api's.
@ -139,7 +143,7 @@ nsDragService :: BuildDragRegion ( nsIRegion* inRegion, Point inGlobalMouseLoc,
// At the end, we are left with an outline of the region in global coordinates.
if ( inRegion ) {
RgnHandle dragRegion = nsnull;
inRegion->GetNativeRegion(dragRegion);
holder->GetNativeRegion(dragRegion);
if ( dragRegion && ioDragRgn ) {
::CopyRgn ( dragRegion, ioDragRgn );
::InsetRgn ( ioDragRgn, 1, 1 );

Просмотреть файл

@ -48,7 +48,7 @@ public:
NS_DECL_ISUPPORTS_INHERITED
//nsIDragService
NS_IMETHOD InvokeDragSession (nsISupportsArray * anArrayTransferables, nsIRegion * aRegion, PRUint32 aActionType);
NS_IMETHOD InvokeDragSession (nsISupportsArray * anArrayTransferables, nsIScriptableRegion * aRegion, PRUint32 aActionType);
//nsIDragSession
NS_IMETHOD GetData (nsITransferable * aTransferable, PRUint32 aItemIndex);
@ -63,7 +63,7 @@ private:
char* LookupMimeMappingsForItem ( DragReference inDragRef, ItemReference itemRef ) ;
void RegisterDragItemsAndFlavors ( nsISupportsArray * inArray ) ;
void BuildDragRegion ( nsIRegion* inRegion, Point inGlobalMouseLoc, RgnHandle ioDragRgn ) ;
void BuildDragRegion ( nsIScriptableRegion* inRegion, Point inGlobalMouseLoc, RgnHandle ioDragRgn ) ;
OSErr GetDataForFlavor ( nsISupportsArray* inDragItems, DragReference inDragRef, unsigned int inItemIndex,
FlavorType inFlavor, void** outData, unsigned int * outSize ) ;

Просмотреть файл

@ -58,7 +58,7 @@ nsDragService::~nsDragService()
//-------------------------------------------------------------------------
NS_IMETHODIMP nsDragService::InvokeDragSession (nsISupportsArray * anArrayTransferables, nsIRegion * aRegion, PRUint32 aActionType)
NS_IMETHODIMP nsDragService::InvokeDragSession (nsISupportsArray * anArrayTransferables, nsIScriptableRegion * aRegion, PRUint32 aActionType)
{
nsresult rv;
PRUint32 cnt;

Просмотреть файл

@ -37,7 +37,7 @@ public:
virtual ~nsDragService();
// nsIDragService
NS_IMETHOD InvokeDragSession (nsISupportsArray * anArrayTransferables, nsIRegion * aRegion, PRUint32 aActionType);
NS_IMETHOD InvokeDragSession (nsISupportsArray * anArrayTransferables, nsIScriptableRegion * aRegion, PRUint32 aActionType);
NS_IMETHOD GetCurrentSession (nsIDragSession ** aSession);
// nsIDragSession

Просмотреть файл

@ -130,7 +130,7 @@ NS_IMETHODIMP nsBaseDragService::IsDataFlavorSupported(const char *aDataFlavor,
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsBaseDragService::InvokeDragSession (nsISupportsArray * anArrayTransferables, nsIRegion * aRegion, PRUint32 aActionType)
NS_IMETHODIMP nsBaseDragService::InvokeDragSession (nsISupportsArray * anArrayTransferables, nsIScriptableRegion * aRegion, PRUint32 aActionType)
{
return NS_ERROR_FAILURE;
}

Просмотреть файл

@ -40,7 +40,7 @@ public:
NS_DECL_ISUPPORTS
//nsIDragService
NS_IMETHOD InvokeDragSession (nsISupportsArray * anArrayTransferables, nsIRegion * aRegion, PRUint32 aActionType);
NS_IMETHOD InvokeDragSession (nsISupportsArray * anArrayTransferables, nsIScriptableRegion * aRegion, PRUint32 aActionType);
NS_IMETHOD GetCurrentSession (nsIDragSession ** aSession);
NS_IMETHOD StartDragSession ();
NS_IMETHOD EndDragSession ();