Skip to content

Comments

AppKit Improvements (Getting TextEdit to compile and Run)#29

Merged
CuriousTommy merged 13 commits intodarlinghq:masterfrom
CKegel:TextEdit_patches
Aug 17, 2024
Merged

AppKit Improvements (Getting TextEdit to compile and Run)#29
CuriousTommy merged 13 commits intodarlinghq:masterfrom
CKegel:TextEdit_patches

Conversation

@CKegel
Copy link

@CKegel CKegel commented Apr 21, 2023

Adds stubs and implements missing functionality as required for Apple TextEdit to compile and run.
Also note the following related PRs:
CoreFoundation
LaunchServices
AppleEvents Stubs
TextEdit CMake

Fixes Issue 383
TextEdit running on Darling

@CKegel CKegel changed the title Stubs and Implementation for TextEdit AppKit Improvements (Getting TextEdit to compile and Run) Apr 24, 2023
@CKegel
Copy link
Author

CKegel commented Apr 28, 2023

I'm working on finalizing this PR, and I plan to do the following before I'd consider it ready to merge(after review):

  1. Solidify the implementation of [NSAttributedString initWithData:]
  2. Ensure File Type and UTI to Document Class parsing/identification are working correctly
  3. review the code for style and memory leaks and refactor

After this PR is eventually merged, I'd like to create an issue where I can track progress on the rest of my AppKit improvements for TextEdit as, while this PR makes great strides, it doesn't even come close to making TextEdit run perfectly. Let me know what ya'll think and I'll be back to implement it after my final exams have wrapped up next week!

@CKegel CKegel force-pushed the TextEdit_patches branch 16 times, most recently from bc723e1 to cdd4de1 Compare May 1, 2023 07:03
Copy link
Member

@facekapow facekapow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for one minor note

@CKegel CKegel force-pushed the TextEdit_patches branch 4 times, most recently from 3808f90 to 332d6e6 Compare October 22, 2023 01:26
@CKegel CKegel requested a review from facekapow October 22, 2023 01:27
CKegel added 11 commits February 2, 2024 16:19
Fix issue where a layout manager's NSTextStorage could be `nil` at initialization
but later set by introducing the `_setTextStorage:` method to NSTextView.

Add stubs a for missing properties in NSTextView.

Refactor `firstTextView` to properly find and return the first text view,
or `nil` if there are no text views.

Use 64-bit ready types where applicable.

Relocate unrelated code from _setTextStorage
Adds code in `initWithData` to infer document format for RTF, HTML, and plaintext documents.
Additionally refactors NSAttributedString to use the correct attribute types as described in Apple's documentation.
Add stubs for content size, frame size, and magnification size,
and add basic implementations where feasible.
Implement NSTextTab handling based on the GNUStep implementation,
with formatting and other adjustments.

return (result == nil) ? [_NSUnsupportedDocument class] : NSClassFromString(result);
return (result == nil) ? [_NSUnsupportedDocument class]
: NSClassFromString(result);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no such class (with this name), should this:

  • return nil
  • return _NSUnsupportedDocument
  • crash (throw an exception)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per Apple's documentation, it should return nil.

@CKegel CKegel requested a review from bugaevc March 12, 2024 20:16
@CuriousTommy
Copy link

CuriousTommy commented Aug 17, 2024

@bugaevc I don't remember if we talk about this before, but I'm thinking of merging this as is, unless you have any objections.

@bugaevc
Copy link
Member

bugaevc commented Aug 17, 2024

Please do. Whatever remaining objections/corrections I might/would have had would be better dealt with after the fact, compared to keeping this stalled indefinitely.

@CuriousTommy CuriousTommy merged commit be9227b into darlinghq:master Aug 17, 2024
@CuriousTommy
Copy link

Thank you for your contribution @CKegel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get TextEdit to compile and run

4 participants