Package org.apache.harmony.awt.nativebridge

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


        setIntProperty(propName, win32.GetSystemMetrics(idx), props);
    }
   
    private int getIntSPI(int idx) {
        NativeBridge bridge = NativeBridge.getInstance();
        Int32Pointer ptr = bridge.createInt32Pointer(1, false);
        win32.SystemParametersInfoW(idx, 0, ptr, 0);
        return ptr.get(0);
    }
View Full Code Here


        Win32.BITMAPINFO bmi = createAndFillBMI(w, h);

        // now get device independent bitmap bits from
        // compBMP and use them to create BufferedImage
        Int32Pointer pData = nb.createInt32Pointer(size, false);
        win32.DeleteObject(compBMP);
        long screenDC = win32.GetDC(0l);
        int nLines = win32.GetDIBits(screenDC, compBMP, 0, h, pData,
                        bmi, WindowsDefs.DIB_RGB_COLORS);
        win32.ReleaseDC(0, screenDC);
       
        if (nLines != h) {
            return null;
        }
        BufferedImage bufImg = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
        int[] data = new int[size];
        pData.get(data, 0, data.length);
        bufImg.setRGB(0, 0, w, h, data, 0, w);
        return bufImg;
    }
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

    /**
     * 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

    }


    private void queryExtension() {
        Int32Pointer dummyPtr = nb.createInt32Pointer(1, false);
        Int32Pointer majorPtr = nb.createInt32Pointer(1, false);
        Int32Pointer minorPtr = nb.createInt32Pointer(1, false);
        int res = 0;
        res = x11.XTestQueryExtension(dpy, dummyPtr, dummyPtr,
                                      majorPtr, minorPtr);
        if (res != X11Defs.True) {
            throw new AWTError("XTest is not supported by your X server!");
View Full Code Here

    /**
     * @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

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.