Package org.yajsdl.jna

Examples of org.yajsdl.jna.SDLLibrary$XEvent


                    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:
View Full Code Here


     */
    private static int sendClientMessage(Display display, long wid, String msg, NativeLong data0, NativeLong data1) {
        // Use the JNA platform X11 binding
        X11 x = X11.INSTANCE;
        // Create and populate a client-event structure
        XEvent event = new XEvent();
        event.type = X11.ClientMessage;
        // Select the proper union structure for the event type and populate it
        event.setType(XClientMessageEvent.class);
        event.xclient.type = X11.ClientMessage;
        event.xclient.serial = new NativeLong(0L);
        event.xclient.send_event = TRUE;
        event.xclient.message_type = x.XInternAtom(display, msg, false);
        event.xclient.window = new com.sun.jna.platform.unix.X11.Window(wid);
View Full Code Here

TOP

Related Classes of org.yajsdl.jna.SDLLibrary$XEvent

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.