some changes for better integration on the mac-plattform

This commit is contained in:
eflist
2007-06-24 23:01:16 +00:00
parent 787e5f2188
commit 7c8d65ca1c
6 changed files with 150 additions and 37 deletions
+48
View File
@@ -0,0 +1,48 @@
#!/bin/bash
# Author: Erhard List (dunkanx@pokerth.net) Version: 1.0
# ATTENTION: this is for MAC only!
#
# This script integrates the necessary frameworks into the binary.
#
# The integration of Qt is optional (commandlineswitch --without-qt) as you can save 30MB
# of binary-size if you leave Qt out.
# Using such a "small" version needs to install qt 4.2.3 on the mac seperatly as a framework
# (see http://trolltech.com/developer/downloads/qt/mac)
QT_FW_PATH="/Library/Frameworks"
SDL_FW_PATH="/Library/Frameworks"
APPLICATION="./bin/pokerth.app"
BINARY="$APPLICATION/Contents/MacOs/pokerth"
# strip binary
strip $BINARY
# create framework-path
BINARY_FW_PATH="$APPLICATION/Contents/Frameworks"
mkdir $BINARY_FW_PATH
# integrate SDL-frameworks into binary
cp -R $SDL_FW_PATH/SDL.framework $BINARY_FW_PATH
cp -R $SDL_FW_PATH/SDL_mixer.framework $BINARY_FW_PATH
# integrate Qt-frameworks into binary
if [ "$1" != "--without-qt" ] ; then
cp -R $QT_FW_PATH/QtCore.framework $BINARY_FW_PATH
cp -R $QT_FW_PATH/QtGui.framework $BINARY_FW_PATH
# redirect binary to use integrated frameworks
QTCORE="QtCore.framework/Versions/4.0/QtCore"
QTGUI="QtGui.framework/Versions/4.0/QtGui"
install_name_tool -id @executable_path/../Frameworks/$QTCORE $BINARY_FW_PATH/$QTCORE
install_name_tool -id @executable_path/../Frameworks/$QTGUI $BINARY_FW_PATH/$QTGUI
QTCORE_LINK=$(otool -L $BINARY | grep QtCore | cut -d"(" -f1 | cut -f2)
QTGUI_LINK=$(otool -L $BINARY | grep QtGui | cut -d"(" -f1 | cut -f2)
install_name_tool -change $QTCORE_LINK @executable_path/../Frameworks/$QTCORE $BINARY
install_name_tool -change $QTGUI_LINK @executable_path/../Frameworks/$QTGUI $BINARY
QTCORE_LINK=$(otool -L $BINARY_FW_PATH/$QTGUI | grep QtCore | cut -d"(" -f1 | cut -f2)
install_name_tool -change $QTCORE_LINK @executable_path/../Frameworks/$QTCORE $BINARY_FW_PATH/$QTGUI
fi
+18 -11
View File
@@ -267,7 +267,7 @@ win32{
src/net/linux/socket_startup.cpp
}
unix{
unix:!mac{
exists( /usr/lib/libboost_thread-mt.so ) {
message("Found libboost_thread-mt")
LIBS += -lboost_thread-mt
@@ -281,29 +281,36 @@ unix{
#LIBS += -lcrypto -lSDL_mixer -lSDL -lmikmod
}
macx{
mac{
# make it universal
CONFIG += x86
CONFIG += ppc
# for universal-compilation on PPC-Mac uncomment the following line
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.3
# for universal-compilation on PPC-Mac uncomment the following line
# on Intel-Mac you have to comment this line out or build will fail.
# QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk/
# link needed Qt parts static (path is standard for self-compiling qt)
LIBS += /usr/local/Trolltech/Qt-4.2.3/lib/libQtCore.a
LIBS += /usr/local/Trolltech/Qt-4.2.3/lib/libQtGui.a
# Qt static (path is standard for self-compiling qt)
#LIBS += /usr/local/Trolltech/Qt-4.2.3/lib/libQtCore.a
#LIBS += /usr/local/Trolltech/Qt-4.2.3/lib/libQtGui.a
# QT dynamic linked framework (see also mac_post_make.sh)
LIBS += -framework QtCore
LIBS += -framework QtGui
# SDL and SDL_mixer come as frameworks
LIBS += -framework SDL
LIBS += -framework SDL_mixer
# standard path for darwinports
# make sure you have a universal version of boost
LIBS += /opt/local/lib/libboost_thread.a
# crypto should be installed on every mac
# libraries installed on every mac
LIBS += -lcrypto -lz -framework Carbon
# set the application icon
RC_FILE = pokerth.icns
LIBPATH += /Developer/SDKs/MacOSX10.4u.sdk/usr/lib
INCLUDEPATH += /Developer/SDKs/MacOSX10.4u.sdk/usr/include/
INCLUDEPATH += /usr/local/Trolltech/Qt-4.2.3/include/
INCLUDEPATH += /usr/local/Trolltech/Qt-4.2.3/include/QtCore
INCLUDEPATH += /usr/local/Trolltech/Qt-4.2.3/include/QtGui
INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers
INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers
}
CONFIG += qt release
+37 -13
View File
@@ -6068,15 +6068,9 @@
<x>0</x>
<y>0</y>
<width>1000</width>
<height>30</height>
<height>23</height>
</rect>
</property>
<widget class="QMenu" name="menuView" >
<property name="title" >
<string>View</string>
</property>
<addaction name="actionFullScreen" />
</widget>
<widget class="QMenu" name="menuSpiel" >
<property name="title" >
<string>Game</string>
@@ -6088,6 +6082,12 @@
<addaction name="actionAboutPokerth" />
<addaction name="actionQuit" />
</widget>
<widget class="QMenu" name="menuView" >
<property name="title" >
<string>View</string>
</property>
<addaction name="actionFullScreen" />
</widget>
<addaction name="menuSpiel" />
<addaction name="menuView" />
</widget>
@@ -6133,21 +6133,45 @@
<string>Fullscreen</string>
</property>
<property name="shortcut" >
<string>F</string>
<string>Ctrl-F</string>
</property>
</action>
<action name="actionShowHideChat" >
<property name="text" >
<string>Show/Hide Chat-Window</string>
</property>
<property name="shortcut" >
<string>Ctrl-C</string>
</property>
</action>
<action name="actionShowHideHelp" >
<property name="text" >
<string>Show/Hide Help Window</string>
</property>
<property name="shortcut" >
<string>Ctrl-H</string>
</property>
</action>
<action name="actionShowHideLog" >
<property name="text" >
<string>Show/Hide Log Window</string>
</property>
<property name="shortcut" >
<string>Ctrl-L</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>MySetLabel</class>
<extends>QLabel</extends>
<header>mysetlabel.h</header>
</customwidget>
<customwidget>
<class>MyRightTabWidget</class>
<extends>QTabWidget</extends>
<header>myrighttabwidget.h</header>
</customwidget>
<customwidget>
<class>MySetLabel</class>
<extends>QLabel</extends>
<header>mysetlabel.h</header>
</customwidget>
<customwidget>
<class>MyLeftTabWidget</class>
<extends>QTabWidget</extends>
+36 -8
View File
@@ -569,6 +569,9 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
connect( actionCreate_network_Game, SIGNAL( triggered() ), this, SLOT( callCreateNetworkGameDialog() ) );
connect( actionQuit, SIGNAL( triggered() ), this, SLOT( quitPokerTH() ) );
connect( actionFullScreen, SIGNAL( triggered() ), this, SLOT( switchFullscreen() ) );
connect( actionShowHideChat, SIGNAL( triggered() ), this, SLOT( switchChatWindow() ) );
connect( actionShowHideHelp, SIGNAL( triggered() ), this, SLOT( switchHelpWindow() ) );
connect( actionShowHideLog, SIGNAL( triggered() ), this, SLOT( switchLogWindow() ) );
connect( pushButton_BetRaise, SIGNAL( clicked() ), this, SLOT( myBetRaise() ) );
connect( pushButton_FoldAllin, SIGNAL( clicked() ), this, SLOT( myFoldAllin() ) );
@@ -2562,8 +2565,6 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
if (event->key() == Qt::Key_F1) { pushButton_FoldAllin->click(); }
if (event->key() == Qt::Key_F2) { pushButton_CallCheckSet->click(); }
if (event->key() == Qt::Key_F3) { pushButton_BetRaise->click(); }
if (event->key() == Qt::Key_F10) { switchLeftToolBox(); }
if (event->key() == Qt::Key_F11) { switchRightToolBox(); }
if (event->key() == Qt::Key_S) { setLabelArray[0]->startTimeOutAnimation(myConfig->readConfigInt("NetTimeOutPlayerAction"),TRUE); } //s
if (event->key() == 16777249) {
pushButton_break->click();
@@ -2579,16 +2580,43 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
// if(event->type() == QEvent::MouseMove) { event->setAccepted ( FALSE ); }
// }
void mainWindowImpl::switchLeftToolBox() {
void mainWindowImpl::switchChatWindow() {
if (groupBox_LeftToolBox->isHidden()) { groupBox_LeftToolBox->show(); }
else { groupBox_LeftToolBox->hide(); }
int tab = 1;
if (groupBox_LeftToolBox->isHidden()) {
tabWidget_Left->setCurrentIndex(tab);
groupBox_LeftToolBox->show();
} else {
if (tabWidget_Left->currentIndex() == tab) {
groupBox_LeftToolBox->hide();
} else {
tabWidget_Left->setCurrentIndex(tab);
}
}
}
void mainWindowImpl::switchRightToolBox() {
void mainWindowImpl::switchHelpWindow() {
if (groupBox_RightToolBox->isHidden()) { groupBox_RightToolBox->show(); }
else { groupBox_RightToolBox->hide(); }
int tab = 0;
if (groupBox_LeftToolBox->isHidden()) {
tabWidget_Left->setCurrentIndex(tab);
groupBox_LeftToolBox->show();
} else {
if (tabWidget_Left->currentIndex() == tab) {
groupBox_LeftToolBox->hide();
} else {
tabWidget_Left->setCurrentIndex(tab);
}
}
}
void mainWindowImpl::switchLogWindow() {
if (groupBox_RightToolBox->isHidden()) {
groupBox_RightToolBox->show();
} else {
groupBox_RightToolBox->hide();
}
}
void mainWindowImpl::switchFullscreen() {
+3 -2
View File
@@ -250,8 +250,9 @@ public slots:
void keyPressEvent ( QKeyEvent*);
// bool event ( QEvent * );
void switchLeftToolBox();
void switchRightToolBox();
void switchChatWindow();
void switchHelpWindow();
void switchLogWindow();
void switchFullscreen();
void paintStartSplash();
+8 -3
View File
@@ -14,12 +14,17 @@
#ifndef SDLPLAYER_H
#define SDLPLAYER_H
#ifdef _WIN32
#ifdef _WIN32
#include <SDL.h>
#include <SDL_mixer.h>
#else
#include <SDL/SDL.h>
#include <SDL/SDL_mixer.h>
#ifdef __APPLE__
#include <SDL.h>
#include <SDL_mixer.h>
#else
#include <SDL/SDL.h>
#include <SDL/SDL_mixer.h>
#endif
#endif
#include <string>