~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Tools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
 
3
 *
 
4
 * Redistribution and use in source and binary forms, with or without
 
5
 * modification, are permitted provided that the following conditions
 
6
 * are met:
 
7
 *
 
8
 * 1.  Redistributions of source code must retain the above copyright
 
9
 *     notice, this list of conditions and the following disclaimer. 
 
10
 * 2.  Redistributions in binary form must reproduce the above copyright
 
11
 *     notice, this list of conditions and the following disclaimer in the
 
12
 *     documentation and/or other materials provided with the distribution. 
 
13
 * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
 
14
 *     its contributors may be used to endorse or promote products derived
 
15
 *     from this software without specific prior written permission. 
 
16
 *
 
17
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
 
18
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 
19
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 
20
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 
21
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 
22
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 
23
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 
24
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
27
 */
 
28
 
 
29
#import "config.h"
 
30
#import "DumpRenderTreeDraggingInfo.h"
 
31
 
 
32
#import "DumpRenderTree.h"
 
33
#import "EventSendingController.h"
 
34
#import <WebKit/WebKit.h>
 
35
 
 
36
@implementation DumpRenderTreeDraggingInfo
 
37
 
 
38
- (id)initWithImage:(NSImage *)anImage offset:(NSSize)o pasteboard:(NSPasteboard *)pboard source:(id)source
 
39
{
 
40
    draggedImage = [anImage retain];
 
41
    draggingPasteboard = [pboard retain];
 
42
    draggingSource = [source retain];
 
43
    offset = o;
 
44
    
 
45
    return [super init];
 
46
}
 
47
 
 
48
- (void)dealloc
 
49
{
 
50
    [draggedImage release];
 
51
    [draggingPasteboard release];
 
52
    [draggingSource release];
 
53
    [super dealloc];
 
54
}
 
55
 
 
56
- (NSWindow *)draggingDestinationWindow 
 
57
{
 
58
    return [[mainFrame webView] window];
 
59
}
 
60
 
 
61
- (NSDragOperation)draggingSourceOperationMask 
 
62
{
 
63
    return [draggingSource draggingSourceOperationMaskForLocal:YES];
 
64
}
 
65
 
 
66
- (NSPoint)draggingLocation
 
67
 
68
    return lastMousePosition; 
 
69
}
 
70
 
 
71
- (NSPoint)draggedImageLocation 
 
72
{
 
73
    return NSMakePoint(lastMousePosition.x + offset.width, lastMousePosition.y + offset.height);
 
74
}
 
75
 
 
76
- (NSImage *)draggedImage
 
77
{
 
78
    return draggedImage;
 
79
}
 
80
 
 
81
- (NSPasteboard *)draggingPasteboard
 
82
{
 
83
    return draggingPasteboard;
 
84
}
 
85
 
 
86
- (id)draggingSource
 
87
{
 
88
    return draggingSource;
 
89
}
 
90
 
 
91
- (int)draggingSequenceNumber
 
92
{
 
93
    NSLog(@"DumpRenderTree doesn't support draggingSequenceNumber");
 
94
    return 0;
 
95
}
 
96
 
 
97
- (void)slideDraggedImageTo:(NSPoint)screenPoint
 
98
{
 
99
    NSLog(@"DumpRenderTree doesn't support slideDraggedImageTo:");
 
100
}
 
101
 
 
102
- (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination
 
103
{
 
104
    NSLog(@"DumpRenderTree doesn't support namesOfPromisedFilesDroppedAtDestination:");
 
105
    return nil;
 
106
}
 
107
 
 
108
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
 
109
- (NSDraggingFormation)draggingFormation
 
110
{
 
111
    return NSDraggingFormationDefault;
 
112
}
 
113
 
 
114
- (void)setDraggingFormation:(NSDraggingFormation)formation
 
115
{
 
116
    // Ignored.
 
117
}
 
118
 
 
119
- (BOOL)animatesToDestination
 
120
{
 
121
    return NO;
 
122
}
 
123
 
 
124
- (void)setAnimatesToDestination:(BOOL)flag
 
125
{
 
126
    // Ignored.
 
127
}
 
128
 
 
129
- (NSInteger)numberOfValidItemsForDrop
 
130
{
 
131
    return 1;
 
132
}
 
133
 
 
134
- (void)setNumberOfValidItemsForDrop:(NSInteger)number
 
135
{
 
136
    // Ignored.
 
137
}
 
138
 
 
139
- (void)enumerateDraggingItemsWithOptions:(NSEnumerationOptions)enumOpts forView:(NSView *)view classes:(NSArray *)classArray searchOptions:(NSDictionary *)searchOptions usingBlock:(void (^)(NSDraggingItem *draggingItem, NSInteger idx, BOOL *stop))block
 
140
{
 
141
    // Ignored.
 
142
}
 
143
#endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
 
144
 
 
145
@end
 
146