You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
(23) |
Apr
(254) |
May
(252) |
Jun
(209) |
Jul
(198) |
Aug
(192) |
Sep
(207) |
Oct
(120) |
Nov
(179) |
Dec
(52) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(48) |
Feb
(69) |
Mar
(129) |
Apr
(250) |
May
(113) |
Jun
(177) |
Jul
(228) |
Aug
(155) |
Sep
(218) |
Oct
(185) |
Nov
(109) |
Dec
(88) |
| 2009 |
Jan
(83) |
Feb
(39) |
Mar
(70) |
Apr
(47) |
May
(48) |
Jun
(67) |
Jul
(61) |
Aug
(97) |
Sep
(221) |
Oct
(141) |
Nov
(70) |
Dec
(61) |
| 2010 |
Jan
(45) |
Feb
(76) |
Mar
(178) |
Apr
(106) |
May
(57) |
Jun
(32) |
Jul
(64) |
Aug
(98) |
Sep
(96) |
Oct
(19) |
Nov
(34) |
Dec
(117) |
| 2011 |
Jan
(55) |
Feb
(48) |
Mar
(64) |
Apr
(21) |
May
(39) |
Jun
(53) |
Jul
(99) |
Aug
(56) |
Sep
(39) |
Oct
(26) |
Nov
(19) |
Dec
(69) |
| 2012 |
Jan
(17) |
Feb
(40) |
Mar
(17) |
Apr
|
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
(10) |
Sep
(10) |
Oct
(38) |
Nov
(48) |
Dec
(70) |
| 2013 |
Jan
(43) |
Feb
(47) |
Mar
(39) |
Apr
(37) |
May
(25) |
Jun
(6) |
Jul
(20) |
Aug
(49) |
Sep
(33) |
Oct
(34) |
Nov
(75) |
Dec
(6) |
| 2014 |
Jan
(32) |
Feb
(10) |
Mar
(17) |
Apr
|
May
|
Jun
(26) |
Jul
(5) |
Aug
|
Sep
(4) |
Oct
(23) |
Nov
(80) |
Dec
(48) |
| 2015 |
Jan
(80) |
Feb
(50) |
Mar
(58) |
Apr
(20) |
May
(11) |
Jun
(16) |
Jul
(24) |
Aug
(27) |
Sep
(56) |
Oct
(30) |
Nov
(16) |
Dec
(6) |
| 2016 |
Jan
(31) |
Feb
(14) |
Mar
(23) |
Apr
(17) |
May
(40) |
Jun
(12) |
Jul
(17) |
Aug
(9) |
Sep
(32) |
Oct
(36) |
Nov
(23) |
Dec
(9) |
| 2017 |
Jan
(37) |
Feb
(23) |
Mar
(65) |
Apr
(22) |
May
(6) |
Jun
(3) |
Jul
|
Aug
|
Sep
(3) |
Oct
(22) |
Nov
(63) |
Dec
(71) |
| 2018 |
Jan
(83) |
Feb
(21) |
Mar
(35) |
Apr
(44) |
May
(14) |
Jun
(12) |
Jul
(8) |
Aug
(18) |
Sep
(10) |
Oct
(145) |
Nov
(144) |
Dec
(76) |
| 2019 |
Jan
(18) |
Feb
(28) |
Mar
(5) |
Apr
(208) |
May
(291) |
Jun
(158) |
Jul
(27) |
Aug
(8) |
Sep
(10) |
Oct
(83) |
Nov
(41) |
Dec
(31) |
| 2020 |
Jan
(16) |
Feb
(46) |
Mar
(100) |
Apr
(78) |
May
(69) |
Jun
(71) |
Jul
(28) |
Aug
(131) |
Sep
(176) |
Oct
(89) |
Nov
(147) |
Dec
(19) |
| 2021 |
Jan
(19) |
Feb
(25) |
Mar
(91) |
Apr
(98) |
May
(14) |
Jun
(44) |
Jul
(8) |
Aug
(3) |
Sep
(38) |
Oct
(57) |
Nov
(97) |
Dec
(74) |
| 2022 |
Jan
(89) |
Feb
(47) |
Mar
(15) |
Apr
(50) |
May
(54) |
Jun
(56) |
Jul
(80) |
Aug
(12) |
Sep
(11) |
Oct
(60) |
Nov
(48) |
Dec
(4) |
| 2023 |
Jan
(75) |
Feb
(49) |
Mar
(84) |
Apr
(24) |
May
(13) |
Jun
(74) |
Jul
(32) |
Aug
(66) |
Sep
(50) |
Oct
(38) |
Nov
(105) |
Dec
(181) |
| 2024 |
Jan
(21) |
Feb
(49) |
Mar
(77) |
Apr
(84) |
May
(20) |
Jun
(71) |
Jul
(53) |
Aug
(33) |
Sep
(54) |
Oct
(124) |
Nov
(151) |
Dec
(73) |
| 2025 |
Jan
(61) |
Feb
(17) |
Mar
(136) |
Apr
(72) |
May
(200) |
Jun
(238) |
Jul
(91) |
Aug
(8) |
Sep
|
Oct
(63) |
Nov
(43) |
Dec
|
|
From: <ho...@us...> - 2025-10-02 16:54:36
|
Revision: 15681
http://sourceforge.net/p/skim-app/code/15681
Author: hofman
Date: 2025-10-02 16:54:33 +0000 (Thu, 02 Oct 2025)
Log Message:
-----------
remove a log
Modified Paths:
--------------
trunk/SKBookmarkController.m
Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m 2025-10-02 16:32:25 UTC (rev 15680)
+++ trunk/SKBookmarkController.m 2025-10-02 16:54:33 UTC (rev 15681)
@@ -681,7 +681,7 @@
SKBookmark *bookmark = nil;
NSInteger tag = 0;
- if (supermenu == [NSApp mainMenu]) {log_method();
+ if (supermenu == [NSApp mainMenu]) {
bookmark = [self bookmarkRoot];
tag = SKBookmarkTagBookmarksMenu;
} else if (idx >= 0) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-10-02 16:32:27
|
Revision: 15680
http://sourceforge.net/p/skim-app/code/15680
Author: hofman
Date: 2025-10-02 16:32:25 +0000 (Thu, 02 Oct 2025)
Log Message:
-----------
override designated initializer rather than convenience initializer
Modified Paths:
--------------
trunk/SKBookmarkController.m
trunk/SKDownloadController.m
trunk/SKInfoWindowController.m
trunk/SKLineInspector.m
trunk/SKPreferenceController.m
Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m 2025-10-02 16:21:17 UTC (rev 15679)
+++ trunk/SKBookmarkController.m 2025-10-02 16:32:25 UTC (rev 15680)
@@ -146,9 +146,9 @@
return sharedBookmarkController ?: [super allocWithZone:zone];
}
-- (instancetype)init {
+- (instancetype)initWithWindow:(NSWindow *)window {
if (sharedBookmarkController == nil) {
- self = [self initWithWindowNibName:@"BookmarksWindow"];
+ self = [super initWithWindow:nil];
if (self) {
NSDictionary *bookmarkDictionary = [[NSUserDefaults standardUserDefaults] persistentDomainForName:SKBookmarksIdentifier];
@@ -187,6 +187,10 @@
[self stopObservingBookmarks:@[bookmarkRoot]];
}
+- (NSString *)windowNibName {
+ return @"BookmarksWindow";
+}
+
- (void)windowDidLoad {
[self setupToolbar];
Modified: trunk/SKDownloadController.m
===================================================================
--- trunk/SKDownloadController.m 2025-10-02 16:21:17 UTC (rev 15679)
+++ trunk/SKDownloadController.m 2025-10-02 16:32:25 UTC (rev 15680)
@@ -106,8 +106,8 @@
SKDownloadsIdentifier = [[[NSBundle mainBundle] bundleIdentifier] stringByAppendingString:@".downloads"];
}
-- (instancetype)init {
- self = [self initWithWindowNibName:@"DownloadsWindow"];
+- (instancetype)initWithWindow:(NSWindow *)window {
+ self = [super initWithWindow:nil];
if (self) {
downloads = [[NSMutableArray alloc] init];
@@ -132,6 +132,10 @@
[self endObservingDownloads:downloads];
}
+- (NSString *)windowNibName {
+ return @"DownloadsWindow";
+}
+
- (void)windowDidLoad {
[self setupToolbar];
Modified: trunk/SKInfoWindowController.m
===================================================================
--- trunk/SKInfoWindowController.m 2025-10-02 16:21:17 UTC (rev 15679)
+++ trunk/SKInfoWindowController.m 2025-10-02 16:32:25 UTC (rev 15680)
@@ -77,8 +77,8 @@
@synthesize summaryTableView, attributesTableView, tabView, info;
-- (instancetype)init {
- self = [self initWithWindowNibName:@"InfoWindow"];
+- (instancetype)initWithWindow:(NSWindow *)window {
+ self = [super initWithWindow:nil];
if (self){
info = nil;
summaryKeys = [[NSArray alloc] initWithObjects:
@@ -123,6 +123,10 @@
return self;
}
+- (NSString *)windowNibName {
+ return @"InfoWindow";
+}
+
- (void)updateForDocument:(NSDocument *)doc {
[self setInfo:[[self class] infoForDocument:doc]];
[summaryTableView reloadData];
Modified: trunk/SKLineInspector.m
===================================================================
--- trunk/SKLineInspector.m 2025-10-02 16:21:17 UTC (rev 15679)
+++ trunk/SKLineInspector.m 2025-10-02 16:32:25 UTC (rev 15680)
@@ -80,9 +80,9 @@
return sharedLineInspector != nil;
}
-- (instancetype)init {
+- (instancetype)initWithWindow:(NSWindow *)window {
if (sharedLineInspector) NSLog(@"Attempt to allocate second instance of %@", [self class]);
- self = [self initWithWindowNibName:@"LineInspector"];
+ self = [super initWithWindow:nil];
if (self) {
style = kPDFBorderStyleSolid;
lineWidth = 1.0;
@@ -94,6 +94,10 @@
return self;
}
+- (NSString *)windowNibName {
+ return @"LineInspector";
+}
+
- (void)windowDidLoad {
[lineWell setCanActivate:NO];
[lineWell bind:SKLineWellLineWidthKey toObject:self withKeyPath:LINEWIDTH_KEY options:nil];
Modified: trunk/SKPreferenceController.m
===================================================================
--- trunk/SKPreferenceController.m 2025-10-02 16:21:17 UTC (rev 15679)
+++ trunk/SKPreferenceController.m 2025-10-02 16:32:25 UTC (rev 15680)
@@ -71,8 +71,8 @@
@synthesize resetButton, resetAllButton;
-- (instancetype)init {
- self = [self initWithWindowNibName:@"PreferenceWindow"];
+- (instancetype)initWithWindow:(NSWindow *)window {
+ self = [super initWithWindow:nil];
if (self) {
preferencePanes = [[NSArray alloc] initWithObjects:
[[SKGeneralPreferences alloc] init],
@@ -85,6 +85,10 @@
return self;
}
+- (NSString *)windowNibName {
+ return @"PreferenceWindow";
+}
+
- (NSViewController<SKPreferencePane> *)preferencePaneForItemIdentifier:(NSString *)itemIdent {
for (NSViewController<SKPreferencePane> *pane in preferencePanes)
if ([[pane nibName] isEqualToString:itemIdent])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-10-02 16:21:19
|
Revision: 15679
http://sourceforge.net/p/skim-app/code/15679
Author: hofman
Date: 2025-10-02 16:21:17 +0000 (Thu, 02 Oct 2025)
Log Message:
-----------
Add some more designated initializer attributes
Modified Paths:
--------------
trunk/SKFileUpdateChecker.h
trunk/SKLoupeController.h
trunk/SKNoteTypeSheetController.h
trunk/SKNoteTypeSheetController.m
trunk/SKNoteWindowController.h
trunk/SKNoteWindowController.m
trunk/SKPresentationOptionsSheetController.h
trunk/SKPresentationOptionsSheetController.m
trunk/SKViewSettingsController.h
trunk/SKViewSettingsController.m
Modified: trunk/SKFileUpdateChecker.h
===================================================================
--- trunk/SKFileUpdateChecker.h 2025-10-02 15:53:38 UTC (rev 15678)
+++ trunk/SKFileUpdateChecker.h 2025-10-02 16:21:17 UTC (rev 15679)
@@ -61,7 +61,8 @@
@property (nonatomic, getter=isEnabled) BOOL enabled;
@property (nonatomic, readonly) BOOL fileChangedOnDisk, isUpdatingFile;
-- (instancetype)initForDocument:(NSDocument *)aDocument;
+- (instancetype)initForDocument:(NSDocument *)aDocument NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
- (void)terminate;
Modified: trunk/SKLoupeController.h
===================================================================
--- trunk/SKLoupeController.h 2025-10-02 15:53:38 UTC (rev 15678)
+++ trunk/SKLoupeController.h 2025-10-02 16:21:17 UTC (rev 15679)
@@ -50,7 +50,8 @@
NSInteger level;
}
-- (instancetype)initWithPDFView:(PDFView *)aPdfView;
+- (instancetype)initWithPDFView:(PDFView *)aPdfView NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
@property (nonatomic) CGFloat magnification;
@property (nonatomic) NSInteger level;
Modified: trunk/SKNoteTypeSheetController.h
===================================================================
--- trunk/SKNoteTypeSheetController.h 2025-10-02 15:53:38 UTC (rev 15678)
+++ trunk/SKNoteTypeSheetController.h 2025-10-02 16:21:17 UTC (rev 15679)
@@ -47,7 +47,9 @@
__weak id <SKNoteTypeSheetControllerDelegate> delegate;
}
-- (instancetype)initIncludingWidgets:(BOOL)includeWidgets;
+- (instancetype)initIncludingWidgets:(BOOL)includeWidgets NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithWindow:(nullable NSWindow *)window NS_UNAVAILABLE;
+- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;
@property (nonatomic, nullable, weak) id <SKNoteTypeSheetControllerDelegate> delegate;
@property (nonatomic, readonly) NSArray<NSString *> *noteTypes;
Modified: trunk/SKNoteTypeSheetController.m
===================================================================
--- trunk/SKNoteTypeSheetController.m 2025-10-02 15:53:38 UTC (rev 15678)
+++ trunk/SKNoteTypeSheetController.m 2025-10-02 16:21:17 UTC (rev 15679)
@@ -56,7 +56,7 @@
@dynamic noteTypes;
- (instancetype)initIncludingWidgets:(BOOL)includeWidgets {
- self = [super initWithWindowNibName:@"NoteTypeSheet"];
+ self = [super initWithWindow:nil];
if (self) {
noteTypeMenu = [[NSMenu alloc] init];
NSArray *noteTypes = [NSArray arrayWithObjects:SKNFreeTextString, SKNNoteString, SKNCircleString, SKNSquareString, SKNHighlightString, SKNUnderlineString, SKNStrikeOutString, SKNLineString, SKNInkString, includeWidgets ? SKNWidgetString : nil, nil];
@@ -79,6 +79,10 @@
return [self initIncludingWidgets:NO];
}
+- (NSString *)windowNibName {
+ return @"NoteTypeSheet";
+}
+
- (NSButton *)switchForTag:(NSInteger)tag {
for (NSView *view in [[[self window] contentView] subviews]) {
if ([view isKindOfClass:[NSButton class]] && [(NSButton *)view action] == NULL && [(NSButton *)view tag] == tag)
Modified: trunk/SKNoteWindowController.h
===================================================================
--- trunk/SKNoteWindowController.h 2025-10-02 15:53:38 UTC (rev 15678)
+++ trunk/SKNoteWindowController.h 2025-10-02 16:21:17 UTC (rev 15679)
@@ -78,7 +78,9 @@
@property (nonatomic, readonly) PDFAnnotation *note;
@property (nonatomic) BOOL keepOnTop, forceOnTop, isNoteType;
-- (instancetype)initWithNote:(PDFAnnotation *)aNote;
+- (instancetype)initWithNote:(PDFAnnotation *)aNote NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithWindow:(nullable NSWindow *)window NS_UNAVAILABLE;
+- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;
- (void)statusBarClicked:(nullable id)sender;
Modified: trunk/SKNoteWindowController.m
===================================================================
--- trunk/SKNoteWindowController.m 2025-10-02 15:53:38 UTC (rev 15678)
+++ trunk/SKNoteWindowController.m 2025-10-02 16:21:17 UTC (rev 15679)
@@ -148,7 +148,7 @@
}
- (instancetype)initWithNote:(PDFAnnotation *)aNote {
- self = [self initWithWindowNibName:@"NoteWindow"];
+ self = [super initWithWindow:nil];
if (self) {
note = aNote;
@@ -170,6 +170,10 @@
return self;
}
+- (NSString *)windowNibName {
+ return @"NoteWindow";
+}
+
- (void)updateStatusMessage {
NSRect bounds = [note bounds];
[[statusBar leftField] setStringValue:[NSString stringWithFormat:NSLocalizedString(@"Page %@ at (%ld, %ld)", @"Status message"), [[note page] displayLabel], (long)NSMidX(bounds), (long)NSMidY(bounds)]];
Modified: trunk/SKPresentationOptionsSheetController.h
===================================================================
--- trunk/SKPresentationOptionsSheetController.h 2025-10-02 15:53:38 UTC (rev 15678)
+++ trunk/SKPresentationOptionsSheetController.h 2025-10-02 16:21:17 UTC (rev 15679)
@@ -76,7 +76,9 @@
@property (nonatomic) BOOL separate;
@property (nonatomic, copy) NSArray<SKLabeledTransitionInfo *> *transitions;
-- (instancetype)initForController:(SKMainWindowController *)aController;
+- (instancetype)initForController:(SKMainWindowController *)aController NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithWindow:(nullable NSWindow *)window NS_UNAVAILABLE;
+- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;
- (IBAction)preview:(nullable id)sender;
Modified: trunk/SKPresentationOptionsSheetController.m
===================================================================
--- trunk/SKPresentationOptionsSheetController.m 2025-10-02 15:53:38 UTC (rev 15678)
+++ trunk/SKPresentationOptionsSheetController.m 2025-10-02 16:21:17 UTC (rev 15679)
@@ -102,7 +102,7 @@
}
- (instancetype)initForController:(SKMainWindowController *)aController {
- self = [self initWithWindowNibName:@"TransitionSheet"];
+ self = [super initWithWindow:nil];
if (self) {
controller = aController;
@@ -134,6 +134,10 @@
);
}
+- (NSString *)windowNibName {
+ return @"TransitionSheet";
+}
+
- (void)handleDocumentsDidChangeNotification:(NSNotification *)note {
id currentDoc = [[notesDocumentPopUpButton selectedItem] representedObject];
Modified: trunk/SKViewSettingsController.h
===================================================================
--- trunk/SKViewSettingsController.h 2025-10-02 15:53:38 UTC (rev 15678)
+++ trunk/SKViewSettingsController.h 2025-10-02 16:21:17 UTC (rev 15679)
@@ -54,7 +54,9 @@
NSDictionary<NSString *, id> *defaultSettings;
}
-- (instancetype)initWithSettings:(NSDictionary<NSString *, id> *)settings defaultSettings:(nullable NSDictionary<NSString *, id> *)aDefaultSettings;
+- (instancetype)initWithSettings:(NSDictionary<NSString *, id> *)settings defaultSettings:(nullable NSDictionary<NSString *, id> *)aDefaultSettings NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithWindow:(nullable NSWindow *)window NS_UNAVAILABLE;
+- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;
@property (nonatomic, getter=isCustom) BOOL custom;
Modified: trunk/SKViewSettingsController.m
===================================================================
--- trunk/SKViewSettingsController.m 2025-10-02 15:53:38 UTC (rev 15678)
+++ trunk/SKViewSettingsController.m 2025-10-02 16:21:17 UTC (rev 15679)
@@ -60,7 +60,7 @@
}
- (instancetype)initWithSettings:(NSDictionary *)settings defaultSettings:(NSDictionary *)aDefaultSettings {
- self = [self initWithWindowNibName: @"ViewSettings"];
+ self = [super initWithWindow:nil];
if (self) {
defaultSettings = [aDefaultSettings copy];
if (defaultSettings == nil || [settings count]) {
@@ -75,6 +75,10 @@
return self;
}
+- (NSString *)windowNibName {
+ return @"ViewSettings";
+}
+
- (NSInteger)extendedDisplayMode {
NSInteger mode = [self displayMode];
if (mode == kPDFDisplaySinglePageContinuous && [self displayDirection] == 1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-10-02 15:53:45
|
Revision: 15678
http://sourceforge.net/p/skim-app/code/15678
Author: hofman
Date: 2025-10-02 15:53:38 +0000 (Thu, 02 Oct 2025)
Log Message:
-----------
Add deignated initializer attributes
Modified Paths:
--------------
trunk/SKAlias.h
trunk/SKChainedUndoManager.h
trunk/SKColorMenuView.h
trunk/SKDisplayPrefs.h
trunk/SKDownload.h
trunk/SKGroupedSearchResult.h
trunk/SKLine.h
trunk/SKNotePrefs.h
trunk/SKNoteText.h
trunk/SKPDFSyncRecord.h
trunk/SKReadingBar.h
trunk/SKShareMenuController.h
trunk/SKShareMenuController.m
trunk/SKSnapshotConfiguration.h
trunk/SKSyncDot.h
trunk/SKTemplateTag.h
trunk/SKTextNoteEditor.h
trunk/SKThumbnail.h
trunk/SKThumbnailStamp.h
trunk/SKTransitionInfo.h
trunk/SKTransitionInfo.m
trunk/SKTypeSelectHelper.h
trunk/SKVersionNumber.h
Modified: trunk/SKAlias.h
===================================================================
--- trunk/SKAlias.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKAlias.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -50,9 +50,10 @@
@property (nonatomic, nullable, readonly) NSURL *fileURL;
@property (nonatomic, nullable, readonly) NSURL *fileURLNoUI;
-- (nullable instancetype)initWithAliasData:(NSData *)data;
-- (nullable instancetype)initWithBookmarkData:(NSData *)data;
+- (nullable instancetype)initWithAliasData:(NSData *)data NS_DESIGNATED_INITIALIZER;
+- (nullable instancetype)initWithBookmarkData:(NSData *)data NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithURL:(NSURL *)fileURL;
+- (instancetype)init NS_UNAVAILABLE;
@end
Modified: trunk/SKChainedUndoManager.h
===================================================================
--- trunk/SKChainedUndoManager.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKChainedUndoManager.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -43,7 +43,8 @@
@interface SKChainedUndoManager : NSUndoManager {
NSUndoManager *nextUndoManager;
}
-- (instancetype)initWithNextUndoManager:(NSUndoManager *)undoManager;
+- (instancetype)initWithNextUndoManager:(NSUndoManager *)undoManager NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
Modified: trunk/SKColorMenuView.h
===================================================================
--- trunk/SKColorMenuView.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKColorMenuView.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -49,7 +49,9 @@
NSUInteger hoveredIndex;
}
-- (instancetype)initWithAnnotation:(PDFAnnotation *)anAnnotation;
+- (instancetype)initWithAnnotation:(PDFAnnotation *)anAnnotation NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithFrame:(NSRect)frameRect NS_UNAVAILABLE;
+- (instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;
@end
Modified: trunk/SKDisplayPrefs.h
===================================================================
--- trunk/SKDisplayPrefs.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKDisplayPrefs.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -51,8 +51,9 @@
@property (nonatomic, nullable, strong) NSColor *whitePoint;
@property (nonatomic, getter=isInverted) BOOL inverted;
-- (instancetype)initForFullScreen:(BOOL)isFullScreen;
+- (instancetype)initForFullScreen:(BOOL)isFullScreen NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithName:(NSString *)name;
+- (instancetype)init NS_UNAVAILABLE;
@end
Modified: trunk/SKDownload.h
===================================================================
--- trunk/SKDownload.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKDownload.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -104,8 +104,9 @@
@property (class, nonatomic, readonly) NSImage *cancelImage;
@property (class, nonatomic, readonly) NSImage *resumeImage;
-- (instancetype)initWithURL:(nullable NSURL *)aURL;
+- (instancetype)initWithURL:(nullable NSURL *)aURL NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithProperties:(NSDictionary<NSString *, id> *)properties;
+- (instancetype)init NS_UNAVAILABLE;
- (void)start;
- (void)cancel;
Modified: trunk/SKGroupedSearchResult.h
===================================================================
--- trunk/SKGroupedSearchResult.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKGroupedSearchResult.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -56,7 +56,8 @@
@property (weak, nonatomic, readonly) NSString *label;
@property (nonatomic, readonly) NSArray<PDFSelection *> *matches;
-- (instancetype)initWithPage:(PDFPage *)aPage maxCount:(NSUInteger)aMaxCount;
+- (instancetype)initWithPage:(PDFPage *)aPage maxCount:(NSUInteger)aMaxCount NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
- (void)addMatch:(PDFSelection *)match;
Modified: trunk/SKLine.h
===================================================================
--- trunk/SKLine.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKLine.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -47,7 +47,8 @@
NSInteger index;
}
-- (instancetype)initWithPage:(PDFPage *)aPage index:(NSInteger)anIndex;
+- (instancetype)initWithPage:(PDFPage *)aPage index:(NSInteger)anIndex NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
@property (nonatomic, readonly) PDFPage *page;
@property (nonatomic, readonly) NSInteger index;
Modified: trunk/SKNotePrefs.h
===================================================================
--- trunk/SKNotePrefs.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKNotePrefs.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -61,7 +61,8 @@
@property (nonatomic, nullable, strong) NSString *scriptingUserName;
@property (nonatomic, strong) NSDictionary<NSString *, id> *scriptingProperties;
-- (nullable instancetype)initWithType:(NSString *)aType;
+- (nullable instancetype)initWithType:(NSString *)aType NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
@end
Modified: trunk/SKNoteText.h
===================================================================
--- trunk/SKNoteText.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKNoteText.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -45,7 +45,8 @@
__weak PDFAnnotation *note;
}
-- (instancetype)initWithNote:(PDFAnnotation *)aNote;
+- (instancetype)initWithNote:(PDFAnnotation *)aNote NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
@property (nonatomic, weak, readonly) PDFAnnotation *note;
Modified: trunk/SKPDFSyncRecord.h
===================================================================
--- trunk/SKPDFSyncRecord.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKPDFSyncRecord.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -55,7 +55,8 @@
@property (nonatomic, nullable, strong) NSString *file;
@property (nonatomic) NSInteger line;
-- (instancetype)initWithRecordIndex:(NSInteger)aRecordIndex;
+- (instancetype)initWithRecordIndex:(NSInteger)aRecordIndex NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
@end
Modified: trunk/SKReadingBar.h
===================================================================
--- trunk/SKReadingBar.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKReadingBar.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -61,7 +61,8 @@
@property (readonly) NSRect currentBounds;
@property (nonatomic, nullable, weak) id <SKReadingBarDelegate> delegate;
-- (instancetype)initWithPage:(nullable PDFPage *)aPage line:(NSInteger)line delegate:(nullable id <SKReadingBarDelegate>)aDelegate;
+- (instancetype)initWithPage:(nullable PDFPage *)aPage line:(NSInteger)line delegate:(nullable id <SKReadingBarDelegate>)aDelegate NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
- (BOOL)goToNextLine;
- (BOOL)goToPreviousLine;
Modified: trunk/SKShareMenuController.h
===================================================================
--- trunk/SKShareMenuController.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKShareMenuController.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -44,7 +44,8 @@
__weak NSDocument *document;
}
-- (instancetype)initForDocument:(nullable NSDocument *)aDocument;
+- (instancetype)initForDocument:(nullable NSDocument *)aDocument NS_DESIGNATED_INITIALIZER;
+- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;
@property (nonatomic, nullable, weak) NSDocument *document;
Modified: trunk/SKShareMenuController.m
===================================================================
--- trunk/SKShareMenuController.m 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKShareMenuController.m 2025-10-02 15:53:38 UTC (rev 15678)
@@ -54,6 +54,11 @@
return self;
}
+- (instancetype)init {
+ self = [self initForDocument:nil];
+ return self;
+}
+
- (instancetype)initWithCoder:(NSCoder *)coder {
self = nil;
return nil;
Modified: trunk/SKSnapshotConfiguration.h
===================================================================
--- trunk/SKSnapshotConfiguration.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKSnapshotConfiguration.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -49,7 +49,8 @@
NSArray<PDFDestination *> *pages;
}
-- (instancetype)initWithPDFView:(PDFView *)pdfView;
+- (instancetype)initWithPDFView:(PDFView *)pdfView NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
- (NSImage *)thumbnailWithSize:(CGFloat)aSize scale:(CGFloat)scale;
- (NSImage *)placeholderThumbnailWithSize:(CGFloat)aSize scale:(CGFloat)scale;
Modified: trunk/SKSyncDot.h
===================================================================
--- trunk/SKSyncDot.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKSyncDot.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -58,7 +58,8 @@
@property (nonatomic, readonly) NSRect bounds;
@property (nonatomic) BOOL shouldHideReadingBar;
-- (instancetype)initWithPoint:(NSPoint)aPoint page:(PDFPage *)aPage updateHandler:(SKSyncDotUpdateBlock)aHandler;
+- (instancetype)initWithPoint:(NSPoint)aPoint page:(PDFPage *)aPage updateHandler:(SKSyncDotUpdateBlock)aHandler NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
- (void)invalidate;
Modified: trunk/SKTemplateTag.h
===================================================================
--- trunk/SKTemplateTag.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKTemplateTag.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -73,7 +73,8 @@
NSString *keyPath;
}
-- (instancetype)initWithKeyPath:(NSString *)aKeyPath;
+- (instancetype)initWithKeyPath:(NSString *)aKeyPath NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
@property (nonatomic, readonly) NSString *keyPath;
@@ -86,7 +87,8 @@
SKAttributeTemplate *linkTemplate;
}
-- (instancetype)initWithKeyPath:(NSString *)aKeyPath attributes:(NSDictionary<NSString *, id> *)anAttributes;
+- (instancetype)initWithKeyPath:(NSString *)aKeyPath attributes:(NSDictionary<NSString *, id> *)anAttributes NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithKeyPath:(NSString *)aKeyPath NS_UNAVAILABLE;
@property (nonatomic, readonly) NSDictionary<NSString *, id> *attributes;
@property (nonatomic, nullable, readonly) SKAttributeTemplate *linkTemplate;
@@ -102,7 +104,8 @@
NSArray<__kindof SKTemplateTag *> *separatorTemplate;
}
-- (instancetype)initWithKeyPath:(NSString *)aKeyPath itemTemplateString:(NSString *)anItemTemplateString separatorTemplateString:(nullable NSString *)aSeparatorTemplateString;
+- (instancetype)initWithKeyPath:(NSString *)aKeyPath itemTemplateString:(NSString *)anItemTemplateString separatorTemplateString:(nullable NSString *)aSeparatorTemplateString NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithKeyPath:(NSString *)aKeyPath NS_UNAVAILABLE;
@property (nonatomic, nullable, readonly) NSArray<__kindof SKTemplateTag *> *itemTemplate, *separatorTemplate;
@@ -117,7 +120,8 @@
NSArray<__kindof SKTemplateTag *> *separatorTemplate;
}
-- (instancetype)initWithKeyPath:(NSString *)aKeyPath itemTemplateAttributedString:(NSAttributedString *)anItemTemplateAttributedString separatorTemplateAttributedString:(nullable NSAttributedString *)aSeparatorTemplateAttributedString;
+- (instancetype)initWithKeyPath:(NSString *)aKeyPath itemTemplateAttributedString:(NSAttributedString *)anItemTemplateAttributedString separatorTemplateAttributedString:(nullable NSAttributedString *)aSeparatorTemplateAttributedString NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithKeyPath:(NSString *)aKeyPath NS_UNAVAILABLE;
@property (nonatomic, nullable, readonly) NSArray<__kindof SKTemplateTag *> *itemTemplate, *separatorTemplate;
@@ -131,7 +135,8 @@
NSArray<NSString *> *matchStrings;
}
-- (instancetype)initWithKeyPath:(NSString *)aKeyPath matchType:(SKTemplateTagMatchType)aMatchType matchStrings:(NSArray *)aMatchStrings subtemplates:(NSArray *)aSubtemplates;
+- (instancetype)initWithKeyPath:(NSString *)aKeyPath matchType:(SKTemplateTagMatchType)aMatchType matchStrings:(NSArray *)aMatchStrings subtemplates:(NSArray *)aSubtemplates NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithKeyPath:(NSString *)aKeyPath NS_UNAVAILABLE;
@property (nonatomic, readonly) SKTemplateTagMatchType matchType;
@property (nonatomic, readonly) NSArray<NSString *> *matchStrings;
@@ -152,7 +157,8 @@
NSString *text;
}
-- (instancetype)initWithText:(NSString *)aText;
+- (instancetype)initWithText:(NSString *)aText NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
@property (nonatomic, strong) NSString *text;
@@ -167,7 +173,8 @@
NSArray<NSArray<__kindof SKTemplateTag *> *> *linkTemplates;
}
-- (instancetype)initWithAttributedText:(NSAttributedString *)anAttributedText;
+- (instancetype)initWithAttributedText:(NSAttributedString *)anAttributedText NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
@property (nonatomic, strong) NSAttributedString *attributedText;
@@ -185,7 +192,7 @@
Class attributeClass;
}
-- (instancetype)initWithTemplate:(nullable NSArray<__kindof SKTemplateTag *> *)aTemplate range:(NSRange)aRange attributeClass:(Class)aClass;
+- (instancetype)initWithTemplate:(nullable NSArray<__kindof SKTemplateTag *> *)aTemplate range:(NSRange)aRange attributeClass:(Class)aClass NS_DESIGNATED_INITIALIZER;
@property (nonatomic, nullable, readonly) NSArray<__kindof SKTemplateTag *> *template;
@property (nonatomic, readonly) NSRange range;
Modified: trunk/SKTextNoteEditor.h
===================================================================
--- trunk/SKTextNoteEditor.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKTextNoteEditor.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -50,7 +50,9 @@
NSUndoManager *undoManager;
}
-- (instancetype)initWithAnnotation:(PDFAnnotation *)anAnnotation delegate:(id<SKTextNoteEditorDelegate>)aDelegate;
+- (instancetype)initWithAnnotation:(PDFAnnotation *)anAnnotation delegate:(id<SKTextNoteEditorDelegate>)aDelegate NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithFrame:(NSRect)frameRect NS_UNAVAILABLE;
+- (instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;
@property (nonatomic, readonly) NSString *currentString;
Modified: trunk/SKThumbnail.h
===================================================================
--- trunk/SKThumbnail.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKThumbnail.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -61,7 +61,8 @@
@property (nonatomic, nullable, readonly) PDFPage *page;
@property (nonatomic, readonly, getter=isPlaceholder) BOOL placeholder;
-- (instancetype)initWithImage:(NSImage *)anImage label:(NSString *)aLabel pageIndex:(NSUInteger)anIndex;
+- (instancetype)initWithImage:(NSImage *)anImage label:(NSString *)aLabel pageIndex:(NSUInteger)anIndex NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
- (void)setNeedsUpdate;
Modified: trunk/SKThumbnailStamp.h
===================================================================
--- trunk/SKThumbnailStamp.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKThumbnailStamp.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -47,7 +47,8 @@
CGFloat fraction;
}
-- (instancetype)initWithImage:(NSImage *)anImage rect:(NSRect)aRect fraction:(CGFloat)aFraction;
+- (instancetype)initWithImage:(NSImage *)anImage rect:(NSRect)aRect fraction:(CGFloat)aFraction NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
- (void)drawForPage:(PDFPage *)pdfPage withBox:(PDFDisplayBox)box;
Modified: trunk/SKTransitionInfo.h
===================================================================
--- trunk/SKTransitionInfo.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKTransitionInfo.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -52,6 +52,7 @@
BOOL shouldRestrict;
}
+- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithTransitionInfo:(SKTransitionInfo *)info;
- (instancetype)initWithProperties:(NSDictionary *)dictionary;
Modified: trunk/SKTransitionInfo.m
===================================================================
--- trunk/SKTransitionInfo.m 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKTransitionInfo.m 2025-10-02 15:53:38 UTC (rev 15678)
@@ -118,7 +118,7 @@
}
- (instancetype)initWithTransitionInfo:(SKTransitionInfo *)info {
- self = [super init];
+ self = [self init];
if (self) {
style = [info style];
duration = [info duration];
Modified: trunk/SKTypeSelectHelper.h
===================================================================
--- trunk/SKTypeSelectHelper.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKTypeSelectHelper.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -64,7 +64,7 @@
+ (instancetype)typeSelectHelper;
+ (instancetype)typeSelectHelperWithMatchOption:(SKTypeSelectMatchOption)aMatchOption;
-- (instancetype)initWithMatchOption:(SKTypeSelectMatchOption)aMatchOption;
+- (instancetype)initWithMatchOption:(SKTypeSelectMatchOption)aMatchOption NS_DESIGNATED_INITIALIZER;
- (void)rebuildTypeSelectSearchCache;
Modified: trunk/SKVersionNumber.h
===================================================================
--- trunk/SKVersionNumber.h 2025-10-02 14:47:52 UTC (rev 15677)
+++ trunk/SKVersionNumber.h 2025-10-02 15:53:38 UTC (rev 15678)
@@ -64,7 +64,8 @@
+ (NSComparisonResult)compareVersionString:(NSString *)versionString toVersionString:(NSString *)otherVersionString;
-- (nullable instancetype)initWithVersionString:(NSString *)versionString;
+- (nullable instancetype)initWithVersionString:(NSString *)versionString NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
- (NSInteger)componentAtIndex:(NSUInteger)componentIndex;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-10-02 14:47:55
|
Revision: 15677
http://sourceforge.net/p/skim-app/code/15677
Author: hofman
Date: 2025-10-02 14:47:52 +0000 (Thu, 02 Oct 2025)
Log Message:
-----------
Use self for convenience initializers and super for designated initializers
Modified Paths:
--------------
trunk/SKAnimatedBorderlessWindow.m
trunk/SKBookmarkController.m
trunk/SKColorPicker.m
trunk/SKDownloadController.m
trunk/SKImageToolTipWindow.m
trunk/SKInfoWindowController.m
trunk/SKLineInspector.m
trunk/SKNavigationWindow.m
trunk/SKNoteWindowController.m
trunk/SKPreferenceController.m
trunk/SKPresentationOptionsSheetController.m
trunk/SKSideWindow.m
trunk/SKViewSettingsController.m
Modified: trunk/SKAnimatedBorderlessWindow.m
===================================================================
--- trunk/SKAnimatedBorderlessWindow.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKAnimatedBorderlessWindow.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -53,7 +53,7 @@
@dynamic fadeInDuration, fadeOutDuration;
- (instancetype)initWithContentRect:(NSRect)contentRect {
- self = [super initWithContentRect:contentRect styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
+ self = [self initWithContentRect:contentRect styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
if (self) {
defaultAlphaValue = ALPHA_VALUE;
autoHideTimeInterval = AUTO_HIDE_TIME_INTERVAL;
Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKBookmarkController.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -148,7 +148,7 @@
- (instancetype)init {
if (sharedBookmarkController == nil) {
- self = [super initWithWindowNibName:@"BookmarksWindow"];
+ self = [self initWithWindowNibName:@"BookmarksWindow"];
if (self) {
NSDictionary *bookmarkDictionary = [[NSUserDefaults standardUserDefaults] persistentDomainForName:SKBookmarksIdentifier];
@@ -677,7 +677,7 @@
SKBookmark *bookmark = nil;
NSInteger tag = 0;
- if (supermenu == [NSApp mainMenu]) {
+ if (supermenu == [NSApp mainMenu]) {log_method();
bookmark = [self bookmarkRoot];
tag = SKBookmarkTagBookmarksMenu;
} else if (idx >= 0) {
Modified: trunk/SKColorPicker.m
===================================================================
--- trunk/SKColorPicker.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKColorPicker.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -50,8 +50,8 @@
@synthesize delegate;
@dynamic colors;
-- (instancetype)init {
- self = [super init];
+- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
scrubber = [[NSScrubber alloc] initWithFrame:NSMakeRect(0.0, 0.0, 180, 22.0)];
[scrubber setDelegate:self];
Modified: trunk/SKDownloadController.m
===================================================================
--- trunk/SKDownloadController.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKDownloadController.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -107,7 +107,7 @@
}
- (instancetype)init {
- self = [super initWithWindowNibName:@"DownloadsWindow"];
+ self = [self initWithWindowNibName:@"DownloadsWindow"];
if (self) {
downloads = [[NSMutableArray alloc] init];
Modified: trunk/SKImageToolTipWindow.m
===================================================================
--- trunk/SKImageToolTipWindow.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKImageToolTipWindow.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -70,7 +70,7 @@
- (instancetype)init {
if (sharedToolTipWindow) NSLog(@"Attempt to allocate second instance of %@", self);
- self = [super initWithContentRect:NSZeroRect];
+ self = [self initWithContentRect:NSZeroRect];
if (self) {
[self setHidesOnDeactivate:NO];
[self setIgnoresMouseEvents:YES];
Modified: trunk/SKInfoWindowController.m
===================================================================
--- trunk/SKInfoWindowController.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKInfoWindowController.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -78,7 +78,7 @@
@synthesize summaryTableView, attributesTableView, tabView, info;
- (instancetype)init {
- self = [super initWithWindowNibName:@"InfoWindow"];
+ self = [self initWithWindowNibName:@"InfoWindow"];
if (self){
info = nil;
summaryKeys = [[NSArray alloc] initWithObjects:
Modified: trunk/SKLineInspector.m
===================================================================
--- trunk/SKLineInspector.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKLineInspector.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -82,7 +82,7 @@
- (instancetype)init {
if (sharedLineInspector) NSLog(@"Attempt to allocate second instance of %@", [self class]);
- self = [super initWithWindowNibName:@"LineInspector"];
+ self = [self initWithWindowNibName:@"LineInspector"];
if (self) {
style = kPDFBorderStyleSolid;
lineWidth = 1.0;
Modified: trunk/SKNavigationWindow.m
===================================================================
--- trunk/SKNavigationWindow.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKNavigationWindow.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -77,7 +77,7 @@
NSScreen *screen = [[presentationView window] screen] ?: [NSScreen mainScreen];
CGFloat width = 5 * BUTTON_WIDTH + 3 * SEP_WIDTH + 2 * BUTTON_MARGIN;
NSRect contentRect = NSMakeRect(NSMidX([screen frame]) - 0.5 * width, NSMinY([screen frame]) + WINDOW_OFFSET, width, BUTTON_HEIGHT + 2 * BUTTON_MARGIN);
- self = [super initWithContentRect:contentRect];
+ self = [self initWithContentRect:contentRect];
if (self) {
[self setIgnoresMouseEvents:NO];
@@ -416,7 +416,7 @@
@synthesize view;
- (instancetype)init {
- self = [super initWithContentRect:NSZeroRect styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES];
+ self = [self initWithContentRect:NSZeroRect styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:YES];
if (self) {
[self setBackgroundColor:[NSColor clearColor]];
[self setOpaque:NO];
Modified: trunk/SKNoteWindowController.m
===================================================================
--- trunk/SKNoteWindowController.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKNoteWindowController.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -148,7 +148,7 @@
}
- (instancetype)initWithNote:(PDFAnnotation *)aNote {
- self = [super initWithWindowNibName:@"NoteWindow"];
+ self = [self initWithWindowNibName:@"NoteWindow"];
if (self) {
note = aNote;
Modified: trunk/SKPreferenceController.m
===================================================================
--- trunk/SKPreferenceController.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKPreferenceController.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -72,7 +72,7 @@
@synthesize resetButton, resetAllButton;
- (instancetype)init {
- self = [super initWithWindowNibName:@"PreferenceWindow"];
+ self = [self initWithWindowNibName:@"PreferenceWindow"];
if (self) {
preferencePanes = [[NSArray alloc] initWithObjects:
[[SKGeneralPreferences alloc] init],
Modified: trunk/SKPresentationOptionsSheetController.m
===================================================================
--- trunk/SKPresentationOptionsSheetController.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKPresentationOptionsSheetController.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -102,7 +102,7 @@
}
- (instancetype)initForController:(SKMainWindowController *)aController {
- self = [super init];
+ self = [self initWithWindowNibName:@"TransitionSheet"];
if (self) {
controller = aController;
@@ -272,10 +272,6 @@
name:SKDocumentControllerDidRemoveDocumentNotification object:nil];
}
-- (NSString *)windowNibName {
- return @"TransitionSheet";
-}
-
- (void)dismissSheet:(id)sender {
[[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil];
if ([sender tag] == NSModalResponseCancel) {
Modified: trunk/SKSideWindow.m
===================================================================
--- trunk/SKSideWindow.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKSideWindow.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -73,7 +73,7 @@
}
- (instancetype)initWithView:(NSView *)view {
- self = [super initWithContentRect:NSMakeRect(0.0, 0.0, DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT) styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
+ self = [self initWithContentRect:NSMakeRect(0.0, 0.0, DEFAULT_WINDOW_WIDTH, DEFAULT_WINDOW_HEIGHT) styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
if (self) {
[self setBackgroundColor:[NSColor clearColor]];
[self setOpaque:NO];
Modified: trunk/SKViewSettingsController.m
===================================================================
--- trunk/SKViewSettingsController.m 2025-10-02 14:43:53 UTC (rev 15676)
+++ trunk/SKViewSettingsController.m 2025-10-02 14:47:52 UTC (rev 15677)
@@ -60,7 +60,7 @@
}
- (instancetype)initWithSettings:(NSDictionary *)settings defaultSettings:(NSDictionary *)aDefaultSettings {
- self = [super init];
+ self = [self initWithWindowNibName: @"ViewSettings"];
if (self) {
defaultSettings = [aDefaultSettings copy];
if (defaultSettings == nil || [settings count]) {
@@ -75,10 +75,6 @@
return self;
}
-- (NSString *)windowNibName {
- return @"ViewSettings";
-}
-
- (NSInteger)extendedDisplayMode {
NSInteger mode = [self displayMode];
if (mode == kPDFDisplaySinglePageContinuous && [self displayDirection] == 1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-10-02 14:43:55
|
Revision: 15676
http://sourceforge.net/p/skim-app/code/15676
Author: hofman
Date: 2025-10-02 14:43:53 +0000 (Thu, 02 Oct 2025)
Log Message:
-----------
encode constraints
Modified Paths:
--------------
trunk/SKStatusBar.m
Modified: trunk/SKStatusBar.m
===================================================================
--- trunk/SKStatusBar.m 2025-08-17 17:37:09 UTC (rev 15675)
+++ trunk/SKStatusBar.m 2025-10-02 14:43:53 UTC (rev 15676)
@@ -104,6 +104,7 @@
[[leftField centerYAnchor]constraintEqualToAnchor:[self centerYAnchor]],
[[self trailingAnchor]constraintEqualToAnchor:[rightField trailingAnchor] constant:RIGHT_MARGIN],
[[rightField centerYAnchor] constraintEqualToAnchor:[self centerYAnchor]]];
+ [constraints setValue:@YES forKey:@"shouldBeArchived"];
leftLeadingConstraint = [constraints objectAtIndex:0];
rightTrailingConstraint = [constraints objectAtIndex:2];
[NSLayoutConstraint activateConstraints:constraints];
@@ -122,6 +123,8 @@
rightField = [decoder decodeObjectForKey:@"rightField"];
iconView = [decoder decodeObjectForKey:@"iconView"];
progressIndicator = [decoder decodeObjectForKey:@"progressIndicator"];
+ leftLeadingConstraint = [decoder decodeObjectForKey:@"leftLeadingConstraint"];
+ rightTrailingConstraint = [decoder decodeObjectForKey:@"rightTrailingConstraint"];
animating = NO;
}
return self;
@@ -133,6 +136,8 @@
[coder encodeConditionalObject:rightField forKey:@"rightField"];
[coder encodeConditionalObject:iconView forKey:@"iconView"];
[coder encodeConditionalObject:progressIndicator forKey:@"progressIndicator"];
+ [coder encodeConditionalObject:leftLeadingConstraint forKey:@"leftLeadingConstraint"];
+ [coder encodeConditionalObject:rightTrailingConstraint forKey:@"rightTrailingConstraint"];
}
- (BOOL)isVisible {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-08-17 17:37:12
|
Revision: 15675
http://sourceforge.net/p/skim-app/code/15675
Author: hofman
Date: 2025-08-17 17:37:09 +0000 (Sun, 17 Aug 2025)
Log Message:
-----------
replace synctex parser sources from 2025.3 branch
Modified Paths:
--------------
trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser.c
trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser.h
trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser_advanced.h
trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_version.h
Modified: trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser.c
===================================================================
--- trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser.c 2025-08-17 17:13:48 UTC (rev 15674)
+++ trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser.c 2025-08-17 17:37:09 UTC (rev 15675)
@@ -214,7 +214,7 @@
* @brief tlc inspector structure
*
*/
-typedef struct synctex_tlcpector_t {
+typedef struct _synctex_tlcpector_t {
/** tag getter */
_synctex_int_getter_f tag;
/** line getter */
@@ -442,7 +442,7 @@
if (_synctex_tree_has_##WHAT(node)) {\
return __synctex_tree_##WHAT(node);\
}\
- return 0;\
+ return NULL;\
}
# define DEFINE_SYNCTEX_TREE__RESET(WHAT) \
SYNCTEX_INLINE static synctex_node_p __synctex_tree_reset_##WHAT(synctex_non_null_node_p node) {\
@@ -499,6 +499,38 @@
SYNCTEX_INLINE static synctex_node_p __synctex_tree_set_sibling(synctex_node_p node, synctex_node_p new_value)
SYNCTEX_INLINE static synctex_node_p __synctex_tree_reset_sibling(synctex_node_p node)
*/
+/** @fn __synctex_tree_sibling
+ @brief Get the sibling of the given node.
+ @param node
+ @return node
+
+ Private function.
+ Get the sibling of the given node assuming the node type declares a sibling.
+*/
+/** @fn __synctex_tree_set_sibling
+ @brief Set the sibling of the given node.
+ @param node
+ @param sibling
+ @return old sibling if any
+
+ Private function.
+ Set the sibling of the given node assuming the node type declares a sibling.
+ When the sibling is not `NULL`, it is owned by the node.
+ When the old sibling is not `NULL`, it is no longer owned by the node
+ and must be released somehow.
+*/
+/** @fn __synctex_tree_reset_sibling
+ @brief Reset the sibling of the given node.
+ @param node
+ @return sibling
+
+ Private function.
+ Set the sibling of the given node to NULL assuming the node type
+ declares a sibling.
+ Returns the old sibling.
+ When the old sibling is not `NULL`, it is no longer owned by the node
+ and must be released somehow.
+*/
DEFINE_SYNCTEX_TREE__GETSETRESET(sibling)
/* The next macro call creates:
SYNCTEX_INLINE static synctex_bool_t _synctex_tree_has_parent(synctex_node_p node);
@@ -509,8 +541,206 @@
SYNCTEX_INLINE static synctex_node_p __synctex_tree_reset_parent(synctex_node_p node);
SYNCTEX_INLINE static synctex_node_p _synctex_tree_reset_parent(synctex_node_p node);
*/
+/** @fn __synctex_tree_has_parent
+ @brief Whether a node possibly has a parent.
+ @param node
+ @return boolean
+
+ Private function.
+ Whether the type of the given node declares a parent.
+*/
+/** @fn __synctex_tree_parent
+ @brief Get the parent of the given node.
+ @param node
+ @return parent
+
+ Private function.
+ Get the parent of the given node assuming the node type declares a parent.
+*/
+/** @fn _synctex_tree_parent
+ @brief Get the parent of the given node.
+ @param node
+ @return parent or NULL
+
+ Private function.
+ Get the parent of the given node.
+ If the node type does not declare a parent, then `NULL` is returned.
+*/
+/** @fn __synctex_tree_set_parent
+ @brief Set the parent of the given node.
+ @param node
+ @param parent
+ @return node
+
+ Private function.
+ Set the parent of the given node assuming the node type declares a parent.
+ The node is not yet the child of the parent:
+ `__synctex_tree_set_child` must also be called.
+ When the parent is not `NULL`, it is the owner of the node.
+*/
+/** @fn _synctex_tree_set_parent
+ @brief Set the parent of the given node.
+ @param node
+ @param parent
+ @return node
+
+ Private function.
+ If the the node type declares a parent, set it to the given node.
+ In that case, set the parent of the given node.
+ When the parent is not `NULL`, it becomes the owner of the node.
+ The node is not yet the child of the parent:
+ `__synctex_tree_set_child` must also be called.
+ The old child must be managed as well, if any.
+ If the the node type does not declare a parent,
+ nothing is done.
+*/
+/** @fn __synctex_tree_reset_parent
+ @brief Reset the parent of the given node.
+ @param node
+ @return old parent
+
+ Private function.
+ Synonym of `__synctex_tree_set_parent` to `NULL`.
+*/
+/** @fn _synctex_tree_reset_parent
+ @brief Reset the parent of the given node.
+ @param node
+ @return old parent
+
+ Private function.
+ Synonym of `_synctex_tree_set_parent` to `NULL`.
+*/
DEFINE_SYNCTEX_TREE_GETSETRESET(parent)
+/** @fn __synctex_tree_has_child
+ @brief Whether a node possibly has a child.
+ @param node
+ @return boolean
+
+ Private function.
+ Whether the type of the given node declares a child.
+*/
+/** @fn __synctex_tree_child
+ @brief Get the child of the given node.
+ @param node
+ @return child
+
+ Private function.
+ Get the child of the given node assuming the node type declares a child.
+*/
+/** @fn _synctex_tree_child
+ @brief Get the child of the given node.
+ @param node
+ @return child or NULL
+
+ Private function.
+ Get the child of the given node.
+ If the node type does not declare a child, then `NULL` is returned.
+*/
+/** @fn __synctex_tree_set_child
+ @brief Set the child of the given node.
+ @param node
+ @param child
+ @return old child
+
+ Private function.
+ Set the child of the given node assuming the node type declares a child.
+ The node is not yet the parent of the child:
+ `__synctex_tree_set_parent` must also be called.
+ When the child is not `NULL`, it is owned by the node.
+*/
+/** @fn _synctex_tree_set_child
+ @brief Set the child of the given node.
+ @param node
+ @param child
+ @return old child
+
+ Private function.
+ If the the node type declares a child, set it to the given node.
+ When the child is not `NULL`, it becomes owned by the node.
+ The node is not yet the parent of the child:
+ `__synctex_tree_set_parent` must also be called.
+ The old child must be managed as well, if any.
+ If the the node type does not declare a child,
+ nothing is done.
+*/
+/** @fn __synctex_tree_reset_child
+ @brief Reset the child of the given node.
+ @param node
+ @return old child
+
+ Private function.
+ Synonym of `__synctex_tree_set_child` to `NULL`.
+*/
+/** @fn _synctex_tree_reset_child
+ @brief Reset the child of the given node.
+ @param node
+ @return old child
+
+ Private function.
+ Synonym of `_synctex_tree_set_child` to `NULL`.
+*/
DEFINE_SYNCTEX_TREE_GETSETRESET(child)
+/** @fn __synctex_tree_has_friend
+ @brief Whether a node possibly has a friend.
+ @param node
+ @return boolean
+
+ Private function.
+ Whether the type of the given node declares a friend.
+*/
+/** @fn __synctex_tree_friend
+ @brief Get the friend of the given node.
+ @param node
+ @return friend
+
+ Private function.
+ Get the friend of the given node assuming the node type declares a friend.
+*/
+/** @fn _synctex_tree_friend
+ @brief Get the friend of the given node.
+ @param node
+ @return friend
+
+ Private function.
+ Get the friend of the given node.
+ If the node type does not declare a friend, then `NULL` is returned.
+*/
+/** @fn __synctex_tree_set_friend
+ @brief Set the friend of the given node.
+ @param node
+ @param friend
+ @return old friend
+
+ Private function.
+ Set the friend of the given node assuming the node type declares a friend.
+*/
+/** @fn _synctex_tree_set_friend
+ @brief Set the friend of the given node.
+ @param node
+ @param friend
+ @return old friend
+
+ Private function.
+ If the the node type declares a friend, set it to the given node.
+ If the the node type does not declare a friend,
+ nothing is done.
+*/
+/** @fn __synctex_tree_reset_friend
+ @brief Reset the friend of the given node.
+ @param node
+ @return old friend
+
+ Private function.
+ Synonym of `__synctex_tree_set_friend` to `NULL`.
+*/
+/** @fn _synctex_tree_reset_friend
+ @brief Reset the friend of the given node.
+ @param node
+ @return old friend
+
+ Private function.
+ Synonym of `_synctex_tree_set_friend` to `NULL`.
+*/
DEFINE_SYNCTEX_TREE_GETSETRESET(friend)
/* The next macro call creates:
SYNCTEX_INLINE static synctex_bool_t _synctex_tree_has_last(synctex_node_p node);
@@ -520,10 +750,190 @@
SYNCTEX_INLINE static synctex_node_p _synctex_tree_set_last(synctex_node_p node, synctex_node_p new_value);
*/
DEFINE_SYNCTEX_TREE_GETSET(last)
+/** @fn __synctex_tree_has_last
+ @brief Whether a node possibly has a last.
+ @param node
+ @return boolean
+
+ Private function.
+ Whether the type of the given node declares a last.
+*/
+/** @fn __synctex_tree_last
+ @brief Get the last of the given node.
+ @param node
+ @return last node
+
+ Private function.
+ Get the last node of the given node assuming the node type declares a last node.
+*/
+/** @fn _synctex_tree_last
+ @brief Get the last of the given node.
+ @param node
+ @return last node or NULL
+
+ Private function.
+ Get the last node of the given node.
+ If the node type does not declare a last node, then `NULL` is returned.
+*/
+/** @fn __synctex_tree_set_last
+ @brief Set the last of the given node.
+ @param node
+ @param last
+ @return old last
+
+ Private function.
+ Set the last of the given node assuming the node type declares a last node.
+*/
+/** @fn _synctex_tree_set_last
+ @brief Set the last of the given node.
+ @param node
+ @param last
+ @return old last
+
+ Private function.
+ If the the node type declares a last node, set it to the given node.
+ If the the node type does not declare a last node,
+ nothing is done.
+*/
DEFINE_SYNCTEX_TREE_GETSET(next_hbox)
+/** @fn __synctex_tree_has_next_hbox
+ @brief Whether a node possibly has a next_hbox.
+ @param node
+ @return boolean
+
+ Private function.
+ Whether the type of the given node declares a next_hbox.
+*/
+/** @fn __synctex_tree_next_hbox
+ @brief Get the next_hbox of the given node.
+ @param node
+ @return next_hbox node
+
+ Private function.
+ Get the next_hbox node of the given node assuming the node type declares a next_hbox node.
+*/
+/** @fn _synctex_tree_next_hbox
+ @brief Get the next_hbox of the given node.
+ @param node
+ @return next_hbox node or NULL
+
+ Private function.
+ Get the next_hbox node of the given node.
+ If the node type does not declare a next_hbox node, then `NULL` is returned.
+*/
+/** @fn __synctex_tree_set_next_hbox
+ @brief Set the next_hbox of the given node.
+ @param node
+ @param next_hbox
+ @return old next_hbox
+
+ Private function.
+ Set the next_hbox of the given node assuming the node type declares a next_hbox node.
+*/
+/** @fn _synctex_tree_set_next_hbox
+ @brief Set the next_hbox of the given node.
+ @param node
+ @param next_hbox
+ @return old next_hbox
+
+ Private function.
+ If the the node type declares a next_hbox node, set it to the given node.
+ If the the node type does not declare a next_hbox node,
+ nothing is done.
+*/
DEFINE_SYNCTEX_TREE_GETSET(arg_sibling)
+/** @fn __synctex_tree_has_arg_sibling
+ @brief Whether a node possibly has a arg_sibling.
+ @param node
+ @return boolean
+
+ Private function.
+ Whether the type of the given node declares a arg_sibling.
+*/
+/** @fn __synctex_tree_arg_sibling
+ @brief Get the arg_sibling of the given node.
+ @param node
+ @return arg_sibling node
+
+ Private function.
+ Get the arg_sibling node of the given node assuming the node type declares a arg_sibling node.
+*/
+/** @fn _synctex_tree_arg_sibling
+ @brief Get the arg_sibling of the given node.
+ @param node
+ @return arg_sibling node or NULL
+
+ Private function.
+ Get the arg_sibling node of the given node.
+ If the node type does not declare a arg_sibling node, then `NULL` is returned.
+*/
+/** @fn __synctex_tree_set_arg_sibling
+ @brief Set the arg_sibling of the given node.
+ @param node
+ @param arg_sibling
+ @return old arg_sibling
+
+ Private function.
+ Set the arg_sibling of the given node assuming the node type declares a arg_sibling node.
+*/
+/** @fn _synctex_tree_set_arg_sibling
+ @brief Set the arg_sibling of the given node.
+ @param node
+ @param arg_sibling
+ @return old arg_sibling
+
+ Private function.
+ If the the node type declares a arg_sibling node, set it to the given node.
+ If the the node type does not declare a arg_sibling node,
+ nothing is done.
+*/
DEFINE_SYNCTEX_TREE_GETSETRESET(target)
+/** @fn __synctex_tree_has_target
+ @brief Whether a node possibly has a target.
+ @param node
+ @return boolean
+ Private function.
+ Whether the type of the given node declares a target.
+*/
+/** @fn __synctex_tree_target
+ @brief Get the target of the given node.
+ @param node
+ @return target node
+
+ Private function.
+ Get the target node of the given node assuming the node type declares a target node.
+*/
+/** @fn _synctex_tree_target
+ @brief Get the target of the given node.
+ @param node
+ @return target node or NULL
+
+ Private function.
+ Get the target node of the given node.
+ If the node type does not declare a target node, then `NULL` is returned.
+*/
+/** @fn __synctex_tree_set_target
+ @brief Set the target of the given node.
+ @param node
+ @param target
+ @return old target
+
+ Private function.
+ Set the target of the given node assuming the node type declares a target node.
+*/
+/** @fn _synctex_tree_set_target
+ @brief Set the target of the given node.
+ @param node
+ @param target
+ @return old target
+
+ Private function.
+ If the the node type declares a target node, set it to the given node.
+ If the the node type does not declare a target node,
+ nothing is done.
+*/
+
#if SYNCTEX_DEBUG > 1000
# undef SYNCTEX_USE_NODE_COUNT
# define SYNCTEX_USE_NODE_COUNT 1
@@ -904,7 +1314,7 @@
struct {
/** Whether the scanner has parsed its underlying synctex file. */
unsigned has_parsed:1;
- /* Whether the scanner has parsed its underlying synctex file. */
+ /* Whether the scanner has parsed the postamble. */
unsigned postamble:1;
/* alignment */
unsigned reserved:sizeof(unsigned)-2;
@@ -1007,26 +1417,68 @@
/**
* Free the given node.
- * - parameter node: of type synctex_node_p
+ * @param node of type synctex_node_p
+ *
* - note: a node is meant to own its child and sibling.
* It is not owned by its parent, unless it is its first child.
* This destructor is for all nodes with children.
*
- * Recursion only occurs from parent to children, which means
- * that there is a maximum depth determined by the calling stack size.
- * This is not managed.
+ * There is no recursion.
+ * TODO: Here we cherry pick nodes to be freed one by one.
+ * The memory management should be enhanced to free everything all at once,
+ * for example when we free a whole scanner.
*/
static void _synctex_free_node(synctex_node_p node) {
- while (node) {
- synctex_node_p sibling = __synctex_tree_sibling(node);
- SYNCTEX_SCANNER_REMOVE_HANDLE_TO(node);
- SYNCTEX_WILL_FREE(node);
- _synctex_node_free(_synctex_tree_child(node));
- _synctex_free(node);
- node = sibling;
+ if (node) {
+ synctex_node_p sibling;
+ synctex_node_p child;
+ synctex_node_p parent = _synctex_tree_parent(node);
+ synctex_node_p top_parent = parent;
+ /* deep first traversal */
+find_deepest:
+ if ((child = _synctex_tree_child(node))) {
+ parent = node;
+ node = child;
+ goto find_deepest;
+ }
+ /* node is the deepest one */
+deepest_found:
+ if ((sibling = __synctex_tree_reset_sibling(node))) {
+ /* the sibling is detached */
+ if (parent) {
+ __synctex_tree_reset_parent(node);
+ /* The sibling is assumed to possibly have a parent*/
+ __synctex_tree_set_child(parent, sibling);
+ __synctex_tree_set_parent(sibling, parent);
+ }
+ SYNCTEX_SCANNER_REMOVE_HANDLE_TO(node);
+ SYNCTEX_WILL_FREE(node);
+ _synctex_free(node);
+ node = sibling;
+ goto find_deepest;
+ } else {
+ if (parent) {
+ __synctex_tree_reset_parent(node);
+ __synctex_tree_reset_child(parent);
+ SYNCTEX_SCANNER_REMOVE_HANDLE_TO(node);
+ SYNCTEX_WILL_FREE(node);
+ _synctex_free(node);
+ /* The parent is now the deepest node */
+ if (parent != top_parent) {
+ node = parent;
+ parent = _synctex_tree_parent(node);
+ goto deepest_found;
+ }
+ } else {
+ SYNCTEX_SCANNER_REMOVE_HANDLE_TO(node);
+ SYNCTEX_WILL_FREE(node);
+ _synctex_free(node);
+ /* The parent is now the deepest node */
+ }
+ }
}
- return;
}
+
#if 0
static void _synctex_free_node(synctex_node_p node) {
synctex_node_p sibling;
@@ -1135,6 +1587,7 @@
int integer;
synctex_status_t status;
} _synctex_is_s;
+/** @endcond */
static _synctex_is_s _synctex_decode_int(synctex_scanner_p scanner);
static _synctex_is_s _synctex_decode_int_opt(synctex_scanner_p scanner, int default_value);
@@ -1533,6 +1986,13 @@
-1, /* page */
synctex_data_t_form_max
};
+
+static const _synctex_tlcpector_s synctex_tlcpector_form = {
+ &_synctex_data_tag, /* tag */
+ &_synctex_int_none, /* line */
+ &_synctex_int_none, /* column */
+};;
+
static _synctex_class_s _synctex_class_form = {
NULL, /* No scanner yet */
synctex_node_type_form, /* Node type */
@@ -1543,7 +2003,7 @@
&_synctex_abstract_form, /* abstract */
&synctex_tree_model_form, /* tree model */
&synctex_data_model_form, /* data model */
- &synctex_tlcpector_none, /* tlcpector */
+ &synctex_tlcpector_form, /* tnspector */
&synctex_inspector_none, /* inspector */
&synctex_vispector_none, /* vispector */
};
@@ -3004,7 +3464,7 @@
/**
* The next nodes corresponds to a deep first tree traversal.
* Does not create child proxies as side effect contrary to
- * the synctex_node_next method above.
+ * the synctex_node_next method below.
* May loop infinitely many times if the tree
* is not properly built (contains loops).
*/
@@ -4887,29 +5347,6 @@
# endif
-/* Here are the control characters that strat each line of the synctex output file.
- * Their values define the meaning of the line.
- */
-# define SYNCTEX_CHAR_BEGIN_SHEET '{'
-# define SYNCTEX_CHAR_END_SHEET '}'
-# define SYNCTEX_CHAR_BEGIN_FORM '<'
-# define SYNCTEX_CHAR_END_FORM '>'
-# define SYNCTEX_CHAR_BEGIN_VBOX '['
-# define SYNCTEX_CHAR_END_VBOX ']'
-# define SYNCTEX_CHAR_BEGIN_HBOX '('
-# define SYNCTEX_CHAR_END_HBOX ')'
-# define SYNCTEX_CHAR_ANCHOR '!'
-# define SYNCTEX_CHAR_VOID_VBOX 'v'
-# define SYNCTEX_CHAR_VOID_HBOX 'h'
-# define SYNCTEX_CHAR_KERN 'k'
-# define SYNCTEX_CHAR_GLUE 'g'
-# define SYNCTEX_CHAR_RULE 'r'
-# define SYNCTEX_CHAR_MATH '$'
-# define SYNCTEX_CHAR_FORM_REF 'f'
-# define SYNCTEX_CHAR_BOUNDARY 'x'
-# define SYNCTEX_CHAR_CHARACTER 'c'
-# define SYNCTEX_CHAR_COMMENT '%'
-
# ifdef SYNCTEX_NOTHING
# pragma mark -
# pragma mark SCANNERS & PARSERS
@@ -4954,12 +5391,14 @@
static _synctex_ns_s _synctex_parse_new_form(synctex_scanner_p scanner) {
synctex_node_p node;
if ((node = _synctex_new_form(scanner))) {
- if (
- SYNCTEX_DECODE_FAILED(node,tag)) {
- _synctex_error("Bad sheet record.");
+ if ((_synctex_data_decode_tag(node)<SYNCTEX_STATUS_OK)) {
+// if (SYNCTEX_DECODE_FAILED(node,tag)) {
+ _synctex_error("Bad form record.");
} else if (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {
_synctex_error("Missing end of form.");
} else {
+printf("FORM TAG: %i\n", synctex_node_tag(node));
+printf("FORM TAG: %i\n", _synctex_data_tag(node));
/* Now set the owner */
if (scanner->form) {
synctex_node_p last_form = scanner->form;
@@ -9197,3 +9636,193 @@
return TC;
}
#endif
+
+static void _synctex_node_dump(
+ synctex_node_p node,
+ synctex_printer_f printer,
+ int * depth);
+
+static const char * prefix = ".....................";
+int synctex_scanner_dump(synctex_scanner_p scanner, synctex_printer_f printer) {
+ (*printer)("BEGIN DUMP\n");
+ (*printer)("Ouput:%s\n", synctex_scanner_get_output(scanner));
+ (*printer)(".synctex:%s\n", synctex_scanner_get_synctex(scanner));
+ synctex_node_p N = synctex_scanner_input(scanner);
+ if (N) {
+ int NN = synctex_node_tag(N);
+ for (int i = 0; i<NN; ) {
+ ++i;
+ N = synctex_scanner_input(scanner);
+ do {
+ if(synctex_node_tag(N) == i) {
+ (*printer)("Input:%i:%s\n", i, synctex_node_get_name(N));
+ break;
+ }
+ } while ((N = synctex_node_sibling(N)));
+ }
+ }
+ (*printer)("magnification:%f\n", synctex_scanner_magnification(scanner));
+ (*printer)("x_offset:%i\n", synctex_scanner_x_offset(scanner));
+ (*printer)("y_offset:%i\n", synctex_scanner_y_offset(scanner));
+ synctex_node_p sheet = synctex_sheet(scanner, 0);
+ int depth = 0;
+ while (sheet) {
+ (*printer)("%csheet:%i\n", SYNCTEX_CHAR_BEGIN_SHEET, _synctex_data_page(sheet));
+ _synctex_node_dump(synctex_node_child(sheet), printer, &depth);
+ (*printer)("%csheet:%i\n", SYNCTEX_CHAR_END_SHEET, _synctex_data_page(sheet));
+ sheet = __synctex_tree_sibling(sheet);
+ }
+ synctex_node_p form = synctex_form(scanner, 0);
+ depth = 0;
+ while (form) {
+ (*printer)("%cform:%i\n", SYNCTEX_CHAR_BEGIN_FORM, synctex_node_tag(form));
+ _synctex_node_dump(synctex_node_child(form), printer, &depth);
+ (*printer)("%cform:%i\n", SYNCTEX_CHAR_END_FORM, synctex_node_tag(form));
+ form = __synctex_tree_sibling(form);
+ }
+ (*printer)("END DUMP\n");
+ return 0;
+}
+
+static void _synctex_node_dump(
+ synctex_node_p node,
+ synctex_printer_f printer,
+ int * depth
+) {
+ synctex_node_p N;
+ switch(synctex_node_type(node)) {
+ case synctex_node_type_vbox:
+ (*printer)(
+ "%s%c%s:%i:%i:%i:%i:%i\n",
+ prefix+20-*depth,
+ SYNCTEX_CHAR_BEGIN_VBOX,
+#define SYNCTEX_TMP_ITLHV \
+ synctex_node_isa(node),\
+ synctex_node_tag(node),\
+ synctex_node_line(node),\
+ synctex_node_h(node),\
+ synctex_node_v(node)
+#define SYNCTEX_TMP_ITLHVWHD \
+ SYNCTEX_TMP_ITLHV,\
+ synctex_node_width(node),\
+ synctex_node_height(node),\
+ synctex_node_depth(node)
+ SYNCTEX_TMP_ITLHVWHD
+ );
+ //
+ *depth = (*depth+1)%20;
+ if ((N = synctex_node_child(node))) {
+ do {
+ _synctex_node_dump(N, printer, depth);
+ } while((N = synctex_node_sibling(N)));
+ }
+ *depth = (*depth+19)%20;
+ (*printer)("%s%c\n", prefix+20-*depth, SYNCTEX_CHAR_END_VBOX);
+ break;
+ case synctex_node_type_hbox:
+ (*printer)(
+ "%s%c%s:%i:%i:%i:%i:%i:%i:%i\n",
+ prefix+20-*depth,
+ SYNCTEX_CHAR_BEGIN_HBOX,
+ SYNCTEX_TMP_ITLHVWHD
+ );
+ *depth = (*depth+1)%20;
+ if ((N = synctex_node_child(node))) {
+ do {
+ _synctex_node_dump(N, printer, depth);
+ } while((N = synctex_node_sibling(N)));
+ }
+ *depth = (*depth+19)%20;
+ (*printer)("%s%c\n", prefix+20-*depth, SYNCTEX_CHAR_END_HBOX);
+ break;
+ case synctex_node_type_void_vbox:
+ (*printer)(
+ "%s%c:%s:%i:%i:%i:%i:%i:%i:%i\n",
+ prefix+20-*depth,
+ SYNCTEX_CHAR_VOID_VBOX,
+ SYNCTEX_TMP_ITLHVWHD
+ );
+ break;
+ case synctex_node_type_void_hbox:
+ (*printer)(
+ "%s%c:%s:%i:%i:%i:%i:%i\n",
+ prefix+20-*depth,
+ SYNCTEX_CHAR_VOID_HBOX,
+ SYNCTEX_TMP_ITLHVWHD
+ );
+ break;
+ case synctex_node_type_kern:
+ (*printer)(
+ "%s%c:%s:%i:%i:%i:%i:%i:%i\n",
+ prefix+20-*depth,
+ SYNCTEX_CHAR_KERN,
+ SYNCTEX_TMP_ITLHV,
+ synctex_node_width(node)
+ );
+ break;
+ case synctex_node_type_glue:
+ (*printer)(
+ "%s%c:%s:%i:%i:%i:%i:%i:%i\n",
+ prefix+20-*depth,
+ SYNCTEX_CHAR_GLUE,
+ SYNCTEX_TMP_ITLHV,
+ synctex_node_width(node)
+ );
+ break;
+ case synctex_node_type_rule:
+ (*printer)(
+ "%s%c:%s:%i:%i:%i:%i:%i:%i\n",
+ prefix+20-*depth,
+ SYNCTEX_CHAR_RULE,
+ SYNCTEX_TMP_ITLHV,
+ synctex_node_width(node)
+ );
+ break;
+ case synctex_node_type_math:
+ (*printer)(
+ "%s%c:%s:%i:%i:%i:%i:%i:%i\n",
+ prefix+20-*depth,
+ SYNCTEX_CHAR_MATH,
+ SYNCTEX_TMP_ITLHV,
+ synctex_node_width(node)
+ );
+ break;
+ case synctex_node_type_boundary:
+ (*printer)(
+ "%s%c:%s:%i:%i:%i:%i:%i:%i\n",
+ prefix+20-*depth,
+ SYNCTEX_CHAR_BOUNDARY,
+ SYNCTEX_TMP_ITLHV,
+ synctex_node_width(node)
+ );
+ break;
+ case synctex_node_type_box_bdry:
+ (*printer)(
+ "%sb:%s:%i:%i:%i:%i:%i\n",
+ prefix+20-*depth,
+ SYNCTEX_TMP_ITLHV
+ );
+ break;
+#if 0
+ case synctex_node_type_input:
+ case synctex_node_type_sheet:
+ case synctex_node_type_form:
+ case synctex_node_type_ref:
+ case synctex_node_type_box_bdry:
+ case synctex_node_type_proxy:
+ case synctex_node_type_proxy_last:
+ case synctex_node_type_proxy_vbox:
+ case synctex_node_type_proxy_hbox:
+ case synctex_node_type_handle:
+#endif
+ default:
+ (*printer)(
+ "%sDump unexpected node %s:%i%i\n",
+ prefix+20-*depth,
+ synctex_node_isa(node),
+ synctex_node_tag(node),
+ synctex_node_line(node)
+ );
+ break;
+ }
+}
Modified: trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser.h
===================================================================
--- trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser.h 2025-08-17 17:13:48 UTC (rev 15674)
+++ trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser.h 2025-08-17 17:37:09 UTC (rev 15675)
@@ -47,8 +47,8 @@
I would appreciate to be listed as contributor and see "__SyncTeX__" highlighted.
*/
-#ifndef __SYNCTEX_PARSER__
-# define __SYNCTEX_PARSER__
+#ifndef _SYNCTEX_PARSER_H_
+# define _SYNCTEX_PARSER_H_
#include "synctex_version.h"
@@ -120,11 +120,6 @@
synctex_scanner_p synctex_scanner_new_with_output_file(const char * output, const char * build_directory, int parse);
/**
- * - argument scanner: a scanner.
- * - returns: an integer used for testing purposes.
- */
-
- /**
* @brief Scanner destructor
*
* Designated method to delete a synctex scanner object,
@@ -415,6 +410,7 @@
const char * synctex_scanner_get_name(synctex_scanner_p scanner,int tag);
int synctex_scanner_get_tag(synctex_scanner_p scanner,const char * name);
+ /** @} */
/** @defgroup Tree Node tree
*
@@ -525,6 +521,16 @@
*/
float synctex_scanner_magnification(synctex_scanner_p scanner);
+ typedef int (synctex_printer_f) (const char *, ...);
+
+ /**
+ * @brief Dump the scanner
+ *
+ * @param scanner
+ * @param printer
+ * @return int
+ */
+ int synctex_scanner_dump(synctex_scanner_p scanner, synctex_printer_f printer);
/** @} */
/** @addtogroup Tree
Modified: trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser_advanced.h
===================================================================
--- trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser_advanced.h 2025-08-17 17:13:48 UTC (rev 15674)
+++ trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_parser_advanced.h 2025-08-17 17:37:09 UTC (rev 15675)
@@ -47,11 +47,37 @@
* @copyright Copyright (c) 2024
*
*/
+
+/* Here are the control characters that strat each line of the synctex output file.
+ * Their values define the meaning of the line.
+ */
+# define SYNCTEX_CHAR_BEGIN_SHEET '{'
+# define SYNCTEX_CHAR_END_SHEET '}'
+# define SYNCTEX_CHAR_BEGIN_FORM '<'
+# define SYNCTEX_CHAR_END_FORM '>'
+# define SYNCTEX_CHAR_BEGIN_VBOX '['
+# define SYNCTEX_CHAR_END_VBOX ']'
+# define SYNCTEX_CHAR_BEGIN_HBOX '('
+# define SYNCTEX_CHAR_END_HBOX ')'
+# define SYNCTEX_CHAR_ANCHOR '!'
+# define SYNCTEX_CHAR_VOID_VBOX 'v'
+# define SYNCTEX_CHAR_VOID_HBOX 'h'
+# define SYNCTEX_CHAR_KERN 'k'
+# define SYNCTEX_CHAR_GLUE 'g'
+# define SYNCTEX_CHAR_RULE 'r'
+# define SYNCTEX_CHAR_MATH '$'
+# define SYNCTEX_CHAR_FORM_REF 'f'
+# define SYNCTEX_CHAR_BOUNDARY 'x'
+# define SYNCTEX_CHAR_CHARACTER 'c'
+# define SYNCTEX_CHAR_COMMENT '%'
+
+# if !defined(_SYNCTEX_ONLY_CHAR_DEFINITION_)
+
#include "synctex_parser.h"
#include "synctex_parser_utils.h"
-#ifndef __SYNCTEX_PARSER_PRIVATE__
-# define __SYNCTEX_PARSER_PRIVATE__
+#ifndef _SYNCTEX_PARSER_ADVANCED_H_
+# define _SYNCTEX_PARSER_ADVANCED_H_
#ifdef __cplusplus
extern "C" {
@@ -421,7 +447,7 @@
/** line starting with `f` */
synctex_node_type_ref,
/** line starting with `[` */
- synctex_node_type_vbox,
+ synctex_node_type_vbox,/*5*/
/** line starting with `v` */
synctex_node_type_void_vbox,
/** line starting with `(` */
@@ -431,7 +457,7 @@
/** line starting with `k` */
synctex_node_type_kern,
/** line starting with `g` */
- synctex_node_type_glue,
+ synctex_node_type_glue,/*10*/
/** line starting with `r` */
synctex_node_type_rule,
/** line starting with `$` */
@@ -441,7 +467,7 @@
/** Undocumented */
synctex_node_type_box_bdry,
/** Undocumented */
- synctex_node_type_proxy,
+ synctex_node_type_proxy,/*15*/
/** Undocumented */
synctex_node_type_proxy_last,
/** Undocumented */
@@ -509,6 +535,12 @@
* @{
*/
+/** @defgroup Iterator Managing the answer to queries.
+ *
+ * Answers to edit and view queries are special structure.
+ * @{
+ */
+
/**
* @brief Scanner display switcher getter
*
@@ -769,3 +801,5 @@
#endif
#endif
+
+#endif
Modified: trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_version.h
===================================================================
--- trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_version.h 2025-08-17 17:13:48 UTC (rev 15674)
+++ trunk/vendorsrc/jeromelaurens/synctex-parser/synctex_version.h 2025-08-17 17:37:09 UTC (rev 15675)
@@ -46,8 +46,8 @@
I would appreciate to be listed as contributor and see "__SyncTeX__" highlighted.
*/
-#ifndef __SYNCTEX_VERSION_H__
-# define __SYNCTEX_VERSION_H__
+#ifndef _SYNCTEX_VERSION_H_
+# define _SYNCTEX_VERSION_H_
/* The version of .synctex files contents. */
# define SYNCTEX_VERSION 1
@@ -56,15 +56,20 @@
/* The version of the synctex parser library */
# define SYNCTEX_VERSION_MAJOR 1
+# define SYNCTEX_VERSION_MINOR 30
/* Keep next value in synch with `synctex_parser_version.txt` contents. */
# define SYNCTEX_VERSION_STRING "1.30"
/* The version of the synctex CLI tool */
+# define SYNCTEX_CLI_VERSION_MAJOR 1
+# define SYNCTEX_CLI_VERSION_MINOR 7
# define SYNCTEX_CLI_VERSION_STRING "1.7"
/* The version of the synctex support,
* how synctex is embedded in various TeX engines. */
+# define SYNCTEX_SUPPORT_VERSION_MAJOR 1
+# define SYNCTEX_SUPPORT_VERSION_MINOR 0
# define SYNCTEX_SUPPORT_VERSION_STRING "1.0"
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-08-17 17:13:52
|
Revision: 15674
http://sourceforge.net/p/skim-app/code/15674
Author: hofman
Date: 2025-08-17 17:13:48 +0000 (Sun, 17 Aug 2025)
Log Message:
-----------
revert commit that hiked along
Modified Paths:
--------------
trunk/SKColorPicker.m
Modified: trunk/SKColorPicker.m
===================================================================
--- trunk/SKColorPicker.m 2025-08-17 17:12:35 UTC (rev 15673)
+++ trunk/SKColorPicker.m 2025-08-17 17:13:48 UTC (rev 15674)
@@ -100,7 +100,7 @@
NSScrubberItemView *itemView = [aScrubber makeItemWithIdentifier:COLOR_IDENTIFIER owner:nil];
NSImageView *imageView = [[itemView subviews] firstObject];
if (imageView == nil || [imageView isKindOfClass:[NSImageView class]] == NO || [[imageView cell] isKindOfClass:[SKColorCell class]] == NO) {
- imageView = [[SKColorView alloc] initWithFrame:[itemView bounds]];
+ imageView = [[NSImageView alloc] initWithFrame:[itemView bounds]];
SKColorCell *colorCell = [[SKColorCell alloc] init];
[colorCell setShouldFill:YES];
[imageView setCell:colorCell];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-08-17 17:12:38
|
Revision: 15673
http://sourceforge.net/p/skim-app/code/15673
Author: hofman
Date: 2025-08-17 17:12:35 +0000 (Sun, 17 Aug 2025)
Log Message:
-----------
replace HIDRemote sources with newest version
Modified Paths:
--------------
trunk/SKColorPicker.m
trunk/vendorsrc/iospirit/HIDRemote/HIDRemote.h
trunk/vendorsrc/iospirit/HIDRemote/HIDRemote.m
Modified: trunk/SKColorPicker.m
===================================================================
--- trunk/SKColorPicker.m 2025-08-17 16:38:37 UTC (rev 15672)
+++ trunk/SKColorPicker.m 2025-08-17 17:12:35 UTC (rev 15673)
@@ -100,7 +100,7 @@
NSScrubberItemView *itemView = [aScrubber makeItemWithIdentifier:COLOR_IDENTIFIER owner:nil];
NSImageView *imageView = [[itemView subviews] firstObject];
if (imageView == nil || [imageView isKindOfClass:[NSImageView class]] == NO || [[imageView cell] isKindOfClass:[SKColorCell class]] == NO) {
- imageView = [[NSImageView alloc] initWithFrame:[itemView bounds]];
+ imageView = [[SKColorView alloc] initWithFrame:[itemView bounds]];
SKColorCell *colorCell = [[SKColorCell alloc] init];
[colorCell setShouldFill:YES];
[imageView setCell:colorCell];
Modified: trunk/vendorsrc/iospirit/HIDRemote/HIDRemote.h
===================================================================
--- trunk/vendorsrc/iospirit/HIDRemote/HIDRemote.h 2025-08-17 16:38:37 UTC (rev 15672)
+++ trunk/vendorsrc/iospirit/HIDRemote/HIDRemote.h 2025-08-17 17:12:35 UTC (rev 15673)
@@ -1,9 +1,9 @@
//
-// HIDRemote.h
-// HIDRemote V1.2
+// HIDRemote.m
+// HIDRemote V1.7 (5th September 2018)
//
// Created by Felix Schwarz on 06.04.07.
-// Copyright 2007-2011 IOSPIRIT GmbH. All rights reserved.
+// Copyright 2007-2018 IOSPIRIT GmbH. All rights reserved.
//
// The latest version of this class is available at
// http://www.iospirit.com/developers/hidremote/
@@ -10,23 +10,23 @@
//
// ** LICENSE *************************************************************************
//
-// Copyright (c) 2007-2011 IOSPIRIT GmbH (http://www.iospirit.com/)
+// Copyright (c) 2007-2017 IOSPIRIT GmbH (http://www.iospirit.com/)
// All rights reserved.
-//
+//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
-//
+//
// * Redistributions of source code must retain the above copyright notice, this list
// of conditions and the following disclaimer.
-//
+//
// * Redistributions in binary form must reproduce the above copyright notice, this
// list of conditions and the following disclaimer in the documentation and/or other
// materials provided with the distribution.
-//
+//
// * Neither the name of IOSPIRIT GmbH nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific prior
// written permission.
-//
+//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
@@ -40,7 +40,6 @@
//
// ************************************************************************************
-
// ************************************************************************************
// ********************************** DOCUMENTATION ***********************************
// ************************************************************************************
@@ -50,9 +49,32 @@
//
// ************************************************************************************
-
#import <Cocoa/Cocoa.h>
+// For legacy SDKs
+#ifndef MAC_OS_X_VERSION_10_9
+#define MAC_OS_X_VERSION_10_9 1090
+#endif /* MAC_OS_X_VERSION_10_9 */
+
+#ifndef MAC_OS_X_VERSION_10_10
+#define MAC_OS_X_VERSION_10_10 101000
+#endif /* MAC_OS_X_VERSION_10_10 */
+
+#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10
+// Carbon is only required on OS X versions prior to 10.10 (for getting the OS version via Gestalt() -
+// replaced by [[NSProcessInfo processInfo] operatingSystemVersion] in 10.10)
+#include <Carbon/Carbon.h>
+#endif
+
+#ifndef HIDREMOTE_THREADSAFETY_HARDENED_NOTIFICATION_HANDLING
+ #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
+ // Enable thread-safe notification handling by default if deploying to OS X >= 10.5
+ #define HIDREMOTE_THREADSAFETY_HARDENED_NOTIFICATION_HANDLING 1
+ #else
+ #define HIDREMOTE_THREADSAFETY_HARDENED_NOTIFICATION_HANDLING 0
+ #endif
+#endif
+
#include <unistd.h>
#include <mach/mach.h>
#include <sys/types.h>
@@ -67,209 +89,213 @@
#include <IOKit/hidsystem/IOHIDParameter.h>
#include <IOKit/hidsystem/IOHIDShared.h>
-#pragma mark -- Enums / Codes --
+#pragma mark - Enums / Codes
+#ifndef HID_REMOTE_MODE_ENUM
+#define HID_REMOTE_MODE_ENUM 1
typedef enum
{
- kHIDRemoteModeNone = 0L,
- kHIDRemoteModeShared, // Share the remote with others - let's you listen to the remote control events as long as noone has an exclusive lock on it
- // (RECOMMENDED ONLY FOR SPECIAL PURPOSES)
+ kHIDRemoteModeNone = 0L,
+ kHIDRemoteModeShared, // Share the remote with others - let's you listen to the remote control events as long as noone has an exclusive lock on it
+ // (RECOMMENDED ONLY FOR SPECIAL PURPOSES)
- kHIDRemoteModeExclusive, // Try to acquire an exclusive lock on the remote (NOT RECOMMENDED)
+ kHIDRemoteModeExclusive, // Try to acquire an exclusive lock on the remote (NOT RECOMMENDED)
- kHIDRemoteModeExclusiveAuto // Try to acquire an exclusive lock on the remote whenever the application has focus. Temporarily release control over the
- // remote when another application has focus (RECOMMENDED)
+ kHIDRemoteModeExclusiveAuto // Try to acquire an exclusive lock on the remote whenever the application has focus. Temporarily release control over the
+ // remote when another application has focus (RECOMMENDED)
} HIDRemoteMode;
+#endif /* HID_REMOTE_MODE_ENUM */
typedef enum
{
- /* A code reserved for "no button" (needed for tracking) */
- kHIDRemoteButtonCodeNone = 0L,
+ /* A code reserved for "no button" (needed for tracking) */
+ kHIDRemoteButtonCodeNone = 0L,
- /* Standard codes - available for white plastic and aluminum remote */
- kHIDRemoteButtonCodeUp,
- kHIDRemoteButtonCodeDown,
- kHIDRemoteButtonCodeLeft,
- kHIDRemoteButtonCodeRight,
- kHIDRemoteButtonCodeCenter,
- kHIDRemoteButtonCodeMenu,
+ /* Standard codes - available for white plastic and aluminum remote */
+ kHIDRemoteButtonCodeUp,
+ kHIDRemoteButtonCodeDown,
+ kHIDRemoteButtonCodeLeft,
+ kHIDRemoteButtonCodeRight,
+ kHIDRemoteButtonCodeCenter,
+ kHIDRemoteButtonCodeMenu,
- /* Extra codes - Only available for the new aluminum version of the remote */
- kHIDRemoteButtonCodePlay,
+ /* Extra codes - Only available for the new aluminum version of the remote */
+ kHIDRemoteButtonCodePlay,
- /* Masks */
- kHIDRemoteButtonCodeCodeMask = 0xFFL,
- kHIDRemoteButtonCodeHoldMask = (1L << 16L),
- kHIDRemoteButtonCodeSpecialMask = (1L << 17L),
- kHIDRemoteButtonCodeAluminumMask = (1L << 21L), // PRIVATE - only used internally
+ /* Masks */
+ kHIDRemoteButtonCodeCodeMask = 0xFFL,
+ kHIDRemoteButtonCodeHoldMask = (1L << 16L),
+ kHIDRemoteButtonCodeSpecialMask = (1L << 17L),
+ kHIDRemoteButtonCodeAluminumMask = (1L << 21L), // PRIVATE - only used internally
- /* Hold button standard codes - available for white plastic and aluminum remote */
- kHIDRemoteButtonCodeUpHold = (kHIDRemoteButtonCodeHoldMask|kHIDRemoteButtonCodeUp),
- kHIDRemoteButtonCodeDownHold = (kHIDRemoteButtonCodeHoldMask|kHIDRemoteButtonCodeDown),
- kHIDRemoteButtonCodeLeftHold = (kHIDRemoteButtonCodeHoldMask|kHIDRemoteButtonCodeLeft),
- kHIDRemoteButtonCodeRightHold = (kHIDRemoteButtonCodeHoldMask|kHIDRemoteButtonCodeRight),
- kHIDRemoteButtonCodeCenterHold = (kHIDRemoteButtonCodeHoldMask|kHIDRemoteButtonCodeCenter),
- kHIDRemoteButtonCodeMenuHold = (kHIDRemoteButtonCodeHoldMask|kHIDRemoteButtonCodeMenu),
+ /* Hold button standard codes - available for white plastic and aluminum remote */
+ kHIDRemoteButtonCodeUpHold = (kHIDRemoteButtonCodeHoldMask|kHIDRemoteButtonCodeUp),
+ kHIDRemoteButtonCodeDownHold = (kHIDRemoteButtonCodeHoldMask|kHIDRemoteButtonCodeDown),
+ kHIDRemoteButtonCodeLeftHold = (kHIDRemoteButtonCodeHoldMask|kHIDRemoteButtonCodeLeft),
+ kHIDRemoteButtonCodeRightHold = (kHIDRemoteButtonCodeHoldMask|kHIDRemoteButtonCodeRight),
+ kHIDRemoteButtonCodeCenterHold = (kHIDRemoteButtonCodeHoldMask|kHIDRemoteButtonCodeCenter),
+ kHIDRemoteButtonCodeMenuHold = (kHIDRemoteButtonCodeHoldMask|kHIDRemoteButtonCodeMenu),
- /* Hold button extra codes - Only available for aluminum version of the remote */
- kHIDRemoteButtonCodePlayHold = (kHIDRemoteButtonCodeHoldMask|kHIDRemoteButtonCodePlay),
+ /* Hold button extra codes - Only available for aluminum version of the remote */
+ kHIDRemoteButtonCodePlayHold = (kHIDRemoteButtonCodeHoldMask|kHIDRemoteButtonCodePlay),
- /* DEPRECATED codes - compatibility with HIDRemote 1.0 */
- kHIDRemoteButtonCodePlus = kHIDRemoteButtonCodeUp,
- kHIDRemoteButtonCodePlusHold = kHIDRemoteButtonCodeUpHold,
- kHIDRemoteButtonCodeMinus = kHIDRemoteButtonCodeDown,
- kHIDRemoteButtonCodeMinusHold = kHIDRemoteButtonCodeDownHold,
- kHIDRemoteButtonCodePlayPause = kHIDRemoteButtonCodeCenter,
- kHIDRemoteButtonCodePlayPauseHold = kHIDRemoteButtonCodeCenterHold,
+ /* DEPRECATED codes - compatibility with HIDRemote 1.0 */
+ kHIDRemoteButtonCodePlus = kHIDRemoteButtonCodeUp,
+ kHIDRemoteButtonCodePlusHold = kHIDRemoteButtonCodeUpHold,
+ kHIDRemoteButtonCodeMinus = kHIDRemoteButtonCodeDown,
+ kHIDRemoteButtonCodeMinusHold = kHIDRemoteButtonCodeDownHold,
+ kHIDRemoteButtonCodePlayPause = kHIDRemoteButtonCodeCenter,
+ kHIDRemoteButtonCodePlayPauseHold = kHIDRemoteButtonCodeCenterHold,
- /* Special purpose codes */
- kHIDRemoteButtonCodeIDChanged = (kHIDRemoteButtonCodeSpecialMask|(1L << 18L)), // (the ID of the connected remote has changed, you can safely ignore this)
- #ifdef _HIDREMOTE_EXTENSIONS
- #define _HIDREMOTE_EXTENSIONS_SECTION 1
- #include "HIDRemoteAdditions.h"
- #undef _HIDREMOTE_EXTENSIONS_SECTION
- #endif /* _HIDREMOTE_EXTENSIONS */
+ /* Special purpose codes */
+ kHIDRemoteButtonCodeIDChanged = (kHIDRemoteButtonCodeSpecialMask|(1L << 18L)), // (the ID of the connected remote has changed, you can safely ignore this)
+ #ifdef _HIDREMOTE_EXTENSIONS
+ #define _HIDREMOTE_EXTENSIONS_SECTION 1
+ #include "HIDRemoteAdditions.h"
+ #undef _HIDREMOTE_EXTENSIONS_SECTION
+ #endif /* _HIDREMOTE_EXTENSIONS */
} HIDRemoteButtonCode;
typedef enum
{
- kHIDRemoteModelUndetermined = 0L, // Assume a white plastic remote
- kHIDRemoteModelWhitePlastic, // Signal *likely* to be coming from a white plastic remote
- kHIDRemoteModelAluminum // Signal *definitely* coming from an aluminum remote
+ kHIDRemoteModelUndetermined = 0L, // Assume a white plastic remote
+ kHIDRemoteModelWhitePlastic, // Signal *likely* to be coming from a white plastic remote
+ kHIDRemoteModelAluminum // Signal *definitely* coming from an aluminum remote
} HIDRemoteModel;
typedef enum
{
- kHIDRemoteAluminumRemoteSupportLevelNone = 0L, // This system has no support for the Aluminum Remote at all
- kHIDRemoteAluminumRemoteSupportLevelEmulation, // This system possibly has support for the Aluminum Remote (via emulation)
- kHIDRemoteAluminumRemoteSupportLevelNative // This system has native support for the Aluminum Remote
+ kHIDRemoteAluminumRemoteSupportLevelNone = 0L, // This system has no support for the Aluminum Remote at all
+ kHIDRemoteAluminumRemoteSupportLevelEmulation, // This system possibly has support for the Aluminum Remote (via emulation)
+ kHIDRemoteAluminumRemoteSupportLevelNative // This system has native support for the Aluminum Remote
} HIDRemoteAluminumRemoteSupportLevel;
@class HIDRemote;
-#pragma mark -- Delegate protocol (mandatory) --
+#pragma mark - Delegate protocol (mandatory)
@protocol HIDRemoteDelegate
// Notification of button events
-- (void)hidRemote:(HIDRemote *)hidRemote // The instance of HIDRemote sending this
- eventWithButton:(HIDRemoteButtonCode)buttonCode // Event for the button specified by code
- isPressed:(BOOL)isPressed // The button was pressed (YES) / released (NO)
- fromHardwareWithAttributes:(NSMutableDictionary *)attributes; // Information on the device this event comes from
+- (void)hidRemote:(HIDRemote *)hidRemote // The instance of HIDRemote sending this
+ eventWithButton:(HIDRemoteButtonCode)buttonCode // Event for the button specified by code
+ isPressed:(BOOL)isPressed // The button was pressed (YES) / released (NO)
+ fromHardwareWithAttributes:(NSMutableDictionary *)attributes; // Information on the device this event comes from
@optional
// Notification of ID changes
-- (void)hidRemote:(HIDRemote *)hidRemote // Invoked when the user switched to a remote control with a different ID
- remoteIDChangedOldID:(SInt32)old
- newID:(SInt32)newID
- forHardwareWithAttributes:(NSMutableDictionary *)attributes;
+- (void)hidRemote:(HIDRemote *)hidRemote // Invoked when the user switched to a remote control with a different ID
+ remoteIDChangedOldID:(SInt32)old
+ newID:(SInt32)newID
+ forHardwareWithAttributes:(NSMutableDictionary *)attributes;
-// Notification about hardware additions/removals
-- (void)hidRemote:(HIDRemote *)hidRemote // Invoked when new hardware was found / added to HIDRemote's pool
- foundNewHardwareWithAttributes:(NSMutableDictionary *)attributes;
+// Notification about hardware additions/removals
+- (void)hidRemote:(HIDRemote *)hidRemote // Invoked when new hardware was found / added to HIDRemote's pool
+ foundNewHardwareWithAttributes:(NSMutableDictionary *)attributes;
-- (void)hidRemote:(HIDRemote *)hidRemote // Invoked when initialization of new hardware as requested failed
- failedNewHardwareWithError:(NSError *)error;
+- (void)hidRemote:(HIDRemote *)hidRemote // Invoked when initialization of new hardware as requested failed
+ failedNewHardwareWithError:(NSError *)error;
-- (void)hidRemote:(HIDRemote *)hidRemote // Invoked when hardware was removed from HIDRemote's pool
- releasedHardwareWithAttributes:(NSMutableDictionary *)attributes;
+- (void)hidRemote:(HIDRemote *)hidRemote // Invoked when hardware was removed from HIDRemote's pool
+ releasedHardwareWithAttributes:(NSMutableDictionary *)attributes;
// ### WARNING: Unless you know VERY PRECISELY what you are doing, do not implement any of the delegate methods below. ###
// Matching of newly found receiver hardware
-- (BOOL)hidRemote:(HIDRemote *)hidRemote // Invoked when new hardware is inspected
- inspectNewHardwareWithService:(io_service_t)service //
- prematchResult:(BOOL)prematchResult; // Return YES if HIDRemote should go on with this hardware and try
- // to use it, or NO if it should not be persued further.
+- (BOOL)hidRemote:(HIDRemote *)hidRemote // Invoked when new hardware is inspected
+ inspectNewHardwareWithService:(io_service_t)service //
+ prematchResult:(BOOL)prematchResult; // Return YES if HIDRemote should go on with this hardware and try
+ // to use it, or NO if it should not be persued further.
// Exlusive lock lending
- (BOOL)hidRemote:(HIDRemote *)hidRemote
- lendExclusiveLockToApplicationWithInfo:(NSDictionary *)applicationInfo;
+ lendExclusiveLockToApplicationWithInfo:(NSDictionary *)applicationInfo;
- (void)hidRemote:(HIDRemote *)hidRemote
- exclusiveLockReleasedByApplicationWithInfo:(NSDictionary *)applicationInfo;
+ exclusiveLockReleasedByApplicationWithInfo:(NSDictionary *)applicationInfo;
- (BOOL)hidRemote:(HIDRemote *)hidRemote
- shouldRetryExclusiveLockWithInfo:(NSDictionary *)applicationInfo;
+ shouldRetryExclusiveLockWithInfo:(NSDictionary *)applicationInfo;
-@end
+@end
-#pragma mark -- Actual header file for class --
-
+#pragma mark - Actual header file for class
@interface HIDRemote : NSObject
{
- // IOMasterPort
- mach_port_t _masterPort;
+ // IOMasterPort
+ mach_port_t _masterPort;
- // Notification ports
- IONotificationPortRef _notifyPort;
- CFRunLoopSourceRef _notifyRLSource;
-
- // Matching iterator
- io_iterator_t _matchingServicesIterator;
-
- // SecureInput notification
- io_object_t _secureInputNotification;
-
- // Service attributes
- NSMutableDictionary *_serviceAttribMap;
-
- // Mode
- HIDRemoteMode _mode;
- BOOL _autoRecover;
- NSTimer *_autoRecoveryTimer;
-
- // Delegate
- NSObject <HIDRemoteDelegate> *_delegate;
-
- // Last seen ID and remote model
- SInt32 _lastSeenRemoteID;
- HIDRemoteModel _lastSeenModel;
- SInt32 _lastSeenModelRemoteID;
-
- // Unused button codes
- NSArray *_unusedButtonCodes;
-
- // Simulate Plus/Minus Hold
- BOOL _simulateHoldEvents;
-
- // SecureEventInput workaround
- BOOL _secureEventInputWorkAround;
- UInt64 _lastSecureEventInputPIDSum;
- uid_t _lastFrontUserSession;
-
- // Exclusive lock lending
- BOOL _exclusiveLockLending;
- BOOL _sendExclusiveResourceReuseNotification;
- NSNumber *_waitForReturnByPID;
- NSNumber *_returnToPID;
- BOOL _isRestarting;
-
- // Status notifications
- BOOL _sendStatusNotifications;
- NSString *_pidString;
-
- // Status
- BOOL _applicationIsTerminating;
- BOOL _isStopping;
-
- // Thread safety
- #ifdef HIDREMOTE_THREADSAFETY_HARDENED_NOTIFICATION_HANDLING /* #define HIDREMOTE_THREADSAFETY_HARDENED_NOTIFICATION_HANDLING if you're running your HIDRemote instance on a background thread (requires OS X 10.5 or later) */
- NSThread *_runOnThread;
- #endif
+ // Notification ports
+ IONotificationPortRef _notifyPort;
+ CFRunLoopSourceRef _notifyRLSource;
+
+ // Matching iterator
+ io_iterator_t _matchingServicesIterator;
+
+ // SecureInput notification
+ io_object_t _secureInputNotification;
+
+ // Service attributes
+ NSMutableDictionary *_serviceAttribMap;
+
+ // Mode
+ HIDRemoteMode _mode;
+ BOOL _autoRecover;
+ NSTimer *_autoRecoveryTimer;
+
+ // Delegate
+ NSObject <HIDRemoteDelegate> *_delegate;
+
+ // Last seen ID and remote model
+ SInt32 _lastSeenRemoteID;
+ HIDRemoteModel _lastSeenModel;
+ SInt32 _lastSeenModelRemoteID;
+
+ // Unused button codes
+ NSArray *_unusedButtonCodes;
+
+ // Simulate Plus/Minus Hold
+ BOOL _simulateHoldEvents;
+
+ // SecureEventInput workaround
+ BOOL _secureEventInputWorkAround;
+ UInt64 _lastSecureEventInputPIDSum;
+ uid_t _lastFrontUserSession;
+ BOOL _lastScreenIsLocked;
+
+ // Exclusive lock lending
+ BOOL _exclusiveLockLending;
+ BOOL _sendExclusiveResourceReuseNotification;
+ NSNumber *_waitForReturnByPID;
+ NSNumber *_returnToPID;
+ BOOL _isRestarting;
+
+ // Status notifications
+ BOOL _sendStatusNotifications;
+ NSString *_pidString;
+
+ // Status
+ BOOL _applicationIsTerminating;
+ BOOL _isStopping;
+
+ // Thread safety
+ #if HIDREMOTE_THREADSAFETY_HARDENED_NOTIFICATION_HANDLING /* #define HIDREMOTE_THREADSAFETY_HARDENED_NOTIFICATION_HANDLING if you're running your HIDRemote instance on a background thread (requires OS X 10.5 or later) */
+ NSThread *_runOnThread;
+ #endif
}
-#pragma mark -- PUBLIC: Shared HID Remote --
+#pragma mark - PUBLIC: Shared HID Remote
+ (HIDRemote *)sharedHIDRemote;
-#pragma mark -- PUBLIC: System Information --
+#pragma mark - PUBLIC: System Information
+ (BOOL)isCandelairInstalled;
+ (BOOL)isCandelairInstallationRequiredForRemoteMode:(HIDRemoteMode)remoteMode;
++ (SInt32)OSXVersion;
- (HIDRemoteAluminumRemoteSupportLevel)aluminiumRemoteSystemSupportLevel;
-#pragma mark -- PUBLIC: Interface / API --
-- (BOOL)startRemoteControl:(HIDRemoteMode)hidRemoteMode;
+#pragma mark - PUBLIC: Interface / API
+- (BOOL)startRemoteControl:(HIDRemoteMode)hidRemoteMode;
- (void)stopRemoteControl;
- (BOOL)isStarted;
@@ -291,7 +317,7 @@
- (void)setUnusedButtonCodes:(NSArray *)newArrayWithUnusedButtonCodesAsNSNumbers;
- (NSArray *)unusedButtonCodes;
-#pragma mark -- PUBLIC: Expert APIs --
+#pragma mark - PUBLIC: Expert APIs
- (void)setEnableSecureEventInputWorkaround:(BOOL)newEnableSecureEventInputWorkaround;
- (BOOL)enableSecureEventInputWorkaround;
@@ -301,28 +327,28 @@
- (BOOL)isApplicationTerminating;
- (BOOL)isStopping;
-#pragma mark -- PRIVATE: HID Event handling --
+#pragma mark - PRIVATE: HID Event handling
- (void)_handleButtonCode:(HIDRemoteButtonCode)buttonCode isPressed:(BOOL)isPressed hidAttribsDict:(NSMutableDictionary *)hidAttribsDict;
- (void)_sendButtonCode:(HIDRemoteButtonCode)buttonCode isPressed:(BOOL)isPressed hidAttribsDict:(NSMutableDictionary *)hidAttribsDict;
- (void)_hidEventFor:(io_service_t)hidDevice from:(IOHIDQueueInterface **)interface withResult:(IOReturn)result;
-#pragma mark -- PRIVATE: Service setup and destruction --
+#pragma mark - PRIVATE: Service setup and destruction
- (BOOL)_prematchService:(io_object_t)service;
- (HIDRemoteButtonCode)buttonCodeForUsage:(unsigned int)usage usagePage:(unsigned int)usagePage;
- (BOOL)_setupService:(io_object_t)service;
- (void)_destructService:(io_object_t)service;
-#pragma mark -- PRIVATE: Distributed notifiations handling --
+#pragma mark - PRIVATE: Distributed notifiations handling
- (void)_postStatusWithAction:(NSString *)action;
- (void)_handleNotifications:(NSNotification *)notification;
- (void)_setSendStatusNotifications:(BOOL)doSend;
- (BOOL)_sendStatusNotifications;
-#pragma mark -- PRIVATE: Application becomes active / inactive handling for kHIDRemoteModeExclusiveAuto --
+#pragma mark - PRIVATE: Application becomes active / inactive handling for kHIDRemoteModeExclusiveAuto
- (void)_appStatusChanged:(NSNotification *)notification;
- (void)_delayedAutoRecovery:(NSTimer *)aTimer;
-#pragma mark -- PRIVATE: Notification handling --
+#pragma mark - PRIVATE: Notification handling
- (void)_serviceMatching:(io_iterator_t)iterator;
- (void)_serviceNotificationFor:(io_service_t)service messageType:(natural_t)messageType messageArgument:(void *)messageArgument;
- (void)_updateSessionInformation;
@@ -330,12 +356,12 @@
@end
-#pragma mark -- Information attribute keys --
+#pragma mark - Information attribute keys
extern NSString *kHIDRemoteManufacturer;
extern NSString *kHIDRemoteProduct;
extern NSString *kHIDRemoteTransport;
-#pragma mark -- Internal/Expert attribute keys (AKA: don't touch these unless you really, really, REALLY know what you do) --
+#pragma mark - Internal/Expert attribute keys (AKA: don't touch these unless you really, really, REALLY know what you do)
extern NSString *kHIDRemoteCFPluginInterface;
extern NSString *kHIDRemoteHIDDeviceInterface;
extern NSString *kHIDRemoteCookieButtonCodeLUT;
@@ -349,7 +375,7 @@
extern NSString *kHIDRemoteAluminumRemoteSupportLevel;
extern NSString *kHIDRemoteAluminumRemoteSupportOnDemand;
-#pragma mark -- Distributed notifications --
+#pragma mark - Distributed notifications
extern NSString *kHIDRemoteDNHIDRemotePing;
extern NSString *kHIDRemoteDNHIDRemoteRetry;
extern NSString *kHIDRemoteDNHIDRemoteStatus;
@@ -356,7 +382,7 @@
extern NSString *kHIDRemoteDNHIDRemoteRetryGlobalObject;
-#pragma mark -- Distributed notifications userInfo keys and values --
+#pragma mark - Distributed notifications userInfo keys and values
extern NSString *kHIDRemoteDNStatusHIDRemoteVersionKey;
extern NSString *kHIDRemoteDNStatusPIDKey;
extern NSString *kHIDRemoteDNStatusModeKey;
@@ -369,8 +395,11 @@
extern NSString *kHIDRemoteDNStatusActionUpdate;
extern NSString *kHIDRemoteDNStatusActionNoNeed;
-#pragma mark -- Driver compatibility flags --
+#pragma mark - Driver compatibility flags
+#ifndef HID_REMOTE_COMPATIBILITY_FLAGS_ENUM
+#define HID_REMOTE_COMPATIBILITY_FLAGS_ENUM 1
typedef enum
{
- kHIDRemoteCompatibilityFlagsStandardHIDRemoteDevice = 1L,
+ kHIDRemoteCompatibilityFlagsStandardHIDRemoteDevice = 1L,
} HIDRemoteCompatibilityFlags;
+#endif /* HID_REMOTE_COMPATIBILITY_FLAGS_ENUM */
Modified: trunk/vendorsrc/iospirit/HIDRemote/HIDRemote.m
===================================================================
--- trunk/vendorsrc/iospirit/HIDRemote/HIDRemote.m 2025-08-17 16:38:37 UTC (rev 15672)
+++ trunk/vendorsrc/iospirit/HIDRemote/HIDRemote.m 2025-08-17 17:12:35 UTC (rev 15673)
@@ -1,9 +1,9 @@
//
// HIDRemote.m
-// HIDRemote V1.2 (27th May 2011)
+// HIDRemote V1.7 (5th September 2018)
//
// Created by Felix Schwarz on 06.04.07.
-// Copyright 2007-2011 IOSPIRIT GmbH. All rights reserved.
+// Copyright 2007-2018 IOSPIRIT GmbH. All rights reserved.
//
// The latest version of this class is available at
// http://www.iospirit.com/developers/hidremote/
@@ -10,23 +10,23 @@
//
// ** LICENSE *************************************************************************
//
-// Copyright (c) 2007-2011 IOSPIRIT GmbH (http://www.iospirit.com/)
+// Copyright (c) 2007-2017 IOSPIRIT GmbH (http://www.iospirit.com/)
// All rights reserved.
-//
+//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
-//
+//
// * Redistributions of source code must retain the above copyright notice, this list
// of conditions and the following disclaimer.
-//
+//
// * Redistributions in binary form must reproduce the above copyright notice, this
// list of conditions and the following disclaimer in the documentation and/or other
// materials provided with the distribution.
-//
+//
// * Neither the name of IOSPIRIT GmbH nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific prior
// written permission.
-//
+//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
@@ -51,24 +51,55 @@
#import "HIDRemote.h"
+// ARC support
+#if !__has_feature(objc_arc)
+ #define HIDRemoteRetain(object) [object retain]
+ #define HIDRemoteRetained(object) [object retain]
+ #define HIDRemoteRelease(object) [object release]
+ #define HIDRemoteReleaseNil(object) [object release]; object=nil
+ #define HIDRemoteAutoreleased(object) [object autorelease]
+ #define HIDRemoteSuperDealloc(object) [super dealloc]
+
+ #define HIDRemoteAutoreleasePoolOpen() NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ #define HIDRemoteAutoreleasePoolClose() [pool release];
+
+ #define __HIDRemoteBridge
+ #define HIDRemoteBridgingRelease
+ #define HIDRemoteBridgingRetain
+#else /* !__has_feature(objc_arc) */
+ #define HIDRemoteRetain(object)
+ #define HIDRemoteRetained(object) object
+ #define HIDRemoteRelease(object)
+ #define HIDRemoteReleaseNil(object) object=nil
+ #define HIDRemoteAutoreleased(object) object
+ #define HIDRemoteSuperDealloc(object)
+
+ #define HIDRemoteAutoreleasePoolOpen() @autoreleasepool {
+ #define HIDRemoteAutoreleasePoolClose() }
+
+ #define __HIDRemoteBridge __bridge
+ #define HIDRemoteBridgingRelease CFBridgingRelease
+ #define HIDRemoteBridgingRetain CFBridgingRetain
+#endif
+
// Callback Prototypes
-static void HIDEventCallback( void * target,
- IOReturn result,
- void * refcon,
- void * sender);
+static void HIDEventCallback( void * target,
+ IOReturn result,
+ void * refcon,
+ void * sender);
-static void ServiceMatchingCallback( void *refCon,
- io_iterator_t iterator);
+static void ServiceMatchingCallback( void *refCon,
+ io_iterator_t iterator);
-static void ServiceNotificationCallback(void * refCon,
- io_service_t service,
- natural_t messageType,
- void * messageArgument);
+static void ServiceNotificationCallback(void * refCon,
+ io_service_t service,
+ natural_t messageType,
+ void * messageArgument);
-static void SecureInputNotificationCallback( void * refCon,
- io_service_t service,
- natural_t messageType,
- void * messageArgument);
+static void SecureInputNotificationCallback( void * refCon,
+ io_service_t service,
+ natural_t messageType,
+ void * messageArgument);
// Shared HIDRemote instance
static HIDRemote *sHIDRemote = nil;
@@ -75,1967 +106,2095 @@
@implementation HIDRemote
-#pragma mark -- Init, dealloc & shared instance --
+#pragma mark - Init, dealloc & shared instance
+ (HIDRemote *)sharedHIDRemote
{
- if (sHIDRemote==nil)
- {
- sHIDRemote = [[HIDRemote alloc] init];
- }
-
- return (sHIDRemote);
+ if (sHIDRemote==nil)
+ {
+ sHIDRemote = [[HIDRemote alloc] init];
+ }
+
+ return (sHIDRemote);
}
- (id)init
{
- if ((self = [super init]) != nil)
- {
- #ifdef HIDREMOTE_THREADSAFETY_HARDENED_NOTIFICATION_HANDLING
- _runOnThread = [NSThread currentThread];
- #endif
-
- // Detect application becoming active/inactive
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_appStatusChanged:) name:NSApplicationDidBecomeActiveNotification object:[NSApplication sharedApplication]];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_appStatusChanged:) name:NSApplicationWillResignActiveNotification object:[NSApplication sharedApplication]];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_appStatusChanged:) name:NSApplicationWillTerminateNotification object:[NSApplication sharedApplication]];
+ if ((self = [super init]) != nil)
+ {
+ #if HIDREMOTE_THREADSAFETY_HARDENED_NOTIFICATION_HANDLING
+ _runOnThread = HIDRemoteRetained([NSThread currentThread]);
+ #endif
+
+ // Detect application becoming active/inactive
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_appStatusChanged:) name:NSApplicationDidBecomeActiveNotification object:[NSApplication sharedApplication]];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_appStatusChanged:) name:NSApplicationWillResignActiveNotification object:[NSApplication sharedApplication]];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_appStatusChanged:) name:NSApplicationWillTerminateNotification object:[NSApplication sharedApplication]];
- // Handle distributed notifications
- _pidString = [[NSString alloc] initWithFormat:@"%d", getpid()];
-
- [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_handleNotifications:) name:kHIDRemoteDNHIDRemotePing object:nil];
- [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_handleNotifications:) name:kHIDRemoteDNHIDRemoteRetry object:kHIDRemoteDNHIDRemoteRetryGlobalObject];
- [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_handleNotifications:) name:kHIDRemoteDNHIDRemoteRetry object:_pidString];
+ // Handle distributed notifications
+ _pidString = [[NSString alloc] initWithFormat:@"%d", getpid()];
+
+ [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_handleNotifications:) name:kHIDRemoteDNHIDRemotePing object:nil];
+ [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_handleNotifications:) name:kHIDRemoteDNHIDRemoteRetry object:kHIDRemoteDNHIDRemoteRetryGlobalObject];
+ [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_handleNotifications:) name:kHIDRemoteDNHIDRemoteRetry object:_pidString];
- // Enabled by default: simulate hold events for plus/minus
- _simulateHoldEvents = YES;
-
- // Enabled by default: work around for a locking issue introduced with Security Update 2008-004 / 10.4.9 and beyond (credit for finding this workaround goes to Martin Kahr)
- _secureEventInputWorkAround = YES;
- _secureInputNotification = 0;
-
- // Initialize instance variables
- _lastSeenRemoteID = -1;
- _lastSeenModel = kHIDRemoteModelUndetermined;
- _unusedButtonCodes = [[NSMutableArray alloc] init];
- _exclusiveLockLending = NO;
- _sendExclusiveResourceReuseNotification = YES;
- _applicationIsTerminating = NO;
-
- // Send status notifications
- _sendStatusNotifications = YES;
- }
+ // Enabled by default: simulate hold events for plus/minus
+ _simulateHoldEvents = YES;
+
+ // Enabled by default: work around for a locking issue introduced with Security Update 2008-004 / 10.4.9 and beyond (credit for finding this workaround goes to Martin Kahr)
+ _secureEventInputWorkAround = YES;
+ _secureInputNotification = 0;
+
+ // Initialize instance variables
+ _lastSeenRemoteID = -1;
+ _lastSeenModel = kHIDRemoteModelUndetermined;
+ _unusedButtonCodes = [[NSMutableArray alloc] init];
+ _exclusiveLockLending = NO;
+ _sendExclusiveResourceReuseNotification = YES;
+ _applicationIsTerminating = NO;
+
+ // Send status notifications
+ _sendStatusNotifications = YES;
+ }
- return (self);
+ return (self);
}
- (void)dealloc
{
- [[NSNotificationCenter defaultCenter] removeObserver:self name:NSApplicationWillTerminateNotification object:[NSApplication sharedApplication]];
- [[NSNotificationCenter defaultCenter] removeObserver:self name:NSApplicationWillResignActiveNotification object:[NSApplication sharedApplication]];
- [[NSNotificationCenter defaultCenter] removeObserver:self name:NSApplicationDidBecomeActiveNotification object:[NSApplication sharedApplication]];
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:NSApplicationWillTerminateNotification object:[NSApplication sharedApplication]];
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:NSApplicationWillResignActiveNotification object:[NSApplication sharedApplication]];
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:NSApplicationDidBecomeActiveNotification object:[NSApplication sharedApplication]];
- [[NSDistributedNotificationCenter defaultCenter] removeObserver:self name:kHIDRemoteDNHIDRemotePing object:nil];
- [[NSDistributedNotificationCenter defaultCenter] removeObserver:self name:kHIDRemoteDNHIDRemoteRetry object:kHIDRemoteDNHIDRemoteRetryGlobalObject];
- [[NSDistributedNotificationCenter defaultCenter] removeObserver:self name:kHIDRemoteDNHIDRemoteRetry object:_pidString];
- [[NSDistributedNotificationCenter defaultCenter] removeObserver:self name:nil object:nil]; /* As demanded by the documentation for -[NSDistributedNotificationCenter removeObserver:name:object:] */
-
- [self stopRemoteControl];
+ [[NSDistributedNotificationCenter defaultCenter] removeObserver:self name:kHIDRemoteDNHIDRemotePing object:nil];
+ [[NSDistributedNotificationCenter defaultCenter] removeObserver:self name:kHIDRemoteDNHIDRemoteRetry object:kHIDRemoteDNHIDRemoteRetryGlobalObject];
+ [[NSDistributedNotificationCenter defaultCenter] removeObserver:self name:kHIDRemoteDNHIDRemoteRetry object:_pidString];
+ [[NSDistributedNotificationCenter defaultCenter] removeObserver:self name:nil object:nil]; /* As demanded by the documentation for -[NSDistributedNotificationCenter removeObserver:name:object:] */
+
+ [self stopRemoteControl];
- [self setExclusiveLockLendingEnabled:NO];
+ [self setExclusiveLockLendingEnabled:NO];
- [self setDelegate:nil];
+ [self setDelegate:nil];
- if (_unusedButtonCodes != nil)
- {
- _unusedButtonCodes = nil;
- }
+ if (_unusedButtonCodes != nil)
+ {
+ HIDRemoteReleaseNil(_unusedButtonCodes);
+ }
- #ifdef HIDREMOTE_THREADSAFETY_HARDENED_NOTIFICATION_HANDLING
- _runOnThread = nil;
- #endif
+ #if HIDREMOTE_THREADSAFETY_HARDENED_NOTIFICATION_HANDLING
+ HIDRemoteReleaseNil(_runOnThread);
+ #endif
- _pidString = nil;
+ HIDRemoteReleaseNil(_pidString);
+
+ HIDRemoteSuperDealloc();
}
-#pragma mark -- PUBLIC: System Information --
+#pragma mark - PUBLIC: System Information
+ (BOOL)isCandelairInstalled
{
- mach_port_t masterPort = 0;
- kern_return_t kernResult;
- io_service_t matchingService = 0;
- BOOL isInstalled = NO;
+ mach_port_t masterPort = 0;
+ kern_return_t kernResult;
+ io_service_t matchingService = 0;
+ BOOL isInstalled = NO;
- kernResult = IOMasterPort(MACH_PORT_NULL, &masterPort);
- if ((kernResult!=kIOReturnSuccess) || (masterPort==0)) { return(NO); }
+ kernResult = IOMasterPort(MACH_PORT_NULL, &masterPort);
+ if ((kernResult!=kIOReturnSuccess) || (masterPort==0)) { return(NO); }
- if ((matchingService = IOServiceGetMatchingService(masterPort, IOServiceMatching("IOSPIRITIRController"))) != 0)
- {
- isInstalled = YES;
- IOObjectRelease((io_object_t) matchingService);
- }
+ if ((matchingService = IOServiceGetMatchingService(masterPort, IOServiceMatching("IOSPIRITIRController"))) != 0)
+ {
+ isInstalled = YES;
+ IOObjectRelease((io_object_t) matchingService);
+ }
- mach_port_deallocate(mach_task_self(), masterPort);
+ mach_port_deallocate(mach_task_self(), masterPort);
- return (isInstalled);
+ return (isInstalled);
}
+ (BOOL)isCandelairInstallationRequiredForRemoteMode:(HIDRemoteMode)remoteMode
{
- /*
- SInt32 systemVersionMajor = 0, systemVersionMinor = 0, systemVersionBugFix;
-
- // Determine OS version, use components as gestaltSystemVersion breaks on 10.10
- if (Gestalt(gestaltSystemVersionMajor, &systemVersionMajor) == noErr &&
- Gestalt(gestaltSystemVersionMinor, &systemVersionMinor) == noErr &&
- Gestalt(gestaltSystemVersionBugFix, &systemVersionBugFix) == noErr)
- {
- if (systemVersionMajor == 10 && systemVersionMinor == 6 && systemVersionBugFix <= 1)
- {
- // OS X 10.6(.0) and OS X 10.6.1 require the Candelair driver for to be installed,
- // so that third party apps can acquire an exclusive lock on the receiver HID Device
- // via IOKit.
+ // Determine OS version
+ switch ([self OSXVersion])
+ {
+ case 0x1060: // OS 10.6
+ case 0x1061: // OS 10.6.1
+ // OS X 10.6(.0) and OS X 10.6.1 require the Candelair driver for to be installed,
+ // so that third party apps can acquire an exclusive lock on the receiver HID Device
+ // via IOKit.
- switch (remoteMode)
- {
- case kHIDRemoteModeExclusive:
- case kHIDRemoteModeExclusiveAuto:
- if (![self isCandelairInstalled])
- {
- return (YES);
- }
- break;
- default:
- break;
- }
- }
- }
- */
+ switch (remoteMode)
+ {
+ case kHIDRemoteModeExclusive:
+ case kHIDRemoteModeExclusiveAuto:
+ if (![self isCandelairInstalled])
+ {
+ return (YES);
+ }
+ break;
+
+ default:
+ return (NO);
+ break;
+ }
+ break;
+ }
- return (NO);
+ return (NO);
}
+// Drop-in replacement for Gestalt(gestaltSystemVersion, &osXVersion) that avoids use of Gestalt for code targeting 10.10 or later
++ (SInt32)OSXVersion
+{
+ static SInt32 sHRGestaltOSXVersion = 0;
+
+ if (sHRGestaltOSXVersion==0)
+ {
+ #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_9
+ // Code for builds targeting OS X 10.10+
+ NSOperatingSystemVersion osVersion;
+
+ osVersion = [[NSProcessInfo processInfo] operatingSystemVersion];
+
+ sHRGestaltOSXVersion = (SInt32)(0x01000 | ((osVersion.majorVersion-10)<<8) | (osVersion.minorVersion<<4) | osVersion.patchVersion);
+ #else
+ #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_9
+ // Code for builds using the OS X 10.10 SDK or later
+ NSOperatingSystemVersion osVersion;
+
+ if ([[NSProcessInfo processInfo] respondsToSelector:@selector(operatingSystemVersion)])
+ {
+ osVersion = [[NSProcessInfo processInfo] operatingSystemVersion];
+
+ sHRGestaltOSXVersion = (SInt32)(0x01000 | ((osVersion.majorVersion-10)<<8) | (osVersion.minorVersion<<4) | osVersion.patchVersion);
+ }
+ else
+ {
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ Gestalt (gestaltSystemVersion, &sHRGestaltOSXVersion);
+ #pragma clang diagnostic pop
+ }
+ #else /* MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_9 */
+ // Code for builds using an SDK older than 10.10
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ Gestalt (gestaltSystemVersion, &sHRGestaltOSXVersion);
+ #pragma clang diagnostic pop
+ #endif /* MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_9 */
+ #endif /* MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_9 */
+ }
+
+ return (sHRGestaltOSXVersion);
+}
+
- (HIDRemoteAluminumRemoteSupportLevel)aluminiumRemoteSystemSupportLevel
{
- HIDRemoteAluminumRemoteSupportLevel supportLevel = kHIDRemoteAluminumRemoteSupportLevelNone;
- NSEnumerator *attribDictsEnum;
- NSDictionary *hidAttribsDict;
-
- attribDictsEnum = [_serviceAttribMap objectEnumerator];
-
- while ((hidAttribsDict = [attribDictsEnum nextObject]) != nil)
- {
- NSNumber *deviceSupportLevel;
-
- if ((deviceSupportLevel = [hidAttribsDict objectForKey:kHIDRemoteAluminumRemoteSupportLevel]) != nil)
- {
- if ([deviceSupportLevel intValue] > (int)supportLevel)
- {
- supportLevel = [deviceSupportLevel intValue];
- }
- }
- }
-
- return (supportLevel);
+ HIDRemoteAluminumRemoteSupportLevel supportLevel = kHIDRemoteAluminumRemoteSupportLevelNone;
+ NSEnumerator *attribDictsEnum;
+ NSDictionary *hidAttribsDict;
+
+ attribDictsEnum = [_serviceAttribMap objectEnumerator];
+
+ while ((hidAttribsDict = [attribDictsEnum nextObject]) != nil)
+ {
+ NSNumber *deviceSupportLevel;
+
+ if ((deviceSupportLevel = [hidAttribsDict objectForKey:kHIDRemoteAluminumRemoteSupportLevel]) != nil)
+ {
+ if ([deviceSupportLevel intValue] > (int)supportLevel)
+ {
+ supportLevel = [deviceSupportLevel intValue];
+ }
+ }
+ }
+
+ return (supportLevel);
}
-#pragma mark -- PUBLIC: Interface / API --
+#pragma mark - PUBLIC: Interface / API
- (BOOL)startRemoteControl:(HIDRemoteMode)hidRemoteMode
{
- if ((_mode == kHIDRemoteModeNone) && (hidRemoteMode != kHIDRemoteModeNone))
- {
- kern_return_t kernReturn;
- CFMutableDictionaryRef matchDict=NULL;
- io_service_t rootService;
-
- do
- {
- // Get IOKit master port
- kernReturn = IOMasterPort(bootstrap_port, &_masterPort);
- if ((kernReturn!=kIOReturnSuccess) || (_masterPort==0)) { break; }
-
- // Setup notification port
- _notifyPort = IONotificationPortCreate(_masterPort);
-
- if ((_notifyRLSource = IONotificationPortGetRunLoopSource(_notifyPort)) != NULL)
- {
- CFRunLoopAddSource( CFRunLoopGetCurrent(),
- _notifyRLSource,
- kCFRunLoopCommonModes);
- }
- else
- {
- break;
- }
-
- // Setup SecureInput notification
- if ((hidRemoteMode == kHIDRemoteModeExclusive) || (hidRemoteMode == kHIDRemoteModeExclusiveAuto))
- {
- if ((rootService = IORegistryEntryFromPath(_masterPort, kIOServicePlane ":/")) != 0)
- {
- kernReturn = IOServiceAddInterestNotification( _notifyPort,
- rootService,
- kIOBusyInterest,
- SecureInputNotificationCallback,
- (__bridge void *)self,
- &_secureInputNotification);
- if (kernReturn != kIOReturnSuccess) { break; }
-
- [self _updateSessionInformation];
- }
- else
- {
- break;
- }
- }
+ if ((_mode == kHIDRemoteModeNone) && (hidRemoteMode != kHIDRemoteModeNone))
+ {
+ kern_return_t kernReturn;
+ CFMutableDictionaryRef matchDict=NULL;
+ io_service_t rootService;
+
+ do
+ {
+ // Get IOKit master port
+ kernReturn = IOMasterPort(bootstrap_port, &_masterPort);
+ if ((kernReturn!=kIOReturnSuccess) || (_masterPort==0)) { break; }
+
+ // Setup notification port
+ _notifyPort = IONotificationPortCreate(_masterPort);
+
+ if ((_notifyRLSource = IONotificationPortGetRunLoopSource(_notifyPort)) != NULL)
+ {
+ CFRunLoopAddSource( CFRunLoopGetCurrent(),
+ _notifyRLSource,
+ kCFRunLoopCommonModes);
+ }
+ else
+ {
+ break;
+ }
+
+ // Setup SecureInput notification
+ if ((hidRemoteMode == kHIDRemoteModeExclusive) || (hidRemoteMode == kHIDRemoteModeExclusiveAuto))
+ {
+ if ((rootService = IORegistryEntryFromPath(_masterPort, kIOServicePlane ":/")) != 0)
+ {
+ kernReturn = IOServiceAddInterestNotification( _notifyPort,
+ rootService,
+ kIOBusyInterest,
+ SecureInputNotificationCallback,
+ (__HIDRemoteBridge void *)self,
+ &_secureInputNotification);
+ if (kernReturn != kIOReturnSuccess) { break; }
+
+ [self _updateSessionInformation];
+ }
+ else
+ {
+ break;
+ }
+ }
- // Setup notification matching dict
- matchDict = IOServiceMatching(kIOHIDDeviceKey);
- CFRetain(matchDict);
+ // Setup notification matching dict
+ matchDict = IOServiceMatching(kIOHIDDeviceKey);
+ CFRetain(matchDict);
- // Actually add notification
- kernReturn = IOServiceAddMatchingNotification( _notifyPort,
- kIOFirstMatchNotification,
- matchDict, // one reference count consumed by this call
- ServiceMatchingCallback,
- (__bridge void *) self,
- &_matchingServicesIterator);
- if (kernReturn != kIOReturnSuccess) { break; }
+ // Actually add notification
+ kernReturn = IOServiceAddMatchingNotification( _notifyPort,
+ kIOFirstMatchNotification,
+ matchDict, // one reference count consumed by this call
+ ServiceMatchingCallback,
+ (__HIDRemoteBridge void *) self,
+ &_matchingServicesIterator);
+ if (kernReturn != kIOReturnSuccess) { break; }
- // Setup serviceAttribMap
- _serviceAttribMap = [[NSMutableDictionary alloc] init];
- if (_serviceAttribMap==nil) { break; }
-
- // Phew .. everything went well!
- _mode = hidRemoteMode;
- CFRelease(matchDict);
-
- [self _serviceMatching:_matchingServicesIterator];
-
- [self _postStatusWithAction:kHIDRemoteDNStatusActionStart];
-
- return (YES);
+ // Setup serviceAttribMap
+ _serviceAttribMap = [[NSMutableDictionary alloc] init];
+ if (_serviceAttribMap==nil) { break; }
+
+ // Phew .. everything went well!
+ _mode = hidRemoteMode;
+ CFRelease(matchDict);
+
+ [self _serviceMatching:_matchingServicesIterator];
+
+ [self _postStatusWithAction:kHIDRemoteDNStatusActionStart];
+
+ // Register for system wake notifications
+ [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(_computerDidWake:) name:NSWorkspaceDidWakeNotification object:nil];
+
+ return (YES);
- }while(0);
-
- // An error occured. Do necessary clean up.
- if (matchDict!=NULL)
- {
- CFRelease(matchDict);
- matchDict = NULL;
- }
-
- [self stopRemoteControl];
- }
-
- return (NO);
+ }while(0);
+
+ // An error occured. Do necessary clean up.
+ if (matchDict!=NULL)
+ {
+ CFRelease(matchDict);
+ matchDict = NULL;
+ }
+
+ [self stopRemoteControl];
+ }
+
+ return (NO);
}
- (void)stopRemoteControl
{
- UInt32 serviceCount = 0;
+ UInt32 serviceCount = 0;
- _autoRecover = NO;
- _isStopping = YES;
-
- if (_autoRecoveryTimer!=nil)
- {
- [_autoRecoveryTimer invalidate];
- _autoRecoveryTimer = nil;
- }
+ _autoRecover = NO;
+ _isStopping = YES;
- if (_serviceAttribMap!=nil)
- {
- NSDictionary *cloneDict = [[NSDictionary alloc] initWithDictionary:_serviceAttribMap];
-
- if (cloneDict!=nil)
- {
- NSEnumerator *mapKeyEnum = [cloneDict keyEnumerator];
- NSNumber *serviceValue;
-
- while ((serviceValue = [mapKeyEnum nextObject]) != nil)
- {
- [self _destructService:(io_object_t)[serviceValue unsignedIntValue]];
- serviceCount++;
- };
-
- cloneDict = nil;
- }
-
- _serviceAttribMap = nil;
- }
+ if (_autoRecoveryTimer!=nil)
+ {
+ [_autoRecoveryTimer invalidate];
+ HIDRemoteReleaseNil(_autoRecoveryTimer);
+ }
- if (_matchingServicesIterator!=0)
- {
- IOObjectRelease((io_object_t) _matchingServicesIterator);
- _matchingServicesIterator = 0;
- }
-
- if (_secureInputNotification!=0)
- {
- IOObjectRelease((io_object_t) _secureInputNotification);
- _secureInputNotification = 0;
- }
+ if (_serviceAttribMap!=nil)
+ {
+ NSDictionary *cloneDict = [[NSDictionary alloc] initWithDictionary:_serviceAttribMap];
+
+ if (cloneDict!=nil)
+ {
+ NSEnumerator *mapKeyEnum = [cloneDict keyEnumerator];
+ NSNumber *serviceValue;
+
+ while ((serviceValue = [mapKeyEnum nextObject]) != nil)
+ {
+ [self _destructService:(io_object_t)[serviceValue unsignedIntValue]];
+ serviceCount++;
+ };
+
+ HIDRemoteReleaseNil(cloneDict);
+ }
+
+ HIDRemoteReleaseNil(_serviceAttribMap);
+ }
- if (_notifyRLSource!=NULL)
- {
- CFRunLoopSourceInvalidate(_notifyRLSource);
- _notifyRLSource = NULL;
- }
+ if (_matchingServicesIterator!=0)
+ {
+ IOObjectRelease((io_object_t) _matchingServicesIterator);
+ _matchingServicesIterator = 0;
+ }
+
+ if (_secureInputNotification!=0)
+ {
+ IOObjectRelease((io_object_t) _secureInputNotification);
+ _secureInputNotification = 0;
+ }
- if (_notifyPort!=NULL)
- {
- IONotificationPortDestroy(_notifyPort);
- _notifyPort = NULL;
- }
+ if (_notifyRLSource!=NULL)
+ {
+ CFRunLoopSourceInvalidate(_notifyRLSource);
+ _notifyRLSource = NULL;
+ }
- if (_masterPort!=0)
- {
- mach_port_deallocate(mach_task_self(), _masterPort);
- _masterPort = 0;
- }
+ if (_notifyPort!=NULL)
+ {
+ IONotificationPortDestroy(_notifyPort);
+ _notifyPort = NULL;
+ }
- if (_returnToPID!=nil)
- {
- _returnToPID = nil;
- }
+ if (_masterPort!=0)
+ {
+ mach_port_deallocate(mach_task_self(), _masterPort);
+ _masterPort = 0;
+ }
- if (_mode!=kHIDRemoteModeNone)
- {
- // Post status
- [self _postStatusWithAction:kHIDRemoteDNStatusActionStop];
+ if (_returnToPID!=nil)
+ {
+ HIDRemoteReleaseNil(_returnToPID);
+ }
- if (_sendStatusNotifications)
- {
- // In case we were not ready to lend it earlier, tell other HIDRemote apps that the resources (if any were used) are now again available for use by other applications
- if (((_mode==kHIDRemoteModeExclusive) || (_mode==kHIDRemoteModeExclusiveAuto)) && (_sendExclusiveResourceReuseNotification==YES) && (_exclusiveLockLending==NO) && (serviceCount>0))
- {
- _mode = kHIDRemoteModeNone;
-
- if (!_isRestarting)
- {
- [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kHIDRemoteDNHIDRemoteRetry
- object:kHIDRemoteDNHIDRemoteRetryGlobalObject
- userInfo:[NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithUnsignedInt:(unsigned int)getpid()], kHIDRemoteDNStatusPIDKey,
- [[NSBundle mainBundle] bundleIdentifier], (__bridge NSString *)kCFBundleIdentifierKey,
- nil]
- deliverImmediately:YES];
- }
- }
- }
- }
-
- _mode = kHIDRemoteModeNone;
- _isStopping = NO;
+ if (_mode!=kHIDRemoteModeNone)
+ {
+ // Post status
+ [self _postStatusWithAction:kHIDRemoteDNStatusActionStop];
+
+ if (_sendStatusNotifications)
+ {
+ // In case we were not ready to lend it earlier, tell other HIDRemote apps that the resources (if any were used) are now again available for use by other applications
+ if (((_mode==kHIDRemoteModeExclusive) || (_mode==kHIDRemoteModeExclusiveAuto)) && (_sendExclusiveResourceReuseNotification==YES) && (_exclusiveLockLending==NO) && (serviceCount>0))
+ {
+ _mode = kHIDRemoteModeNone;
+
+ if (!_isRestarting)
+ {
+ [[NSDistributedNotificationCenter defaultCenter] postNotificationName:kHIDRemoteDNHIDRemoteRetry
+ object:kHIDRemoteDNHIDRemoteRetryGlobalObject
+ userInfo:[NSDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithUnsignedInt:(unsigned int)getpid()], kHIDRemoteDNStatusPIDKey,
+ [[NSBundle mainBundle] bundleIdentifier], (NSString *)kCFBundleIdentifierKey,
+ nil]
+ deliverImmediately:YES];
+ }
+ }
+ }
+
+ // Unregister from system wake notifications
+ [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self name:NSWorkspaceDidWakeNotification object:nil];
+ }
+
+ _mode = kHIDRemoteModeNone;
+ _isStopping = NO;
}
- (BOOL)isStarted
{
- return (_mode != kHIDRemoteModeNone);
+ return (_mode != kHIDRemoteModeNone);
}
- (HIDRemoteMode)startedInMode
{
- return (_mode);
+ return (_mode);
}
- (unsigned)activeRemoteControlCount
{
- return ([_serviceAttribMap count]);
+ return ((unsigned)[_serviceAttribMap count]);
}
- (SInt32)lastSeenRemoteControlID
{
- return (_lastSeenRemoteID);
+ return (_lastSeenRemoteID);
}
- (HIDRemoteModel)lastSeenModel
{
- return (_lastSeenModel);
+ return (_lastSeenModel);
}
- (void)setLastSeenModel:(HIDRemoteModel)aModel
{
- _lastSeenModel = aModel;
+ _lastSeenModel = aModel;
}
- (void)setSimulateHoldEvents:(BOOL)newSimulateHoldEvents
{
- _simulateHoldEvents = newSimulateHoldEvents;
+ _simulateHoldEvents = newSimulateHoldEvents;
}
- (BOOL)simulateHoldEvents
{
- return (_simulateHoldEvents);
+ return (_simulateHoldEvents);
}
- (NSArray *)unusedButtonCodes
{
- return (_unusedButtonCodes);
+ return (_unusedButtonCodes);
}
- (void)setUnusedButtonCodes:(NSArray *)newArrayWithUnusedButtonCodesAsNSNumbers
{
- _unusedButtonCodes = newArrayWithUnusedButtonCodesAsNSNumbers;
+ HIDRemoteRetain(newArrayWithUnusedButtonCodesAsNSNumbers);
+ HIDRemoteRelease(_unusedButtonCodes);
+
+ _unusedButtonCodes = newArrayWithUnusedButtonCodesAsNSNumbers;
- [self _postStatusWithAction:kHIDRemoteDNStatusActionUpdate];
+ [self _postStatusWithAction:kHIDRemoteDNStatusActionUpdate];
}
- (void)setDelegate:(NSObject <HIDRemoteDelegate> *)newDelegate
{
- _delegate = newDelegate;
+ _delegate = newDelegate;
}
- (NSObject <HIDRemoteDelegate> *)delegate
{
- return (_delegate);
+ return (_delegate);
}
-#pragma mark -- PUBLIC: Expert APIs --
+#pragma mark - PUBLIC: Expert APIs
- (void)setEnableSecureEventInputWorkaround:(BOOL)newEnableSecureEventInputWorkaround
{
- _secureEventInputWorkAround = newEnableSecureEventInputWorkaround;
+ _secureEventInputWorkAround = newEnableSecureEventInputWorkaround;
}
- (BOOL)enableSecureEventInputWorkaround
{
- return (_secureEventInputWorkAround);
+ return (_secureEventInputWorkAround);
}
- (void)setExclusiveLockLendingEnabled:(BOOL)newExclusiveLockLendingEnabled
{
- if (newExclusiveLockLendingEnabled != _exclusiveLockLending)
- {
- _exclusiveLockLending = newExclusiveLockLendingEnabled;
-
- if (_exclusiveLockLending)
- {
- [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_handleNotifications:) name:kHIDRemoteDNHIDRemoteStatus object:nil];
- }
- else
- {
- [[NSDistributedNotificationCenter defaultCenter] removeObserver:self name:kHIDRemoteDNHIDRemoteStatus object:nil];
-
- _waitForReturnByPID = nil;
- }
- }
+ if (newExclusiveLockLendingEnabled != _exclusiveLockLending)
+ {
+ _exclusiveLockLending = newExclusiveLockLendingEnabled;
+
+ if (_exclusiveLockLending)
+ {
+ [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_handleNotifications:) name:kHIDRemoteDNHIDRemoteStatus object:nil];
+ }
+ else
+ {
+ [[NSDistributedNotificationCenter defaultCenter] removeObserver:self name:kHIDRemoteDNHIDRemoteStatus object:nil];
+
+ HIDRemoteReleaseNil(_waitForReturnByPID);
+ }
+ }
}
- (BOOL)exclusiveLockLendingEnabled
{
- return (_exclusiveLockLending);
+ return (_exclusiveLockLending);
}
- (void)setSendExclusiveResourceReuseNotification:(BOOL)newSendExclusiveResourceReuseNotification
{
- _sendExclusiveResourceReuseNotification = newSendExclusiveResourceReuseNotification;
+ _sendExclusiveResourceReuseNotification = newSendExclusiveResourceReuseNotification;
}
- (BOOL)sendExclusiveResourceReuseNotification
{
- return (_sendExclusiveResourceReuseNotification);
+ return (_sendExclusiveResourceReuseNotification);
}
- (BOOL)isApplicationTerminating
{
- return (_applicationIsTerminating);
+ return (_applicationIsTerminating);
}
- (BOOL)isStopping
{
- return (_isStopping);
+ return (_isStopping);
}
-#pragma mark -- PRIVATE: Application becomes active / inactive handling for kHIDRemoteModeExclusiveAuto --
+#pragma mark - PRIVATE: Application becomes active / inactive handling for kHIDRemoteModeExclusiveAuto
- (void)_appStatusChanged:(NSNotification *)notification
{
- #ifdef HIDREMOTE_THREADSAFETY_HARDENED_NOTIFICATION_HANDLING
- if ([self respondsToSelector:@selector(performSelector:onThread:withObject:waitUntilDone:)]) // OS X 10.5+ only
- {
- if ([NSThread currentThread] != _runOnThread)
- {
- if ([[notification name] isEqual:NSApplicationDidBecomeActiveNotification])
- {
- if (!_autoRecover)
- {
- return;
- }
- }
-
- if ([[notificat...
[truncated message content] |
|
From: <ho...@us...> - 2025-08-17 16:38:40
|
Revision: 15672
http://sourceforge.net/p/skim-app/code/15672
Author: hofman
Date: 2025-08-17 16:38:37 +0000 (Sun, 17 Aug 2025)
Log Message:
-----------
Move level indicator call code to view class files
Modified Paths:
--------------
trunk/SKLevelIndicator.h
trunk/SKLevelIndicator.m
trunk/Skim.xcodeproj/project.pbxproj
Removed Paths:
-------------
trunk/SKLevelIndicatorCell.h
trunk/SKLevelIndicatorCell.m
Modified: trunk/SKLevelIndicator.h
===================================================================
--- trunk/SKLevelIndicator.h 2025-08-17 16:33:02 UTC (rev 15671)
+++ trunk/SKLevelIndicator.h 2025-08-17 16:38:37 UTC (rev 15672)
@@ -2,11 +2,11 @@
// SKLevelIndicator.h
// Skim
//
-// Created by Christiaan Hofman on 19/04/2019.
+// Created by Christiaan Hofman on 10/31/08.
/*
- This software is Copyright (c) 2019
+ This software is Copyright (c) 2007
Christiaan Hofman. All rights reserved.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
@@ -41,3 +41,7 @@
@interface SKLevelIndicator : NSLevelIndicator
@end
+
+
+@interface SKLevelIndicatorCell : NSLevelIndicatorCell
+@end
Modified: trunk/SKLevelIndicator.m
===================================================================
--- trunk/SKLevelIndicator.m 2025-08-17 16:33:02 UTC (rev 15671)
+++ trunk/SKLevelIndicator.m 2025-08-17 16:38:37 UTC (rev 15672)
@@ -2,11 +2,11 @@
// SKLevelIndicator.m
// Skim
//
-// Created by Christiaan Hofman on 19/04/2019.
+// Created by Christiaan Hofman on 10/31/08.
/*
- This software is Copyright (c) 2019
+ This software is Copyright (c) 2007
Christiaan Hofman. All rights reserved.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
@@ -37,7 +37,7 @@
*/
#import "SKLevelIndicator.h"
-#import "SKLevelIndicatorCell.h"
+#import "NSGeometry_SKExtensions.h"
@implementation SKLevelIndicator
@@ -50,3 +50,74 @@
}
@end
+
+#pragma mark -
+
+@implementation SKLevelIndicatorCell
+
+#define EDGE_HEIGHT 4.0
+
+- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
+ BOOL drawDiscreteContinuous = ([self levelIndicatorStyle] == NSDiscreteCapacityLevelIndicatorStyle) && (NSWidth(cellFrame) + 1.0 < 3.0 * [self maxValue]);
+ if (drawDiscreteContinuous)
+ [self setLevelIndicatorStyle:NSContinuousCapacityLevelIndicatorStyle];
+ CGFloat cellHeight = [self cellSize].height;
+ if (fabs(NSHeight(cellFrame) - cellHeight) <= 0.0) {
+ [NSGraphicsContext saveGraphicsState];
+ [[NSBezierPath bezierPathWithRect:cellFrame] addClip];
+ [super drawWithFrame:cellFrame inView:controlView];
+ [NSGraphicsContext restoreGraphicsState];
+ } else if (NSHeight(cellFrame) <= 2.0 * (cellHeight - EDGE_HEIGHT)) {
+ NSRect topFrame, bottomFrame, frame = cellFrame;
+ NSDivideRect(cellFrame, &topFrame, &bottomFrame, floor(0.5 * NSHeight(cellFrame)), NSMinYEdge);
+ frame.size.height = cellHeight;
+ [NSGraphicsContext saveGraphicsState];
+ [[NSBezierPath bezierPathWithRect:topFrame] addClip];
+ [super drawWithFrame:frame inView:controlView];
+ [NSGraphicsContext restoreGraphicsState];
+ [NSGraphicsContext saveGraphicsState];
+ [[NSBezierPath bezierPathWithRect:bottomFrame] addClip];
+ frame.origin.y = NSMaxY(bottomFrame) - cellHeight;
+ [super drawWithFrame:frame inView:controlView];
+ [NSGraphicsContext restoreGraphicsState];
+ } else {
+ NSRect topFrame, bottomFrame, restFrame, frame = cellFrame, midFrame;
+ NSDivideRect(cellFrame, &topFrame, &bottomFrame, cellHeight - EDGE_HEIGHT, NSMinYEdge);
+ NSDivideRect(bottomFrame, &bottomFrame, &restFrame, cellHeight - EDGE_HEIGHT, NSMaxYEdge);
+ frame.size.height = cellHeight;
+ [NSGraphicsContext saveGraphicsState];
+ [[NSBezierPath bezierPathWithRect:topFrame] addClip];
+ [super drawWithFrame:frame inView:controlView];
+ [NSGraphicsContext restoreGraphicsState];
+ do {
+ NSDivideRect(restFrame, &midFrame, &restFrame, fmin(cellHeight - 2.0 * EDGE_HEIGHT, NSHeight(restFrame)), NSMinYEdge);
+ [NSGraphicsContext saveGraphicsState];
+ [[NSBezierPath bezierPathWithRect:midFrame] addClip];
+ frame.origin.y = NSMinY(midFrame) - EDGE_HEIGHT;
+ [super drawWithFrame:frame inView:controlView];
+ [NSGraphicsContext restoreGraphicsState];
+ } while (NSHeight(restFrame) > 0.0);
+ frame.origin.y = NSMaxY(bottomFrame) - cellHeight;
+ [NSGraphicsContext saveGraphicsState];
+ [[NSBezierPath bezierPathWithRect:bottomFrame] addClip];
+ [super drawWithFrame:frame inView:controlView];
+ [NSGraphicsContext restoreGraphicsState];
+ }
+ if (drawDiscreteContinuous)
+ [self setLevelIndicatorStyle:NSDiscreteCapacityLevelIndicatorStyle];
+}
+
+- (void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle {
+ if (@available(macOS 10.14, *)) {
+ if ([self levelIndicatorStyle] == NSLevelIndicatorStyleRelevancy && [[self controlView] isKindOfClass:[NSLevelIndicator class]]) {
+ if (backgroundStyle == NSBackgroundStyleEmphasized)
+ [[self controlView] setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameDarkAqua]];
+ else
+ [[self controlView] setAppearance:nil];
+ }
+ }
+ [super setBackgroundStyle:backgroundStyle];
+}
+
+@end
+
Deleted: trunk/SKLevelIndicatorCell.h
===================================================================
--- trunk/SKLevelIndicatorCell.h 2025-08-17 16:33:02 UTC (rev 15671)
+++ trunk/SKLevelIndicatorCell.h 2025-08-17 16:38:37 UTC (rev 15672)
@@ -1,43 +0,0 @@
-//
-// SKLevelIndicatorCell.h
-// Skim
-//
-// Created by Christiaan Hofman on 10/31/08.
-/*
- This software is Copyright (c) 2007
- Christiaan Hofman. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
- - Neither the name of Christiaan Hofman nor the names of any
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <Cocoa/Cocoa.h>
-
-
-@interface SKLevelIndicatorCell : NSLevelIndicatorCell
-@end
Deleted: trunk/SKLevelIndicatorCell.m
===================================================================
--- trunk/SKLevelIndicatorCell.m 2025-08-17 16:33:02 UTC (rev 15671)
+++ trunk/SKLevelIndicatorCell.m 2025-08-17 16:38:37 UTC (rev 15672)
@@ -1,108 +0,0 @@
-//
-// SKLevelIndicatorCell.m
-// Skim
-//
-// Created by Christiaan Hofman on 10/31/08.
-/*
- This software is Copyright (c) 2007
- Christiaan Hofman. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
- - Neither the name of Christiaan Hofman nor the names of any
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "SKLevelIndicatorCell.h"
-#import "NSGeometry_SKExtensions.h"
-
-#define EDGE_HEIGHT 4.0
-
-@implementation SKLevelIndicatorCell
-
-- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
- BOOL drawDiscreteContinuous = ([self levelIndicatorStyle] == NSDiscreteCapacityLevelIndicatorStyle) && (NSWidth(cellFrame) + 1.0 < 3.0 * [self maxValue]);
- if (drawDiscreteContinuous)
- [self setLevelIndicatorStyle:NSContinuousCapacityLevelIndicatorStyle];
- CGFloat cellHeight = [self cellSize].height;
- if (fabs(NSHeight(cellFrame) - cellHeight) <= 0.0) {
- [NSGraphicsContext saveGraphicsState];
- [[NSBezierPath bezierPathWithRect:cellFrame] addClip];
- [super drawWithFrame:cellFrame inView:controlView];
- [NSGraphicsContext restoreGraphicsState];
- } else if (NSHeight(cellFrame) <= 2.0 * (cellHeight - EDGE_HEIGHT)) {
- NSRect topFrame, bottomFrame, frame = cellFrame;
- NSDivideRect(cellFrame, &topFrame, &bottomFrame, floor(0.5 * NSHeight(cellFrame)), NSMinYEdge);
- frame.size.height = cellHeight;
- [NSGraphicsContext saveGraphicsState];
- [[NSBezierPath bezierPathWithRect:topFrame] addClip];
- [super drawWithFrame:frame inView:controlView];
- [NSGraphicsContext restoreGraphicsState];
- [NSGraphicsContext saveGraphicsState];
- [[NSBezierPath bezierPathWithRect:bottomFrame] addClip];
- frame.origin.y = NSMaxY(bottomFrame) - cellHeight;
- [super drawWithFrame:frame inView:controlView];
- [NSGraphicsContext restoreGraphicsState];
- } else {
- NSRect topFrame, bottomFrame, restFrame, frame = cellFrame, midFrame;
- NSDivideRect(cellFrame, &topFrame, &bottomFrame, cellHeight - EDGE_HEIGHT, NSMinYEdge);
- NSDivideRect(bottomFrame, &bottomFrame, &restFrame, cellHeight - EDGE_HEIGHT, NSMaxYEdge);
- frame.size.height = cellHeight;
- [NSGraphicsContext saveGraphicsState];
- [[NSBezierPath bezierPathWithRect:topFrame] addClip];
- [super drawWithFrame:frame inView:controlView];
- [NSGraphicsContext restoreGraphicsState];
- do {
- NSDivideRect(restFrame, &midFrame, &restFrame, fmin(cellHeight - 2.0 * EDGE_HEIGHT, NSHeight(restFrame)), NSMinYEdge);
- [NSGraphicsContext saveGraphicsState];
- [[NSBezierPath bezierPathWithRect:midFrame] addClip];
- frame.origin.y = NSMinY(midFrame) - EDGE_HEIGHT;
- [super drawWithFrame:frame inView:controlView];
- [NSGraphicsContext restoreGraphicsState];
- } while (NSHeight(restFrame) > 0.0);
- frame.origin.y = NSMaxY(bottomFrame) - cellHeight;
- [NSGraphicsContext saveGraphicsState];
- [[NSBezierPath bezierPathWithRect:bottomFrame] addClip];
- [super drawWithFrame:frame inView:controlView];
- [NSGraphicsContext restoreGraphicsState];
- }
- if (drawDiscreteContinuous)
- [self setLevelIndicatorStyle:NSDiscreteCapacityLevelIndicatorStyle];
-}
-
-- (void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle {
- if (@available(macOS 10.14, *)) {
- if ([self levelIndicatorStyle] == NSLevelIndicatorStyleRelevancy && [[self controlView] isKindOfClass:[NSLevelIndicator class]]) {
- if (backgroundStyle == NSBackgroundStyleEmphasized)
- [[self controlView] setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameDarkAqua]];
- else
- [[self controlView] setAppearance:nil];
- }
- }
- [super setBackgroundStyle:backgroundStyle];
-}
-
-@end
Modified: trunk/Skim.xcodeproj/project.pbxproj
===================================================================
--- trunk/Skim.xcodeproj/project.pbxproj 2025-08-17 16:33:02 UTC (rev 15671)
+++ trunk/Skim.xcodeproj/project.pbxproj 2025-08-17 16:38:37 UTC (rev 15672)
@@ -252,7 +252,6 @@
CEDB6A7A228F596000F93C87 /* SKColorPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = CEDB6A78228F596000F93C87 /* SKColorPicker.m */; };
CEDC7B1A2913CD2500032269 /* SKLoupeController.m in Sources */ = {isa = PBXBuildFile; fileRef = CEDC7B192913CD2500032269 /* SKLoupeController.m */; };
CEDE68E5201FDCB5000D881A /* SKKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = CEDE68E3201FDCB4000D881A /* SKKeychain.m */; };
- CEE0F5EB0EBB3DEC000A7A8C /* SKLevelIndicatorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CEE0F5EA0EBB3DEC000A7A8C /* SKLevelIndicatorCell.m */; };
CEE106150BCBB72C00BF2D3E /* SKNotesDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = CEE106140BCBB72C00BF2D3E /* SKNotesDocument.m */; };
CEE176E40DBD5B0C00E6C317 /* PDFDocumentView_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CEE176E30DBD5B0C00E6C317 /* PDFDocumentView_SKExtensions.m */; };
CEE229390BFB7CE9002B746B /* ReleaseNotes.rtf in Resources */ = {isa = PBXBuildFile; fileRef = CE54AA8E0BBC037400008750 /* ReleaseNotes.rtf */; };
@@ -1196,8 +1195,6 @@
CEDC7B192913CD2500032269 /* SKLoupeController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SKLoupeController.m; sourceTree = "<group>"; };
CEDE68E3201FDCB4000D881A /* SKKeychain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKKeychain.m; sourceTree = "<group>"; };
CEDE68E4201FDCB4000D881A /* SKKeychain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKKeychain.h; sourceTree = "<group>"; };
- CEE0F5E90EBB3DEC000A7A8C /* SKLevelIndicatorCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKLevelIndicatorCell.h; sourceTree = "<group>"; };
- CEE0F5EA0EBB3DEC000A7A8C /* SKLevelIndicatorCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKLevelIndicatorCell.m; sourceTree = "<group>"; };
CEE106130BCBB72C00BF2D3E /* SKNotesDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKNotesDocument.h; sourceTree = "<group>"; };
CEE106140BCBB72C00BF2D3E /* SKNotesDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKNotesDocument.m; sourceTree = "<group>"; };
CEE176E20DBD5B0C00E6C317 /* PDFDocumentView_SKExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PDFDocumentView_SKExtensions.h; sourceTree = "<group>"; };
@@ -1881,8 +1878,6 @@
CE454B50226E33150034FD6B /* SKHighlightingTableRowView.m */,
CE792F72226D12C40005BE9F /* SKLevelIndicator.h */,
CE792F73226D12C40005BE9F /* SKLevelIndicator.m */,
- CEE0F5E90EBB3DEC000A7A8C /* SKLevelIndicatorCell.h */,
- CEE0F5EA0EBB3DEC000A7A8C /* SKLevelIndicatorCell.m */,
CE4BC12D0C357A0300C2AF03 /* SKLineWell.h */,
CE4BC12E0C357A0300C2AF03 /* SKLineWell.m */,
CEA575CC0B9206E60003D2E7 /* SKNoteOutlineView.h */,
@@ -2944,7 +2939,6 @@
CE05A86F0E90ED950060BB07 /* SKTextFieldSheetController.m in Sources */,
CEAA8F2F0EA2A86200C16FE4 /* SKNoteText.m in Sources */,
CE7611650EA49D1400301E45 /* SKPrintableView.m in Sources */,
- CEE0F5EB0EBB3DEC000A7A8C /* SKLevelIndicatorCell.m in Sources */,
CE0A3C8E0EBF3AAA00526C74 /* NSResponder_SKExtensions.m in Sources */,
CE19E7A9275B7BC1007EBD8B /* SKDisplayPrefs.m in Sources */,
CE32531F0F4723EA0021BADD /* SKMainWindowController_Actions.m in Sources */,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-08-17 16:33:05
|
Revision: 15671
http://sourceforge.net/p/skim-app/code/15671
Author: hofman
Date: 2025-08-17 16:33:02 +0000 (Sun, 17 Aug 2025)
Log Message:
-----------
Move annotation type image cell code to view class files
Modified Paths:
--------------
trunk/SKAnnotationTypeImageView.h
trunk/SKAnnotationTypeImageView.m
trunk/Skim.xcodeproj/project.pbxproj
Removed Paths:
-------------
trunk/SKAnnotationTypeImageCell.h
trunk/SKAnnotationTypeImageCell.m
Deleted: trunk/SKAnnotationTypeImageCell.h
===================================================================
--- trunk/SKAnnotationTypeImageCell.h 2025-08-17 16:27:05 UTC (rev 15670)
+++ trunk/SKAnnotationTypeImageCell.h 2025-08-17 16:33:02 UTC (rev 15671)
@@ -1,49 +0,0 @@
-//
-// SKAnnotationTypeImageCell.h
-// Skim
-//
-// Created by Christiaan Hofman on 3/22/08.
-/*
- This software is Copyright (c) 2008
- Christiaan Hofman. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
- - Neither the name of Christiaan Hofman nor the names of any
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <Cocoa/Cocoa.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface SKAnnotationTypeImageCell : NSImageCell {
- BOOL hasOutline;
-}
-@property (nonatomic) BOOL hasOutline;
-@end
-
-NS_ASSUME_NONNULL_END
Deleted: trunk/SKAnnotationTypeImageCell.m
===================================================================
--- trunk/SKAnnotationTypeImageCell.m 2025-08-17 16:27:05 UTC (rev 15670)
+++ trunk/SKAnnotationTypeImageCell.m 2025-08-17 16:33:02 UTC (rev 15671)
@@ -1,94 +0,0 @@
-//
-// SKAnnotationTypeImageCell.m
-// Skim
-//
-// Created by Christiaan Hofman on 3/22/08.
-/*
- This software is Copyright (c) 2008
- Christiaan Hofman. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
- - Neither the name of Christiaan Hofman nor the names of any
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "SKAnnotationTypeImageCell.h"
-#import "NSImage_SKExtensions.h"
-#import "NSString_SKExtensions.h"
-#import <SkimNotes/SkimNotes.h>
-
-
-@implementation SKAnnotationTypeImageCell
-
-@synthesize hasOutline;
-
-static NSMutableDictionary *activeImages;
-
-+ (void)initialize {
- SKINITIALIZE;
- activeImages = [[NSMutableDictionary alloc] init];
-}
-
-- (instancetype)initWithCoder:(NSCoder *)decoder {
- self = [super initWithCoder:decoder];
- if (self) {
- hasOutline = [decoder decodeBoolForKey:@"hasOutline"];
- }
- return self;
-}
-
-- (void)encodeWithCoder:(NSCoder *)coder {
- [super encodeWithCoder:coder];
- [coder encodeBool:hasOutline forKey:@"hasOutline"];
-}
-
-- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
- [super drawWithFrame:cellFrame inView:controlView];
-
- if ([self hasOutline]) {
- NSSize size = cellFrame.size;
- size.height = fmin(size.width, size.height);
- NSString *sizeKey = NSStringFromSize(size);
- NSImage *image = [activeImages objectForKey:sizeKey];
- if (image == nil) {
- image = [NSImage imageWithSize:size drawingHandler:^(NSRect r){
- [[NSColor blackColor] setStroke];
- [NSBezierPath setDefaultLineWidth:1.0];
- [NSBezierPath strokeRect:NSMakeRect(0.5, 1.5, NSWidth(r) - 1.0, NSHeight(r) - 2.0)];
- return YES;
- }];
- [image setTemplate:YES];
- [activeImages setObject:image forKey:sizeKey];
- }
- id object = [self objectValue];
- [self setObjectValue:image];
- [super drawWithFrame:cellFrame inView:controlView];
- [self setObjectValue:object];
- }
-}
-
-@end
Modified: trunk/SKAnnotationTypeImageView.h
===================================================================
--- trunk/SKAnnotationTypeImageView.h 2025-08-17 16:27:05 UTC (rev 15670)
+++ trunk/SKAnnotationTypeImageView.h 2025-08-17 16:33:02 UTC (rev 15671)
@@ -2,9 +2,9 @@
// SKAnnotationTypeImageView.h
// Skim
//
-// Created by Christiaan Hofman on 23/04/2019.
+// Created by Christiaan Hofman on 3/22/08.
/*
- This software is Copyright (c) 2019
+ This software is Copyright (c) 2008
Christiaan Hofman. All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -46,4 +46,14 @@
@end
+#pragma mark -
+
+@interface SKAnnotationTypeImageCell : NSImageCell {
+ BOOL hasOutline;
+}
+
+@property (nonatomic) BOOL hasOutline;
+
+@end
+
NS_ASSUME_NONNULL_END
Modified: trunk/SKAnnotationTypeImageView.m
===================================================================
--- trunk/SKAnnotationTypeImageView.m 2025-08-17 16:27:05 UTC (rev 15670)
+++ trunk/SKAnnotationTypeImageView.m 2025-08-17 16:33:02 UTC (rev 15671)
@@ -2,9 +2,9 @@
// SKAnnotationTypeImageView.m
// Skim
//
-// Created by Christiaan Hofman on 23/04/2019.
+// Created by Christiaan Hofman on 3/22/08.
/*
- This software is Copyright (c) 2019
+ This software is Copyright (c) 2008
Christiaan Hofman. All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -37,7 +37,9 @@
*/
#import "SKAnnotationTypeImageView.h"
-#import "SKAnnotationTypeImageCell.h"
+#import "NSImage_SKExtensions.h"
+#import "NSString_SKExtensions.h"
+#import <SkimNotes/SkimNotes.h>
@implementation SKAnnotationTypeImageView
@@ -58,3 +60,56 @@
}
@end
+
+#pragma mark -
+
+@implementation SKAnnotationTypeImageCell
+
+@synthesize hasOutline;
+
+static NSMutableDictionary *activeImages;
+
++ (void)initialize {
+ SKINITIALIZE;
+ activeImages = [[NSMutableDictionary alloc] init];
+}
+
+- (instancetype)initWithCoder:(NSCoder *)decoder {
+ self = [super initWithCoder:decoder];
+ if (self) {
+ hasOutline = [decoder decodeBoolForKey:@"hasOutline"];
+ }
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+ [super encodeWithCoder:coder];
+ [coder encodeBool:hasOutline forKey:@"hasOutline"];
+}
+
+- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
+ [super drawWithFrame:cellFrame inView:controlView];
+
+ if ([self hasOutline]) {
+ NSSize size = cellFrame.size;
+ size.height = fmin(size.width, size.height);
+ NSString *sizeKey = NSStringFromSize(size);
+ NSImage *image = [activeImages objectForKey:sizeKey];
+ if (image == nil) {
+ image = [NSImage imageWithSize:size drawingHandler:^(NSRect r){
+ [[NSColor blackColor] setStroke];
+ [NSBezierPath setDefaultLineWidth:1.0];
+ [NSBezierPath strokeRect:NSMakeRect(0.5, 1.5, NSWidth(r) - 1.0, NSHeight(r) - 2.0)];
+ return YES;
+ }];
+ [image setTemplate:YES];
+ [activeImages setObject:image forKey:sizeKey];
+ }
+ id object = [self objectValue];
+ [self setObjectValue:image];
+ [super drawWithFrame:cellFrame inView:controlView];
+ [self setObjectValue:object];
+ }
+}
+
+@end
Modified: trunk/Skim.xcodeproj/project.pbxproj
===================================================================
--- trunk/Skim.xcodeproj/project.pbxproj 2025-08-17 16:27:05 UTC (rev 15670)
+++ trunk/Skim.xcodeproj/project.pbxproj 2025-08-17 16:33:02 UTC (rev 15671)
@@ -73,7 +73,6 @@
CE19446710627483007E8770 /* ProgressSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE19446010627483007E8770 /* ProgressSheet.xib */; };
CE19446910627483007E8770 /* SnapshotWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE19446210627483007E8770 /* SnapshotWindow.xib */; };
CE19641516E811D40027E2CF /* SKSnapshotWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CE19641416E811D40027E2CF /* SKSnapshotWindow.m */; };
- CE199DFD0D957A16009B2055 /* SKAnnotationTypeImageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CE199DFC0D957A16009B2055 /* SKAnnotationTypeImageCell.m */; };
CE19E7A9275B7BC1007EBD8B /* SKDisplayPrefs.m in Sources */ = {isa = PBXBuildFile; fileRef = CE19E7A8275B7BC1007EBD8B /* SKDisplayPrefs.m */; };
CE1ADEBF0C4C341100071840 /* SKTransitionController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE1ADEBE0C4C341100071840 /* SKTransitionController.m */; };
CE1C77B6123FB41E00C73F1A /* SKNoteTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = CE1C77B5123FB41E00C73F1A /* SKNoteTextView.m */; };
@@ -828,8 +827,6 @@
CE19446210627483007E8770 /* SnapshotWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SnapshotWindow.xib; sourceTree = "<group>"; };
CE19641316E811D40027E2CF /* SKSnapshotWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKSnapshotWindow.h; sourceTree = "<group>"; };
CE19641416E811D40027E2CF /* SKSnapshotWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKSnapshotWindow.m; sourceTree = "<group>"; };
- CE199DFB0D957A16009B2055 /* SKAnnotationTypeImageCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKAnnotationTypeImageCell.h; sourceTree = "<group>"; };
- CE199DFC0D957A16009B2055 /* SKAnnotationTypeImageCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKAnnotationTypeImageCell.m; sourceTree = "<group>"; };
CE19E7A7275B7BC1007EBD8B /* SKDisplayPrefs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SKDisplayPrefs.h; sourceTree = "<group>"; };
CE19E7A8275B7BC1007EBD8B /* SKDisplayPrefs.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SKDisplayPrefs.m; sourceTree = "<group>"; };
CE1ADB170C4BC6DE00071840 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
@@ -1860,8 +1857,6 @@
CE2DE4D10B85D92F00D0DA12 /* Views and Cells */ = {
isa = PBXGroup;
children = (
- CE199DFB0D957A16009B2055 /* SKAnnotationTypeImageCell.h */,
- CE199DFC0D957A16009B2055 /* SKAnnotationTypeImageCell.m */,
CE325590226F73810032390F /* SKAnnotationTypeImageView.h */,
CE325591226F73810032390F /* SKAnnotationTypeImageView.m */,
CEED148A2709EE4D00A8C4AA /* SKBasePDFView.h */,
@@ -2911,7 +2906,6 @@
CE2E9A592C14D2F300044B01 /* SKSnapshotConfiguration.m in Sources */,
CEA8FCD60D89C34A00E8A6F4 /* SKAnimatedBorderlessWindow.m in Sources */,
CEB4EC502D87409100CA01A1 /* SKNoteToolbarController.m in Sources */,
- CE199DFD0D957A16009B2055 /* SKAnnotationTypeImageCell.m in Sources */,
CEE54D880DA2E37B0037169F /* PDFAnnotation_SKExtensions.m in Sources */,
CEE54D930DA2E5E10037169F /* PDFAnnotationCircle_SKExtensions.m in Sources */,
CEE54D980DA2E6FC0037169F /* PDFAnnotationSquare_SKExtensions.m in Sources */,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-08-17 16:27:08
|
Revision: 15670
http://sourceforge.net/p/skim-app/code/15670
Author: hofman
Date: 2025-08-17 16:27:05 +0000 (Sun, 17 Aug 2025)
Log Message:
-----------
remove unused import
Modified Paths:
--------------
trunk/PDFAnnotation_SKExtensions.m
Modified: trunk/PDFAnnotation_SKExtensions.m
===================================================================
--- trunk/PDFAnnotation_SKExtensions.m 2025-08-17 16:15:03 UTC (rev 15669)
+++ trunk/PDFAnnotation_SKExtensions.m 2025-08-17 16:27:05 UTC (rev 15670)
@@ -63,7 +63,6 @@
#import "SKNoteText.h"
#import "PDFView_SKExtensions.h"
#import "NSDate_SKExtensions.h"
-#import "SKAnnotationTypeImageCell.h"
NSString *SKPDFAnnotationScriptingColorKey = @"scriptingColor";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-08-17 16:15:07
|
Revision: 15669
http://sourceforge.net/p/skim-app/code/15669
Author: hofman
Date: 2025-08-17 16:15:03 +0000 (Sun, 17 Aug 2025)
Log Message:
-----------
make methods to get string from template array private
Modified Paths:
--------------
trunk/SKTemplateParser.h
trunk/SKTemplateParser.m
Modified: trunk/SKTemplateParser.h
===================================================================
--- trunk/SKTemplateParser.h 2025-08-17 15:34:24 UTC (rev 15668)
+++ trunk/SKTemplateParser.h 2025-08-17 16:15:03 UTC (rev 15669)
@@ -45,12 +45,10 @@
@interface SKTemplateParser : NSObject
+ (NSString *)stringByParsingTemplateString:(NSString *)templateString usingObject:(id)object;
++ (NSAttributedString *)attributedStringByParsingTemplateAttributedString:(NSAttributedString *)templateAttrString usingObject:(id)object;
+
+ (NSArray<__kindof SKTemplateTag *> *)templateByParsingTemplateString:(NSString *)templateString isSubtemplate:(BOOL)isSubtemplate;
-+ (NSString *)stringFromTemplate:(NSArray<__kindof SKTemplateTag *> *)templateArray usingObject:(id)object atIndex:(NSInteger)anIndex;
-
-+ (NSAttributedString *)attributedStringByParsingTemplateAttributedString:(NSAttributedString *)templateAttrString usingObject:(id)object;
+ (NSArray<__kindof SKTemplateTag *> *)templateByParsingTemplateAttributedString:(NSAttributedString *)templateAttrString isSubtemplate:(BOOL)isSubtemplate;
-+ (NSAttributedString *)attributedStringFromTemplate:(NSArray<__kindof SKTemplateTag *> *)templateArray usingObject:(id)object atIndex:(NSInteger)anIndex;
@end
Modified: trunk/SKTemplateParser.m
===================================================================
--- trunk/SKTemplateParser.m 2025-08-17 15:34:24 UTC (rev 15668)
+++ trunk/SKTemplateParser.m 2025-08-17 16:15:03 UTC (rev 15669)
@@ -344,10 +344,6 @@
#pragma mark Parsing string templates
-+ (NSString *)stringByParsingTemplateString:(NSString *)template usingObject:(id)object {
- return [self stringFromTemplate:[self templateByParsingTemplateString:template isSubtemplate:NO] usingObject:object atIndex:0];
-}
-
+ (NSArray *)templateByParsingTemplateString:(NSString *)template isSubtemplate:(BOOL)isSubtemplate {
NSScanner *scanner = [[NSScanner alloc] initWithString:template];
NSMutableArray *result = [[NSMutableArray alloc] init];
@@ -566,12 +562,12 @@
return result;
}
++ (NSString *)stringByParsingTemplateString:(NSString *)template usingObject:(id)object {
+ return [self stringFromTemplate:[self templateByParsingTemplateString:template isSubtemplate:NO] usingObject:object atIndex:0];
+}
+
#pragma mark Parsing attributed string templates
-+ (NSAttributedString *)attributedStringByParsingTemplateAttributedString:(NSAttributedString *)template usingObject:(id)object {
- return [self attributedStringFromTemplate:[self templateByParsingTemplateAttributedString:template isSubtemplate:NO] usingObject:object atIndex:0];
-}
-
+ (NSArray *)templateByParsingTemplateAttributedString:(NSAttributedString *)template isSubtemplate:(BOOL)isSubtemplate {
NSString *templateString = [template string];
NSScanner *scanner = [[NSScanner alloc] initWithString:templateString];
@@ -848,6 +844,10 @@
return result;
}
++ (NSAttributedString *)attributedStringByParsingTemplateAttributedString:(NSAttributedString *)template usingObject:(id)object {
+ return [self attributedStringFromTemplate:[self templateByParsingTemplateAttributedString:template isSubtemplate:NO] usingObject:object atIndex:0];
+}
+
@end
#pragma mark -
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-08-17 15:34:28
|
Revision: 15668
http://sourceforge.net/p/skim-app/code/15668
Author: hofman
Date: 2025-08-17 15:34:24 +0000 (Sun, 17 Aug 2025)
Log Message:
-----------
service for keychain is never nil
Modified Paths:
--------------
trunk/SKKeychain.h
trunk/SKKeychain.m
Modified: trunk/SKKeychain.h
===================================================================
--- trunk/SKKeychain.h 2025-07-28 15:38:10 UTC (rev 15667)
+++ trunk/SKKeychain.h 2025-08-17 15:34:24 UTC (rev 15668)
@@ -50,7 +50,7 @@
+ (nullable NSString *)passwordForService:(NSString *)service account:(nullable NSString *)account status:(SKPasswordStatus *)status;
+ (void)setPassword:(NSString *)password forService:(NSString *)service account:(NSString *)account label:(nullable NSString *)label comment:(nullable NSString *)comment;
-+ (SKPasswordStatus)updatePassword:(nullable NSString *)password service:(nullable NSString *)service account:(nullable NSString *)account label:(nullable NSString *)label comment:(nullable NSString *)comment forService:(nullable NSString *)oldService account:(nullable NSString *)oldAccount;
++ (SKPasswordStatus)updatePassword:(nullable NSString *)password service:(nullable NSString *)service account:(nullable NSString *)account label:(nullable NSString *)label comment:(nullable NSString *)comment forService:(NSString *)oldService account:(nullable NSString *)oldAccount;
@end
Modified: trunk/SKKeychain.m
===================================================================
--- trunk/SKKeychain.m 2025-07-28 15:38:10 UTC (rev 15667)
+++ trunk/SKKeychain.m 2025-08-17 15:34:24 UTC (rev 15668)
@@ -49,8 +49,7 @@
CFDictionarySetValue(query, kSecClass, kSecClassGenericPassword);
CFDictionarySetValue(query, kSecMatchLimit, kSecMatchLimitOne);
- if (service)
- CFDictionarySetValue(query, kSecAttrService, (__bridge CFStringRef)service);
+ CFDictionarySetValue(query, kSecAttrService, (__bridge CFStringRef)service);
if (account)
CFDictionarySetValue(query, kSecAttrAccount, (__bridge CFStringRef)account);
CFDictionarySetValue(query, kSecReturnData, kCFBooleanTrue);
@@ -101,8 +100,7 @@
CFDictionarySetValue(query, kSecClass, kSecClassGenericPassword);
CFDictionarySetValue(query, kSecMatchLimit, kSecMatchLimitOne);
- if (itemService)
- CFDictionarySetValue(query, kSecAttrService, (__bridge CFStringRef)itemService);
+ CFDictionarySetValue(query, kSecAttrService, (__bridge CFStringRef)itemService);
if (itemAccount)
CFDictionarySetValue(query, kSecAttrAccount, (__bridge CFStringRef)itemAccount);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-28 15:38:11
|
Revision: 15667
http://sourceforge.net/p/skim-app/code/15667
Author: hofman
Date: 2025-07-28 15:38:10 +0000 (Mon, 28 Jul 2025)
Log Message:
-----------
support back / forward mouse buttons
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2025-07-17 08:53:45 UTC (rev 15666)
+++ trunk/SKPDFView.m 2025-07-28 15:38:10 UTC (rev 15667)
@@ -1866,6 +1866,15 @@
}
}
+- (void)otherMouseDown:(NSEvent *)theEvent {
+ [super otherMouseDown:theEvent];
+ NSInteger button = [theEvent buttonNumber];
+ if (button == 3 && [self canGoBack])
+ [self goBack:nil];
+ else if (button == 4 && [self canGoForward])
+ [self goForward:nil];
+}
+
- (void)flagsChanged:(NSEvent *)theEvent {
[super flagsChanged:theEvent];
[self setCursorForMouse:nil];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-17 08:53:46
|
Revision: 15666
http://sourceforge.net/p/skim-app/code/15666
Author: hofman
Date: 2025-07-17 08:53:45 +0000 (Thu, 17 Jul 2025)
Log Message:
-----------
don't set conditionally editable option for author field, it is always editable
Modified Paths:
--------------
trunk/RightSideView.xib
trunk/SKMainWindowController_UI.m
Modified: trunk/RightSideView.xib
===================================================================
--- trunk/RightSideView.xib 2025-07-17 08:48:02 UTC (rev 15665)
+++ trunk/RightSideView.xib 2025-07-17 08:53:45 UTC (rev 15666)
@@ -285,7 +285,11 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
- <binding destination="I4N-kX-XRY" name="value" keyPath="objectValue.userName" id="wY0-NB-x0w"/>
+ <binding destination="I4N-kX-XRY" name="value" keyPath="objectValue.userName" id="NUe-EE-ODN">
+ <dictionary key="options">
+ <bool key="NSConditionallySetsEditable" value="NO"/>
+ </dictionary>
+ </binding>
</connections>
</textField>
</subviews>
Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m 2025-07-17 08:48:02 UTC (rev 15665)
+++ trunk/SKMainWindowController_UI.m 2025-07-17 08:53:45 UTC (rev 15666)
@@ -1419,6 +1419,7 @@
}
- (BOOL)commitEditingAndReturnError:(NSError **)error {
+ // there are no validations of the edited value, so we will always succeed
BOOL rv = [pdfView commitEditing];
id firstResponder = [[self window] firstResponder];
if ([firstResponder isKindOfClass:[NSText class]] && [firstResponder isDescendantOf:rightSideController.noteOutlineView])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-17 08:48:03
|
Revision: 15665
http://sourceforge.net/p/skim-app/code/15665
Author: hofman
Date: 2025-07-17 08:48:02 +0000 (Thu, 17 Jul 2025)
Log Message:
-----------
just check whether first responder is descendant of note outline view
Modified Paths:
--------------
trunk/SKMainWindowController_UI.m
Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m 2025-07-16 09:35:17 UTC (rev 15664)
+++ trunk/SKMainWindowController_UI.m 2025-07-17 08:48:02 UTC (rev 15665)
@@ -1421,7 +1421,7 @@
- (BOOL)commitEditingAndReturnError:(NSError **)error {
BOOL rv = [pdfView commitEditing];
id firstResponder = [[self window] firstResponder];
- if ([firstResponder isKindOfClass:[NSText class]] && [rightSideController.noteOutlineView rowForView:firstResponder] != -1)
+ if ([firstResponder isKindOfClass:[NSText class]] && [firstResponder isDescendantOf:rightSideController.noteOutlineView])
rv = [[rightSideController.noteOutlineView window] makeFirstResponder:rightSideController.noteOutlineView] && rv;
if (rv == NO && error)
*error = [NSError failedToCommitErrorWithLocalizedDescription:NSLocalizedString(@"Failed to commit edits", @"Error description")];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-16 09:35:19
|
Revision: 15664
http://sourceforge.net/p/skim-app/code/15664
Author: hofman
Date: 2025-07-16 09:35:17 +0000 (Wed, 16 Jul 2025)
Log Message:
-----------
revert last commit, we already commit when reading settings
Modified Paths:
--------------
trunk/SKViewSettingsController.m
Modified: trunk/SKViewSettingsController.m
===================================================================
--- trunk/SKViewSettingsController.m 2025-07-16 09:34:22 UTC (rev 15663)
+++ trunk/SKViewSettingsController.m 2025-07-16 09:35:17 UTC (rev 15664)
@@ -129,11 +129,4 @@
}
}
-- (void)dismissSheet:(id)sender {
- if ([sender tag] == NSModalResponseOK && [[self window] makeFirstResponder:[self window]] == NO)
- NSBeep();
- else
- [super dismissSheet:sender];
-}
-
@end
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-16 09:34:25
|
Revision: 15663
http://sourceforge.net/p/skim-app/code/15663
Author: hofman
Date: 2025-07-16 09:34:22 +0000 (Wed, 16 Jul 2025)
Log Message:
-----------
commit edits in view settings when closing sheet
Modified Paths:
--------------
trunk/Base.lproj/PreferenceWindow.xib
trunk/SKViewSettingsController.m
Modified: trunk/Base.lproj/PreferenceWindow.xib
===================================================================
--- trunk/Base.lproj/PreferenceWindow.xib 2025-07-15 14:53:31 UTC (rev 15662)
+++ trunk/Base.lproj/PreferenceWindow.xib 2025-07-16 09:34:22 UTC (rev 15663)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
+ <deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19529"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Modified: trunk/SKViewSettingsController.m
===================================================================
--- trunk/SKViewSettingsController.m 2025-07-15 14:53:31 UTC (rev 15662)
+++ trunk/SKViewSettingsController.m 2025-07-16 09:34:22 UTC (rev 15663)
@@ -38,6 +38,7 @@
#import "SKViewSettingsController.h"
#import "SKStringConstants.h"
+#import "NSWindowController_SKExtensions.h"
#define kPDFDisplaySinglePageContinuous 1
#define kPDFDisplayHorizontalContinuous 4
@@ -128,4 +129,11 @@
}
}
+- (void)dismissSheet:(id)sender {
+ if ([sender tag] == NSModalResponseOK && [[self window] makeFirstResponder:[self window]] == NO)
+ NSBeep();
+ else
+ [super dismissSheet:sender];
+}
+
@end
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-15 14:53:34
|
Revision: 15662
http://sourceforge.net/p/skim-app/code/15662
Author: hofman
Date: 2025-07-15 14:53:31 +0000 (Tue, 15 Jul 2025)
Log Message:
-----------
don't use editedRow for voew based tables
Modified Paths:
--------------
trunk/SKBookmarkController.m
trunk/SKMainWindowController_UI.m
Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m 2025-07-15 14:40:21 UTC (rev 15661)
+++ trunk/SKBookmarkController.m 2025-07-15 14:53:31 UTC (rev 15662)
@@ -868,7 +868,8 @@
}
- (void)endEditing {
- if ([outlineView editedRow] && [[self window] makeFirstResponder:outlineView] == NO)
+ id firstResponder = [[self window] firstResponder];
+ if ([firstResponder isKindOfClass:[NSText class]] && [outlineView rowForView:firstResponder] != -1 && [[self window] makeFirstResponder:outlineView] == NO)
[[self window] endEditingFor:nil];
}
Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m 2025-07-15 14:40:21 UTC (rev 15661)
+++ trunk/SKMainWindowController_UI.m 2025-07-15 14:53:31 UTC (rev 15662)
@@ -1420,7 +1420,8 @@
- (BOOL)commitEditingAndReturnError:(NSError **)error {
BOOL rv = [pdfView commitEditing];
- if ([rightSideController.noteOutlineView editedRow] != -1)
+ id firstResponder = [[self window] firstResponder];
+ if ([firstResponder isKindOfClass:[NSText class]] && [rightSideController.noteOutlineView rowForView:firstResponder] != -1)
rv = [[rightSideController.noteOutlineView window] makeFirstResponder:rightSideController.noteOutlineView] && rv;
if (rv == NO && error)
*error = [NSError failedToCommitErrorWithLocalizedDescription:NSLocalizedString(@"Failed to commit edits", @"Error description")];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-15 14:40:24
|
Revision: 15661
http://sourceforge.net/p/skim-app/code/15661
Author: hofman
Date: 2025-07-15 14:40:21 +0000 (Tue, 15 Jul 2025)
Log Message:
-----------
discard editing when reverting
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2025-07-15 14:21:49 UTC (rev 15660)
+++ trunk/SKMainWindowController.m 2025-07-15 14:40:21 UTC (rev 15661)
@@ -1133,6 +1133,8 @@
[oldPdfDoc cancelFindString];
+ [self discardEditing];
+
// make sure these will not be activated, or they can lead to a crash
[pdfView removePDFToolTipRects];
[pdfView setCurrentAnnotation:nil];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-15 14:21:51
|
Revision: 15660
http://sourceforge.net/p/skim-app/code/15660
Author: hofman
Date: 2025-07-15 14:21:49 +0000 (Tue, 15 Jul 2025)
Log Message:
-----------
enumerate copy of array
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2025-07-15 14:18:49 UTC (rev 15659)
+++ trunk/SKMainWindowController.m 2025-07-15 14:21:49 UTC (rev 15660)
@@ -1078,7 +1078,7 @@
// remove the current annotations
[pdfView setCurrentAnnotation:nil];
[self commitEditing];
- for (NSWindowController *wc in [[self document] windowControllers]) {
+ for (NSWindowController *wc in [[[self document] windowControllers] copy]) {
if ([wc isNoteWindowController])
[wc close];
}
@@ -1436,8 +1436,7 @@
- (void)removeAllObjectsFromNotes {
if ([notes count]) {
- NSArray *wcs = [[[self document] windowControllers] copy];
- for (NSWindowController *wc in wcs) {
+ for (NSWindowController *wc in [[[self document] windowControllers] copy]) {
if ([wc isNoteWindowController]) {
[wc discardEditing];
[wc close];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-15 14:19:00
|
Revision: 15659
http://sourceforge.net/p/skim-app/code/15659
Author: hofman
Date: 2025-07-15 14:18:49 +0000 (Tue, 15 Jul 2025)
Log Message:
-----------
close all window controllers with commit gefore replacing all notes from file
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2025-07-15 14:15:05 UTC (rev 15658)
+++ trunk/SKMainWindowController.m 2025-07-15 14:18:49 UTC (rev 15659)
@@ -1078,6 +1078,10 @@
// remove the current annotations
[pdfView setCurrentAnnotation:nil];
[self commitEditing];
+ for (NSWindowController *wc in [[self document] windowControllers]) {
+ if ([wc isNoteWindowController])
+ [wc close];
+ }
if ([undoManager groupingLevel] > level) {
[undoManager endUndoGrouping];
[undoManager beginUndoGrouping];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-15 14:15:08
|
Revision: 15658
http://sourceforge.net/p/skim-app/code/15658
Author: hofman
Date: 2025-07-15 14:15:05 +0000 (Tue, 15 Jul 2025)
Log Message:
-----------
discard editing in note windows when closing for revert
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2025-07-15 14:03:38 UTC (rev 15657)
+++ trunk/SKMainWindowController.m 2025-07-15 14:15:05 UTC (rev 15658)
@@ -1434,8 +1434,10 @@
if ([notes count]) {
NSArray *wcs = [[[self document] windowControllers] copy];
for (NSWindowController *wc in wcs) {
- if ([wc isNoteWindowController])
+ if ([wc isNoteWindowController]) {
+ [wc discardEditing];
[wc close];
+ }
}
[rightSideController.noteOutlineView resetRowHeights];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ho...@us...> - 2025-07-15 14:03:40
|
Revision: 15657
http://sourceforge.net/p/skim-app/code/15657
Author: hofman
Date: 2025-07-15 14:03:38 +0000 (Tue, 15 Jul 2025)
Log Message:
-----------
begin new undo group when comitting edit in progress before replacing notes from file
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2025-07-14 22:41:26 UTC (rev 15656)
+++ trunk/SKMainWindowController.m 2025-07-15 14:03:38 UTC (rev 15657)
@@ -1072,9 +1072,16 @@
NSArray *notesAndPagesToAdd = [self annotationsAndPagesWithProperties:noteDicts forDocument:[pdfView document] autoUpdate:NO widgetProperties:widgetDicts];
if (replacing && [notes count]) {
+ NSUndoManager *undoManager = [[self document] undoManager];
+ NSInteger level = [undoManager groupingLevel];
[pdfView removePDFToolTipRects];
// remove the current annotations
[pdfView setCurrentAnnotation:nil];
+ [self commitEditing];
+ if ([undoManager groupingLevel] > level) {
+ [undoManager endUndoGrouping];
+ [undoManager beginUndoGrouping];
+ }
}
[self updateWidgetsWithProperties:widgetDicts reset:replacing];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|