Package org.apache.harmony.awt.nativebridge

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


        ofn.set_lpstrInitialDir(nb.createInt16Pointer(dirName, false));
    }

    private void setFile(String fileName) {
        int bufSize = 255;
        Int16Pointer bufferPtr = nb.createInt16Pointer(bufSize, false);
        if (fileName != null) {
            bufferPtr.setString(fileName);
        }
        ofn.set_nMaxFileTitle(bufSize);
        ofn.set_lpstrFileTitle(nb.createInt16Pointer(bufSize, false));
        ofn.set_lpstrFile(bufferPtr);
        ofn.set_nMaxFile(bufSize); // mandatory!
View Full Code Here


                                        int flags) {
           
            Win32.STRRET strret = win32.createSTRRET(false);
            parent.GetDisplayNameOf(item, flags, strret);
            int bufLen = 2048;           
            Int16Pointer bufPtr = nb.createInt16Pointer(bufLen, false);
            win32.StrRetToBufW(strret, null, bufPtr, bufLen);
            return bufPtr.getString();
        }
View Full Code Here

        return wtk.getWinEventQueue().windowProc(hwnd, msg, wParam, lParam);
    }

    public static void registerWindowClass(String className, long windowProc) {

        Int16Pointer namePtr = WinEventQueue.bridge.createInt16Pointer(
                className, false);

        Win32.WNDCLASSEXW wndCls = win32.createWNDCLASSEXW(false);

        wndCls.set_cbSize(wndCls.size());
        wndCls.set_style(WindowsDefs.CS_OWNDC);
        wndCls.set_lpfnWndProc(windowProc);
        wndCls.set_hCursor(0);
        wndCls.set_lpszClassName(namePtr);

        short classAtom = win32.RegisterClassExW(wndCls);
        int winError = win32.GetLastError();
        namePtr.unlock();

        if (classAtom == 0) {
            throw new InternalError("Failed to register window class "
                    + className + " GetLastError returned " + winError);
        }
View Full Code Here

            themes.put(name, new Long(hTheme));
            return hTheme;
        }

        private long open(String name) {
            Int16Pointer namePtr = bridge.createInt16Pointer(name, false);
            long hTheme = win32.OpenThemeData(javaWindow, namePtr.lock());
            namePtr.unlock();
            return hTheme;
        }
View Full Code Here

       
    }
   
    private static String getLocaleInfo(int lcid, int lcType) {
        int size = 6;
        Int16Pointer lpLCData = nb.createInt16Pointer(size, false);
        size = win32.GetLocaleInfoW(lcid, lcType, lpLCData, size);
        return lpLCData.getString();
    }
View Full Code Here

        if (parent.GetDisplayNameOf(itemId, flags, strret) != WindowsDefs.NOERROR) {
            return null;
        }

        Int16Pointer bufPtr = nb.createInt16Pointer(bufLen, false);
        win32.StrRetToBufW(strret, null, bufPtr, bufLen);
        return bufPtr.getString();
    }
View Full Code Here

    private String getPath(final Win32.IShellFolder parent, final Win32.ITEMIDLIST itemId) {
        return getChildFolderDisplayName(parent, itemId, WindowsConsts.SHGDN_FORPARSING);
    }

    private static Win32.GUID getGUID(final String name) {
        Int16Pointer namePrt = nb.createInt16Pointer(name, false);
        Win32.GUID result = win32.createGUID(false);
        if (win32.CLSIDFromString(namePrt, result) != WindowsDefs.NOERROR) {
            return null;
        }
        return result;
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

            themes.put(name, new Long(hTheme));
            return hTheme;
        }

        private long open(String name) {
            Int16Pointer namePtr = bridge.createInt16Pointer(name, false);
            long hTheme = win32.OpenThemeData(javaWindow, namePtr.lock());
            namePtr.unlock();
            return hTheme;
        }
View Full Code Here

       
    }
   
    private static String getLocaleInfo(int lcid, int lcType) {
        int size = 6;
        Int16Pointer lpLCData = nb.createInt16Pointer(size, false);
        size = win32.GetLocaleInfoW(lcid, lcType, lpLCData, size);
        return lpLCData.getString();
    }
View Full Code Here

TOP

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

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.