Преглед на файлове

Merge branch 'develop_PDFReaderProNew' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderProNew

niehaoyu преди 6 месеца
родител
ревизия
014a019061

+ 4 - 4
PDF Office/PDF Master/Class/ChromiumTabs/src/Tab/CTTabController.m

@@ -438,15 +438,15 @@ static NSString* const kBrowserThemeDidChangeNotification =
 }
 
 - (void)rename:(id)sender {
-    if (isActive_) {
+//    if (isActive_) {
         [[NSNotificationCenter defaultCenter] postNotificationName:@"KMTabControllerRename" object:self];
-    }
+//    }
 }
 
 - (void)showInFinder:(id)sender {
-    if (isActive_) {
+//    if (isActive_) {
         [[NSNotificationCenter defaultCenter] postNotificationName:@"KMTabControllerShowInFinder" object:self];
-    }
+//    }
 }
 
 - (void)closeAllTabs:(id)sender {

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/AppKitCategories/NSCursor+PDFListView.m

@@ -337,7 +337,7 @@ static NSCursor *textSelfSignCursor = nil;
 + (NSCursor *)anchoredNoteCursor {
     static NSCursor *anchoredNoteCursor = nil;
     if (nil == anchoredNoteCursor) {
-        NSImage *cursorImage = [[NSImage imageNamed:CPDFListViewImageNameCursorsNote] copy];
+        NSImage *cursorImage = [[NSImage imageNamed:@"KMImageNameCursorsNote"] copy];
         cursorImage = [NSCursor arrowCursorImage:cursorImage];
         anchoredNoteCursor = [[NSCursor alloc] initWithImage:cursorImage hotSpot:[[self arrowCursor] hotSpot]];
     }

+ 8 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Note.swift

@@ -778,11 +778,15 @@ extension KMLeftSideViewController {
                 let page = self.pdfDocument()?.page(at: UInt(i))
                 var annos: [CPDFAnnotation] = []
                 // 处理过滤
+                let types = ["Highlight","Underline","Strikeout","Freehand","FreeText","Note","Square","Circle","Line","Stamp","Arrow","Image","Redact","Sign"/*, "table"*/]
                 if typeArr.count == 0 && colorArr.count == 0 && authorArr.count == 0 {
-                    let types = ["Highlight","Underline","Strikeout","Freehand","FreeText","Note","Square","Circle","Line","Stamp","Arrow","Image","Redact","Sign"/*, "table"*/]
                     annos = KMOCToolClass.filterAnnotation(annotations: page?.annotations ?? [],types: types) as? [CPDFAnnotation] ?? []
+                    annotationArray += annos
                 } else {
                     var filterAnnos: [CPDFAnnotation] = page?.annotations ?? []
+                    let allAnnos = KMOCToolClass.filterAnnotation(annotations: filterAnnos,types: types) as? [CPDFAnnotation] ?? []
+                    annotationArray += allAnnos
+                    
                     if typeArr.count > 0 {
                         filterAnnos = (KMOCToolClass.filterAnnotation(annotations: filterAnnos, types: typeArr) as? [CPDFAnnotation]) ?? []
                     }
@@ -798,6 +802,8 @@ extension KMLeftSideViewController {
                 for annotation in page?.annotations ?? [] {
                     if annotation.isKind(of: CPDFSignatureAnnotation.self) {
                         annos.append(annotation)
+                        
+                        annotationArray.append(annotation)
                     }
                 }
                 for annotation in annos {
@@ -816,7 +822,7 @@ extension KMLeftSideViewController {
                 
                 //添加所有annotation 用于筛选
 //                annotationArray += (page?.annotations ?? [])
-                annotationArray += annos
+//                annotationArray += annos
             }
             
             //  处理排序

+ 3 - 1
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -941,7 +941,9 @@ import Cocoa
         //选中page
         var tPages = pages
         if tPages.count == 0 {
-            tPages = self.leftSideViewController.thumb_fetchSelectedRows() ?? [self.listView.currentPageIndex]
+            if self.leftSideViewController.type.methodType == .Thumbnail {
+                tPages = self.leftSideViewController.thumb_fetchSelectedRows() ?? [self.listView.currentPageIndex]
+            } 
         }
         
         if (hasEnterPageEdit()) {

+ 59 - 1
PDF Office/PDF Master/Class/README.md

@@ -1,4 +1,47 @@
-## PDF Reader Pro Mac 主要模块的入口
+## App 需要记录的信息汇总
+
+- 页签窗口控制器 KMBrowserWindowController
+- 页签窗口 KMBrowserWindowController
+- 文档 KMMainDocument
+- 首页页签内容控制器 KMHomeViewController
+- 阅读页签内容控制器 KMMainViewController
+- 页签操作可查看 KMBrowser
+
+
+## App 架构 
+- MVC
+- MVC 目前存在 C 比较臃肿的弊端,但是也是可以使用的,比较臃肿的问题待后续优化.
+
+## 多页签
+
+- 页签操作 KMBrowser [CTTabStripModel 实际操作对象]
+- 窗口控制器 KMBrowserWindowController
+- 窗口 KMBrowserWindow
+- 页签区域控制器 KMTabStripController
+- 页签区域 KMTabStripView
+- 页签控制器 CTTabController
+- 页签视图 CTTabView
+- 页签内容控制器 CTTabContentsController [KMHomeViewController + KMMainViewController 都是显示在其上]
+- 页签内容提供者 CTTabContents(文档 当前App对应的是 KMMainDocument)
+
+- 页签拖拽 CTTabStripDragController
+
+* 内存管理 
+1. KMBrowser [-> CTTabStripModel -> KMMainDocument] -> KMMainDocument -> KMBrowser
+2. 环形内存引用 让内存不释放。在适当的时机断环来释放内存,避免循环引用.
+3. KMBrowser -> KMBrowserWindowController 因强引用 页签窗口控制器,这也是页签窗口控制器没有被持有而没有释放的原因.
+
+* 事件传递
+1. target-action [KMTabStripController -> CTTabController, CTTabController --> KMTabStripController(target)]
+2. 响应者链 [NewTabButton]
+3. 通知 [CTTabStripModel]
+4. 代理 [KMBrowser -> CTTabStripModel, CTTabStripModel --> KMBrowser(delegate)]
+
+* 维护建议
+1. 新增功能或修复bug,尽量通过重写类来处理,保证三方库内部尽可能少的改动.
+ 
+
+## App 主要模块的入口
 
 ## 首页
 
@@ -37,18 +80,23 @@
 * AIConfigWindowController 
 
 ## 合并
+
 * KMMergeWindowController
 
 ## 转档
+
 * KMConvertWindowController
 
 ## 批量
+
 * KMBatchOperateWindowController
 
 ## 图片转PDF
+
 * KMBatchOperateBaseWindowController
 
 ## 属性面板
+
 * KMGeneralAnnotationViewController
 
 - 【页面设置】
@@ -80,37 +128,47 @@
 * 图片 KMEditImagePropertyViewController
 
 ## What's New
+
 * KMFunctionGuideWindowController
 
 ## 信息
+
 * KMProfileInfoWindowController
 
 ## 幻灯片
+
 * 选项设置 SKPresentationOptionsSheetController
 
 ## 注释工具
+
 * 笔记 CPDFListAnnotationNoteWindowController
 * 便签 CPDFListEditAnnotationViewController
 
 * 自定义注释工具 KMToolbarCustomWindowController
 
 ## 填写与签名
+
 * 日期注释 CSelfSignAnnotationFreeText
 
 ## 数字签名
+
 * KMPDFDigitalSignViewController
 
 ## 导入 [扫描仪 & 相册]
+
 * KMDeviceBrowserWindowController
 
 ## 线条设置窗口
+
 * KMLineInspector
 * KMAnnotationLineWindowController
 
 ## 笔记类型窗口
+
 * KMNotesPanelController
 
 ## 字体设置窗口
+
 * KMAnnotationFontWindowController
 
 ## xxx