Revision: 28422
          http://sourceforge.net/p/bibdesk/svn/28422
Author:   hofman
Date:     2023-11-05 17:55:38 +0000 (Sun, 05 Nov 2023)
Log Message:
-----------
allow older enum values for older SDKs

Modified Paths:
--------------
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVArrowButtonCell.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVMIMEIcon.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVScaledImageView.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVSlider.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVUtilities.m

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVArrowButtonCell.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVArrowButtonCell.m       
2023-11-05 16:34:16 UTC (rev 28421)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVArrowButtonCell.m       
2023-11-05 17:55:38 UTC (rev 28422)
@@ -38,6 +38,11 @@
 
 #import "FVArrowButtonCell.h"
 
+#if !defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MAX_ALLOWED < 
MAC_OS_X_VERSION_10_12
+#define NSEventMaskLeftMouseUp NSLeftMouseUpMask
+#define NSEventMaskLeftMouseDragged NSLeftMouseDraggedMask
+#define NSEventTypeLeftMouseDragged NSLeftMouseDragged
+#endif
 
 @implementation FVArrowButtonCell
 
@@ -147,7 +152,7 @@
                 theEvent = [[controlView window] nextEventMatchingMask: 
NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged];
                 mouseLoc = [controlView convertPoint:[theEvent 
locationInWindow] fromView:nil];
                 isInside = NSMouseInRect(mouseLoc, cellFrame, [controlView 
isFlipped]);
-                keepOn = ([theEvent type] == NSEventMaskLeftMouseDragged);
+                keepOn = ([theEvent type] == NSEventTypeLeftMouseDragged);
             }
                }
         return isInside;

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.m 2023-11-05 
16:34:16 UTC (rev 28421)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.m 2023-11-05 
17:55:38 UTC (rev 28422)
@@ -94,16 +94,19 @@
         [_labelCell setFont:[NSFont menuBarFontOfSize:0.0]];
         
         _labelNameCell = [[NSTextFieldCell alloc] initTextCell:@""];
+#if defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= 
MAC_OS_X_VERSION_10_12
         [_labelNameCell setAlignment:NSTextAlignmentCenter];
-        if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_10)
-        {
+#else
+        [_labelNameCell setAlignment:NSCenterTextAlignment];
+#endif
+#if !defined(MAC_OS_X_VERSION_10_10) || MAC_OS_X_VERSION_MIN_REQUIRED < 
MAC_OS_X_VERSION_10_10
+        if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_10) {
             [_labelNameCell setFont:[NSFont boldSystemFontOfSize:[NSFont 
smallSystemFontSize]]];
             [_labelNameCell setTextColor:[NSColor disabledControlTextColor]];
-        }
-        else {
-            // @@ Dark mode
-            [_labelNameCell setTextColor:[NSColor systemGrayColor]];
-        }
+        } else
+#endif
+        // @@ Dark mode
+        [_labelNameCell setTextColor:[NSColor systemGrayColor]];
         [self _createMatrix];
         
         _target = nil;

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2023-11-05 
16:34:16 UTC (rev 28421)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2023-11-05 
17:55:38 UTC (rev 28422)
@@ -97,6 +97,16 @@
 // time interval for indeterminate download progress indicator updates
 #define PROGRESS_TIMER_INTERVAL (floor(NSAppKitVersionNumber) > 
NSAppKitVersionNumber10_15 ? 0.1 : 1.0/24.0)
 
+#if !defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MAX_ALLOWED < 
MAC_OS_X_VERSION_10_12
+#define NSTextAlignmentCenter NSCenterTextAlignment
+#define NSCompositingOperationSourceOver NSCompositeSourceOver
+#define NSEventMaskScrollWheel NSScrollWheelMask
+#define NSEventTypeKeyDown NSKeyDown
+#define NSEventModifierFlagCommand NSCommandKeyMask
+#define NSEventModifierFlagShift NSShiftKeyMask
+#define NSEventModifierFlagOption NSAlternateKeyMask
+#endif
+
 @interface _FVURLInfo : NSObject
 {
 @public;

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVMIMEIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVMIMEIcon.m      2023-11-05 
16:34:16 UTC (rev 28421)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVMIMEIcon.m      2023-11-05 
17:55:38 UTC (rev 28422)
@@ -96,7 +96,11 @@
     // slight inset and draw partially transparent
     NSRect networkRect = NSInsetRect(iconRect, iconRect.size.width / 5.0, 
iconRect.size.height / 5.0);
     
+#if defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= 
MAC_OS_X_VERSION_10_12
     [_networkIcon drawInRect:networkRect fromRect:NSZeroRect 
operation:NSCompositingOperationSourceOver fraction:0.6];
+#else
+    [_networkIcon drawInRect:networkRect fromRect:NSZeroRect 
operation:NSCompositeSourceOver fraction:0.6];
+#endif
     
     [NSGraphicsContext restoreGraphicsState];
 }

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVScaledImageView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVScaledImageView.m       
2023-11-05 16:34:16 UTC (rev 28421)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVScaledImageView.m       
2023-11-05 17:55:38 UTC (rev 28422)
@@ -56,7 +56,11 @@
     [ta setObject:[NSFont systemFontOfSize:[NSFont systemFontSize]] 
forKey:NSFontAttributeName];
     [ta setObject:[NSColor darkGrayColor] 
forKey:NSForegroundColorAttributeName];
     NSMutableParagraphStyle *ps = [[NSParagraphStyle defaultParagraphStyle] 
mutableCopy];
+#if defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= 
MAC_OS_X_VERSION_10_12
     [ps setAlignment:NSTextAlignmentCenter];
+#else
+    [ps setAlignment:NSCenterTextAlignment];
+#endif
     [ta setObject:ps forKey:NSParagraphStyleAttributeName];
     [ps release];
     

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVSlider.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVSlider.m        2023-11-05 
16:34:16 UTC (rev 28421)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVSlider.m        2023-11-05 
17:55:38 UTC (rev 28422)
@@ -130,7 +130,11 @@
 - (id)init
 {
     self = [super init];
+#if defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= 
MAC_OS_X_VERSION_10_12
     [self setControlSize:NSControlSizeMini];
+#else
+    [self setControlSize:NSMiniControlSize];
+#endif
     return self;
 }
 
@@ -146,7 +150,11 @@
 
 - (id)init
 {
+#if defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= 
MAC_OS_X_VERSION_10_12
     self = [super initWithContentRect:NSMakeRect(0,0,50,10) 
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES];
+#else
+    self = [super initWithContentRect:NSMakeRect(0,0,50,10) 
styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
+#endif
     if (self) {
         [self setReleasedWhenClosed:NO];
         [self setBackgroundColor:[NSColor clearColor]];

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVUtilities.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVUtilities.m     2023-11-05 
16:34:16 UTC (rev 28421)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVUtilities.m     2023-11-05 
17:55:38 UTC (rev 28422)
@@ -168,7 +168,11 @@
 {
     NSRect rect = NSZeroRect;
     rect.size = size;
+#if defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= 
MAC_OS_X_VERSION_10_12
     NSWindow *window = [[NSWindow alloc] initWithContentRect:rect 
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
+#else
+    NSWindow *window = [[NSWindow alloc] initWithContentRect:rect 
styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
+#endif
     [window autorelease];
     return [NSGraphicsContext graphicsContextWithWindow:window];
 }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to