Examples of CLongPointer


Examples of org.apache.harmony.awt.nativebridge.CLongPointer

    public NativeWindow getWindowFromPoint(Point p) {
        long rootID = getRootWindow();
        long childID = rootID;
        Int32Pointer x = bridge.createInt32Pointer(1, false);
        Int32Pointer y = bridge.createInt32Pointer(1, false);
        CLongPointer childWindow = bridge.createCLongPointer(1, false);

        //recursevily ask for child containing p
        //until the deepest child is found
        //or until our top-level window is found
        while (childID != X11Defs.None) {
            x11.XTranslateCoordinates(display, rootID, childID,
                    p.x, p.y, x, y, childWindow);
            long nextID = childWindow.get(0);
            // avoid endless loop
            if (childID == nextID) {
                return null;
            }
            childID = nextID;
View Full Code Here

Examples of org.apache.harmony.awt.nativebridge.CLongPointer

    public Dimension getWindowSizeById(long id) {
        Int32Pointer x = bridge.createInt32Pointer(1, false);
        Int32Pointer y = bridge.createInt32Pointer(1, false);
        Int32Pointer w = bridge.createInt32Pointer(1, false);
        Int32Pointer h = bridge.createInt32Pointer(1, false);
        CLongPointer root = bridge.createCLongPointer(1, false);
        Int32Pointer border = bridge.createInt32Pointer(1, false);
        Int32Pointer depth = bridge.createInt32Pointer(1, false);

        x11.XGetGeometry(display, id, root, x, y, w, h, border, depth);
        return new Dimension(w.get(0), h.get(0));
View Full Code Here

Examples of org.apache.harmony.awt.nativebridge.CLongPointer

    static KeyInfo translateEvent(X11.XKeyEvent event) {
        KeyInfo res = new KeyInfo();
        int nBytes = 255;
        Int8Pointer buffer = bridge.createInt8Pointer(nBytes, false);
        buffer.fill((byte)0, nBytes);
        CLongPointer keySymPtr = bridge.createCLongPointer(1, false);

        nBytes = x11.XLookupString(event, buffer, nBytes, keySymPtr, null);

        if (nBytes > 0) {
            String str = buffer.getStringUTF();
            res.keyChars.append(str);
        } else {
            res.keyChars.append(KeyEvent.CHAR_UNDEFINED);
        }
        int keySym = (int)keySymPtr.get(0);

        if (tableXK2VK.containsKey(new Integer(keySym))) {
            res.vKey = ((Integer) tableXK2VK.get(new Integer(keySym))).intValue();
            res.keyLocation = deriveLocation(keySym);
        } else {
View Full Code Here

Examples of org.apache.harmony.awt.nativebridge.CLongPointer

        //so have to translate it for top-level(managed by WM)windows
        //to get root-related coords
        if (!child && !isSynthetic) {
            Int32Pointer x = bridge.createInt32Pointer(1, false);
            Int32Pointer y = bridge.createInt32Pointer(1, false);
            CLongPointer childWindow = bridge.createCLongPointer(1, false);

            long parentId = win.getParentID();
            x11.XTranslateCoordinates(win.getDisplay(), parentId,
                                      factory.getRootWindow(),
                                      windowRect.x, windowRect.y,
View Full Code Here

Examples of org.apache.harmony.awt.nativebridge.CLongPointer

        forwardToContent();

    }

    private void processWindowStateEvent() {
        CLongPointer actualTypeReturn = bridge.createCLongPointer(1, false);
        Int32Pointer actualFormatReturn = bridge.createInt32Pointer(1, false);
        CLongPointer nitemsReturn = bridge.createCLongPointer(1, false);
        CLongPointer bytesAfterReturn = bridge.createCLongPointer(1, false);
        PointerPointer propReturn = bridge.createPointerPointer(1, false);

        x11.XGetWindowProperty(factory.getDisplay(), windowId,
                factory.wm.NET_WM_STATE, 0, Integer.MAX_VALUE, X11Defs.FALSE,
                X11Defs.AnyPropertyType, actualTypeReturn, actualFormatReturn,
                nitemsReturn, bytesAfterReturn, propReturn);

        int count = (int)nitemsReturn.get(0);
        if (count == 0) {
            return;
        }
        if (actualFormatReturn.get(0) == 32) {
            CLongPointer types = bridge.createCLongPointer(propReturn.get(0));
            deriveNewWindowState(count, types);
        } else {
            // awt.10=Only 32-bit format is supported for window state operations.
            throw new RuntimeException(Messages.getString("awt.10")); //$NON-NLS-1$
        }
View Full Code Here

Examples of org.apache.harmony.awt.nativebridge.CLongPointer

        forwardToContent();
    }

    private void processClientMessageEvent(X11.XClientMessageEvent event) {
        if (event.get_message_type() == factory.wm.WM_PROTOCOLS) {
            CLongPointer data = event.get_l();
            long protocol = data.get(0);
            if (protocol == factory.wm.WM_DELETE_WINDOW) {
                LinuxWindow lw = (LinuxWindow)factory.getWindowById(windowId);
                LinuxWindow cw = lw.getContentWindow();
                if (lw.isInputAllowed()) {
                    eventId = WindowEvent.WINDOW_CLOSING;
View Full Code Here

Examples of org.apache.harmony.awt.nativebridge.CLongPointer

        X11.XEvent e = x11.createXEvent(false);
        long ref = objAccessor.getGlobalReference(task);
        e.set_type(X11Defs.ClientMessage);
        X11.XClientMessageEvent xclient = e.get_xclient();
        xclient.set_message_type(performTaskAtom);
        CLongPointer data = xclient.get_l();
        data.set(0, (ref & 0xFFFFFFFF));
        data.set(1, (ref >> 32));
        data.set(2, wait ? 1 : 0);
        return e;
    }
View Full Code Here

Examples of org.apache.harmony.awt.nativebridge.CLongPointer

        }
        return false;
    }

       private void performTask(X11.XClientMessageEvent xclient) {
        CLongPointer data = xclient.get_l();
       
        long ref = (data.get(0) & 0xFFFFFFFF) | (data.get(1) << 32);
        boolean wait = (data.get(2) != 0);
              
        Task t = (Task)objAccessor.getObjectFromReference(ref);
        if (wait) {
            synchronized(t) {
                t.perform();
View Full Code Here

Examples of org.apache.harmony.awt.nativebridge.CLongPointer

    public Rectangle getBounds() {
        Int32Pointer x = bridge.createInt32Pointer(1, false);
        Int32Pointer y = bridge.createInt32Pointer(1, false);
        Int32Pointer w = bridge.createInt32Pointer(1, false);
        Int32Pointer h = bridge.createInt32Pointer(1, false);
        CLongPointer root = bridge.createCLongPointer(1, false);
        Int32Pointer border = bridge.createInt32Pointer(1, false);
        Int32Pointer depth = bridge.createInt32Pointer(1, false);

        x11.XGetGeometry(display, windowID, root, x, y, w, h, border, depth);
        long rootID = root.get(0);
        if (!child || (this instanceof ContentWindow)) {
            CLongPointer childWindow = bridge.createCLongPointer(1, false);
            x11.XTranslateCoordinates(display, getParentID(), rootID,
                                      x.get(0), y.get(0), x, y, childWindow);
        }
        Rectangle r = new Rectangle(x.get(0), y.get(0), w.get(0), h.get(0));
View Full Code Here

Examples of org.apache.harmony.awt.nativebridge.CLongPointer

        if (!child && !undecorated) {
            Int32Pointer x = bridge.createInt32Pointer(1, false);
            Int32Pointer y = bridge.createInt32Pointer(1, false);
            Int32Pointer w = bridge.createInt32Pointer(1, false);
            Int32Pointer h = bridge.createInt32Pointer(1, false);
            CLongPointer root = bridge.createCLongPointer(1, false);
            Int32Pointer border = bridge.createInt32Pointer(1, false);
            Int32Pointer depth = bridge.createInt32Pointer(1, false);

            x11.XGetGeometry(display, windowID, root, x, y, w, h, border, depth);
            long rootID = root.get(0);
            long frameID = getFrameID(windowID, rootID);

            if (frameID != 0 && frameID != rootID && parentID == rootID) {
                int width = w.get(0), height = h.get(0);
                CLongPointer childWindow = bridge.createCLongPointer(1, false);

                //get window coordinates relative to WM's frame
                x11.XTranslateCoordinates(display, getParentID(), frameID,
                                        x.get(0), y.get(0), x, y, childWindow);
                insets.top = y.get(0);
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.