From 0bc8c187943d7188c20f7ea969f05f2ca8d7f255 Mon Sep 17 00:00:00 2001 From: sinamas Date: Sat, 10 Jan 2009 21:52:05 +0000 Subject: [PATCH] - Esc exits fullscreen on macx. - Drop OpenAL from default macx binary. - Add some useful but commented build flags for macx to .pro files. git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@224 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24 --- .../src/framework/addaudioengines_macx.cpp | 4 +-- gambatte_qt/src/framework/framework.pro | 18 ++++++++----- gambatte_qt/src/framework/mainwindow.cpp | 5 ---- gambatte_qt/src/gambattemenuhandler.cpp | 26 +++++++++++++++---- gambatte_qt/src/gambattemenuhandler.h | 6 +++++ gambatte_qt/src/src.pro | 1 + 6 files changed, 42 insertions(+), 18 deletions(-) diff --git a/gambatte_qt/src/framework/addaudioengines_macx.cpp b/gambatte_qt/src/framework/addaudioengines_macx.cpp index dd36dc2..e5027ec 100644 --- a/gambatte_qt/src/framework/addaudioengines_macx.cpp +++ b/gambatte_qt/src/framework/addaudioengines_macx.cpp @@ -18,10 +18,10 @@ ***************************************************************************/ #include "addaudioengines.h" -#include "audioengines/openalengine.h" +//#include "audioengines/openalengine.h" #include "audioengines/coreaudioengine.h" void addAudioEngines(std::vector &audioEngines, WId /*winId*/) { audioEngines.push_back(new CoreAudioEngine); - audioEngines.push_back(new OpenAlEngine); +// audioEngines.push_back(new OpenAlEngine); } diff --git a/gambatte_qt/src/framework/framework.pro b/gambatte_qt/src/framework/framework.pro index cd4c28a..7b9986c 100644 --- a/gambatte_qt/src/framework/framework.pro +++ b/gambatte_qt/src/framework/framework.pro @@ -70,21 +70,27 @@ INCLUDEPATH += $$COMMONPATH DEFINES += HAVE_STDINT_H QMAKE_CXXFLAGS += -fno-exceptions -fno-rtti -macx { +macx { +# CONFIG += x86 ppc +# QMAKE_CFLAGS += -Xarch_ppc -DWORDS_BIGENDIAN +# QMAKE_CXXFLAGS += -fvisibility=hidden -Xarch_ppc -DWORDS_BIGENDIAN +# QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.4u.sdk +# QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.3 HEADERS += $$COMMONPATH/ringbuffer.h SOURCES += framework/addaudioengines_macx.cpp \ framework/addblitterwidgets.cpp \ framework/getfullmodetoggler_macx.cpp SOURCES += framework/SDL_Joystick/src/darwin/SDL_sysjoystick.c \ - framework/audioengines/openalengine.cpp \ +# framework/audioengines/openalengine.cpp \ framework/audioengines/coreaudioengine.cpp \ framework/fullmodetogglers/quartztoggler.cpp - HEADERS += framework/audioengines/openalengine.h \ - framework/audioengines/coreaudioengine.h \ + HEADERS += framework/audioengines/coreaudioengine.h \ +# framework/audioengines/openalengine.h \ framework/fullmodetogglers/quartztoggler.h +# LIBS += -dead_strip LIBS += -framework IOKit \ - -framework AudioUnit \ - -framework OpenAL +# -framework OpenAL \ + -framework AudioUnit } else:unix { DEFINES += PLATFORM_UNIX diff --git a/gambatte_qt/src/framework/mainwindow.cpp b/gambatte_qt/src/framework/mainwindow.cpp index 1a0196e..14b646a 100644 --- a/gambatte_qt/src/framework/mainwindow.cpp +++ b/gambatte_qt/src/framework/mainwindow.cpp @@ -321,16 +321,11 @@ void MainWindow::toggleFullScreen() { } void MainWindow::toggleMenuHidden() { -#ifdef Q_WS_MAC -// if (isFullScreen()) -// toggleFullScreen(); -#else menuBar()->setVisible(!menuBar()->isVisible()); if (!menuBar()->isVisible()) { hideCursor(); } -#endif } void MainWindow::clearInputVectors() { diff --git a/gambatte_qt/src/gambattemenuhandler.cpp b/gambatte_qt/src/gambattemenuhandler.cpp index b523a6d..0eb42b3 100644 --- a/gambatte_qt/src/gambattemenuhandler.cpp +++ b/gambatte_qt/src/gambattemenuhandler.cpp @@ -154,7 +154,10 @@ mw(mw), source(source), frameTime(4389, 262144) { settingsm->addSeparator(); { - QAction *fsAct = settingsm->addAction(tr("&Full Screen"), mw, SLOT(toggleFullScreen()), tr("Ctrl+F")); +#ifndef Q_WS_MAC + QAction *fsAct; +#endif + fsAct = settingsm->addAction(tr("&Full Screen"), mw, SLOT(toggleFullScreen()), tr("Ctrl+F")); fsAct->setCheckable(true); } @@ -171,10 +174,16 @@ mw(mw), source(source), frameTime(4389, 262144) { mw->addActions(mw->menuBar()->actions()); - QAction *hideMenuAct = new QAction(mw); - hideMenuAct->setShortcut(tr("Esc")); - connect(hideMenuAct, SIGNAL(triggered()), mw, SLOT(toggleMenuHidden())); - mw->addAction(hideMenuAct); + { + QAction *const escAct = new QAction(mw); + escAct->setShortcut(tr("Esc")); +#ifdef Q_WS_MAC + connect(escAct, SIGNAL(triggered()), this, SLOT(unsetFullScreen())); +#else + connect(escAct, SIGNAL(triggered()), mw, SLOT(toggleMenuHidden())); +#endif + mw->addAction(escAct); + } mw->setFrameTime(frameTime.get().num, frameTime.get().denom); mw->setSamplesPerFrame(35112); @@ -406,3 +415,10 @@ void GambatteMenuHandler::resetFrameRate() { decFrameRateAction->setEnabled(true); mw->setFrameTime(frameTime.get().num, frameTime.get().denom); } + +#ifdef Q_WS_MAC +void GambatteMenuHandler::unsetFullScreen() { + if (fsAct->isChecked()) + fsAct->trigger(); +} +#endif diff --git a/gambatte_qt/src/gambattemenuhandler.h b/gambatte_qt/src/gambattemenuhandler.h index 31fcc5c..83feb46 100644 --- a/gambatte_qt/src/gambattemenuhandler.h +++ b/gambatte_qt/src/gambattemenuhandler.h @@ -81,6 +81,9 @@ class GambatteMenuHandler : public QObject { QAction *decFrameRateAction; QAction *incFrameRateAction; QAction *forceDmgAction; +#ifdef Q_WS_MAC + QAction *fsAct; +#endif QMenu *recentMenu; QMenu *stateSlotMenu; PaletteDialog *globalPaletteDialog; @@ -112,6 +115,9 @@ private slots: void decFrameRate(); void incFrameRate(); void resetFrameRate(); +#ifdef Q_WS_MAC + void unsetFullScreen(); +#endif public: GambatteMenuHandler(MainWindow *mw, GambatteSource *source, int argc, const char *const argv[]); diff --git a/gambatte_qt/src/src.pro b/gambatte_qt/src/src.pro index 0fdd6f3..1e5d191 100644 --- a/gambatte_qt/src/src.pro +++ b/gambatte_qt/src/src.pro @@ -12,6 +12,7 @@ TEMPLATE = app CONFIG += warn_on \ release TARGET = gambatte_qt +macx:TARGET = "Gambatte Qt" DESTDIR = ../bin INCLUDEPATH += ../../libgambatte/include LIBS += -L../../libgambatte -lgambatte