[Debian-islamic-commits] [SCM] Packaging for Zekr branch, master, updated. debian/1.0.0+repack-7-6-ge863058
أحمد المحمو =?UTF-8?Q?=D8=AF=D9=8A=20?=(Ahmed El-Mahmoudy)
aelmahmoudy at sabily.org
Sat Jul 14 08:39:36 UTC 2012
The following commit has been merged in the master branch:
commit 1a076f7f2d8f6a34b88be3399c2d28679d1226cb
Author: أحمد المحمودي (Ahmed El-Mahmoudy) <aelmahmoudy at sabily.org>
Date: Sat Jul 14 09:56:27 2012 +0200
Added no_jintellitype.diff patch to disable code using JIntellitype API
(which is only for Windows)
diff --git a/debian/patches/no_jintellitype.diff b/debian/patches/no_jintellitype.diff
new file mode 100644
index 0000000..0a3330d
--- /dev/null
+++ b/debian/patches/no_jintellitype.diff
@@ -0,0 +1,172 @@
+Description: JIntellitype API only works on Windows.
+Author: أحمد المحمودي (Ahmed El-Mahmoudy) <aelmahmoudy at sabily.org>
+Forwarded: not-needed
+--- a/src/net/sf/zekr/ui/WindowsNativeKeyboardListener.java
++++ /dev/null
+@@ -1,115 +0,0 @@
+-/*
+- * In the name of Allah
+- * This file is part of The Zekr Project. Use is subject to
+- * license terms.
+- *
+- * Author: Mohsen Saboorian
+- * Start Date: July 5, 2012
+- */
+-package net.sf.zekr.ui;
+-
+-import java.util.ArrayList;
+-import java.util.List;
+-import java.util.Map.Entry;
+-import java.util.Set;
+-
+-import net.sf.zekr.common.config.KeyboardAction;
+-import net.sf.zekr.common.config.KeyboardShortcut;
+-import net.sf.zekr.engine.log.Logger;
+-
+-import org.eclipse.swt.widgets.Display;
+-
+-import com.melloware.jintellitype.HotkeyListener;
+-import com.melloware.jintellitype.IntellitypeListener;
+-import com.melloware.jintellitype.JIntellitype;
+-
+-/**
+- * @author Mohsen Saboorian
+- */
+-public class WindowsNativeKeyboardListener implements NativeKeyboardListener {
+- private Logger logger = Logger.getLogger(WindowsNativeKeyboardListener.class);
+-
+- private List<KeyboardAction> superGlobalActionList = new ArrayList<KeyboardAction>();
+-
+- @Override
+- public void install(final Display display, final QuranFormController qfc, KeyboardShortcut shortcut) {
+- JIntellitype jIntellitype = null;
+- try {
+- jIntellitype = JIntellitype.getInstance();
+- } catch (Exception e) {
+- logger.error("Error instantiating JIntellitype: " + e.toString());
+- return;
+- }
+-
+- for (Entry<String, Integer> e : shortcut.getActionToKey().entrySet()) {
+- List<KeyboardAction> al = shortcut.getKeyActionList(e.getValue());
+- for (KeyboardAction keyboardAction : al) {
+- if (keyboardAction.superGlobal) {
+- String keyStr = KeyboardShortcut.keyCodeToString(keyboardAction.key);
+- logger.debug(String.format("Registering super global shortcut for %s: %s", keyboardAction, keyStr));
+- jIntellitype.registerHotKey(superGlobalActionList.size(), keyStr);
+- superGlobalActionList.add(keyboardAction);
+- }
+- }
+- }
+-
+- // install super global listeners
+- jIntellitype.addHotKeyListener(new HotkeyListener() {
+- @Override
+- public void onHotKey(int identifier) {
+- if (identifier < superGlobalActionList.size()) {
+- KeyboardAction action = superGlobalActionList.get(identifier);
+- logger.debug(String.format("Hotkey detected. id: %s, action: ", identifier, action.action));
+- qfc.executeAction(action.action);
+- }
+- }
+- });
+-
+- // install media player listeners
+- jIntellitype.addIntellitypeListener(new IntellitypeListener() {
+- @Override
+- public void onIntellitype(final int command) {
+- switch (command) {
+- // volume is usually handled by OS, so better not to handle it again inside Zekr
+- /*case JIntellitype.APPCOMMAND_VOLUME_UP:
+- case JIntellitype.APPCOMMAND_VOLUME_DOWN:
+- case JIntellitype.APPCOMMAND_VOLUME_MUTE:*/
+-
+- case JIntellitype.APPCOMMAND_MEDIA_PREVIOUSTRACK:
+- case JIntellitype.APPCOMMAND_MEDIA_NEXTTRACK:
+- case JIntellitype.APPCOMMAND_MEDIA_STOP:
+- case JIntellitype.APPCOMMAND_MEDIA_PLAY_PAUSE:
+- display.asyncExec(new Runnable() {
+- @Override
+- public void run() {
+- if (command == JIntellitype.APPCOMMAND_MEDIA_PREVIOUSTRACK) {
+- qfc.playerPrev();
+- } else if (command == JIntellitype.APPCOMMAND_MEDIA_NEXTTRACK) {
+- qfc.playerNext();
+- } else if (command == JIntellitype.APPCOMMAND_MEDIA_STOP) {
+- qfc.playerStop();
+- } else if (command == JIntellitype.APPCOMMAND_MEDIA_PLAY_PAUSE) {
+- qfc.playerTogglePlayPause();
+- }
+- }
+- });
+- break;
+- default:
+- break;
+- }
+- }
+- });
+- }
+-
+- @Override
+- public void uninstall() {
+- JIntellitype jIntellitype;
+- try {
+- jIntellitype = JIntellitype.getInstance();
+- jIntellitype.cleanUp();
+- } catch (Exception e) {
+- logger.error("Error instanciating JIntellitype: " + e.toString());
+- return;
+- }
+- }
+-}
+--- a/src/net/sf/zekr/ui/ZekrGlobalKeyListener.java
++++ b/src/net/sf/zekr/ui/ZekrGlobalKeyListener.java
+@@ -26,10 +26,6 @@
+ import org.eclipse.swt.widgets.Listener;
+ import org.eclipse.swt.widgets.Shell;
+
+-import com.melloware.jintellitype.HotkeyListener;
+-import com.melloware.jintellitype.IntellitypeListener;
+-import com.melloware.jintellitype.JIntellitype;
+-
+ /**
+ * @author Mohsen Saboorian
+ */
+@@ -49,37 +45,12 @@
+
+ if (config.getProps().getBoolean("key.enableNativeHandler", false)) {
+ if (GlobalConfig.isWindows) {
+- try {
+- nativeKeyboardListener = (NativeKeyboardListener) Class.forName("net.sf.zekr.ui.WindowsNativeKeyboardListener")
+- .newInstance();
+- nativeKeyboardListener.install(quranForm.display, quranForm.quranFormController, shortcut);
+- } catch (Exception e1) {
+- // JIntellitype is not available in the path, bypass super global listener installation.
+- return;
+- }
+ } else if (GlobalConfig.isLinux) {
+ }
+ }
+
+ }
+
+- private int toJIntelliType(int keys) {
+- int ret = 0;
+- if ((keys & SWT.SHIFT) == SWT.SHIFT) {
+- ret |= JIntellitype.MOD_SHIFT;
+- }
+- if ((keys & SWT.CONTROL) == SWT.CONTROL) {
+- ret |= JIntellitype.MOD_CONTROL;
+- }
+- if ((keys & SWT.ALT) == SWT.ALT) {
+- ret |= JIntellitype.MOD_ALT;
+- }
+- if ((keys & KeyboardShortcut.WINKEY) == KeyboardShortcut.WINKEY) {
+- ret |= JIntellitype.MOD_WIN;
+- }
+- return ret;
+- }
+-
+ public void handleEvent(Event event) {
+ if (quranForm == null || quranForm.shell == null || quranForm.isDisposed()) {
+ return;
diff --git a/debian/patches/series b/debian/patches/series
index 61e77c9..1c8d09b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
02_build_xml.patch
build_manifest.diff
+no_jintellitype.diff
--
Packaging for Zekr
More information about the Debian-islamic-commits
mailing list