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