Package org.apache.harmony.awt.nativebridge

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


    /**
     * @return
     */
    long getInputFocus() {
        CLongPointer window = bridge.createCLongPointer(1, false);
        Int32Pointer revertStatus = bridge.createInt32Pointer(1, false);
        x11.XGetInputFocus(display, window, revertStatus);
        return window.get(0);
    }
View Full Code Here


        return supportedHints;
    }

    private long[] getWindowProperty(long winId, final long propertyAtom) {
        CLongPointer type = bridge.createCLongPointer(1, false);
        Int32Pointer formatPtr = bridge.createInt32Pointer(1, false);
        CLongPointer nItemsPtr = bridge.createCLongPointer(1, false);
        CLongPointer bytesRemaining = bridge.createCLongPointer(1, false);
        PointerPointer data = bridge.createPointerPointer(1, false);

        final int anyType = X11Defs.AnyPropertyType;
        x11.XGetWindowProperty(display, winId, propertyAtom, 0, 1,
                               anyType, X11Defs.False, type,
                               formatPtr, nItemsPtr,
                               bytesRemaining, data);
        VoidPointer dataPtr = data.get(0);
        if (dataPtr == null) {
            return null;
        }
        x11.XFree(dataPtr);
        long nBytes = bytesRemaining.get(0);
        long typeAtom = type.get(0);
        if (typeAtom == X11Defs.None) {
            // the property doesn't exist
            return null;
        }
        int bitFormat = formatPtr.get(0);
        long nItems = (nBytes + 4) * 8 / bitFormat;
        long n32bitItems = nItems / (32 / bitFormat);
        x11.XGetWindowProperty(display, winId, propertyAtom, 0,
                               n32bitItems, anyType, X11Defs.False,
                               type, formatPtr, nItemsPtr,
View Full Code Here

        }

        CLongPointer root = bridge.createCLongPointer(1, false);
        CLongPointer parent = bridge.createCLongPointer(1, false);
        PointerPointer childrenArray = bridge.createPointerPointer(1, false);
        Int32Pointer childrenCount = bridge.createInt32Pointer(1, false);;
        x11.XQueryTree(display, windowID, root, parent,
                       childrenArray, childrenCount);

        int count = childrenCount.get(0);
        CLongPointer children = bridge.createCLongPointer(childrenArray.get(0));
        if (children == null) {
            return new long[0];
        }
        long[] result = new long[count];
View Full Code Here

     */
    Insets getNativeInsets(long windowId, long property) {
        Insets insets = null;

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

        int result = x11.XGetWindowProperty(factory.getDisplay(), windowId,
                property, 0, 4, X11Defs.FALSE,
                X11Defs.AnyPropertyType, actualTypeReturn, actualFormatReturn,
                nitemsReturn, bytesAfterReturn, propReturn);

        if (result == X11Defs.Success) {
            long nItems = nitemsReturn.get(0);
            long actualType = actualTypeReturn.get(0);
            int actualFormat = actualFormatReturn.get(0);
            CLongPointer ptrData = bridge.createCLongPointer(propReturn.get(0));
            if (ptrData == null) {
                return insets;
            }

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

            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

        gradObjectPlane[1] = a2;
        gradObjectPlane[2] = 0;
        gradObjectPlane[3] = a3;

        // Create 1D texture object
        Int32Pointer texPtr =
                NativeBridge.getInstance().createInt32Pointer(1, true);
        gl.glGenTextures(1, texPtr);
        gradTexName = texPtr.get(0);
        gl.glBindTexture(GLDefs.GL_TEXTURE_1D, gradTexName);
        texPtr.free();
        gl.glTexParameteri(GLDefs.GL_TEXTURE_1D, GLDefs.GL_TEXTURE_MAG_FILTER, GLDefs.GL_LINEAR);
        gl.glTexParameteri(GLDefs.GL_TEXTURE_1D, GLDefs.GL_TEXTURE_MIN_FILTER, GLDefs.GL_LINEAR);
        gl.glTexEnvf(GLDefs.GL_TEXTURE_ENV, GLDefs.GL_TEXTURE_ENV_MODE, GLDefs.GL_REPLACE);

        // Setup texture coordinates generation
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.