Examples of CGPoint


Examples of org.eclipse.swt.internal.carbon.CGPoint

      dragging = true;
      Rect rect = new Rect ();
      int window = OS.GetControlOwner (control.handle);
      int x, y;
      if (OS.HIVIEW) {
        CGPoint pt = new CGPoint ();
        pt.x = dragMouseStart.h;
        pt.y = dragMouseStart.v;
        OS.HIViewConvertPoint (pt, 0, control.handle);
        x = (int) pt.x;
        y = (int) pt.y;
View Full Code Here

Examples of org.eclipse.swt.internal.carbon.CGPoint

  int [] theWindow = new int [1];
  if (OS.FindWindow (where, theWindow) != OS.inContent) return null;
  if (theWindow [0] == 0) return null;
  Rect rect = new Rect ();
  OS.GetWindowBounds (theWindow [0], (short) OS.kWindowContentRgn, rect);
  CGPoint inPoint = new CGPoint ();
  inPoint.x = where.h - rect.left;
  inPoint.y = where.v - rect.top;
  int [] theRoot = new int [1];
  OS.GetRootControl (theWindow [0], theRoot);
  int [] theControl = new int [1];
View Full Code Here

Examples of org.eclipse.swt.internal.carbon.CGPoint

      }
    }
    case SWT.MouseDown:
    case SWT.MouseMove:
    case SWT.MouseUp: {
      CGPoint mouseCursorPosition = new CGPoint ();
      int chord = OS.GetCurrentEventButtonState ();
      if (type == SWT.MouseMove) {
        mouseCursorPosition.x = event.x;
        mouseCursorPosition.y = event.y;
        return OS.CGPostMouseEvent (mouseCursorPosition, true, 3, (chord & 0x1) != 0, (chord & 0x2) != 0, (chord & 0x4) != 0) == 0;
View Full Code Here

Examples of org.eclipse.swt.internal.carbon.CGPoint

  Point point = new Point (x, y);
  Rect rect = new Rect ();
  if (from != null) {
    int window = OS.GetControlOwner (from.handle);
    if (OS.HIVIEW) {
      CGPoint pt = new CGPoint ();
      OS.HIViewConvertPoint (pt, from.handle, 0);
      point.x += (int) pt.x;
      point.y += (int) pt.y;
      OS.GetWindowBounds (window, (short) OS.kWindowStructureRgn, rect);
    } else {
      OS.GetControlBounds (from.handle, rect);
      point.x += rect.left;
      point.y += rect.top;
      OS.GetWindowBounds (window, (short) OS.kWindowContentRgn, rect);
    }
    point.x += rect.left;
    point.y += rect.top;
    Rect inset = from.getInset ();
    point.x -= inset.left;
    point.y -= inset.top;
  }
  if (to != null) {
    int window = OS.GetControlOwner (to.handle);
    if (OS.HIVIEW) {
      CGPoint pt = new CGPoint ();
      OS.HIViewConvertPoint (pt, to.handle, 0);
      point.x -= (int) pt.x;
      point.y -= (int) pt.y;
      OS.GetWindowBounds (window, (short) OS.kWindowStructureRgn, rect);
    } else {
View Full Code Here

Examples of org.eclipse.swt.internal.carbon.CGPoint

  Rectangle rectangle = new Rectangle (x, y, width, height);
  Rect rect = new Rect ();
  if (from != null) {
    int window = OS.GetControlOwner (from.handle);
    if (OS.HIVIEW) {
      CGPoint pt = new CGPoint ();
      OS.HIViewConvertPoint (pt, from.handle, 0);
      rectangle.x += (int) pt.x;
      rectangle.y += (int) pt.y;
      OS.GetWindowBounds (window, (short) OS.kWindowStructureRgn, rect);
    } else {
      OS.GetControlBounds (from.handle, rect);
      rectangle.x += rect.left;
      rectangle.y += rect.top;
      OS.GetWindowBounds (window, (short) OS.kWindowContentRgn, rect);
    }
    rectangle.x += rect.left;
    rectangle.y += rect.top;
    Rect inset = from.getInset ();
    rectangle.x -= inset.left;
    rectangle.y -= inset.top;
  }
  if (to != null) {
    int window = OS.GetControlOwner (to.handle);
    if (OS.HIVIEW) {
      CGPoint pt = new CGPoint ();
      OS.HIViewConvertPoint (pt, to.handle, 0);
      rectangle.x -= (int) pt.x;
      rectangle.y -= (int) pt.y;
      OS.GetWindowBounds (window, (short) OS.kWindowStructureRgn, rect);
    } else {
View Full Code Here

Examples of org.eclipse.swt.internal.carbon.CGPoint

      break;
    }
    case OS.inContent: {
      Rect windowRect = new Rect ();
      OS.GetWindowBounds (theWindow [0], (short) OS.kWindowContentRgn, windowRect);
      CGPoint inPoint = new CGPoint ();
      inPoint.x = where.h - windowRect.left;
      inPoint.y = where.v - windowRect.top;
      if (OS.HIVIEW) {
        int root = OS.HIViewGetRoot (theWindow [0]);
        int [] buffer = new int [1];
View Full Code Here

Examples of org.eclipse.swt.internal.carbon.CGPoint

  int [] theWindow = new int [1];
  if (OS.FindWindow (where, theWindow) == OS.inContent) {
    if (theWindow [0] != 0) {
      Rect rect = new Rect ();
      OS.GetWindowBounds (theWindow [0], (short) OS.kWindowContentRgn, rect);
      CGPoint inPoint = new CGPoint ();
      inPoint.x = where.h - rect.left;
      inPoint.y = where.v - rect.top;
      int [] theRoot = new int [1];
      OS.GetRootControl (theWindow [0], theRoot);
      OS.HIViewGetSubviewHit (theRoot [0], inPoint, true, theControl);
View Full Code Here

Examples of org.eclipse.swt.internal.carbon.CGPoint

    return false;
  }
  Rect rect = new Rect ();
  int [] outModifiers = new int [1];
  short [] outResult = new short [1];
  CGPoint pt = new CGPoint ();
  org.eclipse.swt.internal.carbon.Point outPt = new org.eclipse.swt.internal.carbon.Point ();
  grabbing = true;
  mouseUpControl = null;
  try {
    while (grabControl != null && !grabControl.isDisposed () && outResult [0] != OS.kMouseTrackingMouseUp) {
View Full Code Here

Examples of org.eclipse.swt.internal.carbon.CGPoint

*
* @since 2.1
*/
public void setCursorLocation (int x, int y) {
  checkDevice ();
  CGPoint pt = new CGPoint ();
  pt.x = x;  pt.y = y;
  OS.CGWarpMouseCursorPosition (pt);
}
View Full Code Here

Examples of org.robovm.apple.coregraphics.CGPoint

    long array = NSSetExtensions.allObjects(touches);
    int length = (int) NSArrayExtensions.count(array);
    for (int i = 0; i < length; i++) {
      long touchHandle = NSArrayExtensions.objectAtIndex$(array, i);
      UITouch touch = UI_TOUCH_WRAPPER.wrap(touchHandle);
      CGPoint loc = touch.getLocation(touch.getView());
      synchronized(touchEvents) {
        UITouchPhase phase = touch.getPhase();
        TouchEvent event = touchEventPool.obtain();
        event.x = (int)(loc.x() * app.displayScaleFactor);
        event.y = (int)(loc.y() * app.displayScaleFactor);
        event.phase = phase;
        event.timestamp = (long)(touch.getTimestamp() * 1000000000);
        touchEvents.add(event);
       
        if(phase == UITouchPhase.Began) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.