Prima
view release on metacpan or search on metacpan
unix/event.c view on Meta::CPAN
if ( ev-> xmotion. state & ShiftMask) e.pos.mod |= kmShift;
if ( ev-> xmotion. state & ControlMask) e.pos.mod |= kmCtrl;
if ( ev-> xmotion. state & Mod1Mask) e.pos.mod |= kmAlt;
if ( ev-> xmotion. state & Button1Mask) e.pos.mod |= mb1;
if ( ev-> xmotion. state & Button2Mask) e.pos.mod |= mb2;
if ( ev-> xmotion. state & Button3Mask) e.pos.mod |= mb3;
if ( ev-> xmotion. state & Button4Mask) e.pos.mod |= mb4;
if ( ev-> xmotion. state & Button5Mask) e.pos.mod |= mb5;
if ( ev-> xmotion. state & Button6Mask) e.pos.mod |= mb6;
if ( ev-> xmotion. state & Button7Mask) e.pos.mod |= mb7;
break;
}
case EnterNotify: {
if (( guts. pointer_invisible_count == 0) && XX-> flags. pointer_obscured) {
XX-> flags. pointer_obscured = 0;
XDefineCursor( DISP, XX-> udrawable, prima_get_cursor(self));
} else if (( guts. pointer_invisible_count < 0) && !XX-> flags. pointer_obscured) {
XX-> flags. pointer_obscured = 1;
XDefineCursor( DISP, XX-> udrawable, guts. null_pointer);
}
guts. last_time = ev-> xcrossing. time;
e. cmd = cmMouseEnter;
CrossingEvent:
if ( ev-> xcrossing. subwindow != None) return;
e. pos. where. x = ev-> xcrossing. x;
e. pos. where. y = XX-> size. y - ev-> xcrossing. y - 1;
break;
}
case LeaveNotify: {
guts. last_time = ev-> xcrossing. time;
e. cmd = cmMouseLeave;
goto CrossingEvent;
}
case FocusIn: {
Handle frame = self;
switch ( ev-> xfocus. detail) {
case NotifyVirtual:
case NotifyPointer:
case NotifyPointerRoot:
case NotifyDetailNone:
return;
case NotifyNonlinearVirtual:
if (!XT_IS_WINDOW(XX)) return;
break;
}
if ( guts. message_boxes) {
struct MsgDlg * md = guts. message_boxes;
while ( md) {
XSetInputFocus( DISP, md-> w, RevertToNone, CurrentTime);
md = md-> next;
}
return;
}
syntetic_mouse_move(); /* XXX - simulated MouseMove event for compatibility reasons */
if (!XT_IS_WINDOW(XX))
frame = C_APPLICATION-> top_frame( prima_guts.application, self);
if ( C_APPLICATION-> map_focus( prima_guts.application, frame) != frame) {
C_APPLICATION-> popup_modal( prima_guts.application);
break;
}
if ( XT_IS_WINDOW(XX)) {
e. cmd = cmActivate;
SELF_MESSAGE(e);
if (( PObject( self)-> stage == csDead) ||
( ev-> xfocus. detail == NotifyNonlinearVirtual)) return;
}
if ( guts. focused) prima_no_cursor( guts. focused);
guts. focused = self;
prima_update_cursor( guts. focused);
e. cmd = cmReceiveFocus;
if ( guts.use_xim )
prima_xim_focus_in(self);
break;
}
case FocusOut: {
switch ( ev-> xfocus. detail) {
case NotifyVirtual:
case NotifyPointer:
case NotifyPointerRoot:
case NotifyDetailNone:
return;
case NotifyNonlinearVirtual:
if (!XT_IS_WINDOW(XX)) return;
break;
}
if ( XT_IS_WINDOW(XX)) {
e. cmd = cmDeactivate;
SELF_MESSAGE(e);
if (( PObject( self)-> stage == csDead) ||
( ev-> xfocus. detail == NotifyNonlinearVirtual)) return;
}
if ( guts. focused) prima_no_cursor( guts. focused);
if ( self == guts. focused) guts. focused = NULL_HANDLE;
e. cmd = cmReleaseFocus;
if ( guts.use_xim )
prima_xim_focus_out();
break;
}
case KeymapNotify: {
break;
}
case GraphicsExpose:
case Expose: {
XRectangle r;
if ( !was_sent) {
r. x = ev-> xexpose. x;
r. y = ev-> xexpose. y;
r. width = ev-> xexpose. width;
r. height = ev-> xexpose. height;
if ( !XX-> invalid_region)
XX-> invalid_region = XCreateRegion();
XUnionRectWithRegion( &r, XX-> invalid_region, XX-> invalid_region);
}
( run in 1.049 second using v1.01-cache-2.11-cpan-364913b4093 )