mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
MacPDF: Use Serenity license headers, remove Xcode boilerplate
This commit is contained in:
parent
91e0438fca
commit
e9b0ebe55a
Notes:
sideshowbarker
2024-07-17 09:49:48 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/e9b0ebe55a Pull-request: https://github.com/SerenityOS/serenity/pull/21272
7 changed files with 39 additions and 57 deletions
|
@ -1,9 +1,10 @@
|
|||
//
|
||||
// AppDelegate.h
|
||||
// SerenityPDF
|
||||
//
|
||||
// Created by Nico Weber on 7/22/23.
|
||||
//
|
||||
/*
|
||||
* Copyright (c) 2023, Nico Weber <thakis@chromium.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Several AK types conflict with MacOS types.
|
||||
#define FixedPoint FixedPointMacOS
|
||||
|
@ -11,5 +12,4 @@
|
|||
#undef FixedPoint
|
||||
|
||||
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
//
|
||||
// AppDelegate.m
|
||||
// SerenityPDF
|
||||
//
|
||||
// Created by Nico Weber on 7/22/23.
|
||||
//
|
||||
/*
|
||||
* Copyright (c) 2023, Nico Weber <thakis@chromium.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
#include <LibGfx/Font/FontDatabase.h>
|
||||
|
||||
@interface AppDelegate ()
|
||||
|
||||
@property (strong) IBOutlet NSWindow* window;
|
||||
@end
|
||||
|
||||
|
@ -18,7 +16,6 @@
|
|||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification*)aNotification
|
||||
{
|
||||
// Insert code here to initialize your application
|
||||
// FIXME: copy the fonts to the bundle or something
|
||||
auto source_root = DeprecatedString("/Users/thakis/src/serenity");
|
||||
Gfx::FontDatabase::set_default_fonts_lookup_path(DeprecatedString::formatted("{}/Base/res/fonts", source_root));
|
||||
|
@ -26,7 +23,6 @@
|
|||
|
||||
- (void)applicationWillTerminate:(NSNotification*)aNotification
|
||||
{
|
||||
// Insert code here to tear down your application
|
||||
}
|
||||
|
||||
- (BOOL)applicationSupportsSecureRestorableState:(NSApplication*)app
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
//
|
||||
// LagomPDFDocument.h
|
||||
// SerenityPDF
|
||||
//
|
||||
// Created by Nico Weber on 9/21/23.
|
||||
//
|
||||
/*
|
||||
* Copyright (c) 2023, Nico Weber <thakis@chromium.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Several AK types conflict with MacOS types.
|
||||
#define FixedPoint FixedPointMacOS
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
//
|
||||
// LagomPDFDocument.m
|
||||
// SerenityPDF
|
||||
//
|
||||
// Created by Nico Weber on 9/21/23.
|
||||
//
|
||||
/*
|
||||
* Copyright (c) 2023, Nico Weber <thakis@chromium.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#import "LagomPDFDocument.h"
|
||||
|
||||
|
@ -74,8 +73,6 @@
|
|||
|
||||
- (NSString*)windowNibName
|
||||
{
|
||||
// Override to return the nib file name of the document.
|
||||
// If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers, you should remove this method and override -makeWindowControllers instead.
|
||||
return @"LagomPDFDocument";
|
||||
}
|
||||
|
||||
|
@ -96,8 +93,6 @@
|
|||
|
||||
- (NSData*)dataOfType:(NSString*)typeName error:(NSError**)outError
|
||||
{
|
||||
// Insert code here to write your document to data of the specified type. If outError != NULL, ensure that you create and set an appropriate error if you return nil.
|
||||
// Alternatively, you could remove this method and override -fileWrapperOfType:error:, -writeToURL:ofType:error:, or -writeToURL:ofType:forSaveOperation:originalContentsURL:error: instead.
|
||||
if (outError) {
|
||||
*outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:nil];
|
||||
}
|
||||
|
@ -106,10 +101,6 @@
|
|||
|
||||
- (BOOL)readFromData:(NSData*)data ofType:(NSString*)typeName error:(NSError**)outError
|
||||
{
|
||||
// Insert code here to read your document from the given data of the specified type. If outError != NULL, ensure that you create and set an appropriate error if you return NO.
|
||||
// Alternatively, you could remove this method and override -readFromFileWrapper:ofType:error: or -readFromURL:ofType:error: instead.
|
||||
// If you do, you should also override -isEntireFileLoaded to return NO if the contents are lazily loaded.
|
||||
|
||||
if (![[UTType typeWithIdentifier:typeName] conformsToType:UTTypePDF]) {
|
||||
if (outError) {
|
||||
*outError = [NSError errorWithDomain:NSOSStatusErrorDomain
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
//
|
||||
// PDFView.h
|
||||
// SerenityPDF
|
||||
//
|
||||
// Created by Nico Weber on 7/22/23.
|
||||
//
|
||||
/*
|
||||
* Copyright (c) 2023, Nico Weber <thakis@chromium.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
//
|
||||
// PDFView.m
|
||||
// SerenityPDF
|
||||
//
|
||||
// Created by Nico Weber on 7/22/23.
|
||||
//
|
||||
/*
|
||||
* Copyright (c) 2023, Nico Weber <thakis@chromium.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#import "LagomPDFView.h"
|
||||
|
||||
|
|
|
@ -1,16 +1,12 @@
|
|||
//
|
||||
// main.m
|
||||
// SerenityPDF
|
||||
//
|
||||
// Created by Nico Weber on 7/22/23.
|
||||
//
|
||||
/*
|
||||
* Copyright (c) 2023, Nico Weber <thakis@chromium.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, char const* argv[])
|
||||
{
|
||||
@autoreleasepool {
|
||||
// Setup code that might create autoreleased objects goes here.
|
||||
}
|
||||
return NSApplicationMain(argc, argv);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue