Package org.jnode.driver.video

Examples of org.jnode.driver.video.HardwareCursorImage


    final void close() {
        setCursorVisible(false);
    }

    private byte[] getCursor(HardwareCursor cursor) {
        final HardwareCursorImage img = cursor.getImage(32, 32);
        if (img == null) {
            return null;
        }
        final int w = img.getWidth();
        final int h = img.getHeight();
        horzOffset = 64 - w;
        vertOffset = 64 - h;

        byte[] res = (byte[]) cursorCache.get(img);
        if (res == null) {
            res = new byte[1024];
            final int[] argb = img.getImage();

            for (int row = 0; row < h; row++) {
                final int imgOfs = row * w;
                final int resOfs = row * 16;

 
View Full Code Here


        if (cursor == null) {
            return;
        }

        try {
            final HardwareCursorImage cursImage = cursor.getImage(20, 20);

            if ((cursImage != null) && (this.cursorImage != cursImage)) {
                hideCursor();

                cursorArea.setSize(cursImage.getWidth(), cursImage.getHeight());
                if (cursorImage != null) {
                    int newX =
                            (int) (cursorArea.getX() + cursorImage.getHotSpotX() - cursImage
                                    .getHotSpotX());
                    int newY =
                            (int) (cursorArea.getY() + cursorImage.getHotSpotY() - cursImage
                                    .getHotSpotY());
                    cursorArea.setLocation(newX, newY);
                }
                this.cursorImage = cursImage;
               
View Full Code Here

        // Hide the cursor
        setCursorVisible(false);
    }

    private short[] getCursor(HardwareCursor cursor) {
        final HardwareCursorImage img = cursor.getImage(CURSOR_SIZE, CURSOR_SIZE);
        if (img == null) {
            return null;
        }
        short[] res = cursorCache.get(img);
        if (res == null) {
            res = new short[CURSOR_SIZE * CURSOR_SIZE];
            final int[] argb = img.getImage();
            for (int i = 0; i < CURSOR_SIZE * CURSOR_SIZE; i++) {
                final int v = argb[i];
                final int a = (v >>> 24) & 0xFF;
                final int r = ((v >> 16) & 0xFF) >> 3;
                final int g = ((v >> 8) & 0xFF) >> 3;
View Full Code Here

TOP

Related Classes of org.jnode.driver.video.HardwareCursorImage

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.