Package org.apache.harmony.awt.nativebridge

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


        // First get default visual ID
        long defVisualPtr = x11.XDefaultVisual(display, screen);
        long defVisId = x11.XVisualIDFromVisual(defVisualPtr);

        // Allocate one int to get number of visual infos by ref
        Int32Pointer numVisualInfosPtr =
                NativeBridge.getInstance().createInt32Pointer(1, true);

        // Create template visual to obtain visuals for current screen only
        X11.XVisualInfo vinfo_template = x11.createXVisualInfo(true);
        vinfo_template.set_screen(screen);

        // Obtain infos
        X11.XVisualInfo infosPtr = x11.XGetVisualInfo(
                display,
                X11Defs.VisualScreenMask,
                vinfo_template,
                numVisualInfosPtr
        );
        vinfo_template.free(); // Free template data

        int numVisualInfos = numVisualInfosPtr.get(0);
        numVisualInfosPtr.free();

        // Allocate array for configurations
        configs = new XGraphicsConfiguration[numVisualInfos];

        String opengl = org.apache.harmony.awt.Utils.getSystemProperty("java2d.opengl"); //$NON-NLS-1$
View Full Code Here


     * @see org.apache.harmony.awt.wtk.NativeMouseInfo#getLocation()
     */
    public Point getLocation() {
        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);

        long windowID = x11.XRootWindow(display, screen);

        x11.XQueryPointer(display, windowID,
                          rootReturned, childReturned,
View Full Code Here

     * @see org.apache.harmony.awt.wtk.WindowFactory#getWindowFromPoint(java.awt.Point)
     */
    public NativeWindow getWindowFromPoint(Point p) {
        long rootID = getRootWindow();
        long childID = rootID;
        Int32Pointer x = bridge.createInt32Pointer(1, false);
        Int32Pointer y = bridge.createInt32Pointer(1, false);
        CLongPointer childWindow = bridge.createCLongPointer(1, false);

        //recursevily ask for child containing p
        //until the deepest child is found
        //or until our top-level window is found
View Full Code Here

    /**
     * @see org.apache.harmony.awt.wtk.WindowFactory#getWindowSizeById(long)
     */
    public Dimension getWindowSizeById(long id) {
        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, id, root, x, y, w, h, border, depth);
        return new Dimension(w.get(0), h.get(0));
    }
View Full Code Here

        // First get default visual ID
        long defVisualPtr = x11.XDefaultVisual(display, screen);
        long defVisId = x11.XVisualIDFromVisual(defVisualPtr);

        // Allocate one int to get number of visual infos by ref
        Int32Pointer numVisualInfosPtr =
                NativeBridge.getInstance().createInt32Pointer(1, true);

        // Create template visual to obtain visuals for current screen only
        X11.XVisualInfo vinfo_template = x11.createXVisualInfo(true);
        vinfo_template.set_screen(screen);

        // Obtain infos
        X11.XVisualInfo infosPtr = x11.XGetVisualInfo(
                display,
                X11Defs.VisualScreenMask,
                vinfo_template,
                numVisualInfosPtr
        );
        vinfo_template.free(); // Free template data

        int numVisualInfos = numVisualInfosPtr.get(0);
        numVisualInfosPtr.free();

        // Allocate array for configurations
        configs = new XGraphicsConfiguration[numVisualInfos];

        String opengl = org.apache.harmony.awt.Utils.getSystemProperty("java2d.opengl"); //$NON-NLS-1$
View Full Code Here

        //in real configure events new position is reported relative to parent
        //so have to translate it for top-level(managed by WM)windows
        //to get root-related coords
        if (!child && !isSynthetic) {
            Int32Pointer x = bridge.createInt32Pointer(1, false);
            Int32Pointer y = bridge.createInt32Pointer(1, false);
            CLongPointer childWindow = bridge.createCLongPointer(1, false);

            long parentId = win.getParentID();
            x11.XTranslateCoordinates(win.getDisplay(), parentId,
                                      factory.getRootWindow(),
                                      windowRect.x, windowRect.y,
                                      x, y, childWindow);
            windowRect.setLocation(x.get(0), y.get(0));
        }

        boolean isContent = (win instanceof ContentWindow);

        if (!isContent && child && !windowRect.equals(win.getBounds())) {
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

        }

        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) {
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) {
            // awt.12=XTest is not supported by your X server\!
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.