Commit Graph

1628 Commits

Author SHA1 Message Date
Andrew Hyatt
e8e5426fc4 Accessibility related symbols
darlinghq/darling#445
2019-01-16 15:05:45 -05:00
Sergey Bugaev
7beb0626be Tweak scrollbar theming 2019-01-09 20:04:40 +03:00
Sergey Bugaev
28c4832407 Set the _NET_WM_ICON to the app icon(s)
This requires converting the icons from the ICNS format to the one
expected by X11. Thankfully, Onyx2D can most of the conversion for us.
2019-01-09 20:04:08 +03:00
Sergey Bugaev
63221ace67 Call XSetClassHint() for X11Window's
This lets the desktop environment display the name of the app in its UI.
2019-01-09 19:59:32 +03:00
Sergey Bugaev
af3b319399 Unify O2Font_freetype and O2Font_FT 2019-01-09 19:41:48 +03:00
Sergey Bugaev
21260bfed6 Fix a deadlock when font rendering fails 2019-01-09 19:29:57 +03:00
Sergey Bugaev
3f27e843a3 Use a correct private class name
In our Foundation, like in Apple's one and unlike in Cocotron's one, the
proxy class is called NSMutableStringProxyForMutableAttributedString.
2019-01-09 19:28:26 +03:00
Sergey Bugaev
47d7c19174 Fix NSFormCell using incorrect frames when editing 2019-01-09 19:25:41 +03:00
Sergey Bugaev
2f6736d10c Fix -[NSDocument close] recursing 2019-01-09 19:24:02 +03:00
Sergey Bugaev
312c18fdbb Support NSOpen without an app delegate 2019-01-09 19:21:14 +03:00
Andrew Hyatt
f6a226e5b3 Missing NSAttributedString constants
darlinghq/darling#445
2019-01-10 00:11:10 -05:00
Andrew Hyatt
ab0e1ff51f Missing classes and constants
darlinghq/darling#445
2019-01-09 20:53:55 -05:00
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
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
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
Sergey Bugaev
3752636e4f Fix resizing X11Window-s 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
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
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