Package org.apache.harmony.awt.nativebridge

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


        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

        // First get default visual ID
        long defVisualPtr = x11.XDefaultVisual(display, screen);
        long defVisId = x11.XVisualIDFromVisual(defVisualPtr);

        // Allocate one int to get number of visual infos by ref
        Int32Pointer numVisualInfosPtr =
                NativeBridge.getInstance().createInt32Pointer(1, true);

        // Create template visual to obtain visuals for current screen only
        X11.XVisualInfo vinfo_template = x11.createXVisualInfo(true);
        vinfo_template.set_screen(screen);

        // Obtain infos
        X11.XVisualInfo infosPtr = x11.XGetVisualInfo(
                display,
                X11Defs.VisualScreenMask,
                vinfo_template,
                numVisualInfosPtr
        );
        vinfo_template.free(); // Free template data

        int numVisualInfos = numVisualInfosPtr.get(0);
        numVisualInfosPtr.free();

        // Allocate array for configurations
        configs = new XGraphicsConfiguration[numVisualInfos];

        String opengl = System.getProperty("java2d.opengl");
View Full Code Here

        //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 {
            throw new RuntimeException(
                "Only 32-bit format is supported for window state operations.");
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

        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.