Files
haikuports/app-text/goldendict/patches/goldendict-1.5.0rc2.patchset
2017-08-08 14:38:46 +03:00

143 lines
3.8 KiB
Plaintext

From f5b6f4c4cb4bea8b1144f8f8a6d10ebe07466541 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Tue, 8 Aug 2017 11:27:18 +0300
Subject: Haiku patch
diff --git a/goldendict.pro b/goldendict.pro
index 9ba9e69..e8e2300 100644
--- a/goldendict.pro
+++ b/goldendict.pro
@@ -138,7 +138,19 @@ win32 {
}
}
-unix:!mac {
+haiku {
+ LIBS += -liconv \
+ -lavutil \
+ -lavformat \
+ -lavcodec \
+ -lao \
+ -lhunspell-1.6 \
+ -lvorbisfile \
+ -lexecinfo
+
+}
+
+unix:!mac:!haiku {
DEFINES += HAVE_X11
# This is to keep symbols for backtraces
QMAKE_CXXFLAGS += -rdynamic
diff --git a/hotkeywrapper.cc b/hotkeywrapper.cc
index 267e0be..a0438c4 100644
--- a/hotkeywrapper.cc
+++ b/hotkeywrapper.cc
@@ -463,6 +463,23 @@ bool QHotkeyApplication::winEventFilter ( MSG * message, long * result )
//////////////////////////////////////////////////////////////////////////
+#elif defined(Q_OS_HAIKU)
+
+void HotkeyWrapper::init()
+{
+
+}
+
+bool HotkeyWrapper::setGlobalKey( int key, int key2,
+ Qt::KeyboardModifiers modifier, int handle )
+{
+ return true;
+}
+
+void HotkeyWrapper::unregister()
+{
+
+}
#else
//////////////////////////////////////////////////////////////////////////
diff --git a/hotkeywrapper.hh b/hotkeywrapper.hh
index a27873e..e2bdf22 100644
--- a/hotkeywrapper.hh
+++ b/hotkeywrapper.hh
@@ -107,7 +107,7 @@ private:
EventHandlerRef handlerRef;
#else
-
+#ifndef Q_OS_HAIKU
static void recordEventCallback( XPointer, XRecordInterceptData * );
/// Called by recordEventCallback()
@@ -118,9 +118,9 @@ private:
// We do one-time init of those, translating keysyms to keycodes
KeyCode lShiftCode, rShiftCode, lCtrlCode, rCtrlCode, lAltCode, rAltCode,
cCode, insertCode, kpInsertCode, lMetaCode, rMetaCode;
-
+#endif
quint32 currentModifiers;
-
+#ifndef Q_OS_HAIKU
Display * dataDisplay;
XRecordRange * recordRange;
XRecordContext recordContext;
@@ -145,7 +145,7 @@ private:
/// Ungrabs the given key. erasing it from grabbedKeys. The key's provided
/// as an interator inside the grabbedKeys set.
void ungrabKey( GrabbedKeys::iterator );
-
+#endif
signals:
/// Emitted from the thread
diff --git a/keyboardstate.cc b/keyboardstate.cc
index 29c986f..18dd949 100644
--- a/keyboardstate.cc
+++ b/keyboardstate.cc
@@ -40,6 +40,7 @@ bool KeyboardState::checkModifiersPressed( int mask )
( mask & Shift && !( keys & ( 1 << shiftKeyBit ) ) ) ||
( mask & Win && !( keys & ( 1 << controlKeyBit ) ) ) );
#else
+ #ifndef Q_OS_HAIKU
XkbStateRec state;
XkbGetState( QX11Info::display(), XkbUseCoreKbd, &state );
@@ -50,5 +51,14 @@ bool KeyboardState::checkModifiersPressed( int mask )
( mask & Shift && !( state.base_mods & ShiftMask ) ) ||
( mask & Win && !( state.base_mods & Mod4Mask ) ) );
#endif
+//
+/* uint32 mask = modifiers();
+return !(
+( mask & B_COMMAND_KEY && !( state.base_mods & Mod1Mask ) ) ||
+( mask & B_CONTROL_KEY && !( state.base_mods & ControlMask ) ) ||
+( mask & B_SHIFT_KEY && !( state.base_mods & ShiftMask ) ) ||
+( mask & B_OPTION_KEY && !( state.base_mods & Mod4Mask ) ) );*/
+
+ #endif
}
diff --git a/loaddictionaries.cc b/loaddictionaries.cc
index cf31e63..91f799e 100644
--- a/loaddictionaries.cc
+++ b/loaddictionaries.cc
@@ -80,12 +80,12 @@ void LoadDictionaries::run()
// Make soundDirs
{
- vector< sptr< Dictionary::Class > > soundDirDictionaries =
+/* vector< sptr< Dictionary::Class > > soundDirDictionaries =
SoundDir::makeDictionaries( soundDirs, FsEncoding::encode( Config::getIndexDir() ), *this );
dictionaries.insert( dictionaries.end(), soundDirDictionaries.begin(),
soundDirDictionaries.end() );
- }
+*/ }
// Make hunspells
{
--
2.13.1