mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 01:55:07 +00:00
MacPDF: Rename LagomPDFView to MacPDFView
This commit is contained in:
parent
3296fb0189
commit
f99771d46f
|
@ -18,7 +18,7 @@ add_executable(MacPDF MACOSX_BUNDLE
|
|||
main.mm
|
||||
AppDelegate.mm
|
||||
LagomPDFDocument.mm
|
||||
LagomPDFView.mm
|
||||
MacPDFView.mm
|
||||
)
|
||||
target_compile_options(MacPDF PRIVATE
|
||||
-fobjc-arc
|
||||
|
|
|
@ -11,13 +11,13 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
#undef FixedPoint
|
||||
|
||||
#import "LagomPDFView.h"
|
||||
#import "MacPDFView.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface LagomPDFDocument : NSDocument <LagomPDFViewDelegate>
|
||||
@interface LagomPDFDocument : NSDocument <MacPDFViewDelegate>
|
||||
{
|
||||
IBOutlet LagomPDFView* _pdfView;
|
||||
IBOutlet MacPDFView* _pdfView;
|
||||
}
|
||||
|
||||
- (IBAction)showGoToPageDialog:(id)sender;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
|
@ -20,7 +19,7 @@
|
|||
<rect key="contentRect" x="133" y="235" width="600" height="800"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1728" height="1079"/>
|
||||
<value key="minSize" type="size" width="94" height="86"/>
|
||||
<view key="contentView" id="gIp-Ho-8D9" customClass="LagomPDFView">
|
||||
<view key="contentView" id="gIp-Ho-8D9" customClass="MacPDFView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="800"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</view>
|
||||
|
|
|
@ -14,16 +14,16 @@
|
|||
#include <AK/WeakPtr.h>
|
||||
#include <LibPDF/Document.h>
|
||||
|
||||
@protocol LagomPDFViewDelegate
|
||||
@protocol MacPDFViewDelegate
|
||||
- (void)pageChanged;
|
||||
@end
|
||||
|
||||
@interface LagomPDFView : NSView
|
||||
@interface MacPDFView : NSView
|
||||
|
||||
- (void)setDocument:(WeakPtr<PDF::Document>)doc;
|
||||
- (void)goToPage:(int)page;
|
||||
- (int)page;
|
||||
|
||||
- (void)setDelegate:(id<LagomPDFViewDelegate>)delegate;
|
||||
- (void)setDelegate:(id<MacPDFViewDelegate>)delegate;
|
||||
|
||||
@end
|
|
@ -4,18 +4,18 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#import "LagomPDFView.h"
|
||||
#import "MacPDFView.h"
|
||||
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibPDF/Document.h>
|
||||
#include <LibPDF/Renderer.h>
|
||||
|
||||
@interface LagomPDFView ()
|
||||
@interface MacPDFView ()
|
||||
{
|
||||
WeakPtr<PDF::Document> _doc;
|
||||
NSBitmapImageRep* _cachedBitmap;
|
||||
int _page_index;
|
||||
__weak id<LagomPDFViewDelegate> _delegate;
|
||||
__weak id<MacPDFViewDelegate> _delegate;
|
||||
}
|
||||
@end
|
||||
|
||||
|
@ -58,7 +58,7 @@ static NSBitmapImageRep* ns_from_gfx(NonnullRefPtr<Gfx::Bitmap> bitmap_p)
|
|||
return bmp;
|
||||
}
|
||||
|
||||
@implementation LagomPDFView
|
||||
@implementation MacPDFView
|
||||
|
||||
// Called from LagomPDFDocument
|
||||
- (void)setDocument:(WeakPtr<PDF::Document>)doc
|
||||
|
@ -90,7 +90,7 @@ static NSBitmapImageRep* ns_from_gfx(NonnullRefPtr<Gfx::Bitmap> bitmap_p)
|
|||
return _page_index + 1;
|
||||
}
|
||||
|
||||
- (void)setDelegate:(id<LagomPDFViewDelegate>)delegate
|
||||
- (void)setDelegate:(id<MacPDFViewDelegate>)delegate
|
||||
{
|
||||
_delegate = delegate;
|
||||
}
|
Loading…
Reference in a new issue