⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 244820 in webkit


Ignore:
Timestamp:
Apr 30, 2019, 11:30:51 PM (7 years ago)
Author:
timothy_horton@apple.com
Message:

Fix the WebKitTestRunner build
https://bugs.webkit.org/show_bug.cgi?id=197449
<rdar://problem/50334169>

Reviewed by Alexey Proskuryakov.

  • WebKitTestRunner/mac/EventSenderProxy.mm:

(-[EventSenderSyntheticEvent initPressureEventAtLocation:globalLocation:stage:pressure:stageTransition:phase:time:eventNumber:window:]):
(WTR::EventSenderProxy::mouseForceChanged):
Use some SPI instead of IPI.

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r244819 r244820  
     12019-04-30  Tim Horton  <timothy_horton@apple.com>
     2
     3        Fix the WebKitTestRunner build
     4        https://bugs.webkit.org/show_bug.cgi?id=197449
     5        <rdar://problem/50334169>
     6
     7        Reviewed by Alexey Proskuryakov.
     8
     9        * WebKitTestRunner/mac/EventSenderProxy.mm:
     10        (-[EventSenderSyntheticEvent initPressureEventAtLocation:globalLocation:stage:pressure:stageTransition:phase:time:eventNumber:window:]):
     11        (WTR::EventSenderProxy::mouseForceChanged):
     12        Use some SPI instead of IPI.
     13
    1142019-04-30  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Tools/TestRunnerShared/spi/CoreGraphicsTestSPI.h

    r214946 r244820  
    8585typedef uint32_t CGSHIDEventType;
    8686
     87typedef CF_ENUM(uint8_t, CGSGesturePhase)
     88{
     89    kCGSGesturePhaseNone = 0,
     90    kCGSGesturePhaseBegan = 1,
     91    kCGSGesturePhaseChanged = 2,
     92    kCGSGesturePhaseEnded = 4,
     93    kCGSGesturePhaseCancelled = 8,
     94    kCGSGesturePhaseMayBegin = 128
     95};
     96
     97typedef CF_ENUM(uint8_t, CGSGestureBehavior)
     98{
     99    kCGSGestureBehaviorDeepPress = 5,
     100};
     101
    87102CGPoint CGEventGetWindowLocation(CGEventRef);
    88103void CGEventSetWindowLocation(CGEventRef, CGPoint);
  • trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm

    r239255 r244820  
    2828#import "EventSenderProxy.h"
    2929
     30#import "CoreGraphicsTestSPI.h"
    3031#import "PlatformWebView.h"
    3132#import "StringFunctions.h"
     
    4647@interface NSEvent (ForTestRunner)
    4748- (void)_postDelayed;
     49- (instancetype)_initWithCGEvent:(CGEventRef)event eventRef:(void *)eventRef;
    4850@end
    4951
     
    7072@implementation EventSenderSyntheticEvent
    7173
    72 - (id)initPressureEventAtLocation:(NSPoint)location globalLocation:(NSPoint)globalLocation stage:(NSInteger)stage pressure:(float)pressure stageTransition:(float)stageTransition phase:(NSEventPhase)phase time:(NSTimeInterval)time eventNumber:(NSInteger)eventNumber window:(NSWindow *)window
    73 {
    74     self = [super init];
     74- (instancetype)initPressureEventAtLocation:(NSPoint)location globalLocation:(NSPoint)globalLocation stage:(NSInteger)stage pressure:(float)pressure stageTransition:(float)stageTransition phase:(NSEventPhase)phase time:(NSTimeInterval)time eventNumber:(NSInteger)eventNumber window:(NSWindow *)window
     75{
     76    CGSGesturePhase gesturePhase;
     77    switch (phase) {
     78    case NSEventPhaseMayBegin:
     79        gesturePhase = kCGSGesturePhaseMayBegin;
     80        break;
     81    case NSEventPhaseBegan:
     82        gesturePhase = kCGSGesturePhaseBegan;
     83        break;
     84    case NSEventPhaseChanged:
     85        gesturePhase = kCGSGesturePhaseChanged;
     86        break;
     87    case NSEventPhaseCancelled:
     88        gesturePhase = kCGSGesturePhaseCancelled;
     89        break;
     90    case NSEventPhaseEnded:
     91        gesturePhase = kCGSGesturePhaseEnded;
     92        break;
     93    case NSEventPhaseNone:
     94    default:
     95        gesturePhase = kCGSGesturePhaseNone;
     96        break;
     97    }
     98
     99    CGEventRef cgEvent = CGEventCreate(nullptr);
     100    CGEventSetType(cgEvent, (CGEventType)kCGSEventGesture);
     101    CGEventSetIntegerValueField(cgEvent, kCGEventGestureHIDType, 32);
     102    CGEventSetIntegerValueField(cgEvent, kCGEventGesturePhase, gesturePhase);
     103    CGEventSetDoubleValueField(cgEvent, kCGEventStagePressure, pressure);
     104    CGEventSetDoubleValueField(cgEvent, kCGEventTransitionProgress, pressure);
     105    CGEventSetIntegerValueField(cgEvent, kCGEventGestureStage, stageTransition);
     106    CGEventSetIntegerValueField(cgEvent, kCGEventGestureBehavior, kCGSGestureBehaviorDeepPress);
     107
     108    self = [super _initWithCGEvent:cgEvent eventRef:nullptr];
    75109
    76110    if (!self)
     
    86120    _eventSender_eventNumber = eventNumber;
    87121    _eventSender_window = window;
    88 #if defined(__LP64__)
    89     self->_type = NSEventTypePressure;
    90122    _eventSender_type = NSEventTypePressure;
    91 #endif
    92123
    93124    return self;
     
    326357}
    327358
    328 #if defined(__LP64__)
    329359void EventSenderProxy::sendMouseDownToStartPressureEvents()
    330360{
     
    526556    IGNORE_NULL_CHECK_WARNINGS_END
    527557}
    528 #else
    529 
    530 #if PLATFORM(COCOA)
    531 RetainPtr<NSEvent> EventSenderProxy::beginPressureEvent(int)
    532 {
    533     return nil;
    534 }
    535 
    536 RetainPtr<NSEvent> EventSenderProxy::pressureChangeEvent(int, PressureChangeDirection)
    537 {
    538     return nil;
    539 }
    540 
    541 RetainPtr<NSEvent> EventSenderProxy::pressureChangeEvent(int, float, PressureChangeDirection)
    542 {
    543     return nil;
    544 }
    545 #endif // PLATFORM(COCOA)
    546 
    547 void EventSenderProxy::sendMouseDownToStartPressureEvents()
    548 {
    549 }
    550 
    551 void EventSenderProxy::mouseForceDown()
    552 {
    553 }
    554 
    555 void EventSenderProxy::mouseForceUp()
    556 {
    557 }
    558 
    559 void EventSenderProxy::mouseForceChanged(float)
    560 {
    561 }
    562 
    563 void EventSenderProxy::mouseForceClick()
    564 {
    565 }
    566 
    567 void EventSenderProxy::startAndCancelMouseForceClick()
    568 {
    569 }
    570 #endif // defined(__LP64__)
    571558
    572559void EventSenderProxy::mouseMoveTo(double x, double y)
Note: See TracChangeset for help on using the changeset viewer.