Add Objective C++ source file

This commit is contained in:
Jonathan Campbell
2018-05-07 12:45:12 -07:00
parent 3b4fe88ce7
commit 1be03b2420
5 changed files with 30 additions and 4 deletions

View File

@@ -288,6 +288,9 @@ case "$host" in
dnl the same signature "powerpc-apple-darwin*" - so we have
dnl to do more to distinguish them.
dnl For now I am lazy and do not add proper detection code.
macosx=1
AC_PROG_OBJCXX
OBJCXXFLAGS="$OBJCXXFLAGS -std=gnu++0x";
AC_DEFINE(MACOSX, 1, [Compiling on Mac OS X])
LIBS="$LIBS -framework CoreMIDI -framework AudioUnit -framework AudioToolbox"
;;
@@ -310,6 +313,8 @@ case "$host" in
;;
esac
AM_CONDITIONAL(MACOSX, test x"$macosx" == x"1")
dnl The target cpu checks for dynamic cores
AH_TEMPLATE(C_TARGETCPU,[The type of cpu this target has])
AC_MSG_CHECKING(for target cpu type)

View File

@@ -1,3 +1,3 @@
/*auto-generated*/
#define UPDATED_STR "May 7, 2018 11:42:39am"
#define UPDATED_STR "May 7, 2018 12:44:19pm"
#define COPYRIGHT_END_YEAR "2018"

View File

@@ -20,3 +20,8 @@ libgui_a_SOURCES += \
midi_mt32.h
endif
if MACOSX
libgui_a_SOURCES += \
menu_osx.mm
endif

View File

@@ -299,10 +299,12 @@ void DOSBoxMenu::unbuild(void) {
}
#if DOSBOXMENU_TYPE == DOSBOXMENU_NSMENU /* Mac OS X menu handle */
void* sdl_hax_nsMenuAlloc(const char *initWithText);
void sdl_hax_nsMenuRelease(void *nsMenu);
bool DOSBoxMenu::nsMenuInit(void) {
if (nsMenu == NULL) {
/* TODO */
return false;
if ((nsMenu = sdl_hax_nsMenuAlloc("")) == NULL)
return false;
}
return true;
@@ -310,7 +312,7 @@ bool DOSBoxMenu::nsMenuInit(void) {
void DOSBoxMenu::nsMenuDestroy(void) {
if (nsMenu != NULL) {
/* TODO */
sdl_hax_nsMenuRelease(nsMenu);
nsMenu = NULL;
}
}

14
src/gui/menu_osx.mm Normal file
View File

@@ -0,0 +1,14 @@
/* Mac OS X portion of menu.cpp */
#include "config.h"
#include "menu.h"
#if DOSBOXMENU_TYPE == DOSBOXMENU_NSMENU /* Mac OS X NSMenu / NSMenuItem handle */
void* sdl_hax_nsMenuAlloc(const char *initWithText) {
return NULL;
}
void sdl_hax_nsMenuRelease(void *nsMenu) {
}
#endif