[oe] [PATCH] Add fbreader 0.10.7

Graham Gower graham.gower at gmail.com
Wed Sep 9 06:59:44 UTC 2009


Probably looks ugly on small screens, but as none of the other build targets
would build for me, nor the older fbreader recipes, I adapted the desktop/gtk
target for this latest version.

Patches are mostly to fix tap scrolling bugs.

Signed-off-by: Graham Gower <graham.gower at gmail.com>
---
 conf/checksums.ini                                 |    4 +
 .../fbreader/fbreader-0.10.7/clear-selection.patch |   14 +++++
 .../fbreader-0.10.7/motion-threshold.patch         |   23 ++++++++
 .../fbreader-0.10.7/remove-recursion.patch         |   10 +++
 recipes/fbreader/fbreader-0.10.7/sane-events.patch |   59 ++++++++++++++++++++
 recipes/fbreader/fbreader_0.10.7.bb                |   41 ++++++++++++++
 6 files changed, 151 insertions(+), 0 deletions(-)
 create mode 100644 recipes/fbreader/fbreader-0.10.7/clear-selection.patch
 create mode 100644 recipes/fbreader/fbreader-0.10.7/motion-threshold.patch
 create mode 100644 recipes/fbreader/fbreader-0.10.7/remove-recursion.patch
 create mode 100644 recipes/fbreader/fbreader-0.10.7/sane-events.patch
 create mode 100644 recipes/fbreader/fbreader_0.10.7.bb

diff --git a/conf/checksums.ini b/conf/checksums.ini
index a69b6b0..74580d6 100644
--- a/conf/checksums.ini
+++ b/conf/checksums.ini
@@ -6066,6 +6066,10 @@ sha256=e4db7a6305ffe2333fae08c940ded8f7e5b02999e0917b0ea4ef3764c80f58c8
 md5=2d2f3713cf3c17b71997064f39d4c888
 sha256=e4db7a6305ffe2333fae08c940ded8f7e5b02999e0917b0ea4ef3764c80f58c8
 
+[http://www.fbreader.org/fbreader-sources-0.10.7.tgz]
+md5=145f4d2ba24c54288bad2d66ddd2baf2
+sha256=d7bcc7cafb1c78f00b380dc2facdb82c5a2fb1475e1ddfc8e5d44a2b855cec1a
+
 [http://only.mawhrin.net/fbreader/obsolete/fbreader-sources-0.7.3d.tgz]
 md5=705a89bb03860fb312a7afa25db0310e
 sha256=ec9f93968147526a9b2dd17e31a6d2795356b2eeed309f796f655b37b98abd83
diff --git a/recipes/fbreader/fbreader-0.10.7/clear-selection.patch b/recipes/fbreader/fbreader-0.10.7/clear-selection.patch
new file mode 100644
index 0000000..813b2ba
--- /dev/null
+++ b/recipes/fbreader/fbreader-0.10.7/clear-selection.patch
@@ -0,0 +1,14 @@
+--- fbreader-0.10.7.orig/zlibrary/text/src/view/ZLTextView.cpp
++++ fbreader-0.10.7/zlibrary/text/src/view/ZLTextView.cpp
+@@ -479,6 +478,11 @@
+ bool ZLTextView::onStylusRelease(int x, int y) {
+ 	myDoubleClickInfo.update(x, y, false);
+ 
++	if (myDoubleClickInfo.Count == 2) {
++		/* fast tap */
++		mySelectionModel.clear();
++		application().refreshWindow();
++	}
+ 	if (myDoubleClickInfo.Count > 0) {
+ 		return onStylusClick(x, y, myDoubleClickInfo.Count);
+ 	}
diff --git a/recipes/fbreader/fbreader-0.10.7/motion-threshold.patch b/recipes/fbreader/fbreader-0.10.7/motion-threshold.patch
new file mode 100644
index 0000000..0359aba
--- /dev/null
+++ b/recipes/fbreader/fbreader-0.10.7/motion-threshold.patch
@@ -0,0 +1,23 @@
+http://www.mikecrash.com/index.php?name=News&file=article&id=107
+
+diff -ur fbreader-0.10.7/fbreader/src/fbreader/FBView.cpp fbreader-0.10.7dfsg/fbreader/src/fbreader/FBView.cpp
+--- fbreader-0.10.7/fbreader/src/fbreader/FBView.cpp	2009-03-30 23:26:07.000000000 +1030
++++ fbreader-0.10.7dfsg/fbreader/src/fbreader/FBView.cpp	2009-05-29 13:07:36.000000000 +0930
+@@ -151,7 +154,7 @@
+ 	}
+ 
+ 	myIsReleasedWithoutMotion =
+-		myIsReleasedWithoutMotion && (abs(x - pressedX()) <= 5) && (abs(y - pressedY()) <= 5);
++		myIsReleasedWithoutMotion && (abs(x - pressedX()) <= 50) && (abs(y - pressedY()) <= 50);
+ 	if (isReleasedWithoutMotion() &&
+ 			fbreader().EnableTapScrollingOption.value() &&
+ 			(!ZLBooleanOption(ZLCategoryKey::EMPTY, ZLOption::PLATFORM_GROUP, ZLOption::FINGER_TAP_DETECTABLE, false).value() ||
+@@ -185,7 +188,7 @@
+ 
+ bool FBView::onStylusMovePressed(int x, int y) {
+ 	if (myIsReleasedWithoutMotion) {
+-		if ((abs(x - pressedX()) > 5) || (abs(y - pressedY()) > 5)) {
++		if ((abs(x - pressedX()) > 50) || (abs(y - pressedY()) > 50)) {
+ 			myIsReleasedWithoutMotion = false;
+ 			activateSelection(pressedX(), pressedY());
+ 		}
diff --git a/recipes/fbreader/fbreader-0.10.7/remove-recursion.patch b/recipes/fbreader/fbreader-0.10.7/remove-recursion.patch
new file mode 100644
index 0000000..cab3bb4
--- /dev/null
+++ b/recipes/fbreader/fbreader-0.10.7/remove-recursion.patch
@@ -0,0 +1,10 @@
+--- fbreader-0.10.7/zlibrary/core/src/application/ZLApplication.cpp.orig
++++ fbreader-0.10.7/zlibrary/core/src/application/ZLApplication.cpp
+@@ -210,7 +210,6 @@
+ void ZLApplicationWindow::refresh() {
+ 	refreshToolbar(WINDOW_TOOLBAR);
+ 	refreshToolbar(FULLSCREEN_TOOLBAR);
+-	processAllEvents();
+ }
+ 
+ void ZLApplicationWindow::refreshToolbar(ToolbarType type) {
diff --git a/recipes/fbreader/fbreader-0.10.7/sane-events.patch b/recipes/fbreader/fbreader-0.10.7/sane-events.patch
new file mode 100644
index 0000000..8f583e9
--- /dev/null
+++ b/recipes/fbreader/fbreader-0.10.7/sane-events.patch
@@ -0,0 +1,59 @@
+--- fbreader-0.10.7.orig/zlibrary/ui/src/gtk/view/ZLGtkViewWidget.cpp
++++ fbreader-0.10.7/zlibrary/ui/src/gtk/view/ZLGtkViewWidget.cpp
+@@ -23,6 +23,7 @@
+ 
+ #include <ZLibrary.h>
+ #include <ZLLanguageUtil.h>
++#include <stdlib.h>
+ 
+ #include "ZLGtkViewWidget.h"
+ #include "ZLGtkPaintContext.h"
+@@ -54,7 +55,15 @@
+ 	}
+ }
+ 
++static int mouse_is_down = 0;
++
+ static void mousePressed(GtkWidget *area, GdkEventButton *event, gpointer data) {
++	if (event->button == 3)
++		/* ignore gtkstylus long touch events */
++		return;
++
++	mouse_is_down = 1;
++
+ 	gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(area)), area);
+ 	ZLGtkViewWidget *viewWidget = (ZLGtkViewWidget*)data;
+ 	int x = (int)event->x;
+@@ -65,6 +74,12 @@
+ }
+ 
+ static void mouseReleased(GtkWidget*, GdkEventButton *event, gpointer data) {
++	if (event->button == 3)
++		/* ignore gtkstylus long touch events */
++		return;
++
++	mouse_is_down = 0;
++
+ 	ZLGtkViewWidget *viewWidget = (ZLGtkViewWidget*)data;
+ 	int x = (int)event->x;
+ 	int y = (int)event->y;
+@@ -73,6 +88,19 @@
+ }
+ 
+ static void mouseMoved(GtkWidget*, GdkEventMotion *event, gpointer data) {
++	static gdouble last_x=0, last_y=0;
++
++	if (!mouse_is_down)
++		/* we couldn't possibly want this mouse move event */
++		return;
++
++	if (abs(last_x-event->x) < 5 && abs(last_y-event->y) < 5)
++		/* give the touchscreen tolerance for small movement */
++		return;
++
++	last_x = event->x;
++	last_y = event->y;
++
+ 	ZLGtkViewWidget *viewWidget = (ZLGtkViewWidget*)data;
+ 	int x, y;
+ 	GdkModifierType state;
diff --git a/recipes/fbreader/fbreader_0.10.7.bb b/recipes/fbreader/fbreader_0.10.7.bb
new file mode 100644
index 0000000..256467e
--- /dev/null
+++ b/recipes/fbreader/fbreader_0.10.7.bb
@@ -0,0 +1,41 @@
+DESCRIPTION = "FBreader is an ebook reader"
+HOMEPAGE = "http://www.fbreader.org"
+SECTION = "x11/utils"
+PRIORITY = "optional"
+LICENSE = "GPLv2"
+DEPENDS = "gtk+ expat bzip2 libfribidi liblinebreak virtual/libiconv"
+
+SRC_URI = "http://www.fbreader.org/fbreader-sources-${PV}.tgz \
+	   file://motion-threshold.patch;patch=1 \
+	   file://remove-recursion.patch;patch=1 \
+	   file://sane-events.patch;patch=1 \
+	   file://clear-selection.patch;patch=1 \
+	   "
+
+READER_ARCH	  = "desktop"
+READER_GUI	  = "gtk"
+READER_STATUS	  = "release"
+
+FILES_${PN} += "${datadir}/FBReader ${datadir}/zlibrary ${libdir}/zlibrary"
+FILES_${PN}-dbg += "${libdir}/zlibrary/ui/.debug"
+
+CFLAGS_append = "INSTALLDIR=/usr"
+EXTRA_OEMAKE = "CC='${CXX}' LD='${CXX}' OE_CFLAGS='${CXXFLAGS}' INCPATH='${STAGING_INCDIR}' LIBPATH='${STAGING_LIBDIR}'"
+
+inherit pkgconfig
+
+do_configure() {
+	echo "TARGET_ARCH = ${READER_ARCH}" > ${S}/makefiles/target.mk	
+	echo "UI_TYPE = ${READER_GUI}" >> ${S}/makefiles/target.mk
+	echo "TARGET_STATUS = ${READER_STATUS}" >> ${S}/makefiles/target.mk
+}
+
+do_compile_append() {
+	# enable tap scrolling
+	sed -i -e 's/Enabled" value="false/Enabled" value="true/' \
+		${S}/fbreader/data/default/config.desktop.xml
+}
+
+do_install () {
+	oe_runmake DESTDIR=${D} install
+}
-- 
1.6.0.3





More information about the Openembedded-devel mailing list