mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:17:35 +00:00
MacPDF: Use Serenity license headers, remove Xcode boilerplate
This commit is contained in:
parent
91e0438fca
commit
e9b0ebe55a
7 changed files with 39 additions and 57 deletions
|
@ -1,9 +1,10 @@
|
||||||
//
|
/*
|
||||||
// AppDelegate.h
|
* Copyright (c) 2023, Nico Weber <thakis@chromium.org>
|
||||||
// SerenityPDF
|
*
|
||||||
//
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
// Created by Nico Weber on 7/22/23.
|
*/
|
||||||
//
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
// Several AK types conflict with MacOS types.
|
// Several AK types conflict with MacOS types.
|
||||||
#define FixedPoint FixedPointMacOS
|
#define FixedPoint FixedPointMacOS
|
||||||
|
@ -11,5 +12,4 @@
|
||||||
#undef FixedPoint
|
#undef FixedPoint
|
||||||
|
|
||||||
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -1,16 +1,14 @@
|
||||||
//
|
/*
|
||||||
// AppDelegate.m
|
* Copyright (c) 2023, Nico Weber <thakis@chromium.org>
|
||||||
// SerenityPDF
|
*
|
||||||
//
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
// Created by Nico Weber on 7/22/23.
|
*/
|
||||||
//
|
|
||||||
|
|
||||||
#import "AppDelegate.h"
|
#import "AppDelegate.h"
|
||||||
|
|
||||||
#include <LibGfx/Font/FontDatabase.h>
|
#include <LibGfx/Font/FontDatabase.h>
|
||||||
|
|
||||||
@interface AppDelegate ()
|
@interface AppDelegate ()
|
||||||
|
|
||||||
@property (strong) IBOutlet NSWindow* window;
|
@property (strong) IBOutlet NSWindow* window;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -18,7 +16,6 @@
|
||||||
|
|
||||||
- (void)applicationDidFinishLaunching:(NSNotification*)aNotification
|
- (void)applicationDidFinishLaunching:(NSNotification*)aNotification
|
||||||
{
|
{
|
||||||
// Insert code here to initialize your application
|
|
||||||
// FIXME: copy the fonts to the bundle or something
|
// FIXME: copy the fonts to the bundle or something
|
||||||
auto source_root = DeprecatedString("/Users/thakis/src/serenity");
|
auto source_root = DeprecatedString("/Users/thakis/src/serenity");
|
||||||
Gfx::FontDatabase::set_default_fonts_lookup_path(DeprecatedString::formatted("{}/Base/res/fonts", source_root));
|
Gfx::FontDatabase::set_default_fonts_lookup_path(DeprecatedString::formatted("{}/Base/res/fonts", source_root));
|
||||||
|
@ -26,7 +23,6 @@
|
||||||
|
|
||||||
- (void)applicationWillTerminate:(NSNotification*)aNotification
|
- (void)applicationWillTerminate:(NSNotification*)aNotification
|
||||||
{
|
{
|
||||||
// Insert code here to tear down your application
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)applicationSupportsSecureRestorableState:(NSApplication*)app
|
- (BOOL)applicationSupportsSecureRestorableState:(NSApplication*)app
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
//
|
/*
|
||||||
// LagomPDFDocument.h
|
* Copyright (c) 2023, Nico Weber <thakis@chromium.org>
|
||||||
// SerenityPDF
|
*
|
||||||
//
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
// Created by Nico Weber on 9/21/23.
|
*/
|
||||||
//
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
// Several AK types conflict with MacOS types.
|
// Several AK types conflict with MacOS types.
|
||||||
#define FixedPoint FixedPointMacOS
|
#define FixedPoint FixedPointMacOS
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
//
|
/*
|
||||||
// LagomPDFDocument.m
|
* Copyright (c) 2023, Nico Weber <thakis@chromium.org>
|
||||||
// SerenityPDF
|
*
|
||||||
//
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
// Created by Nico Weber on 9/21/23.
|
*/
|
||||||
//
|
|
||||||
|
|
||||||
#import "LagomPDFDocument.h"
|
#import "LagomPDFDocument.h"
|
||||||
|
|
||||||
|
@ -74,8 +73,6 @@
|
||||||
|
|
||||||
- (NSString*)windowNibName
|
- (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";
|
return @"LagomPDFDocument";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,8 +93,6 @@
|
||||||
|
|
||||||
- (NSData*)dataOfType:(NSString*)typeName error:(NSError**)outError
|
- (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) {
|
if (outError) {
|
||||||
*outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:nil];
|
*outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:nil];
|
||||||
}
|
}
|
||||||
|
@ -106,10 +101,6 @@
|
||||||
|
|
||||||
- (BOOL)readFromData:(NSData*)data ofType:(NSString*)typeName error:(NSError**)outError
|
- (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 (![[UTType typeWithIdentifier:typeName] conformsToType:UTTypePDF]) {
|
||||||
if (outError) {
|
if (outError) {
|
||||||
*outError = [NSError errorWithDomain:NSOSStatusErrorDomain
|
*outError = [NSError errorWithDomain:NSOSStatusErrorDomain
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
//
|
/*
|
||||||
// PDFView.h
|
* Copyright (c) 2023, Nico Weber <thakis@chromium.org>
|
||||||
// SerenityPDF
|
*
|
||||||
//
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
// Created by Nico Weber on 7/22/23.
|
*/
|
||||||
//
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
//
|
/*
|
||||||
// PDFView.m
|
* Copyright (c) 2023, Nico Weber <thakis@chromium.org>
|
||||||
// SerenityPDF
|
*
|
||||||
//
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
// Created by Nico Weber on 7/22/23.
|
*/
|
||||||
//
|
|
||||||
|
|
||||||
#import "LagomPDFView.h"
|
#import "LagomPDFView.h"
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,12 @@
|
||||||
//
|
/*
|
||||||
// main.m
|
* Copyright (c) 2023, Nico Weber <thakis@chromium.org>
|
||||||
// SerenityPDF
|
*
|
||||||
//
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
// Created by Nico Weber on 7/22/23.
|
*/
|
||||||
//
|
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
int main(int argc, char const* argv[])
|
int main(int argc, char const* argv[])
|
||||||
{
|
{
|
||||||
@autoreleasepool {
|
|
||||||
// Setup code that might create autoreleased objects goes here.
|
|
||||||
}
|
|
||||||
return NSApplicationMain(argc, argv);
|
return NSApplicationMain(argc, argv);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue