Package org.apache.harmony.awt.nativebridge

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


        String style = "win.xpstyle."; //$NON-NLS-1$
        String nm = "Name"; //$NON-NLS-1$
        setBoolProperty(style + "themeActive", win32.IsThemeActive(), props);//$NON-NLS-1$
        int bufSize = 256;
        NativeBridge nb = NativeBridge.getInstance();
        Int16Pointer ptrs[] = new Int16Pointer[3];
        for (int i = 0; i < ptrs.length; i++) {
            ptrs[i] = nb.createInt16Pointer(bufSize, false);
        }
        String[] names = new String[] {"dll", "color", "size"};//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
        int res = win32.GetCurrentThemeName(ptrs[0], bufSize, ptrs[1], bufSize,
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) {
            // awt.1A=Failed to register window class {0} GetLastError returned {1}
            throw new InternalError(Messages.getString("awt.1A", //$NON-NLS-1$
                    className, winError));
View Full Code Here

        pPoints.unlock();
       
        int size = outline.get_n_points();
        float points[] = LinuxNativeFont.getPointsFromFTVector(pPointsPtr, size);

        Int16Pointer pContours = outline.get_contours(); // array of contour end points
        Int8Pointer pTags = outline.get_tags(); // an array of point tags
        int index = 0// current point's index
        int tag;        // current tag
        float x_start;
        float y_start;
        float x_finish;
        float y_finish;
        for (int i=0; i < n_contours; i++){
            short end = pContours.get(i);// index of the last point

            // get start position
            x_start = points[index*2];
            y_start = points[index*2 + 1];
           
View Full Code Here

        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

        String style = "win.xpstyle."; //$NON-NLS-1$
        String nm = "Name"; //$NON-NLS-1$
        setBoolProperty(style + "themeActive", win32.IsThemeActive(), props);//$NON-NLS-1$
        int bufSize = 256;
        NativeBridge nb = NativeBridge.getInstance();
        Int16Pointer ptrs[] = new Int16Pointer[3];
        for (int i = 0; i < ptrs.length; i++) {
            ptrs[i] = nb.createInt16Pointer(bufSize, false);
        }
        String[] names = new String[] {"dll", "color", "size"};//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
        int res = win32.GetCurrentThemeName(ptrs[0], bufSize, ptrs[1], bufSize,
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

        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) {
            // awt.1A=Failed to register window class {0} GetLastError returned {1}
            throw new InternalError(Messages.getString("awt.1A", //$NON-NLS-1$
                    className, winError));
View Full Code Here

        pPoints.unlock();
       
        int size = outline.get_n_points();
        float points[] = LinuxNativeFont.getPointsFromFTVector(pPointsPtr, size);

        Int16Pointer pContours = outline.get_contours(); // array of contour end points
        Int8Pointer pTags = outline.get_tags(); // an array of point tags
        int index = 0// current point's index
        int tag;        // current tag
        float x_start;
        float y_start;
        float x_finish;
        float y_finish;
        for (int i=0; i < n_contours; i++){
            short end = pContours.get(i);// index of the last point

            // get start position
            x_start = points[index*2];
            y_start = points[index*2 + 1];
           
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.