src/macosx/native/sun/awt/AWTWindow.m

Print this page




  90     }
  91 }
  92 
  93 // creates a new NSWindow style mask based on the _STYLE_PROP_BITMASK bits
  94 + (NSUInteger) styleMaskForStyleBits:(jint)styleBits {
  95     NSUInteger type = 0;
  96     if (IS(styleBits, DECORATED)) {
  97         type |= NSTitledWindowMask;
  98         if (IS(styleBits, CLOSEABLE))   type |= NSClosableWindowMask;
  99         if (IS(styleBits, MINIMIZABLE)) type |= NSMiniaturizableWindowMask;
 100         if (IS(styleBits, RESIZABLE))   type |= NSResizableWindowMask;
 101     } else {
 102         type |= NSBorderlessWindowMask;
 103     }
 104 
 105     if (IS(styleBits, TEXTURED))    type |= NSTexturedBackgroundWindowMask;
 106     if (IS(styleBits, UNIFIED))     type |= NSUnifiedTitleAndToolbarWindowMask;
 107     if (IS(styleBits, UTILITY))     type |= NSUtilityWindowMask;
 108     if (IS(styleBits, HUD))         type |= NSHUDWindowMask;
 109     if (IS(styleBits, SHEET))       type |= NSDocModalWindowMask;

 110 
 111     return type;
 112 }
 113 
 114 // updates _METHOD_PROP_BITMASK based properties on the window
 115 - (void) setPropertiesForStyleBits:(jint)bits mask:(jint)mask {
 116     if (IS(mask, RESIZABLE)) {
 117         BOOL resizable = IS(bits, RESIZABLE);
 118         [self updateMinMaxSize:resizable];
 119         [self setShowsResizeIndicator:resizable];
 120     }
 121 
 122     if (IS(mask, HAS_SHADOW)) {
 123         [self setHasShadow:IS(bits, HAS_SHADOW)];
 124     }
 125 
 126     if (IS(mask, ZOOMABLE)) {
 127         [[self standardWindowButton:NSWindowZoomButton] setEnabled:IS(bits, ZOOMABLE)];
 128     }
 129 




  90     }
  91 }
  92 
  93 // creates a new NSWindow style mask based on the _STYLE_PROP_BITMASK bits
  94 + (NSUInteger) styleMaskForStyleBits:(jint)styleBits {
  95     NSUInteger type = 0;
  96     if (IS(styleBits, DECORATED)) {
  97         type |= NSTitledWindowMask;
  98         if (IS(styleBits, CLOSEABLE))   type |= NSClosableWindowMask;
  99         if (IS(styleBits, MINIMIZABLE)) type |= NSMiniaturizableWindowMask;
 100         if (IS(styleBits, RESIZABLE))   type |= NSResizableWindowMask;
 101     } else {
 102         type |= NSBorderlessWindowMask;
 103     }
 104 
 105     if (IS(styleBits, TEXTURED))      type |= NSTexturedBackgroundWindowMask;
 106     if (IS(styleBits, UNIFIED))       type |= NSUnifiedTitleAndToolbarWindowMask;
 107     if (IS(styleBits, UTILITY))       type |= NSUtilityWindowMask;
 108     if (IS(styleBits, HUD))           type |= NSHUDWindowMask;
 109     if (IS(styleBits, SHEET))         type |= NSDocModalWindowMask;
 110     if (IS(styleBits, NONACTIVATING)) type |= NSNonactivatingPanelMask;
 111 
 112     return type;
 113 }
 114 
 115 // updates _METHOD_PROP_BITMASK based properties on the window
 116 - (void) setPropertiesForStyleBits:(jint)bits mask:(jint)mask {
 117     if (IS(mask, RESIZABLE)) {
 118         BOOL resizable = IS(bits, RESIZABLE);
 119         [self updateMinMaxSize:resizable];
 120         [self setShowsResizeIndicator:resizable];
 121     }
 122 
 123     if (IS(mask, HAS_SHADOW)) {
 124         [self setHasShadow:IS(bits, HAS_SHADOW)];
 125     }
 126 
 127     if (IS(mask, ZOOMABLE)) {
 128         [[self standardWindowButton:NSWindowZoomButton] setEnabled:IS(bits, ZOOMABLE)];
 129     }
 130