Package org.apache.harmony.awt.nativebridge

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


    private Win32.IShellFolder getShellFolder(final Win32.IShellFolder parent, final Win32.ITEMIDLIST itemId) {
        if (parent == null) {
            return null;
        }

        PointerPointer childPtrPtr = nb.createPointerPointer(1, false);
        if (parent.BindToObject(itemId, null, WinFileManager.SHELL_FOLDER_GUID, childPtrPtr) != WindowsDefs.NOERROR) {
            return null;
        }
        return win32.createIShellFolder(childPtrPtr.getAddress(0));
    }
View Full Code Here


        }
        return null;
    }

    private Win32.IShellFolder createDesktopShellFolder() {
        PointerPointer shellDesktopPtrPtr = nb.createPointerPointer(1, false);
        if (win32.SHGetDesktopFolder(shellDesktopPtrPtr) != WindowsDefs.NOERROR) {
            return null;
        }
        return win32.createIShellFolder(shellDesktopPtrPtr.getAddress(0));
    }
View Full Code Here

        }
        return win32.createIShellFolder(shellDesktopPtrPtr.getAddress(0));
    }

    private Win32.ITEMIDLIST getAbsoluteItemID(final int folderId) {
        PointerPointer itemIdPtrPtr = nb.createPointerPointer(1, false);
        if (win32.SHGetFolderLocation(0, folderId, null, 0, itemIdPtrPtr) != WindowsDefs.NOERROR) {
            return null;
        }
        return win32.createITEMIDLIST(itemIdPtrPtr.getAddress(0));
    }
View Full Code Here

    private Win32.ITEMIDLIST getAbsoluteItemID(final String path) {
        Win32.IShellFolder desktop = getDesktopShellFolder();

        Int16Pointer displayNamePtr = nb.createInt16Pointer(path, false);
        PointerPointer itemIdPtrPtr = nb.createPointerPointer(1, false);
        if (desktop.ParseDisplayName(0, null, displayNamePtr, null, itemIdPtrPtr, null) != WindowsDefs.NOERROR) {
            return null;
        }
        return win32.createITEMIDLIST(itemIdPtrPtr.getAddress(0));
    }
View Full Code Here

    }

    @Override
    public Locale[] getAvailableLocales() throws AWTException {
        int nBuff = win32.GetKeyboardLayoutList(0, null);
        PointerPointer buffPtr = nb.createPointerPointer(nBuff, false);
        nBuff = win32.GetKeyboardLayoutList(nBuff, buffPtr);
        for (int i = 0; i < nBuff; i++) {
            long hkl = buffPtr.getElementPointer(i).getAddress(0);
            hkl2Locale(hkl);
        }
       
        return locale2HKL.keySet().toArray(new Locale[0]);
    }
View Full Code Here

        bmiHeader.set_biBitCount((short)32);
        bmiHeader.set_biCompression(WindowsDefs.BI_RGB);

        long screenDC = win32.GetDC(0);

        PointerPointer valuesPtr = bridge.createPointerPointer(1, false);

        long hBMPColorMask =
            win32.CreateDIBSection(screenDC, bmi, WindowsDefs.DIB_RGB_COLORS, valuesPtr, null, 0);

        // copy rgb-array from BufferedImage to values array
        int[] rgb = bufImg.getRGB(0, 0, width, height, null, 0, width);
        Int32Pointer values = bridge.createInt32Pointer(valuesPtr.get(0));
        values.set(rgb, 0, size);

        long hBMPAlphaMask =
            win32.CreateDIBSection(screenDC, bmi, WindowsDefs.DIB_RGB_COLORS, valuesPtr, null, 0);

        win32.ReleaseDC(0, screenDC);

        // set bitmap mask
        int[] maskArray = new int[size];

        for(int i = 0; i < size; i++) {
            if ((rgb[i] & 0xFF000000) != 0) {
                maskArray[i] = 0xFFFFFF;
            } else {
                maskArray[i] = 0;
            }
        }
        values = bridge.createInt32Pointer(valuesPtr.get(0));
        values.set(maskArray, 0, size);

        // fill icon info
        Win32.ICONINFO iconInfo = win32.createICONINFO(false);
        iconInfo.set_fIcon(icon ? 1 : 0);
View Full Code Here

            return 0;
        }

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

        if (x11.XQueryTree(display, windowID, root, parent, children, count) != 0) {
            final VoidPointer data = children.get(0);
           
            if (data != null) {
                x11.XFree(data);
            }
           
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

            }           
            return (res ? 1 : 0);
        }
       
        private Win32.IShellFolder getIShellFolder(VoidPointer ptr) {
            PointerPointer ptrPtr = nb.createPointerPointer(ptr, false);
            return win32.createIShellFolder(ptrPtr.getAddress(0));
        }
View Full Code Here

        bmiHeader.set_biBitCount((short)32);
        bmiHeader.set_biCompression(WindowsDefs.BI_RGB);

        long screenDC = win32.GetDC(0);

        PointerPointer valuesPtr = bridge.createPointerPointer(1, false);

        long hBMPColorMask =
            win32.CreateDIBSection(screenDC, bmi, WindowsDefs.DIB_RGB_COLORS, valuesPtr, null, 0);

        // copy rgb-array from BufferedImage to values array
        int[] rgb = bufImg.getRGB(0, 0, width, height, null, 0, width);
        Int32Pointer values = bridge.createInt32Pointer(valuesPtr.get(0));
        values.set(rgb, 0, size);

        long hBMPAlphaMask =
            win32.CreateDIBSection(screenDC, bmi, WindowsDefs.DIB_RGB_COLORS, valuesPtr, null, 0);

        win32.ReleaseDC(0, screenDC);

        // set bitmap mask
        int[] maskArray = new int[size];

        for(int i = 0; i < size; i++) {
            if ((rgb[i] & 0xFF000000) != 0) {
                maskArray[i] = 0xFFFFFF;
            } else {
                maskArray[i] = 0;
            }
        }
        values = bridge.createInt32Pointer(valuesPtr.get(0));
        values.set(maskArray, 0, size);

        // fill icon info
        Win32.ICONINFO iconInfo = win32.createICONINFO(false);
        iconInfo.set_fIcon(icon ? 1 : 0);
View Full Code Here

TOP

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

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.