1 /* |
1 /* |
2 * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. |
2 * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Sun designates this |
7 * published by the Free Software Foundation. Sun designates this |
291 return; |
291 return; |
292 } |
292 } |
293 long dst = XlibWrapper.XCreateImage(XToolkit.getDisplay(), |
293 long dst = XlibWrapper.XCreateImage(XToolkit.getDisplay(), |
294 visInfo.get_visual(), |
294 visInfo.get_visual(), |
295 (int)awtImage.get_Depth(), |
295 (int)awtImage.get_Depth(), |
296 (int)XlibWrapper.ZPixmap, |
296 (int)XConstants.ZPixmap, |
297 0, |
297 0, |
298 bytes, |
298 bytes, |
299 iconWidth, |
299 iconWidth, |
300 iconHeight, |
300 iconHeight, |
301 32, |
301 32, |
468 XCreateWindowParams params = getDelayedParams(); |
468 XCreateWindowParams params = getDelayedParams(); |
469 params.add(BORDER_PIXEL, Long.valueOf(XToolkit.getAwtDefaultFg())); |
469 params.add(BORDER_PIXEL, Long.valueOf(XToolkit.getAwtDefaultFg())); |
470 params.add(BACKGROUND_PIXMAP, iconPixmap); |
470 params.add(BACKGROUND_PIXMAP, iconPixmap); |
471 params.add(COLORMAP, adata.get_awt_cmap()); |
471 params.add(COLORMAP, adata.get_awt_cmap()); |
472 params.add(DEPTH, awtImage.get_Depth()); |
472 params.add(DEPTH, awtImage.get_Depth()); |
473 params.add(VISUAL_CLASS, (int)XlibWrapper.InputOutput); |
473 params.add(VISUAL_CLASS, (int)XConstants.InputOutput); |
474 params.add(VISUAL, visInfo.get_visual()); |
474 params.add(VISUAL, visInfo.get_visual()); |
475 params.add(VALUE_MASK, XlibWrapper.CWBorderPixel | XlibWrapper.CWColormap | XlibWrapper.CWBackPixmap); |
475 params.add(VALUE_MASK, XConstants.CWBorderPixel | XConstants.CWColormap | XConstants.CWBackPixmap); |
476 params.add(PARENT_WINDOW, XlibWrapper.RootWindow(XToolkit.getDisplay(), visInfo.get_screen())); |
476 params.add(PARENT_WINDOW, XlibWrapper.RootWindow(XToolkit.getDisplay(), visInfo.get_screen())); |
477 params.add(BOUNDS, new Rectangle(0, 0, iconWidth, iconHeight)); |
477 params.add(BOUNDS, new Rectangle(0, 0, iconWidth, iconHeight)); |
478 params.remove(DELAYED); |
478 params.remove(DELAYED); |
479 init(params); |
479 init(params); |
480 if (getWindow() == 0) { |
480 if (getWindow() == 0) { |
486 if (getWindow() != 0) { |
486 if (getWindow() != 0) { |
487 XlibWrapper.XSetWindowBackgroundPixmap(XToolkit.getDisplay(), getWindow(), iconPixmap); |
487 XlibWrapper.XSetWindowBackgroundPixmap(XToolkit.getDisplay(), getWindow(), iconPixmap); |
488 XlibWrapper.XClearWindow(XToolkit.getDisplay(), getWindow()); |
488 XlibWrapper.XClearWindow(XToolkit.getDisplay(), getWindow()); |
489 } |
489 } |
490 // Provide both pixmap and window, WM or Taskbar will use the one they find more appropriate |
490 // Provide both pixmap and window, WM or Taskbar will use the one they find more appropriate |
491 long newFlags = hints.get_flags() | XlibWrapper.IconPixmapHint | XlibWrapper.IconMaskHint; |
491 long newFlags = hints.get_flags() | XUtilConstants.IconPixmapHint | XUtilConstants.IconMaskHint; |
492 if (getWindow() != 0) { |
492 if (getWindow() != 0) { |
493 newFlags |= XlibWrapper.IconWindowHint; |
493 newFlags |= XUtilConstants.IconWindowHint; |
494 } |
494 } |
495 hints.set_flags(newFlags); |
495 hints.set_flags(newFlags); |
496 hints.set_icon_pixmap(iconPixmap); |
496 hints.set_icon_pixmap(iconPixmap); |
497 hints.set_icon_mask(iconMask); |
497 hints.set_icon_mask(iconMask); |
498 hints.set_icon_window(getWindow()); |
498 hints.set_icon_window(getWindow()); |