Package org.apache.harmony.awt.nativebridge

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


    // Caller should free native pointer to rects after using it
    private static final X11.XRectangle createXRects(int[] vertices) {
        int rectsSize = (vertices[0]-1) << 1; // sizeof(XRectangle) = 8

        Int8Pointer rects = NativeBridge.getInstance().createInt8Pointer(rectsSize, true);
        int idx = 0;
        for (int i = 1; i < vertices[0]; i+=4) {
            X11.XRectangle r = x11.createXRectangle(rects.getElementPointer(idx));
            r.set_x((short) vertices[i]);
            r.set_y((short) vertices[i+1]);
            r.set_width((short) (vertices[i+2]-vertices[i]+1));
            r.set_height((short) (vertices[i+3]-vertices[i+1]+1));
            idx += r.size();
View Full Code Here


            final int parentSize = getItemIDListSize(parentAbsoluteItemId) - 2;
            if (parentSize <= 0) {
                return itemId;
            }
            final int childSize = getItemIDListSize(itemId);
            Int8Pointer resPtr = nb.createInt8Pointer(parentSize + childSize, true); //!!! should be in native mem

            resPtr.copy(parentAbsoluteItemId, 0, parentSize);
            resPtr.copy(itemId, parentSize, childSize);

            return win32.createITEMIDLIST(resPtr);
        }
View Full Code Here

            final int parentSize = (int)(lastItemId.shortLockPointer() - absoluteItemId.shortLockPointer());
            lastItemId.unlock();
            absoluteItemId.unlock();

            Int8Pointer resPtr = nb.createInt8Pointer(parentSize + 2, true); // !!! should be in native mem
            resPtr.copy(absoluteItemId, 0, parentSize);
            resPtr.copy(lastItemId.getElementPointer(getItemIDListSize(lastItemId) - 2), parentSize, 2);
            return win32.createITEMIDLIST(resPtr);
        }
View Full Code Here

TOP

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

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.