Commit Graph

3194 Commits

Author SHA1 Message Date
ckegel
b3c2e2dea3 Implement NSParagraph TabStops properly
Implement NSTextTab handling based on the GNUStep implementation,
with formatting and other adjustments.
2024-02-02 16:19:25 -05:00
ckegel
a4bc3feb11 Add framework for size and magnification methods
Add stubs for content size, frame size, and magnification size,
and add basic implementations where feasible.
2024-02-02 16:19:25 -05:00
ckegel
7fcfc33365 Implement readFromURL: in NSMutableAttributedString 2024-02-02 16:19:25 -05:00
ckegel
2f6272f476 Align documentClassForType: implementation with Apple's developer documentation 2024-02-02 16:19:25 -05:00
ckegel
e086fe9f33 Add document format inference in NSAttributedString
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.
2024-02-02 16:19:25 -05:00
ckegel
5300f80f18 Fix handling of NSTextContainer and NSTextStorage in NSTextView.subproj
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
2024-02-02 16:19:25 -05:00
ckegel
fd68ee23c7 Implement NSUserInterfaceItemIdentifcation protocol 2024-02-02 16:19:25 -05:00
ckegel
81d2422c67 add NSDocumentController type discovery 2024-02-02 16:19:25 -05:00
ckegel
bb0c134428 Add missing methods and stubs for TextEdit 2024-02-02 16:19:25 -05:00
CuriousTommy
e348862349
Merge pull request #33 from sirnacnud/add-NSApplicationLaunchUserNotificationKey
Add symbol for NSApplicationLaunchUserNotificationKey
2024-01-06 19:57:46 -08:00
Duncan Cunningham
8271f7e5ec Add symbol for NSApplicationLaunchUserNotificationKey 2024-01-06 21:32:31 +01:00
Ariel Abreu
e01bcde594
Merge pull request #32 from CKegel/warning_fixes
Correct NSInteger warnings
2023-10-17 00:05:27 -04:00
ckegel
8283bdabbe Implement correct formatting for NSInteger values 2023-10-16 23:41:29 -04:00
Ariel Abreu
9a223835e7
Merge pull request #31 from CKegel/master
Patch NSMenuItem implementation
2023-10-16 14:26:26 -04:00
ckegel
410d10de2a Use correct key values in NSMenuItem encodeWithCoder: implementation 2023-10-16 11:00:32 -04:00
Ariel Abreu
80e61187d4
Many encodeWithCoder: implementations for Interface Builder
These are all the implementations needed for my sample app, but more
will have to be added later for XIBs with other objects, of course.
2023-10-13 10:33:13 -04:00
Ariel Abreu
86a42fbbf9
NSIBObjectData: Add some properties for Xcode; use NSMapTables
The refactoring to use NSMapTables isn't arbitrary, it's required for
Xcode: Xcode accesses these map tables via the `*Table` properties and
inserts and removes objects in them at its discretion.

Note this means the map tables also have to use the same key and value
options that Apple uses in order to remain compatible,
so don't change these without a good reason.
2023-10-13 10:31:12 -04:00
Ariel Abreu
491b0b0418
NSWindowTemplate: Add a lot more properties
These are required by Xcode. TODO: actually use them.
2023-10-13 10:22:23 -04:00
Ariel Abreu
bd843143fb
Misc. stubs, fixes, and implementations for Xcode 2023-10-13 10:18:19 -04:00
Ariel Abreu
1efc3b97de
Implement NSUserInterfaceItemIdentification 2023-10-13 10:08:54 -04:00
Ariel Abreu
6f9958fd46
Add performSynchronousFileAccessUsingBlock stub 2023-10-07 23:50:19 -04:00
Ariel Abreu
22e542f69d
Correct IBCocoaFramework value 2023-10-07 23:50:03 -04:00
Ariel Abreu
d7fc1ce4b7
More fixes and stubs for Xcode 2023-10-07 11:00:59 -04:00
Ariel Abreu
ac4514c596
More stubs and fixes for Xcode 2023-09-25 16:17:44 -04:00
CuriousTommy
a23a4bab20
Merge pull request #30 from darlinghq/fedora_38_fix
Fix Building For Fedora 38
2023-06-28 10:29:56 -07:00
Thomas A
6b006c021b Fix implicit-function-declaration 2023-06-19 11:30:55 -07:00
Thomas A
b30c2be791 Change include from CoreServices to CarbonCore 2023-04-16 13:47:48 -07:00
Ariel Abreu
3c656d84f5
[mtl] Only require texture memory to be host-visible if it's not framebuffer-only 2023-04-11 08:16:16 -04:00
Ariel Abreu
c449e7608e
Make Metal an optional part of the build
See the corresponding commit in the main repo
2023-04-06 10:04:50 -04:00
Ariel Abreu
96122cff43
Use Indium's DynamicVK to load Vulkan functions dynamically
This allows us to link to Vulkan dynamically at runtime (via Indium).
2023-04-06 10:04:50 -04:00
Ariel Abreu
6afea83f6c
[mtl-layer] Fix some lock issues with queued drawables 2023-04-06 10:04:49 -04:00
Ariel Abreu
ccf32c6281
Ensure objc presented handlers are invoked
Previously, they would only be invoked if the `present` method was
invoked directly on the objc drawable object.
2023-04-06 10:04:49 -04:00
Ariel Abreu
c99fc73ebd
Fix huge memory leak
This fixes the massive memory leak that was presented with the old code
that could cause the memory usage to reach over 2GiB in under 5 seconds
(while running at 60fps). There still seems to be another memory leak
present, but it's much smaller by comparison (increases by about 0.3MiB
every second when running at 60fps).
2023-04-06 10:04:49 -04:00
Ariel Abreu
55bafce1f1
Initial support for Metal layers and drawables
In its current state, I consider this code to be experimental and
unstable. The biggest problem is that there's currently a HUGE memory
leak somewhere (over 2GiB in under 5 seconds at 60fps). I'm committing
what I have now since I don't feel like debugging that right now and it
*does* technically work as-is.

The current approach is not great for performance: first, we render to a Metal/Vulkan
texture in the desired format then blit that to an RGBA Metal/Vulkan
texture shared with
OpenGL. Then, we copy *that* to another OpenGL texture in CAMetalLayer
to use as the content for the layer (we can't keep the drawable's OpenGL
texture, since that has to be recycled). Finally, this is rendered to a
subwindow by CARenderer/CALayerContext. We cannot get rid of the last copy
since we must render to the subwindow somehow and it's the easiest
way to play nice with sublayers. I also don't think we can get rid of the
first copy since OpenGL doesn't support some of Metal/Vulkan's texture
formats; plus, we can't share optimally tiled images between Vulkan and
OpenGL with some vendors' drivers (e.g. AMD).
We *could* get rid of the second copy if we were able to accurately
determine when the content is finally presented; then we could simply
keep the drawable in-use, render it to the subwindow when asked to, and
release it once we know the render is complete.
2023-04-06 10:04:49 -04:00
Thomas A
3159ee117c Fix "parameter name omitted" For CGWindowLevelForKey. Add Note About CGWindowLevel. 2023-03-29 09:15:52 -07:00
Thomas A
624da5b8e1 Replace nil with kCGErrorSuccess
Fixes Building
2023-03-27 11:23:05 -07:00
CuriousTommy
4ea39ed10d
Merge pull request #26 from genkiinstruments/coretext-missing-symbols
Add some stubs for missing symbols in CoreText
2023-03-27 10:14:32 -07:00
Daniel Gretarsson
b001b467d5 Use NS_ENUM for added enums in CoreText 2023-03-27 10:25:05 +00:00
Daniel Gretarsson
ccd8c204e1 Add some stubs for missing symbols in CoreText 2023-03-27 10:25:05 +00:00
CuriousTommy
a72fb066cd
Merge pull request #25 from genkiinstruments/coregraphics-missing-symbols
Add some stubs and missing symbols for CoreGraphics
2023-03-26 10:27:35 -07:00
Daniel Gretarsson
90c9369964 Use CF_ENUM on new enums in CoreGraphics 2023-03-26 14:23:02 +00:00
CuriousTommy
520c4c91a9
Merge pull request #27 from genkiinstruments/appkit-missing-symbols
Add missing symbols and stubs for AppKit
2023-03-26 06:17:20 -07:00
Daniel Gretarsson
6ee777f377 Add printf to stubs in NSAccessibility.m and NSPasteboard.m 2023-03-26 13:11:29 +00:00
Daniel Gretarsson
c1b75488c7 Add missing symbols and stubs for AppKit 2023-03-20 12:05:35 +00:00
Daniel Gretarsson
2691295544 Add some stubs and missing symbols for CoreGraphics 2023-03-20 10:59:27 +00:00
Thomas A
aaa486783e Add CGDisplayModeGetPixelWidth Stub 2023-03-17 19:51:54 -07:00
Juan Patricio
4f29ff5b7d
Fix button leak 2023-02-23 17:59:16 -03:00
Juan Patricio
aba55454af
Moved addButtonWithTitle/_addButtonWithTitle definition before its usage, fixed formatting and typo 2023-02-23 15:51:17 -03:00
Juan Patricio
4a75b8cbc7
NSInteger-ization of NSAlert.m
See darlinghq/darling#418
2023-02-23 13:47:21 -03:00
Juan Patricio
2b0caf2f51
Fixed return code for alets created with alertWithMessageText
Those types of alerts have a different set of NSModalResponse.

This fix alerts not working in The Blockheads Server and any other app also using that method.
2023-02-23 13:45:08 -03:00