From d70e1080230b4d16cf403c94502ecbbfeb22fa9c Mon Sep 17 00:00:00 2001 From: hslee Date: Wed, 2 Dec 2015 10:52:51 +0900 Subject: [PATCH 1/7] update for first pull request --- LauncherOSX.xcodeproj/project.pbxproj | 2 + LauncherOSX/LOXAppDelegate.mm | 28 +- LauncherOSX/LOXePubSdkApi.h | 4 + LauncherOSX/LOXePubSdkApi.mm | 46 +- LauncherOSX/drmInitialize.h | 15 + LauncherOSX/en.lproj/MainMenu.xib | 3616 ++++--------------------- 6 files changed, 622 insertions(+), 3089 deletions(-) create mode 100644 LauncherOSX/drmInitialize.h diff --git a/LauncherOSX.xcodeproj/project.pbxproj b/LauncherOSX.xcodeproj/project.pbxproj index 88fec4e..ebf98de 100644 --- a/LauncherOSX.xcodeproj/project.pbxproj +++ b/LauncherOSX.xcodeproj/project.pbxproj @@ -348,6 +348,7 @@ AD8C8F410069609045A3F696 /* LOXSampleStylesProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LOXSampleStylesProvider.mm; sourceTree = ""; }; AD8C8FBED8EFF09E6381C68F /* LOXBookmarksController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LOXBookmarksController.h; sourceTree = ""; }; AD8C8FEC6F5BC3C8D400A388 /* LOXCurrentPagesInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LOXCurrentPagesInfo.mm; sourceTree = ""; }; + FFE961B91C0E81FA00FA2A5C /* drmInitialize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = drmInitialize.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -682,6 +683,7 @@ AD8C8C165CD8EBCC0E30AE2F /* ePubSdkApi */ = { isa = PBXGroup; children = ( + FFE961B91C0E81FA00FA2A5C /* drmInitialize.h */, 855CFE49169B912300AD311E /* LOXePubSdkApi.h */, 855CFE4A169B912300AD311E /* LOXePubSdkApi.mm */, ); diff --git a/LauncherOSX/LOXAppDelegate.mm b/LauncherOSX/LOXAppDelegate.mm index 70e7754..070fc7a 100644 --- a/LauncherOSX/LOXAppDelegate.mm +++ b/LauncherOSX/LOXAppDelegate.mm @@ -198,7 +198,11 @@ - (LOXBook *)findOrCreateBookForCurrentPackageWithPath:(NSString *)path - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename { - return [self openDocumentWithPath:filename]; + [self openDocumentWithPath:filename]; + + // Modified by DRM inside, C.H Yu on 2015-04-23 + // To handle behavior of the 'cancel' button of the passowrd input dialog + return TRUE; } @@ -272,4 +276,26 @@ - (IBAction)showPreferences:(id)sender [self.preferencesController showPreferences:_userData.preferences]; } +// Added by DRM inside, H.S. Lee on 2015-04-23 +// To handle checking user rights for the 'print' action +- (IBAction)OpenPrint:(id)sender { + + if (_epubApi!=nullptr &&[_epubApi checkActionPrint]) { + NSArray *array = [[_window contentView] subviews]; + NSArray *arrayS = [array[2] subviews]; + NSArray *arrayW = [arrayS[1] subviews]; + + NSPrintInfo *printInfo = [NSPrintInfo sharedPrintInfo]; + NSPrintOperation * printOperation = [[[arrayW[0] mainFrame] frameView] printOperationWithPrintInfo:printInfo]; + [printOperation runOperation]; + } + else + { + NSAlert *alert = [[NSAlert alloc] init]; + [alert setMessageText:@"Print action has no permission"]; + [alert addButtonWithTitle:@"Ok"]; + [alert runModal]; + } +} + @end diff --git a/LauncherOSX/LOXePubSdkApi.h b/LauncherOSX/LOXePubSdkApi.h index a50a4a7..de7eb7f 100644 --- a/LauncherOSX/LOXePubSdkApi.h +++ b/LauncherOSX/LOXePubSdkApi.h @@ -51,4 +51,8 @@ namespace ePub3 { - (LOXPackage *)openFile:(NSString *)file; +// Added by DRM inside, H.S. Lee on 2015-04-23 +// To handle checking user rights for the 'print' action +- (bool) checkActionPrint; + @end diff --git a/LauncherOSX/LOXePubSdkApi.mm b/LauncherOSX/LOXePubSdkApi.mm index 7c647ac..31267c8 100644 --- a/LauncherOSX/LOXePubSdkApi.mm +++ b/LauncherOSX/LOXePubSdkApi.mm @@ -39,7 +39,9 @@ #import "LOXSpineItem.h" #import "LOXPackage.h" - +#import "LOXAppDelegate.h" +#import +#import "drmInitialize.h" @interface LOXePubSdkApi () @@ -114,6 +116,14 @@ +(void)initialize ePub3::InitializeSdk(); ePub3::PopulateFilterManager(); + + // If launcher wants to include DRM feature, + // READIUM_DRM=1 should be defined in the preporessor macros section + // in the project configuration +#ifdef _READIUM_DRM_ + [[[DrmInitialize alloc] init] initialize]; +#endif + } - (id)init @@ -134,6 +144,13 @@ - (LOXPackage *)openFile:(NSString *)file _container = ePub3::Container::OpenContainer([file UTF8String]); + // Added by DRM inside, H.S. Lee on 2015-04-23 + // Without the checking validity of the container pointer, app. could be crashed. + if(_container == nullptr) { + return nil; + } + //////// + [self readPackages]; if([_packages count] > 0) { @@ -145,11 +162,15 @@ - (LOXPackage *)openFile:(NSString *)file - (void)readPackages { - auto packages = _container->Packages(); + // Modified by DRM inside, H.S. Lee on 2015-04-23 + // Without the checking validity of the container pointer, app. could be crashed. + if(_container != nullptr) { + auto packages = _container->Packages(); - for (auto package = packages.begin(); package != packages.end(); ++package) { + for (auto package = packages.begin(); package != packages.end(); ++package) { - [_packages addObject:[[LOXPackage alloc] initWithSdkPackage:*package]]; + [_packages addObject:[[LOXPackage alloc] initWithSdkPackage:*package]]; + } } } @@ -166,7 +187,22 @@ - (void)cleanup _currentPackage = nil; } - +// Added by DRM inside, H.S. Lee on 2015-04-23 +// To handle checking user rights for the 'print' action +- (bool) checkActionPrint +{ + if(_container->Creator() != nullptr) + { + ePub3::async_result result = _container->Creator()->ApproveUserAction(ePub3::UserAction(ePub3::ConstManifestItemPtr(nullptr), ePub3::CFI(), ePub3::ActionType::Print)); + + return result.get(); + } + else + { + return false; + } + +} diff --git a/LauncherOSX/drmInitialize.h b/LauncherOSX/drmInitialize.h new file mode 100644 index 0000000..4204b01 --- /dev/null +++ b/LauncherOSX/drmInitialize.h @@ -0,0 +1,15 @@ +// +// LcpInitialize.h +// SDKLauncher-iOS +// +// Created by DRMinside-IMac on 2015. 11. 5.. +// Copyright © 2015년 The Readium Foundation. All rights reserved. +// +#import + +@interface DrmInitialize : NSObject + +- (void)initialize; + +@end + diff --git a/LauncherOSX/en.lproj/MainMenu.xib b/LauncherOSX/en.lproj/MainMenu.xib index 451857d..b84171a 100644 --- a/LauncherOSX/en.lproj/MainMenu.xib +++ b/LauncherOSX/en.lproj/MainMenu.xib @@ -1,3083 +1,533 @@ - - - - 1070 - 12F37 - 4510 - 1187.39 - 626.00 - - 4510 - 3336 - - - NSBox - NSButton - NSButtonCell - NSCustomObject - NSCustomView - NSImageCell - NSImageView - NSMenu - NSMenuItem - NSNumberFormatter - NSOutlineView - NSScrollView - NSScroller - NSSlider - NSSliderCell - NSSplitView - NSTabView - NSTabViewItem - NSTableColumn - NSTableView - NSTextField - NSTextFieldCell - NSUserDefaultsController - NSView - NSWindowTemplate - WebView - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.WebKitIBPlugin - - - PluginDependencyRecalculationVersion - - - - - NSApplication - - - FirstResponder - - - NSApplication - - - AMainMenu - - - - LauncherOSX - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - LauncherOSX - - - - About LauncherOSX - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Services - - 1048576 - 2147483647 - - - submenuAction: - - Services - - _NSServicesMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Hide LauncherOSX - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Quit LauncherOSX - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - File - - 1048576 - 2147483647 - - - submenuAction: - - File - - - - Open Book... - o - 1048576 - 2147483647 - - - - - - YES - Open Book with Cocoa… - O - 1048576 - 2147483647 - - - - - - Open Recent - - 1048576 - 2147483647 - - - submenuAction: - - Open Recent - - - - Clear Menu - - 1048576 - 2147483647 - - - - - _NSRecentDocumentsMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Close - w - 1048576 - 2147483647 - - - - - - Save… - s - 1048576 - 2147483647 - - - - - - Revert to Saved - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Page Setup... - P - 1179648 - 2147483647 - - - - - - - Print… - p - 1048576 - 2147483647 - - - - - - - - - Bookmarks - - 2147483647 - - - submenuAction: - - Bookmarks - - - - Add Bookmark... - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - YES - - - - - Window - - 1048576 - 2147483647 - - - submenuAction: - - Window - - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Bring All to Front - - 1048576 - 2147483647 - - - - - _NSWindowsMenu - - - - _NSMainMenu - - - 15 - 2 - {{234, 379}, {954, 529}} - 1954021376 - LauncherOSX - NSWindow - - - - - - - - 289 - {{858, 8}, {82, 32}} - - - _NS:9 - YES - - 67108864 - 134217728 - >> - - LucidaGrande - 13 - 1044 - - _NS:9 - - -2038284288 - 129 - - - 200 - 25 - - NO - - - - 289 - {{655, 8}, {82, 32}} - - - - _NS:9 - YES - - 67108864 - 134217728 - << - - _NS:9 - - -2038284288 - 129 - - - 200 - 25 - - NO - - - - 274 - - - - 4 - - - - 274 - {{-7, -10}, {258, 433}} - - - _NS:9 - - - 1 - - - 274 - - - - 274 - - - - 2322 - - - - 301 - {212, 385} - - - _NS:13 - YES - NO - YES - - - -2147483392 - {{224, 0}, {16, 17}} - - _NS:19 - - - - idref - 124 - 40 - 1000 - - 75497536 - 2048 - - - LucidaGrande - 11 - 3100 - - - 3 - MC4zMzMzMzI5ODU2AA - - - 6 - System - headerTextColor - - 3 - MAA - - - - - 337641536 - 2048 - Text Cell - - - - 6 - System - controlBackgroundColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - - - 3 - YES - YES - - - - 3 - 2 - - 3 - MQA - - - 6 - System - gridColor - - 3 - MC41AA - - - 17 - -702545920 - - - 0 - 15 - 0 - YES - 0 - 1 - - - {{1, 1}, {212, 385}} - - - _NS:11 - - - 4 - - - - -2147483392 - {{224, 17}, {15, 102}} - - - _NS:58 - NO - - _doScroller: - 0.5 - 0.95533498759305213 - - - - -2147483392 - {{1, 449}, {122, 15}} - - - _NS:60 - NO - 1 - - _doScroller: - 1 - 0.99532710280373837 - - - {214, 387} - - - _NS:9 - 133682 - - - - QSAAAEEgAABBmAAAQZgAAA - 0.25 - 4 - 1 - - - {{10, 33}, {238, 387}} - - _NS:11 - - Spine - - 6 - System - controlColor - - - - - - 2 - - - 274 - - - - 274 - - - - 2322 - - - - 256 - {212, 385} - - - - _NS:13 - YES - NO - YES - - - -2147483392 - {{224, 0}, {16, 17}} - _NS:18 - - - - 209 - 16 - 1000 - - 75497536 - 2048 - - - - 3 - MC4zMzMzMzI5ODU2AA - - - - - 337641536 - 2048 - Text Cell - - - - - - 3 - YES - YES - - - - 3 - 2 - - - 17 - -767557632 - - - 4 - 15 - 0 - YES - 0 - 1 - - - {{1, 1}, {212, 385}} - - - - _NS:11 - - - 4 - - - - -2147483392 - {{224, 17}, {15, 102}} - - - - _NS:58 - NO - - _doScroller: - 0.96277915632754341 - - - - -2147483392 - {{1, 389}, {196, 15}} - - - - _NS:60 - NO - 1 - - _doScroller: - 0.93779904306220097 - - - {214, 387} - - - - _NS:9 - 133682 - - - - QSAAAEEgAABBmAAAQZgAAA - 0.25 - 4 - 1 - - - {{10, 33}, {238, 387}} - - - - _NS:28 - - TOC - - - - - - - 0 - YES - YES - - - - - - {219, 417} - - - - _NS:11 - YES - NSView - - - - 256 - - - - 274 - - Apple HTML pasteboard type - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple URL pasteboard type - Apple Web Archive pasteboard type - NSColor pasteboard type - NSFilenamesPboardType - NSStringPboardType - NeXT RTFD pasteboard type - NeXT Rich Text Format v1.0 pasteboard type - NeXT TIFF v4.0 pasteboard type - WebURLsWithTitlesPboardType - public.png - public.url - public.url-name - - {685, 417} - - - - _NS:9 - - - - - - - - - - - YES - YES - - - {{229, 0}, {685, 417}} - - - - _NS:13 - YES - NSView - - - {{20, 74}, {914, 417}} - - - - _NS:9 - YES - 3 - - - - 289 - {{739, 14}, {56, 22}} - - - - _NS:9 - YES - - -1804599231 - 71308288 - - - _NS:9 - - YES - - 6 - System - textBackgroundColor - - - - 6 - System - textColor - - - - NO - - - - 289 - {{803, 14}, {53, 22}} - - - - _NS:1535 - YES - - 76546112 - 4195328 - - - _NS:1535 - - YES - - - - NO - - - - 2 - - - - 274 - - - - 268 - {{7, 3}, {36, 32}} - - - - _NS:9 - YES - - 67108864 - 134217728 - - - _NS:9 - - -2040250368 - 129 - - NSImage - ico_tts - - - - 200 - 25 - - NO - - - - 268 - - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - {{40, 14}, {18, 16}} - - - - _NS:9 - YES - - 134217728 - 33554432 - - NSImage - green_dot_big - - _NS:9 - 0 - 0 - 0 - NO - - NO - YES - - - - 268 - {{71, 3}, {51, 32}} - - - - _NS:9 - YES - - 67108864 - 134217728 - < - - _NS:9 - - -2038284288 - 129 - - - 200 - 25 - - NO - - - - 268 - {{173, 3}, {61, 32}} - - - - _NS:9 - YES - - 67108864 - 134217728 - esc - - _NS:9 - - -2038284288 - 129 - - LucidaGrande - 13 - 16 - - - - 200 - 25 - - NO - - - - 268 - {{114, 3}, {51, 32}} - - - - _NS:9 - YES - - 67108864 - 134217728 - > - - _NS:9 - - -2038284288 - 129 - - - 200 - 25 - - NO - - - - 265 - {{499, 19}, {96, 24}} - - - - _NS:1535 - YES - - 68157504 - 272630784 - Time %: - - _NS:1535 - - - - - NO - - - - 266 - {{247, 1}, {374, 26}} - - - - _NS:9 - YES - - 67371264 - 0 - - _NS:9 - - 100 - 0.0 - 0.0 - 0.0 - 49 - 1 - NO - NO - - NO - - - - 265 - {{549, 26}, {70, 17}} - - - - _NS:9 - YES - - -1542455232 - 272630784 - - - - - - - - - - - -∞ - - - +∞ - - #,##0.### - #,##0.### - - - - - - - - NaN - - - - - - 3 - YES - YES - YES - - . - , - YES - NO - YES - - _NS:9 - - YES - - - - NO - - - {{1, 1}, {637, 45}} - - - - _NS:11 - - - {{17, 10}, {639, 61}} - - - - _NS:9 - {0, 0} - - 67108864 - 0 - Media Overlays - - - - 3 - MCAwLjgwMDAwMDAxMTkAA - - - - 1 - 0 - 2 - NO - - - {954, 529} - - - - - {{0, 0}, {1280, 778}} - {10000000000000, 10000000000000} - YES - - - LOXSpineViewController - - - LOXTocViewController - - - LOXPreferencesController - - - LOXMediaOverlayController - - - LOXPageNumberTextController - - - LOXWebViewController - - - LOXAppDelegate - - - NSFontManager - - - LOXBookmarksController - - - LOXBookmarkEditController - - - YES - - - - - - - terminate: - - - - 449 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - delegate - - - - 495 - - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - print: - - - - 86 - - - - runPageLayout: - - - - 87 - - - - clearRecentDocuments: - - - - 127 - - - - performClose: - - - - 193 - - - - performZoom: - - - - 240 - - - - saveDocument: - - - - 362 - - - - revertDocumentToSaved: - - - - 364 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - unhideAllApplications: - - - - 370 - - - - window - - - - 532 - - - - spineViewController - - - - 592 - - - - webViewController - - - - 608 - - - - bookmarksController - - - - 960 - - - - tocViewController - - - - 1134 - - - - openDocument: - - - - 1137 - - - - pageNumController - - - - 1138 - - - - preferencesMenu - - - - 1144 - - - - showPreferences: - - - - 1145 - - - - preferencesController - - - - 1147 - - - - mediaOverlayController - - - - 1165 - - - - _tableView - - - - 1085 - - - - resourceLoadDelegate - - - - 841 - - - - frameLoadDelegate - - - - 846 - - - - _webView - - - - 607 - - - - rightPageButton - - - - 842 - - - - leftPageButton - - - - 843 - - - - onRightPageClick: - - - - 844 - - - - onLeftPageClick: - - - - 845 - - - - pageNumController - - - - 865 - - - - appDelegate - - - - 962 - - - - delegate - - - - 926 - - - - pageNumberCtrl - - - - 864 - - - - pageCountCtrl - - - - 919 - - - - webViewController - - - - 925 - - - - bookmarksMenu - - - - 939 - - - - mainController - - - - 951 - - - - addBookmark: - - - - 955 - - - - bookmarkEditController - - - - 959 - - - - addBookmarkMenuItem - - - - 961 - - - - bookmarksController - - - - 958 - - - - dataSource - - - - 1062 - - - - delegate - - - - 1061 - - - - dataSource - - - - 1133 - - - - delegate - - - - 1135 - - - - _outlineView - - - - 1132 - - - - _appDelegate - - - - 1136 - - - - webViewController - - - - 1164 - - - - toggleMediaOverlayButton - - - - 1163 - - - - onToggleMediaOverlayClick: - - - - 1167 - - - - playIndicator - - - - 1228 - - - - previousMediaOverlayButton - - - - 1270 - - - - onPreviousMediaOverlayClick: - - - - 1269 - - - - escapeMediaOverlayButton - - - - 1284 - - - - onEscapeMediaOverlayClick: - - - - 1285 - - - - onNextMediaOverlayClick: - - - - 1241 - - - - nextMediaOverlayButton - - - - 1242 - - - - timeScrobblerValueChanged: - - - - 1820 - - - - value: self.timeScrobbler - - - - - - value: self.timeScrobbler - value - self.timeScrobbler - 2 - - - 1788 - - - - value: self.timeScrobbler - - - - - - value: self.timeScrobbler - value - self.timeScrobbler - 2 - - - 1785 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - - - - - - - - - 19 - - - - - - - - 56 - - - - - - - - 83 - - - - - - - - 81 - - - - - - - - - - - - - - - - - 75 - - - - - 78 - - - - - 72 - - - - - 124 - - - - - - - - 77 - - - - - 73 - - - - - 79 - - - - - 112 - - - - - 74 - - - - - 125 - - - - - - - - 126 - - - - - 57 - - - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - - - 144 - - - - - 129 - - - - - 143 - - - - - 236 - - - - - 131 - - - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 371 - - - - - - - - 372 - - - - - - - - - - - - - 420 - - - - - 494 - - - - - 589 - - - - - 606 - - - - - 738 - - - - - 743 - - - - - - - - 744 - - - - - 747 - - - - - - - - 748 - - - - - 763 - - - - - - - - - 764 - - - - - - - - 765 - - - - - - - - 595 - - - - - - 848 - - - - - - - - 849 - - - - - 862 - - - - - 874 - - - - - - - - 875 - - - - - 931 - - - - - - - - 932 - - - - - - - - - 937 - - - - - 953 - - - - - 954 - - - - - 956 - - - - - 1092 - - - - - - - - - 1093 - - - - - - - - 1094 - - - - - - - - 1095 - - - - - - - - 1096 - - - - - - - - 1051 - - - - - - - - - - 1056 - - - - - 1057 - - - - - 1058 - - - - - - - - 1059 - - - - - - - - 1060 - - - - - 1114 - - - - - - - - - - 1115 - - - - - - - - 1116 - - - - - 1118 - - - - - 1119 - - - - - - - - 1122 - - - - - 1131 - - - - - 1146 - - - - - 1162 - - - - - 1302 - - - - - 1318 - - - - - - - - - - - - - - - 1148 - - - - - - - - 1149 - - - - - 1206 - - - - - - - - 1207 - - - - - 1243 - - - - - - - - 1244 - - - - - 1271 - - - - - - - - 1272 - - - - - 1235 - - - - - - - - 1236 - - - - - 1757 - - - - - - - - 1763 - - - - - 1758 - - - - - - - - 1762 - - - - - 1759 - - - - - - - - 1760 - - - - - - - - 1761 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - LOXTocView - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{380, 496}, {480, 360}} - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.WebKitIBPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 1869 - - - - - LOXAppDelegate - NSObject - - id - id - - - - openDocument: - id - - - showPreferences: - id - - - - LOXBookmarksController - LOXMediaOverlayController - LOXPageNumberTextController - LOXPreferencesController - NSMenuItem - LOXSpineViewController - LOXTocViewController - LOXWebViewController - NSWindow - - - - bookmarksController - LOXBookmarksController - - - mediaOverlayController - LOXMediaOverlayController - - - pageNumController - LOXPageNumberTextController - - - preferencesController - LOXPreferencesController - - - preferencesMenu - NSMenuItem - - - spineViewController - LOXSpineViewController - - - tocViewController - LOXTocViewController - - - webViewController - LOXWebViewController - - - window - NSWindow - - - - IBProjectSource - ./Classes/LOXAppDelegate.h - - - - LOXBookmarkEditController - NSObject - - id - id - - - - onCancel: - id - - - onOK: - id - - - - LOXBookmarksController - NSButton - NSTextField - NSButton - NSWindow - - - - bookmarksController - LOXBookmarksController - - - cancelButton - NSButton - - - nameText - NSTextField - - - okButton - NSButton - - - sheet - NSWindow - - - - IBProjectSource - ./Classes/LOXBookmarkEditController.h - - - - LOXBookmarksController - NSObject - - addBookmark: - id - - - addBookmark: - - addBookmark: - id - - - - NSMenuItem - LOXBookmarkEditController - NSMenu - LOXAppDelegate - - - - addBookmarkMenuItem - NSMenuItem - - - bookmarkEditController - LOXBookmarkEditController - - - bookmarksMenu - NSMenu - - - mainController - LOXAppDelegate - - - - IBProjectSource - ./Classes/LOXBookmarksController.h - - - - LOXMediaOverlayController - NSObject - - id - id - id - id - - - - onEscapeMediaOverlayClick: - id - - - onNextMediaOverlayClick: - id - - - onPreviousMediaOverlayClick: - id - - - onToggleMediaOverlayClick: - id - - - - NSButton - NSButton - NSImageView - NSButton - NSButton - LOXWebViewController - - - - escapeMediaOverlayButton - NSButton - - - nextMediaOverlayButton - NSButton - - - playIndicator - NSImageView - - - previousMediaOverlayButton - NSButton - - - toggleMediaOverlayButton - NSButton - - - webViewController - LOXWebViewController - - - - IBProjectSource - ./Classes/LOXMediaOverlayController.h - - - - LOXPageNumberTextController - NSObject - - NSTextField - NSTextField - LOXWebViewController - - - - pageCountCtrl - NSTextField - - - pageNumberCtrl - NSTextField - - - webViewController - LOXWebViewController - - - - IBProjectSource - ./Classes/LOXPageNumberTextController.h - - - - LOXPreferencesController - NSObject - - id - id - id - id - id - id - id - id - - - - applyEscapables: - id - - - applySkippables: - id - - - clearStyles: - id - - - onApplyStyle: - id - - - onClose: - id - - - resetEscapables: - id - - - resetSkippables: - id - - - selectorSelected: - id - - - - NSTextView - NSTextView - NSPopUpButton - NSWindow - NSTextView - - - - moEscapablesCtrl - NSTextView - - - moSkippablesCtrl - NSTextView - - - selectorsCtrl - NSPopUpButton - - - sheet - NSWindow - - - styleCtrl - NSTextView - - - - IBProjectSource - ./Classes/LOXPreferencesController.h - - - - LOXSpineViewController - NSObject - - _tableView - NSTableView - - - _tableView - - _tableView - NSTableView - - - - IBProjectSource - ./Classes/LOXSpineViewController.h - - - - LOXTocView - NSOutlineView - - IBProjectSource - ./Classes/LOXTocView.h - - - - LOXTocViewController - NSObject - - LOXAppDelegate - NSOutlineView - - - - _appDelegate - LOXAppDelegate - - - _outlineView - NSOutlineView - - - - IBProjectSource - ./Classes/LOXTocViewController.h - - - - LOXWebViewController - NSObject - - id - id - - - - onLeftPageClick: - id - - - onRightPageClick: - id - - - - WebView - LOXAppDelegate - NSButton - NSButton - - - - _webView - WebView - - - appDelegate - LOXAppDelegate - - - leftPageButton - NSButton - - - rightPageButton - NSButton - - - - IBProjectSource - ./Classes/LOXWebViewController.h - - - - - 0 - IBCocoaFramework - YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - {11, 11} - {10, 3} - {27, 29} - {36, 36} - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 0370b749e73e1119d42be221545548a64b791ebe Mon Sep 17 00:00:00 2001 From: hslee Date: Wed, 2 Dec 2015 11:42:01 +0900 Subject: [PATCH 2/7] update print --- LauncherOSX/LOXePubSdkApi.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LauncherOSX/LOXePubSdkApi.mm b/LauncherOSX/LOXePubSdkApi.mm index 31267c8..4c0a040 100644 --- a/LauncherOSX/LOXePubSdkApi.mm +++ b/LauncherOSX/LOXePubSdkApi.mm @@ -199,7 +199,7 @@ - (bool) checkActionPrint } else { - return false; + return true; } } From cc8f882f7c4814289a81fdea3f33825adff5fc70 Mon Sep 17 00:00:00 2001 From: DRMinside Date: Wed, 2 Dec 2015 11:57:41 +0900 Subject: [PATCH 3/7] Update LOXAppDelegate.mm --- LauncherOSX/LOXAppDelegate.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LauncherOSX/LOXAppDelegate.mm b/LauncherOSX/LOXAppDelegate.mm index 070fc7a..f2283de 100644 --- a/LauncherOSX/LOXAppDelegate.mm +++ b/LauncherOSX/LOXAppDelegate.mm @@ -201,7 +201,7 @@ - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filenam [self openDocumentWithPath:filename]; // Modified by DRM inside, C.H Yu on 2015-04-23 - // To handle behavior of the 'cancel' button of the passowrd input dialog + // To handle behavior of the 'cancel' button of the passphrase input dialog return TRUE; } From bd74e15903f1f1df76b00d3d99f565b6f6af45da Mon Sep 17 00:00:00 2001 From: DRMinside Date: Wed, 2 Dec 2015 12:00:40 +0900 Subject: [PATCH 4/7] Update drmInitialize.h --- LauncherOSX/drmInitialize.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/LauncherOSX/drmInitialize.h b/LauncherOSX/drmInitialize.h index 4204b01..8389a59 100644 --- a/LauncherOSX/drmInitialize.h +++ b/LauncherOSX/drmInitialize.h @@ -1,9 +1,24 @@ // -// LcpInitialize.h -// SDKLauncher-iOS +// DrmInitialize.h +// SDKLauncher-OSX // -// Created by DRMinside-IMac on 2015. 11. 5.. -// Copyright © 2015년 The Readium Foundation. All rights reserved. +// Created by DRM inside Development Team on 2015-08-16. +// ( T.H. Kim, H.D. Yoon, H.S. Lee and C.H. Yu ) +// +// Copyright (c) 2015 The Readium Foundation and contributors. All rights reserved. +// +// The Readium SDK is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see // #import From 0fdc08467125e2b343fc6f4638b1cc09cd765cb7 Mon Sep 17 00:00:00 2001 From: DRMinside Date: Wed, 2 Dec 2015 12:02:33 +0900 Subject: [PATCH 5/7] Update LOXePubSdkApi.mm --- LauncherOSX/LOXePubSdkApi.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LauncherOSX/LOXePubSdkApi.mm b/LauncherOSX/LOXePubSdkApi.mm index 4c0a040..b7e5b13 100644 --- a/LauncherOSX/LOXePubSdkApi.mm +++ b/LauncherOSX/LOXePubSdkApi.mm @@ -39,6 +39,7 @@ #import "LOXSpineItem.h" #import "LOXPackage.h" + #import "LOXAppDelegate.h" #import #import "drmInitialize.h" @@ -187,6 +188,7 @@ - (void)cleanup _currentPackage = nil; } + // Added by DRM inside, H.S. Lee on 2015-04-23 // To handle checking user rights for the 'print' action - (bool) checkActionPrint From d27535905bbf83c4dbb1db5636f7a938f69db65c Mon Sep 17 00:00:00 2001 From: hslee Date: Wed, 2 Dec 2015 13:40:49 +0900 Subject: [PATCH 6/7] update epubsdkapi --- LauncherOSX/LOXePubSdkApi.mm | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/LauncherOSX/LOXePubSdkApi.mm b/LauncherOSX/LOXePubSdkApi.mm index b7e5b13..df075e0 100644 --- a/LauncherOSX/LOXePubSdkApi.mm +++ b/LauncherOSX/LOXePubSdkApi.mm @@ -145,13 +145,6 @@ - (LOXPackage *)openFile:(NSString *)file _container = ePub3::Container::OpenContainer([file UTF8String]); - // Added by DRM inside, H.S. Lee on 2015-04-23 - // Without the checking validity of the container pointer, app. could be crashed. - if(_container == nullptr) { - return nil; - } - //////// - [self readPackages]; if([_packages count] > 0) { @@ -163,15 +156,11 @@ - (LOXPackage *)openFile:(NSString *)file - (void)readPackages { - // Modified by DRM inside, H.S. Lee on 2015-04-23 - // Without the checking validity of the container pointer, app. could be crashed. - if(_container != nullptr) { - auto packages = _container->Packages(); + auto packages = _container->Packages(); - for (auto package = packages.begin(); package != packages.end(); ++package) { + for (auto package = packages.begin(); package != packages.end(); ++package) { - [_packages addObject:[[LOXPackage alloc] initWithSdkPackage:*package]]; - } + [_packages addObject:[[LOXPackage alloc] initWithSdkPackage:*package]]; } } From e2267f7c9efc50c9126e49eafb2fc39fafb538c5 Mon Sep 17 00:00:00 2001 From: hslee Date: Wed, 2 Dec 2015 14:09:12 +0900 Subject: [PATCH 7/7] no message --- LauncherOSX/LOXAppDelegate.mm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/LauncherOSX/LOXAppDelegate.mm b/LauncherOSX/LOXAppDelegate.mm index f2283de..22f5e4f 100644 --- a/LauncherOSX/LOXAppDelegate.mm +++ b/LauncherOSX/LOXAppDelegate.mm @@ -198,11 +198,7 @@ - (LOXBook *)findOrCreateBookForCurrentPackageWithPath:(NSString *)path - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename { - [self openDocumentWithPath:filename]; - - // Modified by DRM inside, C.H Yu on 2015-04-23 - // To handle behavior of the 'cancel' button of the passphrase input dialog - return TRUE; + return [self openDocumentWithPath:filename]; }