diff --git a/hiro/cocoa/action/menu-check-item.cpp b/hiro/cocoa/action/menu-check-item.cpp index eef49bb86..ff6139558 100644 --- a/hiro/cocoa/action/menu-check-item.cpp +++ b/hiro/cocoa/action/menu-check-item.cpp @@ -13,7 +13,7 @@ -(void) activate { menuCheckItem->state.checked = !menuCheckItem->state.checked; - auto state = menuCheckItem->state.checked ? NSOnState : NSOffState; + auto state = menuCheckItem->state.checked ? NSControlStateValueOn : NSControlStateValueOff; [self setState:state]; menuCheckItem->doToggle(); } @@ -34,7 +34,7 @@ auto pMenuCheckItem::destruct() -> void { } auto pMenuCheckItem::setChecked(bool checked) -> void { - auto state = checked ? NSOnState : NSOffState; + auto state = checked ? NSControlStateValueOn : NSControlStateValueOff; [cocoaAction setState:state]; } diff --git a/hiro/cocoa/action/menu-radio-item.cpp b/hiro/cocoa/action/menu-radio-item.cpp index a6281c909..0e3dc91ff 100644 --- a/hiro/cocoa/action/menu-radio-item.cpp +++ b/hiro/cocoa/action/menu-radio-item.cpp @@ -40,7 +40,7 @@ auto pMenuRadioItem::setChecked() -> void { if(auto object = weak.acquire()) { if(auto self = object->self()) { if(auto p = dynamic_cast(self)) { - auto state = this == p ? NSOnState : NSOffState; + auto state = this == p ? NSControlStateValueOn : NSControlStateValueOff; [p->cocoaAction setState:state]; } } diff --git a/hiro/cocoa/utility.cpp b/hiro/cocoa/utility.cpp index 913214397..049a32439 100644 --- a/hiro/cocoa/utility.cpp +++ b/hiro/cocoa/utility.cpp @@ -41,7 +41,7 @@ auto NSMakeImage(image icon, u32 scaleWidth = 0, u32 scaleHeight = 0) -> NSImage pixelsWide:icon.width() pixelsHigh:icon.height() bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace - bitmapFormat:NSAlphaNonpremultipliedBitmapFormat + bitmapFormat:NSBitmapFormatAlphaNonpremultiplied bytesPerRow:(4 * icon.width()) bitsPerPixel:32 ]; memory::copy([bitmap bitmapData], icon.data(), icon.width() * icon.height()); diff --git a/hiro/cocoa/widget/button.cpp b/hiro/cocoa/widget/button.cpp index e375f58f2..0bf86e902 100644 --- a/hiro/cocoa/widget/button.cpp +++ b/hiro/cocoa/widget/button.cpp @@ -8,7 +8,7 @@ [self setTarget:self]; [self setAction:@selector(activate:)]; //NSRoundedBezelStyle has a fixed height; which breaks both icons and larger/smaller text - [self setBezelStyle:NSRegularSquareBezelStyle]; + [self setBezelStyle:NSBezelStyleFlexiblePush]; } return self; } diff --git a/hiro/cocoa/widget/check-button.cpp b/hiro/cocoa/widget/check-button.cpp index c48abe312..d04581d14 100644 --- a/hiro/cocoa/widget/check-button.cpp +++ b/hiro/cocoa/widget/check-button.cpp @@ -8,14 +8,14 @@ [self setTarget:self]; [self setAction:@selector(activate:)]; - [self setBezelStyle:NSRegularSquareBezelStyle]; - [self setButtonType:NSOnOffButton]; + [self setBezelStyle:NSBezelStyleFlexiblePush]; + [self setButtonType:NSButtonTypeOnOff]; } return self; } -(IBAction) activate:(id)sender { - checkButton->state.checked = [self state] != NSOffState; + checkButton->state.checked = [self state] != NSControlStateValueOff; checkButton->doToggle(); } @@ -58,7 +58,7 @@ auto pCheckButton::setBordered(bool bordered) -> void { } auto pCheckButton::setChecked(bool checked) -> void { - [(CocoaCheckButton*)cocoaView setState:checked ? NSOnState : NSOffState]; + [(CocoaCheckButton*)cocoaView setState:checked ? NSControlStateValueOn : NSControlStateValueOff]; } auto pCheckButton::setGeometry(Geometry geometry) -> void { diff --git a/hiro/cocoa/widget/check-label.cpp b/hiro/cocoa/widget/check-label.cpp index d990774a7..363ff8d5b 100644 --- a/hiro/cocoa/widget/check-label.cpp +++ b/hiro/cocoa/widget/check-label.cpp @@ -8,13 +8,13 @@ [self setTarget:self]; [self setAction:@selector(activate:)]; - [self setButtonType:NSSwitchButton]; + [self setButtonType:NSButtonTypeSwitch]; } return self; } -(IBAction) activate:(id)sender { - checkLabel->state.checked = [self state] != NSOffState; + checkLabel->state.checked = [self state] != NSControlStateValueOff; checkLabel->doToggle(); } @@ -40,7 +40,7 @@ auto pCheckLabel::minimumSize() const -> Size { } auto pCheckLabel::setChecked(bool checked) -> void { - [(CocoaCheckLabel*)cocoaView setState:checked ? NSOnState : NSOffState]; + [(CocoaCheckLabel*)cocoaView setState:checked ? NSControlStateValueOn : NSControlStateValueOff]; } auto pCheckLabel::setGeometry(Geometry geometry) -> void { diff --git a/hiro/cocoa/widget/horizontal-scroll-bar.cpp b/hiro/cocoa/widget/horizontal-scroll-bar.cpp index 28719a4dc..56ade2a41 100644 --- a/hiro/cocoa/widget/horizontal-scroll-bar.cpp +++ b/hiro/cocoa/widget/horizontal-scroll-bar.cpp @@ -30,13 +30,11 @@ auto& state = horizontalScrollBar->state; switch([self hitPart]) { - case NSScrollerIncrementLine: case NSScrollerIncrementPage: if(state.position < state.length - 1) state.position++; [self update]; break; - case NSScrollerDecrementLine: case NSScrollerDecrementPage: if(state.position) state.position--; [self update]; diff --git a/hiro/cocoa/widget/radio-button.cpp b/hiro/cocoa/widget/radio-button.cpp index 22c5df7e3..7ecfce0a5 100644 --- a/hiro/cocoa/widget/radio-button.cpp +++ b/hiro/cocoa/widget/radio-button.cpp @@ -8,8 +8,8 @@ [self setTarget:self]; [self setAction:@selector(activate:)]; - [self setBezelStyle:NSRegularSquareBezelStyle]; - [self setButtonType:NSOnOffButton]; + [self setBezelStyle:NSBezelStyleFlexiblePush]; + [self setButtonType:NSButtonTypeOnOff]; } return self; } @@ -64,7 +64,7 @@ auto pRadioButton::setChecked() -> void { if(auto object = weak.acquire()) { if(auto self = object->self()) { if(auto p = dynamic_cast(self)) { - auto state = this == p ? NSOnState : NSOffState; + auto state = this == p ? NSControlStateValueOn : NSControlStateValueOff; [(CocoaRadioButton*)p->cocoaView setState:state]; } } diff --git a/hiro/cocoa/widget/radio-label.cpp b/hiro/cocoa/widget/radio-label.cpp index 5d52a6c33..bd91a1cdb 100644 --- a/hiro/cocoa/widget/radio-label.cpp +++ b/hiro/cocoa/widget/radio-label.cpp @@ -8,7 +8,7 @@ [self setTarget:self]; [self setAction:@selector(activate:)]; - [self setButtonType:NSRadioButton]; + [self setButtonType:NSButtonTypeRadio]; } return self; } @@ -60,7 +60,7 @@ auto pRadioLabel::setGroup(sGroup group) -> void { if(auto object = weak.acquire()) { if(auto self = object->self()) { if(auto p = dynamic_cast(self)) { - auto state = p->state().checked ? NSOnState : NSOffState; + auto state = p->state().checked ? NSControlStateValueOn : NSControlStateValueOff; [(CocoaRadioLabel*)p->cocoaView setState:state]; } } diff --git a/hiro/cocoa/widget/table-view.cpp b/hiro/cocoa/widget/table-view.cpp index fe95c8670..74bf4ee6b 100644 --- a/hiro/cocoa/widget/table-view.cpp +++ b/hiro/cocoa/widget/table-view.cpp @@ -202,7 +202,7 @@ if(self = [super initTextCell:@""]) { tableView = &tableViewReference; buttonCell = [[NSButtonCell alloc] initTextCell:@""]; - [buttonCell setButtonType:NSSwitchButton]; + [buttonCell setButtonType:NSButtonTypeSwitch]; [buttonCell setControlSize:NSControlSizeSmall]; [buttonCell setRefusesFirstResponder:YES]; [buttonCell setTarget:self]; @@ -222,7 +222,7 @@ if(auto tableViewCell = tableViewItem->cell([view columnAtPoint:frame.origin])) { if(tableViewCell->state.checkable) { [buttonCell setHighlighted:YES]; - [buttonCell setState:(tableViewCell->state.checked ? NSOnState : NSOffState)]; + [buttonCell setState:(tableViewCell->state.checked ? NSControlStateValueOn : NSControlStateValueOff)]; [buttonCell drawWithFrame:frame inView:view]; frame.origin.x += frame.size.height + 2; frame.size.width -= frame.size.height + 2; diff --git a/hiro/cocoa/widget/vertical-scroll-bar.cpp b/hiro/cocoa/widget/vertical-scroll-bar.cpp index 4776830c0..f0a5367a2 100644 --- a/hiro/cocoa/widget/vertical-scroll-bar.cpp +++ b/hiro/cocoa/widget/vertical-scroll-bar.cpp @@ -30,13 +30,11 @@ auto& state = verticalScrollBar->state; switch([self hitPart]) { - case NSScrollerIncrementLine: case NSScrollerIncrementPage: if(state.position < state.length - 1) state.position++; [self update]; break; - case NSScrollerDecrementLine: case NSScrollerDecrementPage: if(state.position) state.position--; [self update]; diff --git a/ruby/audio/audio.cpp b/ruby/audio/audio.cpp index 019912e9c..90b66da6e 100644 --- a/ruby/audio/audio.cpp +++ b/ruby/audio/audio.cpp @@ -15,7 +15,16 @@ #endif #if defined(AUDIO_OPENAL) + #if defined(__APPLE__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated-declarations" + #endif + #include + + #if defined(__APPLE__) + #pragma clang diagnostic pop + #endif #endif #if defined(AUDIO_OSS) diff --git a/ruby/video/video.cpp b/ruby/video/video.cpp index 6d6e11081..f1b9bbe95 100644 --- a/ruby/video/video.cpp +++ b/ruby/video/video.cpp @@ -1,5 +1,14 @@ #if defined(VIDEO_CGL) + #if defined(__APPLE__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated-declarations" + #endif + #include + + #if defined(__APPLE__) + #pragma clang diagnostic pop + #endif #endif #if defined(VIDEO_DIRECT3D9)