From 049562202ea835f60aa4c57931572638c06f4186 Mon Sep 17 00:00:00 2001 From: andreasb123 Date: Mon, 16 Jan 2012 20:45:30 +0000 Subject: [PATCH] Bugfixes, Dual page input now works correct, before always the left page was selected, even if you clicked on the right page git-svn-id: svn://svn.code.sf.net/p/xournal/svn/trunk@190 9fe2bcd3-a095-4d8b-a836-9b85dc8d7627 --- .cproject | 1334 +++++++++++----------- .project | 6 + .pydevproject | 7 + src/control/Control.cpp | 13 +- src/control/Control.h | 7 +- src/gui/PageView.cpp | 7 +- src/gui/pageposition/PagePositionCache.h | 3 + src/gui/widgets/XournalWidget.cpp | 2 + ui/Makefile.in | 1 + ui/main.glade | 5 +- ui/settings.glade | 12 +- 11 files changed, 707 insertions(+), 690 deletions(-) create mode 100644 .pydevproject diff --git a/.cproject b/.cproject index 5aa35c03..a1be4005 100644 --- a/.cproject +++ b/.cproject @@ -2,677 +2,665 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -make --j4 -all -true -true -false - - -make --j4 -am--refresh -true -true -false - - -make --j4 -check -true -true -false - - -make --j4 -clean -true -true -false - - -make --j4 -config.h -true -true -false - - -make --j4 -ctags -true -true -false - - -make --j4 -ctags-recursive -true -true -false - - -make --j4 -dist -true -true -false - - -make --j4 -dist-all -true -true -false - - -make --j4 -dist-bzip2 -true -true -false - - -make --j4 -dist-gzip -true -true -false - - -make --j4 -dist-lzma -true -true -false - - -make --j4 -dist-shar -true -true -false - - -make --j4 -dist-tarZ -true -true -false - - -make --j4 -dist-xz -true -true -false - - -make --j4 -dist-zip -true -true -false - - -make --j4 -distcheck -true -true -false - - -make --j4 -distclean -true -true -false - - -make --j4 -distclean-hdr -true -true -false - - -make --j4 -distclean-tags -true -true -false - - -make --j4 -distcleancheck -true -true -false - - -make --j4 -distdir -true -true -false - - -make --j4 -distuninstallcheck -true -true -false - - -make --j4 -dvi -true -true -false - - -make --j4 -html -true -true -false - - -make --j4 -info -true -true -false - - -make --j4 -install -true -true -false - - -make --j4 -install-data -true -true -false - - -make --j4 -install-dvi -true -true -false - - -make --j4 -install-exec -true -true -false - - -make --j4 -install-html -true -true -false - - -make --j4 -install-info -true -true -false - - -make --j4 -install-man -true -true -false - - -make --j4 -install-pdf -true -true -false - - -make --j4 -install-ps -true -true -false - - -make --j4 -install-strip -true -true -false - - -make --j4 -installcheck -true -true -false - - -make --j4 -installdirs -true -true -false - - -make --j4 -maintainer-clean -true -true -false - - -make --j4 -Makefile -true -true -false - - -make --j4 -mostlyclean -true -true -false - - -make --j4 -pdf -true -true -false - - -make --j4 -ps -true -true -false - - -make --j4 -stamp-h1 -true -true -false - - -make --j4 -tags -true -true -false - - -make --j4 -tags-recursive -true -true -false - - -make --j4 -uninstall -true -true -false - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + make + -j4 + all + true + true + false + + + make + -j4 + am--refresh + true + true + false + + + make + -j4 + check + true + true + false + + + make + -j4 + clean + true + true + false + + + make + -j4 + config.h + true + true + false + + + make + -j4 + ctags + true + true + false + + + make + -j4 + ctags-recursive + true + true + false + + + make + -j4 + dist + true + true + false + + + make + -j4 + dist-all + true + true + false + + + make + -j4 + dist-bzip2 + true + true + false + + + make + -j4 + dist-gzip + true + true + false + + + make + -j4 + dist-lzma + true + true + false + + + make + -j4 + dist-shar + true + true + false + + + make + -j4 + dist-tarZ + true + true + false + + + make + -j4 + dist-xz + true + true + false + + + make + -j4 + dist-zip + true + true + false + + + make + -j4 + distcheck + true + true + false + + + make + -j4 + distclean + true + true + false + + + make + -j4 + distclean-hdr + true + true + false + + + make + -j4 + distclean-tags + true + true + false + + + make + -j4 + distcleancheck + true + true + false + + + make + -j4 + distdir + true + true + false + + + make + -j4 + distuninstallcheck + true + true + false + + + make + -j4 + dvi + true + true + false + + + make + -j4 + html + true + true + false + + + make + -j4 + info + true + true + false + + + make + -j4 + install + true + true + false + + + make + -j4 + install-data + true + true + false + + + make + -j4 + install-dvi + true + true + false + + + make + -j4 + install-exec + true + true + false + + + make + -j4 + install-html + true + true + false + + + make + -j4 + install-info + true + true + false + + + make + -j4 + install-man + true + true + false + + + make + -j4 + install-pdf + true + true + false + + + make + -j4 + install-ps + true + true + false + + + make + -j4 + install-strip + true + true + false + + + make + -j4 + installcheck + true + true + false + + + make + -j4 + installdirs + true + true + false + + + make + -j4 + maintainer-clean + true + true + false + + + make + -j4 + Makefile + true + true + false + + + make + -j4 + mostlyclean + true + true + false + + + make + -j4 + pdf + true + true + false + + + make + -j4 + ps + true + true + false + + + make + -j4 + stamp-h1 + true + true + false + + + make + -j4 + tags + true + true + false + + + make + -j4 + tags-recursive + true + true + false + + + make + -j4 + uninstall + true + true + false + + + + + + + + diff --git a/.project b/.project index f2ca202a..1f2f002a 100644 --- a/.project +++ b/.project @@ -5,6 +5,11 @@ + + org.python.pydev.PyDevBuilder + + + org.eclipse.linuxtools.cdt.autotools.core.genmakebuilderV2 @@ -72,5 +77,6 @@ org.eclipse.cdt.managedbuilder.core.managedBuildNature org.eclipse.cdt.managedbuilder.core.ScannerConfigNature org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2 + org.python.pydev.pythonNature diff --git a/.pydevproject b/.pydevproject new file mode 100644 index 00000000..a9cca037 --- /dev/null +++ b/.pydevproject @@ -0,0 +1,7 @@ + + + + +Default +python 2.7 + diff --git a/src/control/Control.cpp b/src/control/Control.cpp index a62489ab..c09a8486 100644 --- a/src/control/Control.cpp +++ b/src/control/Control.cpp @@ -838,18 +838,21 @@ void Control::invokeLater(ActionType type) { /** * Fire page selected, but first check if the page Number is valid + * + * @return the page ID or -1 if the page is not found */ -void Control::firePageSelected(PageRef page) { +int Control::firePageSelected(PageRef page) { XOJ_CHECK_TYPE(Control); this->doc->lock(); - int p = this->doc->indexOf(page); + int pageId = this->doc->indexOf(page); this->doc->unlock(); - if (p == -1) { - return; + if (pageId == -1) { + return -1; } - DocumentHandler::firePageSelected(p); + DocumentHandler::firePageSelected(pageId); + return pageId; } void Control::firePageSelected(int page) { diff --git a/src/control/Control.h b/src/control/Control.h index 339cb207..6f18ed2f 100644 --- a/src/control/Control.h +++ b/src/control/Control.h @@ -123,7 +123,12 @@ public: bool searchTextOnPage(const char * text, int p, int * occures, double * top); - void firePageSelected(PageRef page); + /** + * Fire page selected, but first check if the page Number is valid + * + * @return the page ID or -1 if the page is not found + */ + int firePageSelected(PageRef page); void firePageSelected(int page); void addDefaultPage(); diff --git a/src/gui/PageView.cpp b/src/gui/PageView.cpp index 27c97c2d..e378be73 100644 --- a/src/gui/PageView.cpp +++ b/src/gui/PageView.cpp @@ -120,7 +120,12 @@ void PageView::deleteViewBuffer() { bool PageView::containsPoint(int x, int y) { XOJ_CHECK_TYPE(PageView); - return this->layout.getLayoutAbsoluteX() <= x && this->layout.getLayoutAbsoluteX() + this->getDisplayWidth() >= this->layout.getLayoutAbsoluteX() && this->layout.getLayoutAbsoluteY() <= y && this->layout.getLayoutAbsoluteY() + this->getDisplayHeight() >= this->layout.getLayoutAbsoluteY(); + bool leftOk = this->layout.getLayoutAbsoluteX() <= x; + bool rightOk = x <= this->layout.getLayoutAbsoluteX() + this->getDisplayWidth(); + bool topOk = this->layout.getLayoutAbsoluteY() <= y; + bool bottomOk = y <= this->layout.getLayoutAbsoluteY() + this->getDisplayHeight(); + + return leftOk && rightOk && topOk && bottomOk; } bool PageView::searchTextOnPage(const char * text, int * occures, double * top) { diff --git a/src/gui/pageposition/PagePositionCache.h b/src/gui/pageposition/PagePositionCache.h index e2e4e6a9..26107ee5 100644 --- a/src/gui/pageposition/PagePositionCache.h +++ b/src/gui/pageposition/PagePositionCache.h @@ -22,6 +22,9 @@ public: private: XOJ_TYPE_ATTRIB; + /** + * PagePositionCache ID + */ int ppId; friend class PagePositionHandler; diff --git a/src/gui/widgets/XournalWidget.cpp b/src/gui/widgets/XournalWidget.cpp index edf3c525..cc71b198 100644 --- a/src/gui/widgets/XournalWidget.cpp +++ b/src/gui/widgets/XournalWidget.cpp @@ -350,6 +350,8 @@ gboolean gtk_xournal_button_press_event(GtkWidget * widget, GdkEventButton * eve xournal->currentInputPage = pv; pv->translateEvent((GdkEvent*) event, xournal->x, xournal->y); INPUTDBG2("gtk_xournal_button_press_event (pv->onButtonPressEvent) return"); + + xournal->view->getDocument()->indexOf(pv->getPage()); return pv->onButtonPressEvent(widget, event); } diff --git a/ui/Makefile.in b/ui/Makefile.in index 1032aa56..43171c68 100644 --- a/ui/Makefile.in +++ b/ui/Makefile.in @@ -274,6 +274,7 @@ uidir = $(datadir)/xournalpp/ui ui_DATA = \ about.glade \ export.glade \ + goto.glade \ images.glade \ main.glade \ page-background-color.glade \ diff --git a/ui/main.glade b/ui/main.glade index 1dfc3b0d..469e2954 100644 --- a/ui/main.glade +++ b/ui/main.glade @@ -753,6 +753,7 @@ False Select Object True + True @@ -1106,8 +1107,8 @@ False True True - + @@ -1118,8 +1119,8 @@ False True True - + diff --git a/ui/settings.glade b/ui/settings.glade index 91aede37..1a8b5aec 100644 --- a/ui/settings.glade +++ b/ui/settings.glade @@ -1,6 +1,6 @@ - + False @@ -1746,7 +1746,7 @@ Here you can disable your touchscreen.</i> True False - <b>Cursor</b> + <b>Cursor Theme</b> True @@ -1783,13 +1783,9 @@ Here you can disable your touchscreen.</i> True False - - Big cursor for pen + True - True - False - False - True + False True