Mac-specific: Adjust code for Qt5 build

This commit is contained in:
Abs62 2014-05-12 17:53:13 +04:00
parent 6331c49fa5
commit e2b0a7f39c
11 changed files with 21 additions and 20 deletions

View file

@ -37,7 +37,7 @@
#include <QBuffer>
#if defined( Q_OS_WIN32 ) || defined( Q_OS_MACX )
#if defined( Q_OS_WIN32 ) || defined( Q_OS_MAC )
#include "speechclient.hh"
#endif
@ -1201,7 +1201,7 @@ void ArticleView::openLink( QUrl const & url, QUrl const & ref,
if ( url.scheme() == "gdtts" )
{
// TODO: Port TTS
#if defined( Q_OS_WIN32 ) || defined( Q_OS_MACX )
#if defined( Q_OS_WIN32 ) || defined( Q_OS_MAC )
// Text to speech
QString md5Id = url.queryItemValue( "engine" );
QString text( url.path().mid( 1 ) );

View file

@ -106,7 +106,7 @@ bool Babylon::open()
fflush( f );
#ifdef Q_OS_MACX
#ifdef Q_OS_MAC
/* Under Mac OS X the above technique don't set reopen position properly */
int fn = DUP( fileno( f ) );
lseek( fn, i, SEEK_SET );

View file

@ -70,7 +70,7 @@ HotkeyStruct::HotkeyStruct( quint32 key_, quint32 key2_, quint32 modifier_,
modifier( modifier_ ),
handle( handle_ ),
id( id_ )
#ifdef Q_OS_MACX
#ifdef Q_OS_MAC
, hkRef( 0 )
, hkRef2( 0 )
#endif

View file

@ -13,7 +13,7 @@
#endif
#ifdef Q_OS_MACX
#ifdef Q_OS_MAC
#define __SECURITYHI__
#include <Carbon/Carbon.h>
#endif
@ -32,7 +32,7 @@ struct HotkeyStruct
quint32 modifier;
int handle;
int id;
#ifdef Q_OS_MACX
#ifdef Q_OS_MAC
EventHotKeyRef hkRef, hkRef2;
#endif
};
@ -69,7 +69,7 @@ protected slots:
void waitKey2();
#ifndef Q_OS_MACX
#ifndef Q_OS_MAC
private slots:
bool checkState( quint32 vk, quint32 mod );
@ -89,7 +89,7 @@ private:
virtual bool winEvent ( MSG * message, long * result );
HWND hwnd;
#elif defined(Q_OS_MACX)
#elif defined(Q_OS_MAC)
public:
void activated( int hkId );

View file

@ -10,7 +10,7 @@
#include <QX11Info>
#include <X11/X.h>
#include <X11/XKBlib.h>
#elif defined Q_OS_MACX
#elif defined Q_OS_MAC
#define __SECURITYHI__
#include <Carbon/Carbon.h>
#endif
@ -32,7 +32,7 @@ bool KeyboardState::checkModifiersPressed( int mask )
( mask & LeftShift && !( GetAsyncKeyState( VK_LSHIFT ) & 0x8000 ) ) ||
( mask & RightShift && !( GetAsyncKeyState( VK_RSHIFT ) & 0x8000 ) ) );
#elif defined Q_OS_MACX
#elif defined Q_OS_MAC
UInt32 keys = GetCurrentKeyModifiers();
return !(
( mask & Alt && !( keys & ( 1 << optionKeyBit ) ) ) ||

View file

@ -1,3 +1,4 @@
#include <AppKit/NSWindow.h>
#include "lionsupport.h"
bool LionSupport::isLion()

View file

@ -778,7 +778,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
updateStatusLine();
#ifdef Q_OS_MACX
#ifdef Q_OS_MAC
if( cfg.preferences.startWithScanPopupOn && !MacMouseOver::isAXAPIEnabled() )
mainStatusBar->showMessage( tr( "Accessibility API is not enabled" ), 10000,
QPixmap( ":/icons/error.png" ) );
@ -2942,7 +2942,7 @@ void MainWindow::scanEnableToggled( bool on )
if ( on )
{
scanPopup->enableScanning();
#ifdef Q_OS_MACX
#ifdef Q_OS_MAC
if( !MacMouseOver::isAXAPIEnabled() )
mainStatusBar->showMessage( tr( "Accessibility API is not enabled" ), 10000,
QPixmap( ":/icons/error.png" ) );

View file

@ -151,7 +151,7 @@ Preferences::Preferences( QWidget * parent, Config::Preferences const & p ):
ui.rightCtrl->hide();
ui.leftShift->hide();
ui.rightShift->hide();
#ifdef Q_OS_MACX
#ifdef Q_OS_MAC
ui.altKey->setText( "Opt" );
ui.winKey->setText( "Ctrl" );
ui.ctrlKey->setText( "Cmd" );

View file

@ -14,7 +14,7 @@
#include "gddebug.hh"
#include "gestures.hh"
#ifdef Q_OS_MACX
#ifdef Q_OS_MAC
#include "macmouseover.hh"
#define MouseOver MacMouseOver
#else
@ -27,7 +27,7 @@ using std::wstring;
/// in their behavior on those platforms.
static Qt::WindowFlags popupWindowFlags =
#if defined (Q_OS_WIN) || defined (Q_OS_MACX)
#if defined (Q_OS_WIN) || defined (Q_OS_MAC)
Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint
#else
Qt::Popup

View file

@ -10,7 +10,7 @@
Sources::Sources( QWidget * parent, Config::Class const & cfg):
QWidget( parent ),
#if defined( Q_OS_WIN32 ) || defined( Q_OS_MACX )
#if defined( Q_OS_WIN32 ) || defined( Q_OS_MAC )
textToSpeechSource( NULL ),
#endif
itemDelegate( new QItemDelegate( this ) ),
@ -105,7 +105,7 @@ Sources::Sources( QWidget * parent, Config::Class const & cfg):
ui.forvoLanguageCodes->setText( forvo.languageCodes );
// Text to speech
#if defined( Q_OS_WIN32 ) || defined( Q_OS_MACX )
#if defined( Q_OS_WIN32 ) || defined( Q_OS_MAC )
textToSpeechSource = new TextToSpeechSource( this, cfg.voiceEngines );
ui.tabWidget->addTab( textToSpeechSource, QIcon(":/icons/playsound_color.png"), tr( "Text to Speech" ) );
#endif
@ -322,7 +322,7 @@ void Sources::on_removeProgram_clicked()
Config::VoiceEngines Sources::getVoiceEngines() const
{
#if defined( Q_OS_WIN32 ) || defined( Q_OS_MACX )
#if defined( Q_OS_WIN32 ) || defined( Q_OS_MAC )
if ( !textToSpeechSource )
return Config::VoiceEngines();
return textToSpeechSource->getVoiceEnginesModel().getCurrentVoiceEngines();

View file

@ -12,7 +12,7 @@
#include <QItemDelegate>
#include <QItemEditorFactory>
#if defined( Q_OS_WIN32 ) || defined( Q_OS_MACX )
#if defined( Q_OS_WIN32 ) || defined( Q_OS_MAC )
#include "texttospeechsource.hh"
#endif
@ -284,7 +284,7 @@ signals:
private:
Ui::Sources ui;
#if defined( Q_OS_WIN32 ) || defined( Q_OS_MACX )
#if defined( Q_OS_WIN32 ) || defined( Q_OS_MAC )
TextToSpeechSource *textToSpeechSource;
#endif