2015-12-30 06:41:46 +00:00
|
|
|
#if defined(Hiro_Window)
|
|
|
|
|
2013-03-15 13:11:33 +00:00
|
|
|
@interface CocoaWindow : NSWindow <NSWindowDelegate> {
|
|
|
|
@public
|
2015-12-30 06:41:46 +00:00
|
|
|
hiro::mWindow* window;
|
2013-05-02 11:25:45 +00:00
|
|
|
NSMenu* menuBar;
|
|
|
|
NSMenu* rootMenu;
|
2018-07-02 01:55:42 +00:00
|
|
|
NSMenuItem* disableGatekeeper;
|
2013-05-02 11:25:45 +00:00
|
|
|
NSTextField* statusBar;
|
2013-03-15 13:11:33 +00:00
|
|
|
}
|
2015-12-30 06:41:46 +00:00
|
|
|
-(id) initWith:(hiro::mWindow&)window;
|
2013-03-15 13:11:33 +00:00
|
|
|
-(BOOL) canBecomeKeyWindow;
|
|
|
|
-(BOOL) canBecomeMainWindow;
|
2013-03-21 12:59:01 +00:00
|
|
|
-(void) windowDidBecomeMain:(NSNotification*)notification;
|
|
|
|
-(void) windowDidMove:(NSNotification*)notification;
|
|
|
|
-(void) windowDidResize:(NSNotification*)notification;
|
|
|
|
-(BOOL) windowShouldClose:(id)sender;
|
2013-07-29 09:42:45 +00:00
|
|
|
-(NSDragOperation) draggingEntered:(id<NSDraggingInfo>)sender;
|
|
|
|
-(BOOL) performDragOperation:(id<NSDraggingInfo>)sender;
|
2013-03-19 08:48:50 +00:00
|
|
|
-(NSMenu*) menuBar;
|
2013-03-15 13:11:33 +00:00
|
|
|
-(void) menuAbout;
|
|
|
|
-(void) menuPreferences;
|
2016-01-08 09:23:46 +00:00
|
|
|
-(void) menuDisableGatekeeperAutoRearm;
|
2013-03-15 13:11:33 +00:00
|
|
|
-(void) menuQuit;
|
2013-03-21 12:59:01 +00:00
|
|
|
-(NSTextField*) statusBar;
|
2013-03-15 13:11:33 +00:00
|
|
|
@end
|
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
namespace hiro {
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
struct pWindow : pObject {
|
|
|
|
Declare(Window, Object)
|
|
|
|
|
|
|
|
auto append(sMenuBar menuBar) -> void;
|
Update to v106r47 release.
byuu says:
This is probably the largest code-change diff I've done in years.
I spent four days working 10-16 hours a day reworking layouts in hiro
completely.
The result is we now have TableLayout, which will allow for better
horizontal+vertical combined alignment.
Windows, GTK2, and now GTK3 are fully supported.
Windows is getting the initial window geometry wrong by a bit.
GTK2 and GTK3 work perfectly. I basically abandoned trying to detect
resize signals, and instead keep a list of all hiro windows that are
allocated, and every time the main loop runs, it will query all of them
to see if they've been resized. I'm disgusted that I have to do this,
but after fighting with GTK for years, I'm about sick of it. GTK was
doing this crazy thing where it would trigger another size-allocate
inside of a previous size-allocate, and so my layouts would be halfway
through resizing all the widgets, and then the size-allocate would kick
off another one. That would end up leaving the rest of the first layout
loop with bad widget sizes. And if I detected a second re-entry and
blocked it, then the entire window would end up with the older geometry.
I started trying to build a message queue system to allow the second
layout resize to occur after the first one completed, but this was just
too much madness, so I went with the simpler solution.
Qt4 has some geometry problems, and doesn't show tab frame layouts
properly yet.
Qt5 causes an ICE error and tanks my entire Xorg display server, so ...
something is seriously wrong there, and it's not hiro's fault. Creating
a dummy Qt5 application without even using hiro, just int main() {
TestObject object; } with object performing a dynamic\_cast to a derived
type segfaults. Memory is getting corrupted where GCC allocates the
vtables for classes, just by linking in Qt. Could be somehow related to
the -fPIC requirement that only Qt5 has ... could just be that FreeBSD
10.1 has a buggy implementation of Qt5. I don't know. It's beyond my
ability to debug, so this one's going to stay broken.
The Cocoa port is busted. I'll fix it up to compile again, but that's
about all I'm going to do.
Many optimizations mean bsnes and higan open faster. GTK2 and GTK3 both
resize windows very quickly now.
higan crashes when you load a game, so that's not good. bsnes works
though.
bsnes also has the start of a localization engine now. Still a long way
to go.
The makefiles received a rather substantial restructuring. Including the
ruby and hiro makefiles will add the necessary compilation rules for
you, which also means that moc will run for the qt4 and qt5 targets, and
windres will run for the Windows targets.
2018-07-14 03:59:29 +00:00
|
|
|
auto append(sSizable sizable) -> void;
|
2015-12-30 06:41:46 +00:00
|
|
|
auto append(sStatusBar statusBar) -> void;
|
|
|
|
auto focused() const -> bool override;
|
|
|
|
auto frameMargin() const -> Geometry;
|
Update to bsnes v107.1 release.
byuu says:
Don't let the point release fool you, there are many significant changes in this
release. I will be keeping bsnes releases using a point system until the new
higan release is ready.
Changelog:
- GUI: added high DPI support
- GUI: fixed the state manager image preview
- Windows: added a new waveOut driver with support for dynamic rate control
- Windows: corrected the XAudio 2.1 dynamic rate control support [BearOso]
- Windows: corrected the Direct3D 9.0 fullscreen exclusive window centering
- Windows: fixed XInput controller support on Windows 10
- SFC: added high-level emulation for the DSP1, DSP2, DSP4, ST010, and Cx4
coprocessors
- SFC: fixed a slight rendering glitch in the intro to Megalomania
If the coprocessor firmware is missing, bsnes will fallback on HLE where it is
supported, which is everything other than SD Gundam GX and the two Hayazashi
Nidan Morita Shougi games.
The Windows dynamic rate control works best with Direct3D in fullscreen
exclusive mode. I recommend the waveOut driver over the XAudio 2.1 driver, as it
is not possible to target a single XAudio2 version on all Windows OS releases.
The waveOut driver should work everywhere out of the box.
Note that with DRC, the synchronization source is your monitor, so you will
want to be running at 60hz (NTSC) or 50hz (PAL). If you have an adaptive sync
monitor, you should instead use the WASAPI (exclusive) or ASIO audio driver.
2019-04-09 01:16:30 +00:00
|
|
|
auto handle() const -> uintptr_t;
|
Update to 20180729 release.
byuu wrote:
Sigh ...
asio.hpp needs #include <nall/windows/registry.hpp>
[Since the last WIP, byuu also posted the following message. -Ed.]
ruby drivers have all been updated (but not tested outside of BSD), and
I redesigned the settings window. The driver functionality all exists on
a new "Drivers" panel, the emulator/hack settings go to a
"Configuration" panel, and the video/audio panels lose driver settings.
As does the settings menu and its synchronize options.
I want to start pushing toward a v107 release. Critically, I will need
DirectSound and ALSA to support dynamic rate control. I'd also like to
eliminate the other system manifest.bml files. I need to update the
cheat code database format, and bundle at least a few quark shaders --
although I still need to default to Direct3D on Windows.
Turbo keys would be nice, if it's not too much effort. Aside from
netplay, it's the last significant feature I'm missing.
I think for v107, higan is going to be a bit rough around the edges
compared to bsnes. And I don't think it's practical to finish the bsnes
localization support.
I'm thinking we probably want another WIP to iron out any critical
issues, but this time there should be a feature freeze with the next
WIP.
2018-07-29 13:24:38 +00:00
|
|
|
auto monitor() const -> uint;
|
2015-12-30 06:41:46 +00:00
|
|
|
auto remove(sMenuBar menuBar) -> void;
|
Update to v106r47 release.
byuu says:
This is probably the largest code-change diff I've done in years.
I spent four days working 10-16 hours a day reworking layouts in hiro
completely.
The result is we now have TableLayout, which will allow for better
horizontal+vertical combined alignment.
Windows, GTK2, and now GTK3 are fully supported.
Windows is getting the initial window geometry wrong by a bit.
GTK2 and GTK3 work perfectly. I basically abandoned trying to detect
resize signals, and instead keep a list of all hiro windows that are
allocated, and every time the main loop runs, it will query all of them
to see if they've been resized. I'm disgusted that I have to do this,
but after fighting with GTK for years, I'm about sick of it. GTK was
doing this crazy thing where it would trigger another size-allocate
inside of a previous size-allocate, and so my layouts would be halfway
through resizing all the widgets, and then the size-allocate would kick
off another one. That would end up leaving the rest of the first layout
loop with bad widget sizes. And if I detected a second re-entry and
blocked it, then the entire window would end up with the older geometry.
I started trying to build a message queue system to allow the second
layout resize to occur after the first one completed, but this was just
too much madness, so I went with the simpler solution.
Qt4 has some geometry problems, and doesn't show tab frame layouts
properly yet.
Qt5 causes an ICE error and tanks my entire Xorg display server, so ...
something is seriously wrong there, and it's not hiro's fault. Creating
a dummy Qt5 application without even using hiro, just int main() {
TestObject object; } with object performing a dynamic\_cast to a derived
type segfaults. Memory is getting corrupted where GCC allocates the
vtables for classes, just by linking in Qt. Could be somehow related to
the -fPIC requirement that only Qt5 has ... could just be that FreeBSD
10.1 has a buggy implementation of Qt5. I don't know. It's beyond my
ability to debug, so this one's going to stay broken.
The Cocoa port is busted. I'll fix it up to compile again, but that's
about all I'm going to do.
Many optimizations mean bsnes and higan open faster. GTK2 and GTK3 both
resize windows very quickly now.
higan crashes when you load a game, so that's not good. bsnes works
though.
bsnes also has the start of a localization engine now. Still a long way
to go.
The makefiles received a rather substantial restructuring. Including the
ruby and hiro makefiles will add the necessary compilation rules for
you, which also means that moc will run for the qt4 and qt5 targets, and
windres will run for the Windows targets.
2018-07-14 03:59:29 +00:00
|
|
|
auto remove(sSizable sizable) -> void;
|
2015-12-30 06:41:46 +00:00
|
|
|
auto remove(sStatusBar statusBar) -> void;
|
|
|
|
auto setBackgroundColor(Color color) -> void;
|
Update to v103r13 release.
byuu says:
Changelog:
- gb/interface: fix Game Boy Color extension to be "gbc" and not "gb"
[hex\_usr]
- ms/interface: move Master System hardware controls below controller
ports
- sfc/ppu: improve latching behavior of BGnHOFS registers (not
hardware verified) [AWJ]
- tomoko/input: rework port/device mapping to support non-sequential
ports and devices¹
- todo: should add move() to inputDevice.mappings.append and
inputPort.devices.append
- note: there's a weird GCC 4.9 bug with brace initialization of
InputEmulator; have to assign each field separately
- tomoko: all windows sans the main presentation window can be
dismissed with the escape key
- icarus: the single file selection dialog ("Load ROM Image...") can
be dismissed with the escape key
- tomoko: do not pause emulation when FocusLoss/Pause is set during
exclusive fullscreen mode
- hiro/(windows,gtk,qt): implemented Window::setDismissable() function
(missing from cocoa port, sorry)
- nall/string: fixed printing of largest possible negative numbers (eg
`INT_MIN`) [Sintendo]
- only took eight months! :D
¹: When I tried to move the Master System hardware port below the
controller ports, I ran into a world of pain.
The input settings list expects every item in the
`InputEmulator<InputPort<InputDevice<InputMapping>>>>` arrays to be
populated with valid results. But these would be sparsely populated
based on the port and device IDs from inside higan. And that is done so
that the Interface::inputPoll can have O(1) lookup of ports and devices.
This worked because all the port and device IDs were sequential (they
left no gaps in the maps upon creating the lists.)
Unfortunately by changing the expectation of port ID to how it appears
in the list, inputs would not poll correctly. By leaving them alone and
just moving Hardware to the third position, the Game Gear would be
missing port IDs of 0 and 1 (the controller ports of the Master System).
Even by trying to make separate MasterSystemHardware and
GameGearHardware ports, things still fractured when the devices were no
longer contigious.
I got pretty sick of this and just decided to give up on O(1)
port/device lookup, and moved to O(n) lookup. It only knocked the
framerate down by maybe one frame per second, enough to be in the margin
of error. Inputs aren't polled *that* often for loops that usually
terminate after 1-2 cycles to be too detrimental to performance.
So the new input system now allows non-sequential port and device IDs.
Remember that I killed input IDs a while back. There's never any reason
for those to need IDs ... it was easier to just order the inputs in the
order you want to see them in the user interface. So the input lookup is
still O(1). Only now, everything's safer and I return a
maybe<InputMapping&>, and won't crash out the program trying to use a
mapping that isn't found for some reason.
Errata: the escape key isn't working on the browser/message dialogs on
Windows, because of course nothing can ever just be easy and work for
me. If anyone else wouldn't mind looking into that, I'd greatly
appreciate it.
Having the `WM_KEYDOWN` test inside the main `Application_sharedProc`, it
seems to not respond to the escape key on modal dialogs. If I put the
`WM_KEYDOWN` test in the main window proc, then it doesn't seem to get
called for `VK_ESCAPE` at all, and doesn't get called period for modal
windows. So I'm at a loss and it's past 4AM here >_>
2017-07-12 08:24:27 +00:00
|
|
|
auto setDismissable(bool dismissable) -> void;
|
2015-12-30 06:41:46 +00:00
|
|
|
auto setDroppable(bool droppable) -> void;
|
|
|
|
auto setFocused() -> void override;
|
|
|
|
auto setFullScreen(bool fullScreen) -> void;
|
|
|
|
auto setGeometry(Geometry geometry) -> void;
|
2018-07-08 04:58:27 +00:00
|
|
|
auto setMaximized(bool maximized) -> void;
|
|
|
|
auto setMaximumSize(Size size) -> void;
|
|
|
|
auto setMinimized(bool minimized) -> void;
|
|
|
|
auto setMinimumSize(Size size) -> void;
|
2015-12-30 06:41:46 +00:00
|
|
|
auto setModal(bool modal) -> void;
|
|
|
|
auto setResizable(bool resizable) -> void;
|
|
|
|
auto setTitle(const string& text) -> void;
|
|
|
|
auto setVisible(bool visible) -> void;
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
auto moveEvent() -> void;
|
|
|
|
auto sizeEvent() -> void;
|
|
|
|
auto statusBarHeight() -> uint;
|
|
|
|
auto statusBarReposition() -> void;
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2015-12-30 06:41:46 +00:00
|
|
|
auto _append(mWidget& widget) -> void;
|
2016-01-08 09:23:46 +00:00
|
|
|
auto _geometry() -> Geometry;
|
2015-12-30 06:41:46 +00:00
|
|
|
|
|
|
|
CocoaWindow* cocoaWindow = nullptr;
|
2016-01-08 09:23:46 +00:00
|
|
|
Geometry windowedGeometry;
|
2013-03-15 13:11:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2015-12-30 06:41:46 +00:00
|
|
|
|
|
|
|
#endif
|