Package org.apache.harmony.awt.nativebridge

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


        //in real configure events new position is reported relative to parent
        //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,
                                      x, y, childWindow);
            windowRect.setLocation(x.get(0), y.get(0));
        }

        boolean isContent = (win instanceof ContentWindow);

        if (!isContent && child && !windowRect.equals(win.getBounds())) {
View Full Code Here


    }

    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

    /**
     * Query window size and position from X server
     */
    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);
View Full Code Here

    }

    public Insets updateInsets() {
        Insets insets = new Insets(0, 0, 0, 0);
        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);
View Full Code Here

    }

    Point queryPointer() {
        CLongPointer rootReturned = bridge.createCLongPointer(1, false);
        CLongPointer childReturned = bridge.createCLongPointer(1, false);
        Int32Pointer rootX = bridge.createInt32Pointer(1, false);
        Int32Pointer rootY = bridge.createInt32Pointer(1, false);
        Int32Pointer windowX = bridge.createInt32Pointer(1, false);
        Int32Pointer windowY = bridge.createInt32Pointer(1, false);
        Int32Pointer mask = bridge.createInt32Pointer(1, false);

        x11.XQueryPointer(display, windowID,
                rootReturned, childReturned,
                rootX, rootY, windowX,  windowY,
                mask);
View Full Code Here

        }

        CLongPointer root = bridge.createCLongPointer(1, false);
        CLongPointer parent = bridge.createCLongPointer(1, false);
        PointerPointer children = bridge.createPointerPointer(1, true);
        Int32Pointer count = bridge.createInt32Pointer(1, false);

        x11.XQueryTree(display, windowID, root, parent, children, count);
        VoidPointer data = children.get(0);
        if (data != null) {
            x11.XFree(data);
View Full Code Here

    /**
     * @see org.apache.harmony.awt.wtk.NativeWindow#getScreenPos()
     */
    public Point getScreenPos() {

        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);

        CLongPointer childWindow = bridge.createCLongPointer(1, false);
View Full Code Here

    int getAttribute(final Win32.IShellFolder parent, final Win32.ITEMIDLIST itemId, final int flags) {
        PointerPointer itemIdPtrPtr = nb.createPointerPointer(1, false);
        itemIdPtrPtr.set(0, itemId);

        Int32Pointer resultPtr = nb.createInt32Pointer(1, false);
        resultPtr.set(0, flags);
        if (parent.GetAttributesOf(1, itemIdPtrPtr, resultPtr) != WindowsDefs.NOERROR) {
            return -1;
        }
        return resultPtr.get(0);
    }
View Full Code Here

            resolveEXT();
        }
        */
        activateTmpCtx();

        Int32Pointer nFormats = NativeBridge.getInstance().createInt32Pointer(1, true);
        Int32Pointer formatPtr = NativeBridge.getInstance().createInt32Pointer(1, true);
        Int32Pointer attribList = NativeBridge.getInstance().createInt32Pointer(13, true);

        // Fill in FB config attributes
        attribList.set(0, WGLDefs.WGL_PIXEL_TYPE_ARB);
        attribList.set(1, WGLDefs.WGL_TYPE_RGBA_ARB);
        attribList.set(2, WGLDefs.WGL_DRAW_TO_WINDOW_ARB);
        attribList.set(3, GLDefs.GL_TRUE);
        attribList.set(4, WGLDefs.WGL_DRAW_TO_PBUFFER_ARB);
        attribList.set(5, GLDefs.GL_TRUE);
        attribList.set(6, WGLDefs.WGL_STENCIL_BITS_ARB);
        attribList.set(7, 1);
        attribList.set(8, WGLDefs.WGL_ALPHA_BITS_ARB);
        attribList.set(9, 8);
        attribList.set(10, WGLDefs.WGL_ACCELERATION_ARB);
        attribList.set(11, WGLDefs.WGL_FULL_ACCELERATION_ARB);
        //attribList.set(12, WGLDefs.WGL_DOUBLE_BUFFER_ARB);
        //attribList.set(13, GLDefs.GL_TRUE);
        attribList.set(12, 0);

        wgl.wglChoosePixelFormatARB(hdc, attribList, null, 1, formatPtr, nFormats);

        int res = formatPtr.get(0);

        formatPtr.free();
        nFormats.free();
        attribList.free();

        return res;
    }
View Full Code Here

        long hwnd = getHWND();
        long hdc = w32.GetDC(hwnd);

        int pixelFormat = choosePixelFormatARB(hdc);

        Int32Pointer attribList = NativeBridge.getInstance().createInt32Pointer(1, true);
        attribList.set(0,0);
        long id = wgl.wglCreatePbufferARB(hdc, pixelFormat, w, h, attribList.lock());
        attribList.unlock();
        attribList.free();

        long buffHdc = wgl.wglGetPbufferDCARB(id);

        w32.ReleaseDC(hwnd, hdc);
        w32.DestroyWindow(hwnd);
View Full Code Here

TOP

Related Classes of org.apache.harmony.awt.nativebridge.Int32Pointer

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.