mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:17:35 +00:00
MacPDF: FixedPoint hack fix courtesy of trflynn
Also some minor cleanups, and pick a different default document.
This commit is contained in:
parent
ef91ced481
commit
77b311f00a
2 changed files with 4 additions and 5 deletions
|
@ -7,7 +7,10 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// Several AK types conflict with MacOS types.
|
||||||
|
#define FixedPoint FixedPointMacOS
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#undef FixedPoint
|
||||||
|
|
||||||
@interface LagomPDFView : NSView
|
@interface LagomPDFView : NSView
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
|
|
||||||
#import "LagomPDFView.h"
|
#import "LagomPDFView.h"
|
||||||
|
|
||||||
// #define USING_AK_GLOBALLY 0
|
|
||||||
|
|
||||||
#include <LibCore/File.h>
|
#include <LibCore/File.h>
|
||||||
#include <LibCore/MappedFile.h>
|
#include <LibCore/MappedFile.h>
|
||||||
#include <LibGfx/Bitmap.h>
|
#include <LibGfx/Bitmap.h>
|
||||||
|
@ -70,9 +68,7 @@ static NSBitmapImageRep* ns_from_gfx(NonnullRefPtr<Gfx::Bitmap> bitmap_p)
|
||||||
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));
|
||||||
|
|
||||||
NSLog(@"before file");
|
_file = TRY(Core::MappedFile::map("/Users/thakis/Downloads/pdf_reference_1-7.pdf"sv));
|
||||||
_file = TRY(Core::MappedFile::map("/Users/thakis/src/hack/sample.pdf"sv));
|
|
||||||
NSLog(@"got file");
|
|
||||||
auto document = TRY(PDF::Document::create(_file->bytes()));
|
auto document = TRY(PDF::Document::create(_file->bytes()));
|
||||||
TRY(document->initialize());
|
TRY(document->initialize());
|
||||||
return document;
|
return document;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue