Commit Graph

3089 Commits

Author SHA1 Message Date
Andrew Hyatt
972b6eceb7 CGEvent missing function (darlinghq/darling#445) 2019-01-06 22:47:25 -05:00
Andrew Hyatt
46e8401c33 Missing constants in AppKit
darlinghq/darling#445
2019-01-06 17:37:18 -05:00
Andrew Hyatt
d0c910d932 Accessibility constants for Xcode 9/10
darlinghq/darling#445
2019-01-06 12:32:21 -05:00
Andrew Hyatt
774c415f3f CoreData stubs for Xcode (darlinghq/darling#445) 2019-01-04 18:53:27 -05:00
Sergey Bugaev
9837e47f0c Spacing & formatting tweaks 2018-12-17 00:34:31 +03:00
Sergey Bugaev
f965e69721 Implement basic NSSavePanel & NSOpenPanel-s directly in Cocoa
The upstream Cocotron assumes that the implementation of the file panels
is provided by the display, i.e. by the native toolkit. That is what we
ultimately want as well, but we're far from being there yet, and we also
don't want to make any toolkit a hard requirement.

So in order to have our cake and eat it too, these panel implementations
are designed work entirely inside Cocoa but also let the display provide
a native implementation instead if one is available.
2018-12-17 00:34:31 +03:00
Sergey Bugaev
26a2c08c8b Fix NSTableView rendering zero-sized rows
There's no reason to reallocate the row heights cache here.
2018-12-17 00:34:31 +03:00
Sergey Bugaev
a924c352f5 Fix always reporting left mouse button
This makes right-clicking and scrolling work.
2018-12-17 00:34:31 +03:00
Sergey Bugaev
ff314703cd Add NSEventTypeOtherMouseUp 2018-12-17 00:34:31 +03:00
Sergey Bugaev
ddcb49d52e Implement CGPDFDocumentCreateWithURL() 2018-12-17 00:34:31 +03:00
Sergey Bugaev
c95aecf2a3 Actually propagate setAcceptsMouseMovedEvents to XSelectInput()
X11Display already has the code to drop mouse moved events in case
the window does not want them; but we weren't getting the events in
the first place because they were filtered out on the server side.

Fixes, among other things, NSMenu not reacting to clicks properly,
because it was assuming the clicked item was not the selected one
as it could not see the mouse hovering over it.
2018-12-17 00:34:31 +03:00
Sergey Bugaev
1403e9700b Fix -[NSApp runModalForWindow:] hanging
There's no need to additionally spin the run loop since runModalSession: does that
already, in a proper way (that is via nextEventMatchingMask:untilDate:inMode:dequeue:]),
and spinning the run loop directly prevents AppKit from getting its events.
2018-12-16 23:56:58 +03:00
Sergey Bugaev
6474bcd088 NSInteger-ization
See https://github.com/darlinghq/darling/issues/418
2018-12-16 23:54:57 +03:00
Sergey Bugaev
0b5ea84d65 Modernize/improve NSEventType/NSEventMask 2018-11-27 22:33:48 +03:00
Sergey Bugaev
73d36fa841 Add a bunch of NSImageName's
These are just the strings, the images themselves are still missing.
2018-11-27 22:33:48 +03:00
Sergey Bugaev
4c46590230 Implement dynamic loading of AppKit backends
At the moment, there's only one, X11.backend
2018-11-27 22:33:48 +03:00
Sergey Bugaev
29c1349bc6 Fix deallocating an X11Display 2018-11-27 22:33:48 +03:00
Sergey Bugaev
4287f05174 Turn backend-specific CG*() functions into NSDisplay methods
As they are so clearly meant to be. This is also a prerequisite for building
the X11 backend as a separate dynamically loaded Mach-O and loading many such
backends at the same time.
2018-11-27 22:33:48 +03:00
Sergey Bugaev
ba12e65f5a Split X11.subproj into X11.backend and Linux.subproj (FreeType, fontconfig)
Also, drop unused NSOpenGLDrawable_X11, O2Context_cairo and O2Surface_cairo.
2018-11-27 22:25:54 +03:00
Sergey Bugaev
9622fe5236 Pretend to have arbitrary font families like we do for individual fonts already 2018-11-27 22:25:54 +03:00
Sergey Bugaev
18ffffb795 Fix loading the first main menu item
localizedInfoDictionary can be nil if the corresponding localization is missing; you have
to either account for that by falling back to infoDictionary, or use objectForInfoDictionaryKey:
which (in addition to being more concise than [[localizedInfoDictionary] objectForKey:]) implements
automatical fallback to the non-localized dictionary.
2018-11-27 22:25:54 +03:00
Sergey Bugaev
4558f13663 Install some more nibs 2018-11-27 22:25:54 +03:00
Andrew Hyatt
be469a49ab Correct some Foundation permissions 2018-11-23 12:08:53 -05:00
Sergey Bugaev
dd3eb6afcc Return an empty dict from TIFF's copyPropertiesAtIndex:options:
As it's done for other image formats.
2018-09-12 09:25:27 +03:00
Sergey Bugaev
3752636e4f Fix resizing X11Window-s 2018-09-12 09:25:27 +03:00
Sergey Bugaev
33528b917b size_t-ize Onyx2D as appropriate
See darlinghq/darling#418
2018-09-12 09:26:24 +03:00
Sergey Bugaev
655c781ccf Typedef CG* types to @class-es instead of fake structs
This significantly cuts down the number of warnings.
2018-09-12 09:25:27 +03:00
Sergey Bugaev
e3bb5c9196 CGFloat/O2Float-ization
See darlinghq/darling#418
2018-09-12 09:25:27 +03:00
Sergey Bugaev
e2b11f541c Install NSButtonCell_disclosure resources 2018-09-09 22:09:03 +03:00
Sergey Bugaev
078fe9beb7 De-NSInteger-ize {CG,O2}FontGetGlyphAdvances()
Turns out it didn't just break the build (269215f670),
it was actually *wrong*; the Apple's version uses a plain int (not even a CFIndex) for some reason. Do the same in O2FontGetGlyphAdvances(),
but keep the internal ivar as an NSInteger array pointer; we're making a copy in O2FontGetGlyphAdvances() anyway.
2018-09-08 14:06:56 +03:00
Lubos Dolezel
269215f670 Build fix 2018-09-04 16:13:25 +02:00
Sergey Bugaev
1a3da6217a Fix returning NO where a pointer is expected 2018-09-02 23:27:07 +03:00
Sergey Bugaev
f0589098ad Do not cast SEL to id
This only happens to work because they are of the same size (pointer).
2018-09-02 23:26:23 +03:00
Sergey Bugaev
d5ecefdc80 Add a few system colors
See commit e0cbc2b843
2018-09-02 23:25:39 +03:00
Sergey Bugaev
098332d8ee Rewrite FreeType bitmap rendering; now with horizontal clipping support
And much nicer code, too.
2018-09-02 23:24:30 +03:00
Sergey Bugaev
8b1f575427 Disable threaded animation of NSProgressIndicator
The way it's implemented it doesn't work and it's unclear how it is supposed to.
2018-09-02 23:23:12 +03:00
Sergey Bugaev
b4de5dabd8 Style up pushed buttons
See commit 5352e472c9
2018-09-02 23:21:59 +03:00
Sergey Bugaev
7215911cb6 Support CFBundleTypeExtensions=* 2018-09-02 23:21:39 +03:00
Sergey Bugaev
6caf1a0d99 Include the objc runtime header where needed 2018-09-02 23:20:29 +03:00
Sergey Bugaev
1b93004304 Only invoke updateCell: if the controlView responds to it
Otherwise, simply mark it as needing display.
Also, make sure to do all of this when setting an attributed string value.
2018-09-02 23:18:02 +03:00
Sergey Bugaev
a66dd5efba NSInteger-ization & CGFloat/O2Float-ization
See https://github.com/darlinghq/darling/issues/418
2018-09-02 23:14:39 +03:00
Sergey Bugaev
96f2f31de0 Finish rewriting radial gradients
This fixes a few prominent issues of the previous implementation, including
distortions when the circles touch each other and ignoring the second solution of
the equation (resulting in one side of the "tube" missing). This also implements
clipping the negative part of the gradient cone.
2018-09-02 14:10:38 +03:00
Lubos Dolezel
9679b03cbb Export some CGGeometry functions as symbols 2018-08-28 21:25:40 +02:00
Sergey Bugaev
6b789836a8 Fix X11Display ignoring buffered events
-[X11Display processPendingEvnets], which dequeues events from the X11 event queue,
converts them to NSEvents and finally enqueues into the NSDisplay event queue, was
only invoked as a result of the X11 socket becoming readable during an iteration of
NSRunLoop. However, events can arrive and be queued by libX11 as a result of some
other interactions with X11, such as querying the mouse position, in which case the
socket won't be readable, but libX11 will still contain queued events.

Fix this by invoking -[X11Display processPendingEvnets] an additional time before
delegating to super's implementation which spins the loop; this way the NSDisplay
implementation can observe pending events in the event queue and deliver them
immediately.
2018-08-18 13:13:07 +03:00
Lubos Dolezel
9585490b67 Raise if a CGL context cannot be created 2018-08-14 21:40:04 +02:00
Lubos Dolezel
04280a8d90 Add stubs and other things for The Unarchiver 2018-08-14 17:54:53 +02:00
Lubos Dolezel
abcd7e4f5e Use proper retain/release order in NSMenuTemplate 2018-08-14 17:06:35 +02:00
Lubos Dolezel
8f295595e0 Legacy nib decoding initial work 2018-08-14 17:00:24 +02:00
Lubos Dolezel
95d4f03ccc Add NSErrors definitions 2018-08-14 14:44:48 +02:00
Sergey Bugaev
edfc8bf0f7 Implement NSRect & NSSize dictionary representation calls 2018-08-14 11:03:40 +03:00