Package com.sun.jna.platform.unix.X11

Examples of com.sun.jna.platform.unix.X11.Pixmap


                                    Window w, Raster raster) {
            final X11 x11 = X11.INSTANCE;
            Rectangle bounds = raster.getBounds();
            int width = bounds.x + bounds.width;
            int height = bounds.y + bounds.height;
            final Pixmap pm = x11.XCreatePixmap(dpy, win, width, height, 1);
            final GC gc = x11.XCreateGC(dpy, pm, new NativeLong(0), null);
            if (gc == null) {
                return null;
            }
            x11.XSetForeground(dpy, gc, new NativeLong(0));
View Full Code Here


                    X11 x11 = X11.INSTANCE;
                    Xext ext = Xext.INSTANCE;
                    Display dpy = x11.XOpenDisplay(null);
                    if (dpy == null)
                        return;
                    Pixmap pm = null;
                    try {
                        X11.Window win = getDrawable(w);
                        if (raster == null
                            || ((pm = createBitmap(dpy, win, w, raster)) == null)) {
                            ext.XShapeCombineMask(dpy, win,
View Full Code Here

                BufferedImage buf = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB_PRE);
                Graphics g = buf.getGraphics();
                g.drawImage(image, 0, 0, w, h, null);
               
                GC gc = x11.XCreateGC(dpy, win, new NativeLong(0), null);
                Pixmap pixmap = x11.XCreatePixmap(dpy, win, w, h, 32);
                try {
                    x11.XSetForeground(dpy, gc, new NativeLong(0));
                    x11.XFillRectangle(dpy, pixmap, gc, 0, 0, w, h);
                    Raster raster = buf.getData();
                    int[] pixel = new int[4];
View Full Code Here

                                           Raster raster) {
            final X11 x11 = X11.INSTANCE;
            Rectangle bounds = raster.getBounds();
            int width = bounds.x + bounds.width;
            int height = bounds.y + bounds.height;
            final Pixmap pm = x11.XCreatePixmap(dpy, win, width, height, 1);
            final GC gc = x11.XCreateGC(dpy, pm, new NativeLong(0), null);
            if (gc == null) {
                return null;
            }
            x11.XSetForeground(dpy, gc, new NativeLong(0));
View Full Code Here

                    X11 x11 = X11.INSTANCE;
                    Display dpy = x11.XOpenDisplay(null);
                    if (dpy == null) {
                        return;
                    }
                    Pixmap pm = null;
                    try {
                        X11.Window win = getDrawable(w);
                        pm = src.getPixmap(dpy, win);
                        Xext ext = Xext.INSTANCE;
                        ext.XShapeCombineMask(dpy, win, X11.Xext.ShapeBounding,
View Full Code Here

                                           Raster raster) {
            final X11 x11 = X11.INSTANCE;
            Rectangle bounds = raster.getBounds();
            int width = bounds.x + bounds.width;
            int height = bounds.y + bounds.height;
            final Pixmap pm = x11.XCreatePixmap(dpy, win, width, height, 1);
            final GC gc = x11.XCreateGC(dpy, pm, new NativeLong(0), null);
            if (gc == null) {
                return null;
            }
            x11.XSetForeground(dpy, gc, new NativeLong(0));
View Full Code Here

                    X11 x11 = X11.INSTANCE;
                    Display dpy = x11.XOpenDisplay(null);
                    if (dpy == null) {
                        return;
                    }
                    Pixmap pm = null;
                    try {
                        X11.Window win = getDrawable(w);
                        pm = src.getPixmap(dpy, win);
                        Xext ext = Xext.INSTANCE;
                        ext.XShapeCombineMask(dpy, win, X11.Xext.ShapeBounding,
View Full Code Here

          Rectangle.union(bounds, rectangles[i], bounds);
        }
      }
      int width = bounds.x + bounds.width;
      int height = bounds.y + bounds.height;
      final Pixmap pm = x11.XCreatePixmap(dpy, win, width, height, 1);
      final GC gc = x11.XCreateGC(dpy, pm, new NativeLong(0), null);
      if (gc == null) {
        return null;
      }
      x11.XSetForeground(dpy, gc, new NativeLong(0));
View Full Code Here

          Xext ext = Xext.INSTANCE;
          Display dpy = x11.XOpenDisplay(null);
          if (dpy == null) {
            return;
          }
          Pixmap pm = null;
          try {
            X11.Window win = getDrawable(w);
            if (rectangles == null
                || ((pm = createBitmap(dpy, win, rectangles)) == null)) {
              ext.XShapeCombineMask(dpy, win,
View Full Code Here

      watcherRunning = true;
      new Thread() {
        @Override
        public void run() {
          try {
            final X11 x11 = X11.INSTANCE;
            final Display display = x11.XOpenDisplay(null);
            Window window = new Window(nativeHandle);
            x11.XSelectInput(display, window,
                new NativeLong(X11.ExposureMask |
                    X11.VisibilityChangeMask |
                    X11.StructureNotifyMask |
                    X11.FocusChangeMask |
                    //X11.PointerMotionMask |
                    X11.EnterWindowMask |
                    X11.LeaveWindowMask));
            while (watcherRunning) {
              final XEvent xEvent = new XEvent();
              x11.XNextEvent(display, xEvent);
              if (watcherRunning && !isDisposed()) {
                getDisplay().asyncExec(new Runnable() {
                  public void run() {
                    if (watcherRunning && !isDisposed()) {
                      final Event swtEvent = new Event();
                      XCrossingEvent ce;
                      switch (xEvent.type) {
//                        case X11.MotionNotify:
//                          XMotionEvent e = (XMotionEvent)xEvent.readField("xmotion");
//                          swtEvent.x = e.x;
//                          swtEvent.y = e.y;
//                          notifyListeners(SWT.MouseMove, swtEvent);
//                          break;
                        case X11.EnterNotify:
                          ce = (XCrossingEvent)xEvent.readField("xcrossing");
                          swtEvent.x = ce.x;
                          swtEvent.y = ce.y;
                          notifyListeners(SWT.MouseEnter, swtEvent);
                          break;
                        case X11.LeaveNotify:
                          ce = (XCrossingEvent)xEvent.readField("xcrossing");
                          swtEvent.x = ce.x;
                          swtEvent.y = ce.y;
                          notifyListeners(SWT.MouseExit, swtEvent);
                          break;
                        default:
                          overlay.expose();                           
                      }
                    }
                  }
                });
              }
            }
            x11.XCloseDisplay(display);
          } catch (Exception e) {
            e.printStackTrace();
          }
        }
      }.start();
View Full Code Here

TOP

Related Classes of com.sun.jna.platform.unix.X11.Pixmap

Copyright © 2018 www.massapicom. 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.