Commit 3d0b472f authored by darin's avatar darin
Browse files

WebCore:

	- tighten up cursor handling a bit more

        * kwq/KWQWidget.mm:
        (QWidget::setCursor): Use setDocumentCursor: instead of our own protocol.
        (QWidget::cursor): Use documentCursor instead of storing our own cursor.

        * kwq/WebCoreFrameView.h: Remove setCursor: method.

WebKit:

	- tighten up cursor handling a bit more

        * WebView.subproj/WebDynamicScrollBarsView.m:
        * WebView.subproj/WebHTMLView.m:
        (-[WebHTMLView addMouseMovedObserver]): Call _frameOrBoundsChanged
	so we emit a mouse moved event right away.
        (-[WebHTMLView viewWillMoveToSuperview:]): Remove the colon since I
	removed the parameter from _frameOrBoundsChanged.

        * WebView.subproj/WebHTMLViewPrivate.h: Declare _frameOrBoundsChanged.
        * WebView.subproj/WebHTMLViewPrivate.m:
        (-[WebHTMLView _frameOrBoundsChanged]): Remove parameter.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2628 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 43befc74
2002-11-11 Darin Adler <darin@apple.com>
- tighten up cursor handling a bit more
* kwq/KWQWidget.mm:
(QWidget::setCursor): Use setDocumentCursor: instead of our own protocol.
(QWidget::cursor): Use documentCursor instead of storing our own cursor.
* kwq/WebCoreFrameView.h: Remove setCursor: method.
2002-11-11 Darin Adler <darin@apple.com>
 
- fixed 3084704 -- crash in HTMLTokenizer on page with JavaScript
......
2002-11-11 Darin Adler <darin@apple.com>
- tighten up cursor handling a bit more
* kwq/KWQWidget.mm:
(QWidget::setCursor): Use setDocumentCursor: instead of our own protocol.
(QWidget::cursor): Use documentCursor instead of storing our own cursor.
* kwq/WebCoreFrameView.h: Remove setCursor: method.
2002-11-11 Darin Adler <darin@apple.com>
 
- fixed 3084704 -- crash in HTMLTokenizer on page with JavaScript
......
2002-11-11 Darin Adler <darin@apple.com>
- tighten up cursor handling a bit more
* kwq/KWQWidget.mm:
(QWidget::setCursor): Use setDocumentCursor: instead of our own protocol.
(QWidget::cursor): Use documentCursor instead of storing our own cursor.
* kwq/WebCoreFrameView.h: Remove setCursor: method.
2002-11-11 Darin Adler <darin@apple.com>
 
- fixed 3084704 -- crash in HTMLTokenizer on page with JavaScript
......
......@@ -48,7 +48,6 @@ class QWidgetPrivate
public:
QStyle *style;
QFont font;
QCursor cursor;
QPalette pal;
NSView *view;
};
......@@ -287,12 +286,12 @@ bool QWidget::isVisible() const
void QWidget::setCursor(const QCursor &cur)
{
data->cursor = cur;
id view = data->view;
while (view) {
if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
[view setCursor:data->cursor.handle()];
if ([view respondsToSelector:@selector(setDocumentCursor:)]) {
printf("setting cursor to %p\n", cur.handle());
[view setDocumentCursor:cur.handle()];
break;
}
view = [view superview];
}
......@@ -300,7 +299,14 @@ void QWidget::setCursor(const QCursor &cur)
QCursor QWidget::cursor()
{
return data->cursor;
id view = data->view;
while (view) {
if ([view respondsToSelector:@selector(documentCursor)]) {
return [view documentCursor];
}
view = [view superview];
}
return QCursor();
}
void QWidget::unsetCursor()
......
......@@ -23,12 +23,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
@class NSCursor;
// Among other things, this protocol is a way for an NSScrollView to detect
// This protocol is a way for an NSScrollView to detect
// that the view it's embedded in is one that should be resized when the
// scroll view is resized.
@protocol WebCoreFrameView
- (void)setCursor:(NSCursor *)cursor;
@end
2002-11-11 Darin Adler <darin@apple.com>
- tighten up cursor handling a bit more
* WebView.subproj/WebDynamicScrollBarsView.m:
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView addMouseMovedObserver]): Call _frameOrBoundsChanged
so we emit a mouse moved event right away.
(-[WebHTMLView viewWillMoveToSuperview:]): Remove the colon since I
removed the parameter from _frameOrBoundsChanged.
* WebView.subproj/WebHTMLViewPrivate.h: Declare _frameOrBoundsChanged.
* WebView.subproj/WebHTMLViewPrivate.m:
(-[WebHTMLView _frameOrBoundsChanged]): Remove parameter.
2002-11-11 Trey Matteson <trey@apple.com>
 
Fixed 3015884 - Reloading a page should remember the scroll position
......
2002-11-11 Darin Adler <darin@apple.com>
- tighten up cursor handling a bit more
* WebView.subproj/WebDynamicScrollBarsView.m:
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView addMouseMovedObserver]): Call _frameOrBoundsChanged
so we emit a mouse moved event right away.
(-[WebHTMLView viewWillMoveToSuperview:]): Remove the colon since I
removed the parameter from _frameOrBoundsChanged.
* WebView.subproj/WebHTMLViewPrivate.h: Declare _frameOrBoundsChanged.
* WebView.subproj/WebHTMLViewPrivate.m:
(-[WebHTMLView _frameOrBoundsChanged]): Remove parameter.
2002-11-11 Trey Matteson <trey@apple.com>
 
Fixed 3015884 - Reloading a page should remember the scroll position
......
......@@ -75,26 +75,6 @@ - (void)reflectScrolledClipView:(NSClipView *)clipView
[super reflectScrolledClipView:clipView];
}
- (void)setCursor:(NSCursor *)cur
{
if (!cur) {
if (!cursor) {
return;
}
} else {
if ([cur isEqual:[NSCursor arrowCursor]]) {
cur = nil;
} else if (cursor && [cursor isEqual:cur]) {
return;
}
}
[cursor release];
cursor = [cur retain];
[self setDocumentCursor:cursor];
}
- (void)setAllowsScrolling:(BOOL)flag
{
disallowsScrolling = !flag;
......
......@@ -154,6 +154,7 @@ - (void)addMouseMovedObserver
ASSERT(![self _insideAnotherHTMLView]);
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mouseMovedNotification:)
name:NSMouseMovedNotification object:nil];
[self _frameOrBoundsChanged];
}
- (void)removeMouseMovedObserver
......@@ -182,9 +183,9 @@ - (void)viewWillMoveToSuperview:(NSView *)newSuperview
}
if (newSuperview) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_frameOrBoundsChanged:)
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_frameOrBoundsChanged)
name:NSViewFrameDidChangeNotification object:newSuperview];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_frameOrBoundsChanged:)
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_frameOrBoundsChanged)
name:NSViewBoundsDidChangeNotification object:newSuperview];
}
}
......@@ -222,7 +223,6 @@ - (void)viewDidMoveToWindow
_private->inWindow = NO;
}
}
[super viewDidMoveToWindow];
}
- (void)addSubview:(NSView *)view
......
......@@ -56,4 +56,6 @@
+ (NSArray *)_pasteboardTypes;
- (void)_writeSelectionToPasteboard:(NSPasteboard *)pasteboard;
- (void)_frameOrBoundsChanged;
@end
......@@ -125,7 +125,7 @@ + (void)_postFlagsChangedEvent:(NSEvent *)flagsChangedEvent
userInfo:[NSDictionary dictionaryWithObject:fakeEvent forKey:@"NSEvent"]];
}
- (void)_frameOrBoundsChanged:(NSNotification *)notification
- (void)_frameOrBoundsChanged
{
if (!NSEqualSizes(_private->lastLayoutSize, [(NSClipView *)[self superview] documentVisibleRect].size)) {
[self setNeedsLayout:YES];
......@@ -277,7 +277,7 @@ - (void)_updateMouseoverWithEvent:(NSEvent *)event
+ (NSArray *)_pasteboardTypes
{
return [NSArray arrayWithObjects:NSStringPboardType,
#ifdef SUPPORT_HTML_PBOARD
#if SUPPORT_HTML_PBOARD
NSHTMLPboardType,
#endif
NSRTFPboardType, nil];
......@@ -300,7 +300,7 @@ - (void)_writeSelectionToPasteboard:(NSPasteboard *)pasteboard
attributedData = [attributedString RTFFromRange:NSMakeRange(0, [attributedString length]) documentAttributes:nil];
[pasteboard setData:attributedData forType:NSRTFPboardType];
#ifdef SUPPORT_HTML_PBOARD
#if SUPPORT_HTML_PBOARD
// Put HTML on the pasteboard.
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment