* GScribo/BUGS,
* GScribo/GScribo.pro,
* GScribo/GScribo.pro.user,
* GScribo/GScribo.pro.user.1.3,
* GScribo/PagesWidget/pagesdelegate.cpp,
* GScribo/PagesWidget/pagesdelegate.h,
* GScribo/PagesWidget/pagesmodel.cpp,
* GScribo/PagesWidget/pagesmodel.h,
* GScribo/PagesWidget/pageswidget.cpp,
* GScribo/PagesWidget/pageswidget.h,
* GScribo/Preferences/generaloptions.cpp,
* GScribo/Preferences/generaloptions.h,
* GScribo/Preferences/generaloptions.ui,
* GScribo/Preferences/ocroptions.cpp,
* GScribo/Preferences/ocroptions.h,
* GScribo/Preferences/ocroptions.ui,
* GScribo/Preferences/optionwidget.h,
* GScribo/Preferences/preferencesdialog.cpp,
* GScribo/Preferences/preferencesdialog.h,
* GScribo/Preferences/preferencesdialog.ui,
* GScribo/Preferences/preprocessingoptions.cpp,
* GScribo/Preferences/preprocessingoptions.h,
* GScribo/Preferences/preprocessingoptions.ui,
* GScribo/Preferences/segmentationoptions.cpp,
* GScribo/Preferences/segmentationoptions.h,
* GScribo/Preferences/segmentationoptions.ui,
* GScribo/Processing/preprocess.cpp,
* GScribo/Processing/preprocess.h,
* GScribo/Processing/process.cpp,
* GScribo/Processing/process.h,
* GScribo/Processing/progressdialog.cpp,
* GScribo/Processing/progressdialog.h,
* GScribo/Processing/runner.cpp,
* GScribo/Processing/runner.h,
* GScribo/Rendering/abstractregionitem.h,
* GScribo/Rendering/backgroundtexture.h,
* GScribo/Rendering/graphicsview.cpp,
* GScribo/Rendering/graphicsview.h,
* GScribo/Rendering/regionitem.cpp,
* GScribo/Rendering/regionitem.h,
* GScribo/Rendering/rootgraphicsitem.h,
* GScribo/Rendering/scene.cpp,
* GScribo/Rendering/scene.h,
* GScribo/Rendering/selection.cpp,
* GScribo/Rendering/selection.h,
* GScribo/TODO,
* GScribo/XmlWidget/attributesmodel.cpp,
* GScribo/XmlWidget/attributesmodel.h,
* GScribo/XmlWidget/selectionproxy.h,
* GScribo/XmlWidget/xmlattributes.cpp,
* GScribo/XmlWidget/xmlattributes.h,
* GScribo/XmlWidget/xmldelegate.h,
* GScribo/XmlWidget/xmlitem.cpp,
* GScribo/XmlWidget/xmlitem.h,
* GScribo/XmlWidget/xmlmodel.cpp,
* GScribo/XmlWidget/xmlmodel.h,
* GScribo/XmlWidget/xmlview.cpp,
* GScribo/XmlWidget/xmlview.h,
* GScribo/XmlWidget/xmlwidget.cpp,
* GScribo/XmlWidget/xmlwidget.h,
* GScribo/aboutdialog.h,
* GScribo/aboutdialog.ui,
* GScribo/configs.h,
* GScribo/dir.h,
* GScribo/dockwidget.h,
* GScribo/main.cpp,
* GScribo/mainwindow.cpp,
* GScribo/mainwindow.h,
* GScribo/mainwindow.ui,
* GScribo/region.h,
* GScribo/regionwidget.cpp,
* GScribo/regionwidget.h,
* GScribo/variantpointer.h,
* GScribo/xml.cpp,
* GScribo/xml.h: Remove.
---
ChangeLog | 80 +++++
GScribo/BUGS | 1 -
GScribo/GScribo.pro | 83 -----
GScribo/GScribo.pro.user | 405 -------------------------
GScribo/GScribo.pro.user.1.3 | 283 ------------------
GScribo/PagesWidget/pagesdelegate.cpp | 20 --
GScribo/PagesWidget/pagesdelegate.h | 18 --
GScribo/PagesWidget/pagesmodel.cpp | 55 ----
GScribo/PagesWidget/pagesmodel.h | 43 ---
GScribo/PagesWidget/pageswidget.cpp | 49 ---
GScribo/PagesWidget/pageswidget.h | 55 ----
GScribo/Preferences/generaloptions.cpp | 44 ---
GScribo/Preferences/generaloptions.h | 34 --
GScribo/Preferences/generaloptions.ui | 100 ------
GScribo/Preferences/ocroptions.cpp | 53 ----
GScribo/Preferences/ocroptions.h | 33 --
GScribo/Preferences/ocroptions.ui | 62 ----
GScribo/Preferences/optionwidget.h | 15 -
GScribo/Preferences/preferencesdialog.cpp | 98 ------
GScribo/Preferences/preferencesdialog.h | 42 ---
GScribo/Preferences/preferencesdialog.ui | 121 --------
GScribo/Preferences/preprocessingoptions.cpp | 45 ---
GScribo/Preferences/preprocessingoptions.h | 32 --
GScribo/Preferences/preprocessingoptions.ui | 76 -----
GScribo/Preferences/segmentationoptions.cpp | 33 --
GScribo/Preferences/segmentationoptions.h | 31 --
GScribo/Preferences/segmentationoptions.ui | 52 ----
GScribo/Processing/preprocess.cpp | 11 -
GScribo/Processing/preprocess.h | 26 --
GScribo/Processing/process.cpp | 21 --
GScribo/Processing/process.h | 29 --
GScribo/Processing/progressdialog.cpp | 16 -
GScribo/Processing/progressdialog.h | 22 --
GScribo/Processing/runner.cpp | 183 -----------
GScribo/Processing/runner.h | 58 ----
GScribo/Rendering/abstractregionitem.h | 13 -
GScribo/Rendering/backgroundtexture.h | 12 -
GScribo/Rendering/graphicsview.cpp | 150 ---------
GScribo/Rendering/graphicsview.h | 43 ---
GScribo/Rendering/regionitem.cpp | 59 ----
GScribo/Rendering/regionitem.h | 80 -----
GScribo/Rendering/rootgraphicsitem.h | 30 --
GScribo/Rendering/scene.cpp | 273 -----------------
GScribo/Rendering/scene.h | 118 --------
GScribo/Rendering/selection.cpp | 36 ---
GScribo/Rendering/selection.h | 20 --
GScribo/TODO | 100 ------
GScribo/XmlWidget/attributesmodel.cpp | 69 -----
GScribo/XmlWidget/attributesmodel.h | 48 ---
GScribo/XmlWidget/selectionproxy.h | 47 ---
GScribo/XmlWidget/xmlattributes.cpp | 23 --
GScribo/XmlWidget/xmlattributes.h | 33 --
GScribo/XmlWidget/xmldelegate.h | 30 --
GScribo/XmlWidget/xmlitem.cpp | 43 ---
GScribo/XmlWidget/xmlitem.h | 90 ------
GScribo/XmlWidget/xmlmodel.cpp | 87 ------
GScribo/XmlWidget/xmlmodel.h | 44 ---
GScribo/XmlWidget/xmlview.cpp | 88 ------
GScribo/XmlWidget/xmlview.h | 79 -----
GScribo/XmlWidget/xmlwidget.cpp | 34 --
GScribo/XmlWidget/xmlwidget.h | 54 ----
GScribo/aboutdialog.h | 25 --
GScribo/aboutdialog.ui | 136 ---------
GScribo/configs.h | 134 ---------
GScribo/dir.h | 7 -
GScribo/dockwidget.h | 22 --
GScribo/main.cpp | 23 --
GScribo/mainwindow.cpp | 415 --------------------------
GScribo/mainwindow.h | 120 --------
GScribo/mainwindow.ui | 35 ---
GScribo/region.h | 56 ----
GScribo/regionwidget.cpp | 70 -----
GScribo/regionwidget.h | 40 ---
GScribo/variantpointer.h | 19 --
GScribo/xml.cpp | 206 -------------
GScribo/xml.h | 93 ------
76 files changed, 80 insertions(+), 5353 deletions(-)
delete mode 100644 GScribo/BUGS
delete mode 100644 GScribo/GScribo.pro
delete mode 100644 GScribo/GScribo.pro.user
delete mode 100644 GScribo/GScribo.pro.user.1.3
delete mode 100644 GScribo/PagesWidget/pagesdelegate.cpp
delete mode 100644 GScribo/PagesWidget/pagesdelegate.h
delete mode 100644 GScribo/PagesWidget/pagesmodel.cpp
delete mode 100644 GScribo/PagesWidget/pagesmodel.h
delete mode 100644 GScribo/PagesWidget/pageswidget.cpp
delete mode 100644 GScribo/PagesWidget/pageswidget.h
delete mode 100644 GScribo/Preferences/generaloptions.cpp
delete mode 100644 GScribo/Preferences/generaloptions.h
delete mode 100644 GScribo/Preferences/generaloptions.ui
delete mode 100644 GScribo/Preferences/ocroptions.cpp
delete mode 100644 GScribo/Preferences/ocroptions.h
delete mode 100644 GScribo/Preferences/ocroptions.ui
delete mode 100644 GScribo/Preferences/optionwidget.h
delete mode 100644 GScribo/Preferences/preferencesdialog.cpp
delete mode 100644 GScribo/Preferences/preferencesdialog.h
delete mode 100644 GScribo/Preferences/preferencesdialog.ui
delete mode 100644 GScribo/Preferences/preprocessingoptions.cpp
delete mode 100644 GScribo/Preferences/preprocessingoptions.h
delete mode 100644 GScribo/Preferences/preprocessingoptions.ui
delete mode 100644 GScribo/Preferences/segmentationoptions.cpp
delete mode 100644 GScribo/Preferences/segmentationoptions.h
delete mode 100644 GScribo/Preferences/segmentationoptions.ui
delete mode 100644 GScribo/Processing/preprocess.cpp
delete mode 100644 GScribo/Processing/preprocess.h
delete mode 100644 GScribo/Processing/process.cpp
delete mode 100644 GScribo/Processing/process.h
delete mode 100644 GScribo/Processing/progressdialog.cpp
delete mode 100644 GScribo/Processing/progressdialog.h
delete mode 100644 GScribo/Processing/runner.cpp
delete mode 100644 GScribo/Processing/runner.h
delete mode 100644 GScribo/Rendering/abstractregionitem.h
delete mode 100644 GScribo/Rendering/backgroundtexture.h
delete mode 100644 GScribo/Rendering/graphicsview.cpp
delete mode 100644 GScribo/Rendering/graphicsview.h
delete mode 100644 GScribo/Rendering/regionitem.cpp
delete mode 100644 GScribo/Rendering/regionitem.h
delete mode 100644 GScribo/Rendering/rootgraphicsitem.h
delete mode 100644 GScribo/Rendering/scene.cpp
delete mode 100644 GScribo/Rendering/scene.h
delete mode 100644 GScribo/Rendering/selection.cpp
delete mode 100644 GScribo/Rendering/selection.h
delete mode 100644 GScribo/TODO
delete mode 100644 GScribo/XmlWidget/attributesmodel.cpp
delete mode 100644 GScribo/XmlWidget/attributesmodel.h
delete mode 100644 GScribo/XmlWidget/selectionproxy.h
delete mode 100644 GScribo/XmlWidget/xmlattributes.cpp
delete mode 100644 GScribo/XmlWidget/xmlattributes.h
delete mode 100644 GScribo/XmlWidget/xmldelegate.h
delete mode 100644 GScribo/XmlWidget/xmlitem.cpp
delete mode 100644 GScribo/XmlWidget/xmlitem.h
delete mode 100644 GScribo/XmlWidget/xmlmodel.cpp
delete mode 100644 GScribo/XmlWidget/xmlmodel.h
delete mode 100644 GScribo/XmlWidget/xmlview.cpp
delete mode 100644 GScribo/XmlWidget/xmlview.h
delete mode 100644 GScribo/XmlWidget/xmlwidget.cpp
delete mode 100644 GScribo/XmlWidget/xmlwidget.h
delete mode 100644 GScribo/aboutdialog.h
delete mode 100644 GScribo/aboutdialog.ui
delete mode 100644 GScribo/configs.h
delete mode 100644 GScribo/dir.h
delete mode 100644 GScribo/dockwidget.h
delete mode 100644 GScribo/main.cpp
delete mode 100644 GScribo/mainwindow.cpp
delete mode 100644 GScribo/mainwindow.h
delete mode 100644 GScribo/mainwindow.ui
delete mode 100644 GScribo/region.h
delete mode 100644 GScribo/regionwidget.cpp
delete mode 100644 GScribo/regionwidget.h
delete mode 100644 GScribo/variantpointer.h
delete mode 100644 GScribo/xml.cpp
delete mode 100644 GScribo/xml.h
diff --git a/ChangeLog b/ChangeLog
index b47e5a1..5c08e1b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,83 @@
+2013-04-18 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Remove unstable viewer.
+
+ * GScribo/BUGS,
+ * GScribo/GScribo.pro,
+ * GScribo/GScribo.pro.user,
+ * GScribo/GScribo.pro.user.1.3,
+ * GScribo/PagesWidget/pagesdelegate.cpp,
+ * GScribo/PagesWidget/pagesdelegate.h,
+ * GScribo/PagesWidget/pagesmodel.cpp,
+ * GScribo/PagesWidget/pagesmodel.h,
+ * GScribo/PagesWidget/pageswidget.cpp,
+ * GScribo/PagesWidget/pageswidget.h,
+ * GScribo/Preferences/generaloptions.cpp,
+ * GScribo/Preferences/generaloptions.h,
+ * GScribo/Preferences/generaloptions.ui,
+ * GScribo/Preferences/ocroptions.cpp,
+ * GScribo/Preferences/ocroptions.h,
+ * GScribo/Preferences/ocroptions.ui,
+ * GScribo/Preferences/optionwidget.h,
+ * GScribo/Preferences/preferencesdialog.cpp,
+ * GScribo/Preferences/preferencesdialog.h,
+ * GScribo/Preferences/preferencesdialog.ui,
+ * GScribo/Preferences/preprocessingoptions.cpp,
+ * GScribo/Preferences/preprocessingoptions.h,
+ * GScribo/Preferences/preprocessingoptions.ui,
+ * GScribo/Preferences/segmentationoptions.cpp,
+ * GScribo/Preferences/segmentationoptions.h,
+ * GScribo/Preferences/segmentationoptions.ui,
+ * GScribo/Processing/preprocess.cpp,
+ * GScribo/Processing/preprocess.h,
+ * GScribo/Processing/process.cpp,
+ * GScribo/Processing/process.h,
+ * GScribo/Processing/progressdialog.cpp,
+ * GScribo/Processing/progressdialog.h,
+ * GScribo/Processing/runner.cpp,
+ * GScribo/Processing/runner.h,
+ * GScribo/Rendering/abstractregionitem.h,
+ * GScribo/Rendering/backgroundtexture.h,
+ * GScribo/Rendering/graphicsview.cpp,
+ * GScribo/Rendering/graphicsview.h,
+ * GScribo/Rendering/regionitem.cpp,
+ * GScribo/Rendering/regionitem.h,
+ * GScribo/Rendering/rootgraphicsitem.h,
+ * GScribo/Rendering/scene.cpp,
+ * GScribo/Rendering/scene.h,
+ * GScribo/Rendering/selection.cpp,
+ * GScribo/Rendering/selection.h,
+ * GScribo/TODO,
+ * GScribo/XmlWidget/attributesmodel.cpp,
+ * GScribo/XmlWidget/attributesmodel.h,
+ * GScribo/XmlWidget/selectionproxy.h,
+ * GScribo/XmlWidget/xmlattributes.cpp,
+ * GScribo/XmlWidget/xmlattributes.h,
+ * GScribo/XmlWidget/xmldelegate.h,
+ * GScribo/XmlWidget/xmlitem.cpp,
+ * GScribo/XmlWidget/xmlitem.h,
+ * GScribo/XmlWidget/xmlmodel.cpp,
+ * GScribo/XmlWidget/xmlmodel.h,
+ * GScribo/XmlWidget/xmlview.cpp,
+ * GScribo/XmlWidget/xmlview.h,
+ * GScribo/XmlWidget/xmlwidget.cpp,
+ * GScribo/XmlWidget/xmlwidget.h,
+ * GScribo/aboutdialog.h,
+ * GScribo/aboutdialog.ui,
+ * GScribo/configs.h,
+ * GScribo/dir.h,
+ * GScribo/dockwidget.h,
+ * GScribo/main.cpp,
+ * GScribo/mainwindow.cpp,
+ * GScribo/mainwindow.h,
+ * GScribo/mainwindow.ui,
+ * GScribo/region.h,
+ * GScribo/regionwidget.cpp,
+ * GScribo/regionwidget.h,
+ * GScribo/variantpointer.h,
+ * GScribo/xml.cpp,
+ * GScribo/xml.h: Remove.
+
2013-04-17 Guillaume Lazzara <z(a)lrde.epita.fr>
* doc/Makefile.am: Fix a link in documentations generated with
diff --git a/GScribo/BUGS b/GScribo/BUGS
deleted file mode 100644
index 48af52e..0000000
--- a/GScribo/BUGS
+++ /dev/null
@@ -1 +0,0 @@
-- In release compilation, when the first text region is selected in the xml widget, the
program crashs.
diff --git a/GScribo/GScribo.pro b/GScribo/GScribo.pro
deleted file mode 100644
index 1495495..0000000
--- a/GScribo/GScribo.pro
+++ /dev/null
@@ -1,83 +0,0 @@
-# -------------------------------------------------
-# Project created by QtCreator 2013-01-21T09:20:54
-# -------------------------------------------------
-QT += xml
-INCLUDEPATH += /lrde/home/stage/froger_a/olena/scribo/ \
- /lrde/home/stage/froger_a/olena/milena/ \
- /lrde/home/stage/froger_a/olena/_build/scribo/demo/
-QMAKE_CXXFLAGS += -DNDEBUG \
- -DMLN_WO_GLOBAL_VARS
-LIBS += -I/usr/include/graphicsImage \
- -lGraphicsMagick++ \
- -ltesseract_full \
- -ltiff
-TARGET = GScribo
-TEMPLATE = app
-SOURCES += regionwidget.cpp \
- mainwindow.cpp \
- main.cpp \
- xml.cpp \
- Rendering/scene.cpp \
- Rendering/selection.cpp \
- Rendering/regionitem.cpp \
- Rendering/graphicsview.cpp \
- PagesWidget/pageswidget.cpp \
- PagesWidget/pagesmodel.cpp \
- PagesWidget/pagesdelegate.cpp \
- Preferences/segmentationoptions.cpp \
- Preferences/preprocessingoptions.cpp \
- Preferences/ocroptions.cpp \
- Preferences/generaloptions.cpp \
- Preferences/preferencesdialog.cpp \
- Processing/progressdialog.cpp \
- Processing/preprocess.cpp \
- Processing/process.cpp \
- Processing/runner.cpp \
- XmlWidget/xmlwidget.cpp \
- XmlWidget/xmlmodel.cpp \
- XmlWidget/xmlitem.cpp \
- XmlWidget/xmlattributes.cpp \
- XmlWidget/attributesmodel.cpp \
- XmlWidget/xmlview.cpp
-HEADERS += mainwindow.h \
- variantpointer.h \
- regionwidget.h \
- aboutdialog.h \
- configs.h \
- region.h \
- dir.h \
- xml.h \
- Rendering/scene.h \
- Rendering/selection.h \
- Rendering/regionitem.h \
- Rendering/graphicsview.h \
- PagesWidget/pageswidget.h \
- PagesWidget/pagesmodel.h \
- Processing/preprocess.h \
- Processing/process.h \
- Processing/runner.h \
- Processing/progressdialog.h \
- Preferences/segmentationoptions.h \
- Preferences/preprocessingoptions.h \
- Preferences/ocroptions.h \
- Preferences/generaloptions.h \
- Preferences/optionwidget.h \
- Preferences/preferencesdialog.h \
- XmlWidget/xmlwidget.h \
- XmlWidget/xmlmodel.h \
- XmlWidget/xmlitem.h \
- XmlWidget/xmlattributes.h \
- XmlWidget/selectionproxy.h \
- XmlWidget/xmldelegate.h \
- XmlWidget/attributesmodel.h \
- PagesWidget/pagesdelegate.h \
- Rendering/rootgraphicsitem.h \
- XmlWidget/xmlview.h \
- dockwidget.h
-FORMS += mainwindow.ui \
- aboutdialog.ui \
- Preferences/preferencesdialog.ui \
- Preferences/ocroptions.ui \
- Preferences/segmentationoptions.ui \
- Preferences/generaloptions.ui \
- Preferences/preprocessingoptions.ui
diff --git a/GScribo/GScribo.pro.user b/GScribo/GScribo.pro.user
deleted file mode 100644
index d765506..0000000
--- a/GScribo/GScribo.pro.user
+++ /dev/null
@@ -1,405 +0,0 @@
-<!DOCTYPE QtCreatorProject>
-<qtcreator>
- <data>
- <variable>RunConfiguration0-BaseEnvironmentBase</variable>
- <value type="int">2</value>
- </data>
- <data>
- <variable>RunConfiguration0-CommandLineArguments</variable>
- <valuelist type="QVariantList"/>
- </data>
- <data>
- <variable>RunConfiguration0-ProFile</variable>
- <value type="QString">GScribo.pro</value>
- </data>
- <data>
- <variable>RunConfiguration0-RunConfiguration.name</variable>
- <value type="QString">GScribo</value>
- </data>
- <data>
- <variable>RunConfiguration0-UseDyldImageSuffix</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UseTerminal</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UserEnvironmentChanges</variable>
- <valuelist type="QVariantList"/>
- </data>
- <data>
- <variable>RunConfiguration0-UserSetName</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UserSetWorkingDirectory</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UserWorkingDirectory</variable>
- <value type="QString"></value>
- </data>
- <data>
- <variable>RunConfiguration0-type</variable>
- <value
type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
- </data>
- <data>
- <variable>activeRunConfiguration</variable>
- <value type="int">0</value>
- </data>
- <data>
- <variable>activebuildconfiguration</variable>
- <value type="QString">Release</value>
- </data>
- <data>
- <variable>buildConfiguration-Debug</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Debug</value>
- <value key="QtVersionId" type="int">0</value>
- <value key="ToolChain" type="int">0</value>
- <value key="addQDumper" type=""></value>
- <value key="buildConfiguration" type="int">2</value>
- </valuemap>
- </data>
- <data>
- <variable>buildConfiguration-Release</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Release</value>
- <value key="QtVersionId" type="int">0</value>
- <value key="ToolChain" type="int">0</value>
- <value key="addQDumper" type=""></value>
- <value key="buildConfiguration" type="int">0</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Debug-buildstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Debug</value>
- <valuelist key="abstractProcess.Environment"
type="QVariantList">
- <value
type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-YPw0beHDmH,guid=e1ea388d8198abba427530de0006165b</value>
- <value type="QString">DESKTOP_SESSION=fluxbox</value>
- <value type="QString">DISPLAY=:0.0</value>
- <value type="QString">GDMSESSION=fluxbox</value>
- <value type="QString">GDM_LANG=fr_FR.UTF-8</value>
- <value type="QString">GDM_XSERVER_LOCATION=local</value>
- <value type="QString">GTK_MODULES=canberra-gtk-module</value>
- <value type="QString">HOME=/lrde/home/stage/froger_a</value>
- <value type="QString">LANG=fr_FR.UTF-8</value>
- <value
type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
- <value type="QString">LOGNAME=froger_a</value>
- <value
type="QString">PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/games</value>
- <value
type="QString">PWD=/lrde/home/stage/froger_a/qt/GScribo</value>
- <value type="QString">QTDIR=/usr/share/qt4</value>
- <value type="QString">SHELL=/bin/bash</value>
- <value type="QString">SHLVL=2</value>
- <value type="QString">SSH_AGENT_PID=23527</value>
- <value
type="QString">SSH_AUTH_SOCK=/tmp/ssh-rIfho23467/agent.23467</value>
- <value type="QString">TERM=xterm</value>
- <value type="QString">USER=froger_a</value>
- <value type="QString">USERNAME=froger_a</value>
- <value type="QString">WINDOWID=12582936</value>
- <value type="QString">WINDOWPATH=7:8:8:8:8:8:8:8:8</value>
- <value type="QString">XAUTHORITY=/tmp/.gdmS2P7SW</value>
- <value
type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
- <value
type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1361173353.46260-1384018529</value>
- <value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
- <value type="QString">XTERM_SHELL=/bin/bash</value>
- <value type="QString">XTERM_VERSION=XTerm(261)</value>
- </valuelist>
- <valuelist key="abstractProcess.arguments"
type="QVariantList">
- <value
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo/GScribo.pro</value>
- <value type="QString">-spec</value>
- <value type="QString">linux-g++</value>
- <value type="QString">-r</value>
- <value type="QString">CONFIG+=debug</value>
- </valuelist>
- <value key="abstractProcess.command"
type="QString">/usr/bin/qmake-qt4</value>
- <value key="abstractProcess.enabled"
type="bool">false</value>
- <value key="abstractProcess.workingDirectory"
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Debug-buildstep1</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Debug</value>
- <valuelist key="abstractProcess.Environment"
type="QVariantList">
- <value
type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-YPw0beHDmH,guid=e1ea388d8198abba427530de0006165b</value>
- <value type="QString">DESKTOP_SESSION=fluxbox</value>
- <value type="QString">DISPLAY=:0.0</value>
- <value type="QString">GDMSESSION=fluxbox</value>
- <value type="QString">GDM_LANG=fr_FR.UTF-8</value>
- <value type="QString">GDM_XSERVER_LOCATION=local</value>
- <value type="QString">GTK_MODULES=canberra-gtk-module</value>
- <value type="QString">HOME=/lrde/home/stage/froger_a</value>
- <value type="QString">LANG=fr_FR.UTF-8</value>
- <value
type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
- <value type="QString">LOGNAME=froger_a</value>
- <value
type="QString">PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/games</value>
- <value
type="QString">PWD=/lrde/home/stage/froger_a/qt/GScribo</value>
- <value type="QString">QTDIR=/usr/share/qt4</value>
- <value type="QString">SHELL=/bin/bash</value>
- <value type="QString">SHLVL=2</value>
- <value type="QString">SSH_AGENT_PID=23527</value>
- <value
type="QString">SSH_AUTH_SOCK=/tmp/ssh-rIfho23467/agent.23467</value>
- <value type="QString">TERM=xterm</value>
- <value type="QString">USER=froger_a</value>
- <value type="QString">USERNAME=froger_a</value>
- <value type="QString">WINDOWID=12582936</value>
- <value type="QString">WINDOWPATH=7:8:8:8:8:8:8:8:8</value>
- <value type="QString">XAUTHORITY=/tmp/.gdmS2P7SW</value>
- <value
type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
- <value
type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1361173353.46260-1384018529</value>
- <value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
- <value type="QString">XTERM_SHELL=/bin/bash</value>
- <value type="QString">XTERM_VERSION=XTerm(261)</value>
- </valuelist>
- <value key="abstractProcess.IgnoreReturnValue"
type="bool">false</value>
- <valuelist key="abstractProcess.arguments"
type="QVariantList">
- <value type="QString">-w</value>
- </valuelist>
- <value key="abstractProcess.command"
type="QString">/usr/bin/make</value>
- <value key="abstractProcess.enabled"
type="bool">true</value>
- <value key="abstractProcess.workingDirectory"
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Debug-cleanstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Debug</value>
- <valuelist key="abstractProcess.Environment"
type="QVariantList">
- <value
type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-YPw0beHDmH,guid=e1ea388d8198abba427530de0006165b</value>
- <value type="QString">DESKTOP_SESSION=fluxbox</value>
- <value type="QString">DISPLAY=:0.0</value>
- <value type="QString">GDMSESSION=fluxbox</value>
- <value type="QString">GDM_LANG=fr_FR.UTF-8</value>
- <value type="QString">GDM_XSERVER_LOCATION=local</value>
- <value type="QString">GTK_MODULES=canberra-gtk-module</value>
- <value type="QString">HOME=/lrde/home/stage/froger_a</value>
- <value type="QString">LANG=fr_FR.UTF-8</value>
- <value
type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
- <value type="QString">LOGNAME=froger_a</value>
- <value
type="QString">PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/games</value>
- <value
type="QString">PWD=/lrde/home/stage/froger_a/qt/GScribo</value>
- <value type="QString">QTDIR=/usr/share/qt4</value>
- <value type="QString">SHELL=/bin/bash</value>
- <value type="QString">SHLVL=2</value>
- <value type="QString">SSH_AGENT_PID=23527</value>
- <value
type="QString">SSH_AUTH_SOCK=/tmp/ssh-rIfho23467/agent.23467</value>
- <value type="QString">TERM=xterm</value>
- <value type="QString">USER=froger_a</value>
- <value type="QString">USERNAME=froger_a</value>
- <value type="QString">WINDOWID=12582936</value>
- <value type="QString">WINDOWPATH=7:8:8:8:8:8:8:8:8</value>
- <value type="QString">XAUTHORITY=/tmp/.gdmS2P7SW</value>
- <value
type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
- <value
type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1361173353.46260-1384018529</value>
- <value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
- <value type="QString">XTERM_SHELL=/bin/bash</value>
- <value type="QString">XTERM_VERSION=XTerm(261)</value>
- </valuelist>
- <value key="abstractProcess.IgnoreReturnValue"
type="bool">true</value>
- <valuelist key="abstractProcess.arguments"
type="QVariantList">
- <value type="QString">clean</value>
- <value type="QString">-w</value>
- </valuelist>
- <value key="abstractProcess.command"
type="QString">/usr/bin/make</value>
- <value key="abstractProcess.enabled"
type="bool">true</value>
- <value key="abstractProcess.workingDirectory"
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo</value>
- <value key="cleanConfig" type="bool">true</value>
- <valuelist key="makeargs" type="QVariantList">
- <value type="QString">clean</value>
- </valuelist>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Release-buildstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Release</value>
- <valuelist key="abstractProcess.Environment"
type="QVariantList">
- <value
type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-YPw0beHDmH,guid=e1ea388d8198abba427530de0006165b</value>
- <value type="QString">DESKTOP_SESSION=fluxbox</value>
- <value type="QString">DISPLAY=:0.0</value>
- <value type="QString">GDMSESSION=fluxbox</value>
- <value type="QString">GDM_LANG=fr_FR.UTF-8</value>
- <value type="QString">GDM_XSERVER_LOCATION=local</value>
- <value type="QString">GTK_MODULES=canberra-gtk-module</value>
- <value type="QString">HOME=/lrde/home/stage/froger_a</value>
- <value type="QString">LANG=fr_FR.UTF-8</value>
- <value type="QString">LANGUAGE=</value>
- <value
type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
- <value type="QString">LOGNAME=froger_a</value>
- <value
type="QString">PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/games</value>
- <value
type="QString">PWD=/lrde/home/stage/froger_a/qt/GScribo</value>
- <value type="QString">QTDIR=/usr/share/qt4</value>
- <value type="QString">SHELL=/bin/bash</value>
- <value type="QString">SHLVL=2</value>
- <value type="QString">SSH_AGENT_PID=23527</value>
- <value
type="QString">SSH_AUTH_SOCK=/tmp/ssh-rIfho23467/agent.23467</value>
- <value type="QString">TERM=xterm</value>
- <value type="QString">USER=froger_a</value>
- <value type="QString">USERNAME=froger_a</value>
- <value type="QString">WINDOWID=10485784</value>
- <value type="QString">WINDOWPATH=7:8:8:8:8:8:8:8:8</value>
- <value type="QString">XAUTHORITY=/tmp/.gdmS2P7SW</value>
- <value
type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
- <value
type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1361173353.46260-1384018529</value>
- <value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
- <value type="QString">XTERM_SHELL=/bin/bash</value>
- <value type="QString">XTERM_VERSION=XTerm(261)</value>
- </valuelist>
- <valuelist key="abstractProcess.arguments"
type="QVariantList">
- <value
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo/GScribo.pro</value>
- <value type="QString">-spec</value>
- <value type="QString">linux-g++</value>
- <value type="QString">-r</value>
- </valuelist>
- <value key="abstractProcess.command"
type="QString">/usr/bin/qmake-qt4</value>
- <value key="abstractProcess.enabled"
type="bool">false</value>
- <value key="abstractProcess.workingDirectory"
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Release-buildstep1</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Release</value>
- <valuelist key="abstractProcess.Environment"
type="QVariantList">
- <value
type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-YPw0beHDmH,guid=e1ea388d8198abba427530de0006165b</value>
- <value type="QString">DESKTOP_SESSION=fluxbox</value>
- <value type="QString">DISPLAY=:0.0</value>
- <value type="QString">GDMSESSION=fluxbox</value>
- <value type="QString">GDM_LANG=fr_FR.UTF-8</value>
- <value type="QString">GDM_XSERVER_LOCATION=local</value>
- <value type="QString">GTK_MODULES=canberra-gtk-module</value>
- <value type="QString">HOME=/lrde/home/stage/froger_a</value>
- <value type="QString">LANG=fr_FR.UTF-8</value>
- <value type="QString">LANGUAGE=</value>
- <value
type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
- <value type="QString">LOGNAME=froger_a</value>
- <value
type="QString">PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/games</value>
- <value
type="QString">PWD=/lrde/home/stage/froger_a/qt/GScribo</value>
- <value type="QString">QTDIR=/usr/share/qt4</value>
- <value type="QString">SHELL=/bin/bash</value>
- <value type="QString">SHLVL=2</value>
- <value type="QString">SSH_AGENT_PID=23527</value>
- <value
type="QString">SSH_AUTH_SOCK=/tmp/ssh-rIfho23467/agent.23467</value>
- <value type="QString">TERM=xterm</value>
- <value type="QString">USER=froger_a</value>
- <value type="QString">USERNAME=froger_a</value>
- <value type="QString">WINDOWID=10485784</value>
- <value type="QString">WINDOWPATH=7:8:8:8:8:8:8:8:8</value>
- <value type="QString">XAUTHORITY=/tmp/.gdmS2P7SW</value>
- <value
type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
- <value
type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1361173353.46260-1384018529</value>
- <value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
- <value type="QString">XTERM_SHELL=/bin/bash</value>
- <value type="QString">XTERM_VERSION=XTerm(261)</value>
- </valuelist>
- <value key="abstractProcess.IgnoreReturnValue"
type="bool">false</value>
- <valuelist key="abstractProcess.arguments"
type="QVariantList">
- <value type="QString">-w</value>
- </valuelist>
- <value key="abstractProcess.command"
type="QString">/usr/bin/make</value>
- <value key="abstractProcess.enabled"
type="bool">true</value>
- <value key="abstractProcess.workingDirectory"
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Release-cleanstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Release</value>
- <valuelist key="abstractProcess.Environment"
type="QVariantList">
- <value
type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-YPw0beHDmH,guid=e1ea388d8198abba427530de0006165b</value>
- <value type="QString">DESKTOP_SESSION=fluxbox</value>
- <value type="QString">DISPLAY=:0.0</value>
- <value type="QString">GDMSESSION=fluxbox</value>
- <value type="QString">GDM_LANG=fr_FR.UTF-8</value>
- <value type="QString">GDM_XSERVER_LOCATION=local</value>
- <value type="QString">GTK_MODULES=canberra-gtk-module</value>
- <value type="QString">HOME=/lrde/home/stage/froger_a</value>
- <value type="QString">LANG=fr_FR.UTF-8</value>
- <value type="QString">LANGUAGE=</value>
- <value
type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
- <value type="QString">LOGNAME=froger_a</value>
- <value
type="QString">PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/games</value>
- <value
type="QString">PWD=/lrde/home/stage/froger_a/qt/GScribo</value>
- <value type="QString">QTDIR=/usr/share/qt4</value>
- <value type="QString">SHELL=/bin/bash</value>
- <value type="QString">SHLVL=2</value>
- <value type="QString">SSH_AGENT_PID=23527</value>
- <value
type="QString">SSH_AUTH_SOCK=/tmp/ssh-rIfho23467/agent.23467</value>
- <value type="QString">TERM=xterm</value>
- <value type="QString">USER=froger_a</value>
- <value type="QString">USERNAME=froger_a</value>
- <value type="QString">WINDOWID=10485784</value>
- <value type="QString">WINDOWPATH=7:8:8:8:8:8:8:8:8</value>
- <value type="QString">XAUTHORITY=/tmp/.gdmS2P7SW</value>
- <value
type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
- <value
type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1361173353.46260-1384018529</value>
- <value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
- <value type="QString">XTERM_SHELL=/bin/bash</value>
- <value type="QString">XTERM_VERSION=XTerm(261)</value>
- </valuelist>
- <value key="abstractProcess.IgnoreReturnValue"
type="bool">true</value>
- <valuelist key="abstractProcess.arguments"
type="QVariantList">
- <value type="QString">clean</value>
- <value type="QString">-w</value>
- </valuelist>
- <value key="abstractProcess.command"
type="QString">/usr/bin/make</value>
- <value key="abstractProcess.enabled"
type="bool">true</value>
- <value key="abstractProcess.workingDirectory"
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo</value>
- <value key="cleanConfig" type="bool">true</value>
- <valuelist key="makeargs" type="QVariantList">
- <value type="QString">clean</value>
- </valuelist>
- </valuemap>
- </data>
- <data>
- <variable>buildconfigurations</variable>
- <valuelist type="QVariantList">
- <value type="QString">Debug</value>
- <value type="QString">Release</value>
- </valuelist>
- </data>
- <data>
- <variable>buildstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString"></value>
- <value key="mkspec" type="QString"></value>
- </valuemap>
- </data>
- <data>
- <variable>buildstep1</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString"></value>
- </valuemap>
- </data>
- <data>
- <variable>buildsteps</variable>
- <valuelist type="QVariantList">
- <value type="QString">trolltech.qt4projectmanager.qmake</value>
- <value type="QString">trolltech.qt4projectmanager.make</value>
- </valuelist>
- </data>
- <data>
- <variable>cleanstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString"></value>
- <value key="clean" type="bool">true</value>
- </valuemap>
- </data>
- <data>
- <variable>cleansteps</variable>
- <valuelist type="QVariantList">
- <value type="QString">trolltech.qt4projectmanager.make</value>
- </valuelist>
- </data>
- <data>
- <variable>defaultFileEncoding</variable>
- <value type="QByteArray">System</value>
- </data>
- <data>
- <variable>project</variable>
- <valuemap type="QVariantMap"/>
- </data>
-</qtcreator>
diff --git a/GScribo/GScribo.pro.user.1.3 b/GScribo/GScribo.pro.user.1.3
deleted file mode 100644
index dce13f4..0000000
--- a/GScribo/GScribo.pro.user.1.3
+++ /dev/null
@@ -1,283 +0,0 @@
-<!DOCTYPE QtCreatorProject>
-<qtcreator>
- <data>
- <variable>RunConfiguration0-BaseEnvironmentBase</variable>
- <value type="int">2</value>
- </data>
- <data>
- <variable>RunConfiguration0-CommandLineArguments</variable>
- <valuelist type="QVariantList"/>
- </data>
- <data>
- <variable>RunConfiguration0-ProFile</variable>
- <value type="QString">GScribo.pro</value>
- </data>
- <data>
- <variable>RunConfiguration0-RunConfiguration.name</variable>
- <value type="QString">GScribo</value>
- </data>
- <data>
- <variable>RunConfiguration0-UseDyldImageSuffix</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UseTerminal</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UserEnvironmentChanges</variable>
- <valuelist type="QVariantList"/>
- </data>
- <data>
- <variable>RunConfiguration0-UserSetName</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UserSetWorkingDirectory</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UserWorkingDirectory</variable>
- <value type="QString"></value>
- </data>
- <data>
- <variable>RunConfiguration0-type</variable>
- <value
type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
- </data>
- <data>
- <variable>activeRunConfiguration</variable>
- <value type="int">0</value>
- </data>
- <data>
- <variable>activebuildconfiguration</variable>
- <value type="QString">Debug</value>
- </data>
- <data>
- <variable>buildConfiguration-Debug</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Debug</value>
- <value key="QtVersionId" type="int">0</value>
- <value key="ToolChain" type="int">0</value>
- <value key="addQDumper" type=""></value>
- <value key="buildConfiguration" type="int">2</value>
- </valuemap>
- </data>
- <data>
- <variable>buildConfiguration-Release</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Release</value>
- <value key="QtVersionId" type="int">0</value>
- <value key="addQDumper" type=""></value>
- <value key="buildConfiguration" type="int">0</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Debug-buildstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Debug</value>
- <valuelist key="abstractProcess.Environment"
type="QVariantList">
- <value
type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-e8Ai0asIF8,guid=40cd8e30a2205708b63bff1e00011544</value>
- <value type="QString">DESKTOP_SESSION=fluxbox</value>
- <value type="QString">DISPLAY=:0.0</value>
- <value type="QString">GDMSESSION=fluxbox</value>
- <value type="QString">GDM_LANG=fr_FR.UTF-8</value>
- <value type="QString">GDM_XSERVER_LOCATION=local</value>
- <value type="QString">GTK_MODULES=canberra-gtk-module</value>
- <value type="QString">HOME=/lrde/home/stage/froger_a</value>
- <value type="QString">LANG=fr_FR.UTF-8</value>
- <value type="QString">LANGUAGE=</value>
- <value
type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
- <value type="QString">LOGNAME=froger_a</value>
- <value
type="QString">PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/games</value>
- <value
type="QString">PWD=/lrde/home/stage/froger_a/qt/GScribo</value>
- <value type="QString">QTDIR=/usr/share/qt4</value>
- <value type="QString">SHELL=/bin/bash</value>
- <value type="QString">SHLVL=2</value>
- <value type="QString">SSH_AGENT_PID=8827</value>
- <value
type="QString">SSH_AUTH_SOCK=/tmp/ssh-zNmFSg8766/agent.8766</value>
- <value type="QString">TERM=xterm</value>
- <value type="QString">USER=froger_a</value>
- <value type="QString">USERNAME=froger_a</value>
- <value type="QString">WINDOWID=10485784</value>
- <value type="QString">WINDOWPATH=7:8:8</value>
- <value type="QString">XAUTHORITY=/tmp/.gdm1MPCSW</value>
- <value
type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
- <value
type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1360845394.397476-591106291</value>
- <value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
- <value type="QString">XTERM_SHELL=/bin/bash</value>
- <value type="QString">XTERM_VERSION=XTerm(261)</value>
- </valuelist>
- <valuelist key="abstractProcess.arguments"
type="QVariantList">
- <value
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo/GScribo.pro</value>
- <value type="QString">-spec</value>
- <value type="QString">linux-g++</value>
- <value type="QString">-r</value>
- <value type="QString">CONFIG+=debug</value>
- </valuelist>
- <value key="abstractProcess.command"
type="QString">/usr/bin/qmake-qt4</value>
- <value key="abstractProcess.enabled"
type="bool">false</value>
- <value key="abstractProcess.workingDirectory"
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Debug-buildstep1</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Debug</value>
- <valuelist key="abstractProcess.Environment"
type="QVariantList">
- <value
type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-e8Ai0asIF8,guid=40cd8e30a2205708b63bff1e00011544</value>
- <value type="QString">DESKTOP_SESSION=fluxbox</value>
- <value type="QString">DISPLAY=:0.0</value>
- <value type="QString">GDMSESSION=fluxbox</value>
- <value type="QString">GDM_LANG=fr_FR.UTF-8</value>
- <value type="QString">GDM_XSERVER_LOCATION=local</value>
- <value type="QString">GTK_MODULES=canberra-gtk-module</value>
- <value type="QString">HOME=/lrde/home/stage/froger_a</value>
- <value type="QString">LANG=fr_FR.UTF-8</value>
- <value type="QString">LANGUAGE=</value>
- <value
type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
- <value type="QString">LOGNAME=froger_a</value>
- <value
type="QString">PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/games</value>
- <value
type="QString">PWD=/lrde/home/stage/froger_a/qt/GScribo</value>
- <value type="QString">QTDIR=/usr/share/qt4</value>
- <value type="QString">SHELL=/bin/bash</value>
- <value type="QString">SHLVL=2</value>
- <value type="QString">SSH_AGENT_PID=8827</value>
- <value
type="QString">SSH_AUTH_SOCK=/tmp/ssh-zNmFSg8766/agent.8766</value>
- <value type="QString">TERM=xterm</value>
- <value type="QString">USER=froger_a</value>
- <value type="QString">USERNAME=froger_a</value>
- <value type="QString">WINDOWID=10485784</value>
- <value type="QString">WINDOWPATH=7:8:8</value>
- <value type="QString">XAUTHORITY=/tmp/.gdm1MPCSW</value>
- <value
type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
- <value
type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1360845394.397476-591106291</value>
- <value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
- <value type="QString">XTERM_SHELL=/bin/bash</value>
- <value type="QString">XTERM_VERSION=XTerm(261)</value>
- </valuelist>
- <value key="abstractProcess.IgnoreReturnValue"
type="bool">false</value>
- <valuelist key="abstractProcess.arguments"
type="QVariantList">
- <value type="QString">-w</value>
- </valuelist>
- <value key="abstractProcess.command"
type="QString">/usr/bin/make</value>
- <value key="abstractProcess.enabled"
type="bool">true</value>
- <value key="abstractProcess.workingDirectory"
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Debug-cleanstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Debug</value>
- <valuelist key="abstractProcess.Environment"
type="QVariantList">
- <value
type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-e8Ai0asIF8,guid=40cd8e30a2205708b63bff1e00011544</value>
- <value type="QString">DESKTOP_SESSION=fluxbox</value>
- <value type="QString">DISPLAY=:0.0</value>
- <value type="QString">GDMSESSION=fluxbox</value>
- <value type="QString">GDM_LANG=fr_FR.UTF-8</value>
- <value type="QString">GDM_XSERVER_LOCATION=local</value>
- <value type="QString">GTK_MODULES=canberra-gtk-module</value>
- <value type="QString">HOME=/lrde/home/stage/froger_a</value>
- <value type="QString">LANG=fr_FR.UTF-8</value>
- <value type="QString">LANGUAGE=</value>
- <value
type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
- <value type="QString">LOGNAME=froger_a</value>
- <value
type="QString">PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/games</value>
- <value
type="QString">PWD=/lrde/home/stage/froger_a/qt/GScribo</value>
- <value type="QString">QTDIR=/usr/share/qt4</value>
- <value type="QString">SHELL=/bin/bash</value>
- <value type="QString">SHLVL=2</value>
- <value type="QString">SSH_AGENT_PID=8827</value>
- <value
type="QString">SSH_AUTH_SOCK=/tmp/ssh-zNmFSg8766/agent.8766</value>
- <value type="QString">TERM=xterm</value>
- <value type="QString">USER=froger_a</value>
- <value type="QString">USERNAME=froger_a</value>
- <value type="QString">WINDOWID=10485784</value>
- <value type="QString">WINDOWPATH=7:8:8</value>
- <value type="QString">XAUTHORITY=/tmp/.gdm1MPCSW</value>
- <value
type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
- <value
type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1360845394.397476-591106291</value>
- <value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
- <value type="QString">XTERM_SHELL=/bin/bash</value>
- <value type="QString">XTERM_VERSION=XTerm(261)</value>
- </valuelist>
- <value key="abstractProcess.IgnoreReturnValue"
type="bool">true</value>
- <valuelist key="abstractProcess.arguments"
type="QVariantList">
- <value type="QString">clean</value>
- <value type="QString">-w</value>
- </valuelist>
- <value key="abstractProcess.command"
type="QString">/usr/bin/make</value>
- <value key="abstractProcess.enabled"
type="bool">true</value>
- <value key="abstractProcess.workingDirectory"
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo</value>
- <value key="cleanConfig" type="bool">true</value>
- <valuelist key="makeargs" type="QVariantList">
- <value type="QString">clean</value>
- </valuelist>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Release-buildstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Release</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Release-buildstep1</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Release</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Release-cleanstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Release</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfigurations</variable>
- <valuelist type="QVariantList">
- <value type="QString">Debug</value>
- <value type="QString">Release</value>
- </valuelist>
- </data>
- <data>
- <variable>buildstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString"></value>
- <value key="mkspec" type="QString"></value>
- </valuemap>
- </data>
- <data>
- <variable>buildstep1</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString"></value>
- </valuemap>
- </data>
- <data>
- <variable>buildsteps</variable>
- <valuelist type="QVariantList">
- <value type="QString">trolltech.qt4projectmanager.qmake</value>
- <value type="QString">trolltech.qt4projectmanager.make</value>
- </valuelist>
- </data>
- <data>
- <variable>cleanstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString"></value>
- <value key="clean" type="bool">true</value>
- </valuemap>
- </data>
- <data>
- <variable>cleansteps</variable>
- <valuelist type="QVariantList">
- <value type="QString">trolltech.qt4projectmanager.make</value>
- </valuelist>
- </data>
- <data>
- <variable>defaultFileEncoding</variable>
- <value type="QByteArray">System</value>
- </data>
- <data>
- <variable>project</variable>
- <valuemap type="QVariantMap"/>
- </data>
-</qtcreator>
diff --git a/GScribo/PagesWidget/pagesdelegate.cpp
b/GScribo/PagesWidget/pagesdelegate.cpp
deleted file mode 100644
index 19a34c2..0000000
--- a/GScribo/PagesWidget/pagesdelegate.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "pagesdelegate.h"
-
-PagesDelegate::PagesDelegate(QObject *parent) :
- QStyledItemDelegate(parent)
-{
- pen_.setColor(QColor::fromRgb(255, 69, 0, 255));
- pen_.setWidth(2);
-}
-
-void PagesDelegate::paint(QPainter *painter, const QStyleOptionViewItem& option,
const QModelIndex& index) const
-{
- QStyledItemDelegate::paint(painter, option, index);
-
- if(index.row() == index.data(Qt::UserRole+1).toInt())
- {
- painter->setPen(pen_);
- painter->drawRect(option.rect);
- painter->fillRect(option.rect, QColor::fromRgb(255, 69, 0, 60));
- }
-}
diff --git a/GScribo/PagesWidget/pagesdelegate.h b/GScribo/PagesWidget/pagesdelegate.h
deleted file mode 100644
index ff422ca..0000000
--- a/GScribo/PagesWidget/pagesdelegate.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef PAGESDELEGATE_H
-#define PAGESDELEGATE_H
-
-#include <QStyledItemDelegate>
-#include <QPainter>
-
-class PagesDelegate :
- public QStyledItemDelegate
-{
- public:
- explicit PagesDelegate(QObject *parent = 0);
- void paint(QPainter *painter, const QStyleOptionViewItem &option, const
QModelIndex &index) const;
-
- private:
- QPen pen_;
-};
-
-#endif // PAGESDELEGATE_H
diff --git a/GScribo/PagesWidget/pagesmodel.cpp b/GScribo/PagesWidget/pagesmodel.cpp
deleted file mode 100644
index faccb74..0000000
--- a/GScribo/PagesWidget/pagesmodel.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-#include "pagesmodel.h"
-
-PagesModel::PagesModel(QObject *parent):
- QAbstractListModel(parent)
-{
- currentRow_ = 0;
-}
-
-QVariant PagesModel::data(const QModelIndex& index, int role) const
-{
- if(!index.isValid())
- return QVariant();
-
- if(role == Qt::DecorationRole)
- return pixmaps_[index.row()];
-
- if(role == Qt::UserRole)
- return filenames_[index.row()];
-
- if(role == Qt::UserRole+1)
- return currentRow_;
-
- return QVariant();
-}
-
-void PagesModel::addPicture(const QString& filename, const QPixmap& pixmap)
-{
- beginInsertRows(QModelIndex(), 0, 0);
-
- pixmaps_.prepend(pixmap.scaled(QSize(200, 200), Qt::KeepAspectRatio,
Qt::SmoothTransformation));
- filenames_.prepend(filename);
-
- endInsertRows();
-}
-
-void PagesModel::removePixmap(const QModelIndex &parent)
-{
- int row = parent.row();
-
- beginRemoveRows(parent, row, row);
-
- pixmaps_.removeAt(row);
- filenames_.removeAt(row);
-
- endRemoveRows();
-}
-
-void PagesModel::setCurrentRow(int currentRow)
-{
- beginResetModel();
-
- currentRow_ = currentRow;
-
- endResetModel();
-}
diff --git a/GScribo/PagesWidget/pagesmodel.h b/GScribo/PagesWidget/pagesmodel.h
deleted file mode 100644
index 4c18842..0000000
--- a/GScribo/PagesWidget/pagesmodel.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef PAGESMODEL_H
-#define PAGESMODEL_H
-
-#include <QAbstractListModel>
-#include <QIcon>
-#include <QList>
-
-class PagesModel:
- public QAbstractListModel
-{
- Q_OBJECT
-
- public:
- explicit PagesModel(QObject *parent = 0);
-
- inline QStringList filenames() const;
- inline int rowCount(const QModelIndex& parent = QModelIndex()) const;
-
- inline int currentRow() const;
- void setCurrentRow(int currentRow);
-
- QVariant data(const QModelIndex& index, int role = Qt::DecorationRole)
const;
- void addPicture(const QString& filename, const QPixmap& pixmap);
-
- private:
- QStringList filenames_;
- QList<QPixmap> pixmaps_;
- int currentRow_;
-
- public slots:
- void removePixmap(const QModelIndex& parent);
-};
-
-inline QStringList PagesModel::filenames() const
-{ return filenames_; }
-
-inline int PagesModel::rowCount(const QModelIndex&) const
-{ return filenames_.count(); }
-
-inline int PagesModel::currentRow() const
-{ return currentRow_; }
-
-#endif // PAGESMODEL_H
diff --git a/GScribo/PagesWidget/pageswidget.cpp b/GScribo/PagesWidget/pageswidget.cpp
deleted file mode 100644
index 400046a..0000000
--- a/GScribo/PagesWidget/pageswidget.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-#include "pageswidget.h"
-
-PagesWidget::PagesWidget(QWidget *parent):
- QListView(parent)
-{
- setUniformItemSizes(true);
- setSelectionMode(QAbstractItemView::ExtendedSelection);
- setViewMode(QListView::IconMode);
- setIconSize(QSize(200, 200));
- setMovement(QListView::Static);
- setResizeMode(QListView::Adjust);
- setSpacing(10);
-
- setModel(&model_);
- setItemDelegate(new PagesDelegate());
-
- QShortcut *remove = new QShortcut(Qt::Key_Delete, this);
- connect(remove, SIGNAL(activated()), this, SLOT(removeSelection()));
- connect(this, SIGNAL(doubleClicked(QModelIndex)), this,
SLOT(getPicture(QModelIndex)));
-}
-
-void PagesWidget::removeSelection()
-{
- QModelIndexList indexes = selectionModel()->selectedIndexes();
- if(hasFocus() && indexes.count() > 0)
- {
- // Sort the list because after the first removal, the second row index may not be
the good one.
- qSort(indexes.begin(), indexes.end());
-
- // From the highest row to the smallest to be sure to remove the good index.
- for(int i = indexes.count()-1; i > -1; i--)
- model_.removePixmap(indexes[i]);
-
- // Draw new image on the scene.
- getPicture(model_.index(indexes[0].row()));
- clearSelection();
-
- model_.setCurrentRow(indexes[0].row());
- scrollTo(indexes[0]);
- }
-}
-
-void PagesWidget::getPicture(const QModelIndex& index)
-{
- QString filename = index.data(Qt::UserRole).toString();
- model_.setCurrentRow(index.row());
-
- emit imageSelectionned(filename);
-}
diff --git a/GScribo/PagesWidget/pageswidget.h b/GScribo/PagesWidget/pageswidget.h
deleted file mode 100644
index eb6488c..0000000
--- a/GScribo/PagesWidget/pageswidget.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef PAGESWIDGET_H
-#define PAGESWIDGET_H
-
-#include <QListView>
-#include <QShortcut>
-
-#include "pagesdelegate.h"
-#include "pagesmodel.h"
-
-class PagesWidget:
- public QListView
-{
- Q_OBJECT
-
- public:
- explicit PagesWidget(QWidget *parent = 0);
-
- inline QStringList filenames() const;
- inline int currentRow() const;
- inline void setCurrentRow(int currentRow);
-
- inline void addPicture(const QString& filename, const QPixmap& pixmap);
-
- protected:
- inline void focusOutEvent(QFocusEvent *event);
-
- private:
- PagesModel model_;
-
- public slots:
- void removeSelection();
-
- private slots:
- void getPicture(const QModelIndex& index);
-
- signals:
- void imageSelectionned(const QString& filename);
-};
-
-inline QStringList PagesWidget::filenames() const
-{ return model_.filenames(); }
-
-inline int PagesWidget::currentRow() const
-{ return model_.currentRow(); }
-
-inline void PagesWidget::setCurrentRow(int currentRow)
-{ model_.setCurrentRow(currentRow); }
-
-inline void PagesWidget::addPicture(const QString& filename, const QPixmap&
pixmap)
-{ model_.addPicture(filename, pixmap); }
-
-inline void PagesWidget::focusOutEvent(QFocusEvent *event)
-{ QListView::focusOutEvent(event); clearSelection(); }
-
-#endif // PAGESWIDGET_H
diff --git a/GScribo/Preferences/generaloptions.cpp
b/GScribo/Preferences/generaloptions.cpp
deleted file mode 100644
index 620a8fd..0000000
--- a/GScribo/Preferences/generaloptions.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-#include "generaloptions.h"
-#include "ui_generaloptions.h"
-
-GeneralOptions::GeneralOptions(QWidget *parent) :
- OptionWidget(parent),
- ui(new Ui::GeneralOptions)
-{
- ui->setupUi(this);
- loadConfig();
-}
-
-GeneralOptions::~GeneralOptions()
-{
- delete ui;
-}
-
-void GeneralOptions::loadConfig()
-{
- Configs *const conf = Configs::getInstance();
-
- ui->saveXml->setChecked(conf->generalSaveXmlEnabled());
- ui->sameDir->setChecked(conf->generalSaveXmlSameDir());
- ui->customDir->setChecked(conf->generalSaveXmlCustomDir());
- ui->customDirValue->setText(conf->generalSaveXmlCustomDirPath());
-}
-
-
-void GeneralOptions::saveConfig()
-{
- Configs *const conf = Configs::getInstance();
-
- conf->setGeneralSaveXmlEnabled(ui->saveXml->isChecked());
- conf->setGeneralSaveXmlSameDir(ui->sameDir->isChecked());
- conf->setGeneralSaveXmlCustomDir(ui->customDir->isChecked());
- conf->setGeneralSaveXmlCustomDirPath(ui->customDirValue->text());
-}
-
-void GeneralOptions::onCustomDirBrowseBtnClicked()
-{
- QString dir = QFileDialog::getExistingDirectory(0, "Choose a directory");
-
- if (!dir.isEmpty())
- ui->customDirValue->setText(dir);
-}
diff --git a/GScribo/Preferences/generaloptions.h b/GScribo/Preferences/generaloptions.h
deleted file mode 100644
index 0c07129..0000000
--- a/GScribo/Preferences/generaloptions.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef GENERALOPTIONS_H
-#define GENERALOPTIONS_H
-
-#include <QFileDialog>
-
-#include "optionwidget.h"
-#include "configs.h"
-
-namespace Ui
-{
- class GeneralOptions;
-}
-
-class GeneralOptions :
- public OptionWidget
-{
- Q_OBJECT
-
- public:
- explicit GeneralOptions(QWidget *parent = 0);
- ~GeneralOptions();
-
- virtual void loadConfig();
- virtual void saveConfig();
-
- private:
- Ui::GeneralOptions *ui;
-
- private slots:
- void onCustomDirBrowseBtnClicked();
-
-};
-
-#endif // GENERAL_OPTIONS_H
diff --git a/GScribo/Preferences/generaloptions.ui
b/GScribo/Preferences/generaloptions.ui
deleted file mode 100644
index 5839c27..0000000
--- a/GScribo/Preferences/generaloptions.ui
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>GeneralOptions</class>
- <widget class="QWidget" name="GeneralOptions">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>400</width>
- <height>300</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Form</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_3">
- <item>
- <widget class="QGroupBox" name="saveXml">
- <property name="title">
- <string>Save segmentation results</string>
- </property>
- <property name="flat">
- <bool>true</bool>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <widget class="QRadioButton" name="sameDir">
- <property name="text">
- <string>In the same directory as the input image</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QRadioButton" name="customDir">
- <property name="text">
- <string>In the following directory</string>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Maximum</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QLineEdit" name="customDirValue"/>
- </item>
- <item>
- <widget class="QPushButton"
name="customDirBrowseBtn">
- <property name="text">
- <string>Browse</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/GScribo/Preferences/ocroptions.cpp b/GScribo/Preferences/ocroptions.cpp
deleted file mode 100644
index fff05b2..0000000
--- a/GScribo/Preferences/ocroptions.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-#include "ocroptions.h"
-#include "ui_ocroptions.h"
-
-static const char *language[][2] =
-{
- { "English", "eng" },
- { "French", "fra" },
- { 0, 0 }
-};
-
-OcrOptions::OcrOptions(QWidget *parent) :
- OptionWidget(parent),
- ui(new Ui::OcrOptions)
-{
- ui->setupUi(this);
-
- for (unsigned i = 0; language[i][0]; ++i)
- ui->ocr_language->insertItem(i, language[i][0]);
-
- loadConfig();
-}
-
-OcrOptions::~OcrOptions()
-{
- delete ui;
-}
-
-int OcrOptions::findIndex(const QString& lang)
-{
- for (unsigned i = 0; language[i][0]; ++i)
- if (lang == language[i][1])
- return i;
-
- return 0;
-}
-
-
-void OcrOptions::loadConfig()
-{
- Configs *const conf = Configs::getInstance();
-
- ui->enable_ocr->setChecked(conf->ocrEnabled());
- ui->ocr_language->setCurrentIndex(findIndex(conf->ocrLanguage()));
-}
-
-
-void OcrOptions::saveConfig()
-{
- Configs *const conf = Configs::getInstance();
-
- conf->setOcrEnabled(ui->enable_ocr->isChecked());
- conf->setOcrLanguage(language[ui->ocr_language->currentIndex()][1]);
-}
diff --git a/GScribo/Preferences/ocroptions.h b/GScribo/Preferences/ocroptions.h
deleted file mode 100644
index 9ba8d53..0000000
--- a/GScribo/Preferences/ocroptions.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef OCR_OPTIONS_H
-#define OCR_OPTIONS_H
-
-//#include <scribo/toolchain/internal/text_in_doc_preprocess_functor.hh>
-
-#include "optionwidget.h"
-#include "configs.h"
-#include "region.h"
-
-namespace Ui
-{
- class OcrOptions;
-}
-
-class OcrOptions :
- public OptionWidget
-{
- Q_OBJECT
-
- public:
- explicit OcrOptions(QWidget *parent = 0);
- ~OcrOptions();
-
- void loadConfig();
- void saveConfig();
-
- private:
- int findIndex(const QString& lang);
-
- Ui::OcrOptions *ui;
-};
-
-#endif // OCR_OPTIONS_H
diff --git a/GScribo/Preferences/ocroptions.ui b/GScribo/Preferences/ocroptions.ui
deleted file mode 100644
index d001c64..0000000
--- a/GScribo/Preferences/ocroptions.ui
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>OcrOptions</class>
- <widget class="QWidget" name="OcrOptions">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>366</width>
- <height>112</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Form</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QGroupBox" name="enable_ocr">
- <property name="title">
- <string>Enable OCR</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
- </property>
- <property name="flat">
- <bool>true</bool>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="1" column="1">
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Language</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QComboBox" name="ocr_language"/>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/GScribo/Preferences/optionwidget.h b/GScribo/Preferences/optionwidget.h
deleted file mode 100644
index e0979d2..0000000
--- a/GScribo/Preferences/optionwidget.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef OPTIONWIDGET_H
-#define OPTIONWIDGET_H
-
-#include <QWidget>
-
-struct OptionWidget :
- public QWidget
-{
- explicit OptionWidget(QWidget * parent) : QWidget(parent) {}
-
- virtual void loadConfig() {}
- virtual void saveConfig() {}
-};
-
-#endif // OPTIONWIDGET_H
diff --git a/GScribo/Preferences/preferencesdialog.cpp
b/GScribo/Preferences/preferencesdialog.cpp
deleted file mode 100644
index 23a0dd6..0000000
--- a/GScribo/Preferences/preferencesdialog.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-#include "preferencesdialog.h"
-#include "ui_preferencesdialog.h"
-
-PreferencesDialog::PreferencesDialog(QWidget *parent) :
- QDialog(parent, Qt::Dialog),
- ui(new Ui::PreferencesDialog)
-{
- ui->setupUi(this);
-
- // We may want to remove this useless object in the ui file.
- delete ui->widget;
-
- connect(ui->optionList, SIGNAL(currentRowChanged(int)), this,
SLOT(onOptionListCurrentRowChanged(int)));
- setAttribute(Qt::WA_DeleteOnClose);
-
- loadOptionList();
- ui->optionList->setCurrentRow(0);
-}
-
-PreferencesDialog::~PreferencesDialog()
-{
- delete ui;
-}
-
-void PreferencesDialog::loadOptionList()
-{
- static const char *options[] = { "General", "Preprocessing",
"Segmentation", "OCR", 0 };
-
- int i;
- for (i = 0; options[i]; ++i)
- ui->optionList->insertItem(i, options[i]);
-
- widgets.fill(0, i);
-}
-
-void PreferencesDialog::selectOptionWidget(int row)
-{
- if(!widgets[row])
- {
- QWidget *widget = 0;
-
- switch(row)
- {
- case 0:
- widget = new GeneralOptions(this);
- break;
-
- case 1:
- widget = new PreprocessingOptions(this);
- break;
-
- case 2:
- widget = new SegmentationOptions(this);
- break;
-
- case 3:
- widget = new OcrOptions(this);
- break;
- }
-
- if(widget)
- widgets[row] = widget;
- }
-
- if(ui->horizontalLayout_2->count() == 2)
- {
- QWidget *current_widget = ui->horizontalLayout_2->itemAt(1)->widget();
- ui->horizontalLayout_2->removeWidget(current_widget);
- current_widget->hide();
- }
-
- ui->horizontalLayout_2->insertWidget(1, widgets[row]);
- widgets[row]->show();
-}
-
-
-void PreferencesDialog::accept()
-{
- for (int i = 0; i < widgets.size(); ++i)
- {
- if (widgets[i])
- {
- static_cast<OptionWidget *>(widgets[i])->saveConfig();
- delete widgets[i];
- }
- }
-
- QDialog::accept();
-}
-
-
-void PreferencesDialog::reject()
-{
- for (int i = 0; i < widgets.size(); ++i)
- delete widgets[i];
-
- QDialog::reject();
-}
diff --git a/GScribo/Preferences/preferencesdialog.h
b/GScribo/Preferences/preferencesdialog.h
deleted file mode 100644
index b0b9b61..0000000
--- a/GScribo/Preferences/preferencesdialog.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef PREFERENCESDIALOG_H
-#define PREFERENCESDIALOG_H
-
-#include <QDialog>
-
-#include "preprocessingoptions.h"
-#include "segmentationoptions.h"
-#include "generaloptions.h"
-#include "ocroptions.h"
-
-namespace Ui
-{
- class PreferencesDialog;
-}
-
-class PreferencesDialog :
- public QDialog
-{
- Q_OBJECT
-
- public:
- explicit PreferencesDialog(QWidget *parent = 0);
- ~PreferencesDialog();
-
- private:
- void loadOptionList();
- void selectOptionWidget(int row);
-
- Ui::PreferencesDialog *ui;
- QVector<QWidget *> widgets;
-
- private slots:
- inline void onOptionListCurrentRowChanged(int row);
- virtual void accept();
- virtual void reject();
-
-};
-
-inline void PreferencesDialog::onOptionListCurrentRowChanged(int row)
-{ selectOptionWidget(row); }
-
-#endif // PREFERENCESDIALOG_H
diff --git a/GScribo/Preferences/preferencesdialog.ui
b/GScribo/Preferences/preferencesdialog.ui
deleted file mode 100644
index 1d40563..0000000
--- a/GScribo/Preferences/preferencesdialog.ui
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PreferencesDialog</class>
- <widget class="QDialog" name="PreferencesDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>668</width>
- <height>418</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Preferences</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QLabel" name="label">
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext"
content="1" /><style
type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style="
font-family:'DejaVu Sans'; font-size:9pt; font-weight:400;
font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
style=" font-size:12pt;
font-weight:600;">Preferences</span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="QListWidget" name="optionList">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Expanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="maximumSize">
- <size>
- <width>200</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="baseSize">
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QWidget" name="widget"
native="true"/>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>PreferencesDialog</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>248</x>
- <y>254</y>
- </hint>
- <hint type="destinationlabel">
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>PreferencesDialog</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel">
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
diff --git a/GScribo/Preferences/preprocessingoptions.cpp
b/GScribo/Preferences/preprocessingoptions.cpp
deleted file mode 100644
index 6639bae..0000000
--- a/GScribo/Preferences/preprocessingoptions.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-#include "preprocessingoptions.h"
-#include "ui_preprocessingoptions.h"
-
-using namespace scribo::toolchain::internal;
-
-PreprocessingOptions::PreprocessingOptions(QWidget *parent) :
- OptionWidget(parent),
- ui(new Ui::PreprocessingOptions)
-{
- ui->setupUi(this);
-
- ui->bin_algoCbox->insertItem(Convert, "Violent convert");
- ui->bin_algoCbox->insertItem(Sauvola, "Local threshold");
- ui->bin_algoCbox->insertItem(SauvolaMs, "Local threshold
multiscale");
-
- loadConfig();
-}
-
-PreprocessingOptions::~PreprocessingOptions()
-{
- delete ui;
-}
-
-void PreprocessingOptions::loadConfig()
-{
- Configs *const conf = Configs::getInstance();
-
- ui->subsampleCb->setChecked(conf->preprocessingSubsample());
- ui->remove_bgCb->setChecked(conf->preprocessingRemoveBg());
- ui->deskewCb->setChecked(conf->preprocessingDeskew());
- ui->remove_noiseCb->setChecked(conf->preprocessingRemoveNoise());
- ui->bin_algoCbox->setCurrentIndex(conf->preprocessingBinAlgo());
-}
-
-
-void PreprocessingOptions::saveConfig()
-{
- Configs *const conf = Configs::getInstance();
-
- conf->setPreprocessingSubsample(ui->subsampleCb->isChecked());
- conf->setPreprocessingRemoveBg(ui->remove_bgCb->isChecked());
- conf->setPreprocessingDeskew(ui->deskewCb->isChecked());
- conf->setPreprocessingRemoveNoise(ui->remove_noiseCb->isChecked());
- conf->setPreprocessingBinAlgo(ui->bin_algoCbox->currentIndex());
-}
diff --git a/GScribo/Preferences/preprocessingoptions.h
b/GScribo/Preferences/preprocessingoptions.h
deleted file mode 100644
index 6cc0081..0000000
--- a/GScribo/Preferences/preprocessingoptions.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef PREPROCESSINGOPTIONS_H
-#define PREPROCESSINGOPTIONS_H
-
-#include <scribo/toolchain/internal/text_in_doc_preprocess_functor.hh>
-
-#include "optionwidget.h"
-#include "region.h"
-#include "configs.h"
-
-namespace Ui
-{
- class PreprocessingOptions;
-}
-
-class PreprocessingOptions :
- public OptionWidget
-{
- Q_OBJECT
-
- public:
- explicit PreprocessingOptions(QWidget *parent = 0);
- ~PreprocessingOptions();
-
- void loadConfig();
- void saveConfig();
-
- private:
- Ui::PreprocessingOptions *ui;
-
-};
-
-#endif // PREPROCESSINGOPTIONS_H
diff --git a/GScribo/Preferences/preprocessingoptions.ui
b/GScribo/Preferences/preprocessingoptions.ui
deleted file mode 100644
index 962cf49..0000000
--- a/GScribo/Preferences/preprocessingoptions.ui
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PreprocessingOptions</class>
- <widget class="QWidget" name="PreprocessingOptions">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>466</width>
- <height>198</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Configure toolchain</string>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <layout class="QHBoxLayout" name="horizontalLayout_3">
- <item>
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Binarization method:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="bin_algoCbox"/>
- </item>
- </layout>
- </item>
- <item row="1" column="0">
- <widget class="QCheckBox" name="subsampleCb">
- <property name="text">
- <string>Run on subsampled image</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QCheckBox" name="remove_bgCb">
- <property name="text">
- <string>Remove background (slow)</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QCheckBox" name="deskewCb">
- <property name="text">
- <string>Deskew</string>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QCheckBox" name="remove_noiseCb">
- <property name="text">
- <string>Remove noise</string>
- </property>
- </widget>
- </item>
- <item row="5" column="0">
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>48</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/GScribo/Preferences/segmentationoptions.cpp
b/GScribo/Preferences/segmentationoptions.cpp
deleted file mode 100644
index d35209f..0000000
--- a/GScribo/Preferences/segmentationoptions.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-#include "segmentationoptions.h"
-#include "ui_segmentationoptions.h"
-
-SegmentationOptions::SegmentationOptions(QWidget *parent) :
- OptionWidget(parent),
- ui(new Ui::SegmentationOptions)
-{
- ui->setupUi(this);
-
- ui->find_sepsCbox->insertItem(Separator::Lines, "Lines");
- ui->find_sepsCbox->insertItem(Separator::Whitespaces,
"Whitespaces");
- ui->find_sepsCbox->insertItem(Separator::Both, "Lines and
whitespaces");
-
- loadConfig();
-}
-
-SegmentationOptions::~SegmentationOptions()
-{
- delete ui;
-}
-
-void SegmentationOptions::loadConfig()
-{
- Configs *const conf = Configs::getInstance();
- ui->find_sepsCbox->setCurrentIndex(conf->segmentationFindSeps());
-}
-
-
-void SegmentationOptions::saveConfig()
-{
- Configs *const conf = Configs::getInstance();
- conf->setSegmentationFindSeps(ui->find_sepsCbox->currentIndex());
-}
diff --git a/GScribo/Preferences/segmentationoptions.h
b/GScribo/Preferences/segmentationoptions.h
deleted file mode 100644
index 1506bfa..0000000
--- a/GScribo/Preferences/segmentationoptions.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef SEGMENTATIONOPTIONS_H
-#define SEGMENTATIONOPTIONS_H
-
-//#include <scribo/toolchain/internal/text_in_doc_preprocess_functor.hh>
-
-#include "optionwidget.h"
-#include "configs.h"
-#include "region.h"
-
-namespace Ui
-{
- class SegmentationOptions;
-}
-
-class SegmentationOptions :
- public OptionWidget
-{
- Q_OBJECT
-
- public:
- explicit SegmentationOptions(QWidget *parent = 0);
- ~SegmentationOptions();
-
- void loadConfig();
- void saveConfig();
-
- private:
- Ui::SegmentationOptions *ui;
-};
-
-#endif // SEGMENTATIONOPTIONS_H
diff --git a/GScribo/Preferences/segmentationoptions.ui
b/GScribo/Preferences/segmentationoptions.ui
deleted file mode 100644
index 485e448..0000000
--- a/GScribo/Preferences/segmentationoptions.ui
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>SegmentationOptions</class>
- <widget class="QWidget" name="SegmentationOptions">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>400</width>
- <height>300</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Form</string>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Find separators</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="find_sepsCbox">
- <property name="editable">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="0">
- <spacer name="verticalSpacer_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>258</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/GScribo/Processing/preprocess.cpp b/GScribo/Processing/preprocess.cpp
deleted file mode 100644
index f012d88..0000000
--- a/GScribo/Processing/preprocess.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "preprocess.h"
-
-void Preprocess::on_progress()
-{
- emit progress();
-}
-
-void Preprocess::on_new_progress_label(const char *label)
-{
- emit newProgressLabel(QString(label));
-}
diff --git a/GScribo/Processing/preprocess.h b/GScribo/Processing/preprocess.h
deleted file mode 100644
index d65357f..0000000
--- a/GScribo/Processing/preprocess.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef PREPROCESS_H
-#define PREPROCESS_H
-
-#include <scribo/toolchain/internal/text_in_doc_preprocess_functor.hh>
-#include <mln/core/image/image2d.hh>
-#include <mln/value/rgb8.hh>
-#include <QObject>
-
-using namespace scribo::toolchain::internal;
-
-class Preprocess :
- public QObject,
- public text_in_doc_preprocess_functor<mln::image2d<mln::value::rgb8>
>
-{
- Q_OBJECT
-
- public:
- virtual void on_progress();
- virtual void on_new_progress_label(const char *label);
-
- signals:
- void newProgressLabel(const QString& label);
- void progress();
-};
-
-#endif // PREPROCESS_H
diff --git a/GScribo/Processing/process.cpp b/GScribo/Processing/process.cpp
deleted file mode 100644
index bd37480..0000000
--- a/GScribo/Processing/process.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "process.h"
-
-Process::Process(const char *doc_filename)
- : superT(doc_filename)
-{
-}
-
-void Process::on_progress()
-{
- emit progress();
-}
-
-void Process::on_new_progress_label(const char *label)
-{
- emit newProgressLabel(QString(label));
-}
-
-void Process::on_xml_saved()
-{
- emit xmlSaved(QString(output_file.c_str()));
-}
diff --git a/GScribo/Processing/process.h b/GScribo/Processing/process.h
deleted file mode 100644
index 579a988..0000000
--- a/GScribo/Processing/process.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef PROCESS_H
-#define PROCESS_H
-
-#include <scribo/toolchain/internal/content_in_doc_functor.hh>
-#include <mln/core/image/image2d.hh>
-#include <QObject>
-
-using namespace scribo::toolchain::internal;
-
-struct Process :
- public QObject,
- public content_in_doc_functor<mln::image2d<bool> >
-{
- Q_OBJECT
- typedef content_in_doc_functor<mln::image2d<bool> > superT;
-
- public :
- explicit Process(const char *docFilename);
- virtual void on_progress();
- virtual void on_new_progress_label(const char *label);
- virtual void on_xml_saved();
-
- signals:
- void newProgressLabel(const QString& label);
- void progress();
- void xmlSaved(const QString& filename);
-};
-
-#endif // PROCESS_H
diff --git a/GScribo/Processing/progressdialog.cpp
b/GScribo/Processing/progressdialog.cpp
deleted file mode 100644
index 7f9d833..0000000
--- a/GScribo/Processing/progressdialog.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "progressdialog.h"
-
-ProgressDialog::ProgressDialog(QWidget *parent):
- QProgressDialog(parent, Qt::Dialog)
-{
- setAutoClose(false);
- setCancelButton(0);
- hide();
-}
-
-void ProgressDialog::reset()
-{
- setValue(0);
- setLabelText("Initilization");
- show();
-}
diff --git a/GScribo/Processing/progressdialog.h b/GScribo/Processing/progressdialog.h
deleted file mode 100644
index 822d9ba..0000000
--- a/GScribo/Processing/progressdialog.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef PROGRESSDIALOG_H
-#define PROGRESSDIALOG_H
-
-#include <QProgressDialog>
-
-class ProgressDialog :
- public QProgressDialog
-{
- Q_OBJECT
-
- public:
- explicit ProgressDialog(QWidget *parent = 0);
- void reset();
-
- public slots:
- inline void run();
-};
-
-void ProgressDialog::run()
-{ setValue(value()+1); }
-
-#endif // PROGRESSDIALOG_H
diff --git a/GScribo/Processing/runner.cpp b/GScribo/Processing/runner.cpp
deleted file mode 100644
index c02223c..0000000
--- a/GScribo/Processing/runner.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-#include "runner.h"
-
-using namespace mln;
-using namespace scribo::toolchain::internal;
-
-static QString get_pathto(const QString& file, const QString localdirsuffix =
QString())
-{
- QFile f(SCRIBO_LOCAL_DEMODIR "/" + localdirsuffix + "/" + file);
- if (f.exists())
- return SCRIBO_LOCAL_DEMODIR "/" + localdirsuffix;
- f.setFileName(SCRIBO_PREFIX_BINDIR "/" + file);
- if (f.exists())
- return SCRIBO_PREFIX_BINDIR;
-
- return "";
-}
-
-Runner::Runner(QObject *parent) :
- QThread(parent)
-{
- moveToThread(this);
-}
-
-void Runner::run()
-{
- if(mode_ == Demat)
- {
- image2d<value::rgb8> ima;
- for(int i = 0; i < args_.count(); i++)
- {
- io::magick::load(ima, args_.at(i).toUtf8().constData());
- image2d<bool> bin_ima = preprocess(ima);
- process(ima, bin_ima, i);
- }
- }
-
- else if(mode_ == Export)
- export_as();
-
- emit finished();
-}
-
-void Runner::stop()
-{
- terminate();
-}
-
-// Demat related stuff
-void Runner::start_demat(const QStringList& filenames)
-{
- args_.clear();
- args_ = filenames;
- mode_ = Demat;
- QThread::start();
-}
-
-
-image2d<bool> Runner::preprocess(const image2d<value::rgb8>& ima)
-{
- emit new_step("Preprocessing");
- Preprocess f;
-
- // Load config.
- Configs *const conf = Configs::getInstance();
-
- connect(&f, SIGNAL(progress()), this, SIGNAL(progress()));
- connect(&f, SIGNAL(newProgressLabel(QString)),
- this, SIGNAL(new_progress_label(const QString&)));
-
- f.enable_subsample = conf->preprocessingSubsample();
- f.enable_fg_extraction = conf->preprocessingRemoveBg();
- f.enable_deskew = conf->preprocessingDeskew();
- f.enable_denoising = conf->preprocessingRemoveNoise();
-
- f.binarization_algo =
static_cast<Binarization_Algo>(conf->preprocessingBinAlgo());
-
- emit new_progress_max_value(f.nsteps());
-
- // Perform preprocessing.
- f(ima);
-
- return f.output;
-}
-
-
-void Runner::process(const image2d<value::rgb8>& original_ima,
- const image2d<bool>& processed_ima, int arg)
-{
- emit new_step("Page segmentation");
-
- Process f(args_.at(arg).toUtf8().constData());
-
- connect(&f, SIGNAL(progress()), this, SIGNAL(progress()));
- connect(&f, SIGNAL(newProgressLabel(QString)),
- this, SIGNAL(new_progress_label(QString)));
- connect(&f, SIGNAL(xmlSaved(QString)),
- this, SIGNAL(xml_saved(const QString&)));
-
- // Load config.
- Configs *const conf = Configs::getInstance();
-
- Separator::FindSeparator find_seps =
static_cast<Separator::FindSeparator>(conf->segmentationFindSeps());
- f.enable_line_seps = (find_seps == Separator::Lines
- || find_seps == Separator::Both);
- f.enable_whitespace_seps = (find_seps == Separator::Whitespaces
- || find_seps == Separator::Both);
- f.enable_ocr = conf->ocrEnabled();
- f.ocr_language = conf->ocrLanguage().toAscii().data();
- f.xml_format = scribo::io::xml::PageExtended;
-
-
- f.save_doc_as_xml = true;
- QFileInfo file(args_.at(arg));
- QString output_dir = QDir::tempPath();
- if (conf->generalSaveXmlEnabled())
- {
- if (conf->generalSaveXmlSameDir())
- output_dir = file.absolutePath();
- else if (conf->generalSaveXmlCustomDir())
- output_dir = conf->generalSaveXmlCustomDirPath();
-
- QDir dir(output_dir);
- if (!dir.exists() && !dir.mkpath(output_dir))
- output_dir = QDir::tempPath();
- }
- QString filename = (output_dir + "/" + file.baseName() +
"_gui.xml");
- f.output_file = filename.toUtf8().constData();
- emit new_progress_max_value(f.nsteps());
-
- // Perform text detection.
- f(original_ima, processed_ima);
-}
-
-// Export related stuff
-void Runner::start_export(const QString& imgfile,
- const QString& xmlfile, const QString& outfile)
-{
- args_.clear();
- args_ << imgfile << xmlfile << outfile;
- mode_ = Export;
-
- QThread::start();
-}
-
-void Runner::export_as()
-{
- emit new_step("Exporting document");
- emit new_progress_max_value(2);
-
- // Checking output format
- QFileInfo f(args_.at(2));
-
- QString pathto_xml2doc = get_pathto("scribo-xml2doc",
"xml2doc");
-
- if (pathto_xml2doc.isEmpty())
- {
- QMessageBox::critical(0, "Fatal error", "Cannot export! Cannot
find scribo-xml2doc program!");
- return;
- }
-
- emit progress();
-
- int rvalue = 0;
- if (f.suffix() == "pdf")
- {
- emit new_step("Exporting as PDF");
- rvalue = system(QString("%1/scribo-xml2doc --pdf %2 %3 %4")
- .arg(pathto_xml2doc).arg(args_.at(1)).arg(args_.at(0))
- .arg(args_.at(2)).toAscii().constData());
- }
- else if (f.suffix() == "html" || f.suffix() == "htm")
- {
- emit new_step("Exporting as HTML");
- rvalue = system(QString("%1/scribo-xml2doc --html %2 %3 %4")
- .arg(pathto_xml2doc).arg(args_.at(1)).arg(args_.at(0))
- .arg(args_.at(2)).toAscii().constData());
- }
- else
- QMessageBox::critical(0, "Fatal error", "Cannot export! Invalid
output format!");
-
- if (rvalue != 0)
- QMessageBox::critical(0, "Fatal error", "Cannot export! Return
value is not 0!");
-}
diff --git a/GScribo/Processing/runner.h b/GScribo/Processing/runner.h
deleted file mode 100644
index 721086a..0000000
--- a/GScribo/Processing/runner.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef RUNNER_H
-#define RUNNER_H
-
-#include <mln/core/image/image2d.hh>
-#include <mln/io/magick/load.hh>
-#include <mln/value/rgb8.hh>
-#include <QStringList>
-#include <QMessageBox>
-#include <QThread>
-#include <QFile>
-
-#include "preprocess.h"
-#include "process.h"
-#include "configs.h"
-#include "region.h"
-#include "dir.h"
-
-using namespace mln;
-
-enum RunMode
-{
- Demat,
- Export
-};
-
-class Runner :
- public QThread
-{
- Q_OBJECT
-
- public:
- explicit Runner(QObject *parent = 0);
- void start_demat(const QStringList& filenames);
- void start_export(const QString& imgfile, const QString& xmlfile, const
QString& outfile);
-
- private:
- image2d<bool> preprocess(const image2d<value::rgb8>& ima);
- void process(const image2d<value::rgb8>& original_ima, const
image2d<bool>& processed_ima, int arg);
- void export_as();
- virtual void run();
- template <typename V> unsigned find_best_scale(const
mln::image2d<V>& ima);
-
- QStringList args_;
- RunMode mode_;
-
- public slots:
- void stop();
-
- signals:
- void new_step(const QString& step_name);
- void new_progress_max_value(int i);
- void new_progress_label(const QString& msg);
- void xml_saved(const QString& filename);
- void progress();
- void finished();
-};
-
-#endif // RUNNER_H
diff --git a/GScribo/Rendering/abstractregionitem.h
b/GScribo/Rendering/abstractregionitem.h
deleted file mode 100644
index 02b889b..0000000
--- a/GScribo/Rendering/abstractregionitem.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef ABSTRACTREGIONITEM_H
-#define ABSTRACTREGIONITEM_H
-
-#include <QGraphicsItem>
-
-class AbstractRegionItem :
- public QGraphicsItem
-{
- public:
- explicit AbstractRegionItem(QGraphicsItem *parent = 0, QGraphicsScene *scene =
0);
-};
-
-#endif // ABSTRACTREGIONITEM_H
diff --git a/GScribo/Rendering/backgroundtexture.h
b/GScribo/Rendering/backgroundtexture.h
deleted file mode 100644
index 22c8d0c..0000000
--- a/GScribo/Rendering/backgroundtexture.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef BACKGROUNDTEXTURE_H
-#define BACKGROUNDTEXTURE_H
-
-#include <QPixmap>
-
-class BackgroundTexture : public QPixmap
-{
- public:
- explicit BackgroundTexture(const QPixmap& );
-};
-
-#endif // BACKGROUNDTEXTURE_H
diff --git a/GScribo/Rendering/graphicsview.cpp b/GScribo/Rendering/graphicsview.cpp
deleted file mode 100644
index 336d5c2..0000000
--- a/GScribo/Rendering/graphicsview.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-#include "graphicsview.h"
-#include <QDebug>
-
-GraphicsView::GraphicsView(QWidget *parent) :
- QGraphicsView(parent)
-{
- init();
-}
-
-GraphicsView::GraphicsView(QGraphicsScene *scene, QWidget *parent) :
- QGraphicsView(scene, parent)
-{
- init();
-}
-
-void GraphicsView::init()
-{
- isRightClicking_ = false;
- scaleRatio_ = QSizeF(1, 1);
- setTransformationAnchor(GraphicsView::AnchorUnderMouse);
- setBackgroundBrush(QBrush(Qt::lightGray));
-
- // Important to hide scroll bars : when they appear, it triggers the resizeEvent.
- setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-}
-
-void GraphicsView::mousePressEvent(QMouseEvent *event)
-{
- if(event->button() == Qt::RightButton)
- {
- emit beginDrag();
- setDragMode(QGraphicsView::ScrollHandDrag);
- }
-
- QMouseEvent *mouseEvent = new QMouseEvent(QEvent::MouseButtonPress, event->pos(),
Qt::LeftButton,
- Qt::LeftButton, Qt::MetaModifier);
- event->ignore();
- QGraphicsView::mousePressEvent(mouseEvent);
-}
-
-void GraphicsView::mouseReleaseEvent(QMouseEvent *event)
-{
- if(event->button() == Qt::RightButton)
- {
- setDragMode(GraphicsView::NoDrag);
- emit endDrag();
- }
-
- QGraphicsView::mouseReleaseEvent(event);
-}
-
-void GraphicsView::wheelEvent(QWheelEvent *event)
-{
- if(event->modifiers() & Qt::ControlModifier)
- {
- // Current wheel have an angle of 15 degrees by steps with a delta of + or - 120.
A good scale is +- 0.1 in that case.
- // So we have to adapt for wheel whith better precision.
- qreal degrees = 1 + static_cast<qreal>(event->delta()) / 1200;
- qreal nextScaleRatio = degrees * isWidthGreater_ ? scaleRatio_.width() :
- scaleRatio_.height();
- if(event->delta() > 0)
- {
- if(nextScaleRatio <= 20)
- {
- scaleRatio_ *= degrees;
- scale(degrees, degrees);
- }
- }
- else
- {
- if(nextScaleRatio >= 1.1)
- {
- scaleRatio_ *= degrees;
- scale(degrees, degrees);
- }
- else if(isContainedInView_)
- {
- QGraphicsView::fitInView(scene()->sceneRect(), Qt::KeepAspectRatio);
- scaleRatio_ = QSizeF(1, 1);
- }
- }
- }
- else
- QGraphicsView::wheelEvent(event);
-}
-
-void GraphicsView::keyPressEvent(QKeyEvent* event)
-{
- // Bitwise AND to check if at least CTRL is pushed.
- if(event->modifiers() & Qt::ControlModifier)
- {
- qreal nextScaleRatio;
- if(event->key() == Qt::Key_Plus)
- {
- nextScaleRatio = 1.2 * isWidthGreater_ ? scaleRatio_.width() :
- scaleRatio_.height();
- if(nextScaleRatio <= 19)
- {
- scaleRatio_ *= 1.2;
- scale(1.2, 1.2);
- }
- }
- else if(event->key() == Qt::Key_Minus)
- {
- nextScaleRatio = 0.8 * isWidthGreater_ ? scaleRatio_.width() :
- scaleRatio_.height();
- if(nextScaleRatio >= 1.2)
- {
- scaleRatio_ *= 0.8;
- scale(0.8, 0.8);
- }
- else if(isContainedInView_)
- {
- QGraphicsView::fitInView(scene()->sceneRect(), Qt::KeepAspectRatio);
- scaleRatio_ = QSizeF(1, 1);
- }
- }
- }
-
- QGraphicsView::keyPressEvent(event);
-}
-
-void GraphicsView::fitInView(const QRectF& rect)
-{
- setFocus();
- isWidthGreater_ = static_cast<qreal>(rect.width()) /
static_cast<qreal>(rect.height()) > 1 ? true :
-
false;
- qreal ratio = isWidthGreater_ ? static_cast<qreal>(width()) /
static_cast<qreal>(rect.width()) :
- static_cast<qreal>(height()) /
static_cast<qreal>(rect.height());
-
- isContainedInView_ = ratio < 1 ? true : false;
- if(isContainedInView_)
- {
- scaleRatio_ = QSizeF(1, 1);
- QGraphicsView::fitInView(rect, Qt::KeepAspectRatio);
- }
-}
-
-void GraphicsView::resizeEvent(QResizeEvent *event)
-{
- if(scene()->items().count() > 1)
- {
- qreal ratio = isWidthGreater_ ?
static_cast<qreal>(event->size().width()) /
static_cast<qreal>(event->oldSize().width()) :
-
static_cast<qreal>(event->size().height()) /
static_cast<qreal>(event->oldSize().height());
- scale(ratio, ratio);
- }
-
- QGraphicsView::resizeEvent(event);
-}
diff --git a/GScribo/Rendering/graphicsview.h b/GScribo/Rendering/graphicsview.h
deleted file mode 100644
index 285f4cd..0000000
--- a/GScribo/Rendering/graphicsview.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef GRAPHICSVIEW_H
-#define GRAPHICSVIEW_H
-
-#include <QGraphicsView>
-#include <QWheelEvent>
-#include <QScrollBar>
-
-class GraphicsView :
- public QGraphicsView
-{
- Q_OBJECT
-
- public:
- explicit GraphicsView(QWidget *parent = 0);
- explicit GraphicsView(QGraphicsScene *scene, QWidget *parent = 0);
-
- protected:
- void init();
-
- void resizeEvent(QResizeEvent *event);
-
- void wheelEvent(QWheelEvent *event);
- void keyPressEvent(QKeyEvent *event);
- void mousePressEvent(QMouseEvent *event);
- void mouseReleaseEvent(QMouseEvent *event);
-
- private:
- bool isWidthGreater_;
- bool isContainedInView_;
- QSizeF scaleRatio_;
-
- bool isRightClicking_;
- QPointF prevMousePos_;
-
- public slots:
- void fitInView(const QRectF& rect);
-
- signals:
- void beginDrag();
- void endDrag();
-};
-
-#endif // GRAPHICSVIEW_H
diff --git a/GScribo/Rendering/regionitem.cpp b/GScribo/Rendering/regionitem.cpp
deleted file mode 100644
index 77cbcb3..0000000
--- a/GScribo/Rendering/regionitem.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-#include "regionitem.h"
-
-RegionItem::RegionItem(QGraphicsItem *parent, QGraphicsScene *scene)
- : QGraphicsPolygonItem(parent, scene)
-{
- init();
-}
-
-RegionItem::RegionItem(const QPolygonF& polygon, QGraphicsItem *parent,
QGraphicsScene *scene):
- QGraphicsPolygonItem(polygon, parent, scene)
-{
- init();
-}
-
-void RegionItem::init()
-{
- xmlItem_ = 0;
-
- selectedPen_.setStyle(Qt::SolidLine);
- unselectedPen_.setStyle(Qt::SolidLine);
-
- selectedPen_.setWidthF(2);
- unselectedPen_.setWidth(0);
-
- selectedPen_.setCapStyle(Qt::SquareCap);
- unselectedPen_.setCapStyle(Qt::SquareCap);
-
- selectedBrush_.setStyle(Qt::SolidPattern);
- unselectedBrush_.setStyle(Qt::SolidPattern);
-}
-
-void RegionItem::setColor(const QColor& color)
-{
- selectedPen_.setColor(QColor::fromRgb(color.red(), color.green(), color.blue(),
255));
- unselectedPen_.setColor(color);
-
- selectedBrush_.setColor(color);
- unselectedBrush_.setColor(QColor::fromRgb(color.red(), color.green(), color.blue(),
40));
-
- setPen(unselectedPen_);
- setBrush(unselectedBrush_);
-}
-
-void RegionItem::setSelected(bool isSelected)
-{
- if(isSelected)
- {
- isSelected_ = true;
- setPen(selectedPen_);
- setBrush(selectedBrush_);
- }
-
- else
- {
- isSelected_ = false;
- setPen(unselectedPen_);
- setBrush(unselectedBrush_);
- }
-}
diff --git a/GScribo/Rendering/regionitem.h b/GScribo/Rendering/regionitem.h
deleted file mode 100644
index 3e8eb11..0000000
--- a/GScribo/Rendering/regionitem.h
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef RegionITEM_H
-#define RegionITEM_H
-
-#include <QGraphicsPolygonItem>
-#include <QTreeWidgetItem>
-#include <QPen>
-
-#include "variantpointer.h"
-#include "region.h"
-
-class XmlItem;
-
-class RegionItem :
- public QGraphicsPolygonItem
-{
- public:
- explicit RegionItem(QGraphicsItem *parent = 0, QGraphicsScene *scene = 0);
- explicit RegionItem(const QPolygonF& path, QGraphicsItem *parent = 0,
QGraphicsScene *scene = 0);
-
- void setColor(const QColor& color);
- inline QColor color() const;
-
- inline void setXmlItem(XmlItem *xmlItem);
- inline XmlItem *xmlItem() const;
-
- inline void loadData(const GraphicsRegion::Data& data);
- inline int region() const;
-
- inline bool intersects(const QRectF& rect);
- inline bool contains(const QPointF& point);
-
- void setSelected(bool isSelected);
- inline bool isSelected();
- inline void unselect();
- inline void select();
-
- private:
- void init();
-
- XmlItem *xmlItem_;
- int region_;
- bool isSelected_;
-
- QPen selectedPen_;
- QPen unselectedPen_;
- QBrush selectedBrush_;
- QBrush unselectedBrush_;
-};
-
-inline void RegionItem::setXmlItem(XmlItem *xmlItem)
-{ xmlItem_ = xmlItem; }
-
-inline XmlItem *RegionItem::xmlItem() const
-{ return xmlItem_; }
-
-inline QColor RegionItem::color() const
-{ return selectedBrush_.color(); }
-
-inline int RegionItem::region() const
-{ return region_; }
-
-inline bool RegionItem::isSelected()
-{ return isSelected_; }
-
-inline void RegionItem::select()
-{ setSelected(true); }
-
-inline void RegionItem::unselect()
-{ setSelected(false); }
-
-inline void RegionItem::loadData(const GraphicsRegion::Data& data)
-{ region_ = data.region; setColor(data.color); setZValue(data.zValue); }
-
-inline bool RegionItem::contains(const QPointF& point)
-{ return (boundingRect().width() * boundingRect().height() == 0 ||
boundingRect().contains(point)) && shape().contains(point); }
-
-inline bool RegionItem::intersects(const QRectF& rect)
-{ return (boundingRect().width() * boundingRect().height() == 0 ||
boundingRect().intersects(rect)) && shape().intersects(rect); }
-
-#endif // RegionITEM_H
diff --git a/GScribo/Rendering/rootgraphicsitem.h b/GScribo/Rendering/rootgraphicsitem.h
deleted file mode 100644
index 2e95297..0000000
--- a/GScribo/Rendering/rootgraphicsitem.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef ROOTGRAPHICSITEM_H
-#define ROOTGRAPHICSITEM_H
-
-#include <QGraphicsItem>
-
-#include "region.h"
-
-class RootGraphicsItem :
- public QGraphicsPolygonItem
-{
- public:
- explicit RootGraphicsItem(int numberRegion)
- { childsFromRegion_.fill(QList<QGraphicsItem *>(), numberRegion); }
- ~RootGraphicsItem()
- { foreach(QList<QGraphicsItem *> list, childsFromRegion_) {
foreach(QGraphicsItem *child, list) delete child; } }
-
- inline void addItemFrom(QGraphicsItem *graphicalItem, const
GraphicsRegion::Id& region);
- inline QList<QGraphicsItem *> childsFrom(const GraphicsRegion::Id&
region) const;
-
- private:
- QVector<QList<QGraphicsItem *> > childsFromRegion_;
-};
-
-inline QList<QGraphicsItem *> RootGraphicsItem::childsFrom(const
GraphicsRegion::Id& region) const
-{ return childsFromRegion_[region]; }
-
-inline void RootGraphicsItem::addItemFrom(QGraphicsItem *graphicalItem, const
GraphicsRegion::Id& region)
-{ childsFromRegion_[region] << graphicalItem; }
-
-#endif // ROOTGRAPHICSITEM_H
diff --git a/GScribo/Rendering/scene.cpp b/GScribo/Rendering/scene.cpp
deleted file mode 100644
index 903bb97..0000000
--- a/GScribo/Rendering/scene.cpp
+++ /dev/null
@@ -1,273 +0,0 @@
-#include "scene.h"
-
-Scene::Scene(QObject *parent):
- QGraphicsScene(parent)
-{
- init();
-}
-
-Scene::Scene(const QRectF &sceneRect, QObject *parent):
- QGraphicsScene(sceneRect, parent)
-{
- init();
-}
-
-Scene::Scene(qreal x, qreal y, qreal width, qreal height, QObject *parent):
- QGraphicsScene(x, y, width, height, parent)
-{
- init();
-}
-
-void Scene::init()
-{
- isPressing_ = false;
- isSelectionDisabled_ = false;
- backgroundPixmap_ = 0;
- root_ = 0;
-
- selection_.hide();
- addItem(&selection_);
-}
-
-void Scene::clearAll()
-{
- if(root_)
- delete root_;
-
- if(backgroundPixmap_)
- delete backgroundPixmap_;
-
- selectedRegions_.clear();
- backgroundPath_ = QString();
- backgroundPixmap_ = 0;
- root_ = 0;
-}
-
-void Scene::clearRegions()
-{
- if(root_)
- delete root_;
-
- selectedRegions_.clear();
- root_ = 0;
-}
-
-void Scene::clearSelection()
-{
- QGraphicsItem *child;
- RegionItem *regionItem;
-
- // Unselect all items.
- foreach(child, selectedRegions_)
- {
- regionItem = static_cast<RegionItem *>(child);
- regionItem->unselect();
- }
-
- selectedRegions_.clear();
- emit selectionCleared();
-}
-
-void Scene::selectAll()
-{
- RegionItem *item;
- foreach(QGraphicsItem *child, root_->childItems())
- {
- item = static_cast<RegionItem *>(child);
- item->select();
- selectedRegions_ << item;
- }
-}
-
-void Scene::mousePressEvent(QGraphicsSceneMouseEvent *event)
-{
- if(!backgroundPath_.isEmpty() && event->button() == Qt::LeftButton
&& !isSelectionDisabled_)
- {
- isPressing_ = true;
-
- baseSelection_.clear();
- pressPos_ = event->scenePos();
- selection_.show();
- }
-}
-
-void Scene::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
-{
- if(isPressing_)
- {
- // Adapt if the selection rectangle has a negative size.
- if(pressPos_.x() < event->scenePos().x())
- selection_.setRect(pressPos_.x(), 0, event->scenePos().x()-pressPos_.x(),
0);
- else
- selection_.setRect(event->scenePos().x(), 0,
pressPos_.x()-event->scenePos().x(), 0);
-
- if(pressPos_.y() < event->scenePos().y())
- selection_.setRect(selection_.rect().x(), pressPos_.y(),
selection_.rect().width(), event->scenePos().y()-pressPos_.y());
- else
- selection_.setRect(selection_.rect().x(), event->scenePos().y(),
selection_.rect().width(), pressPos_.y()-event->scenePos().y());
- }
-}
-
-void Scene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
- if(event->button() == Qt::LeftButton)
- {
- isPressing_ = false;
-
- // Redraw all items in selection.
- if(root_)
- {
- clearSelection();
-
- // Check if it is a click.
- if(selection_.rect().width() * selection_.rect().height() == 0)
- select(event->scenePos());
- else
- select(selection_.rect());
-
- baseSelection_ = selectedRegions();
- emit newSelection(selectedRegions_);
- }
-
- selection_.setRect(QRect());
- selection_.hide();
- }
-}
-
-void Scene::select(QGraphicsItem *root, const QPointF& point, const QRectF&
rect)
-{
- QGraphicsItem *child;
- RegionItem *regionItem;
-
- // Check if it is a click.
- if(!point.isNull())
- {
- foreach(child, root->childItems())
- {
- regionItem = static_cast<RegionItem *>(child);
-
- if(regionItem->contains(point))
- {
- regionItem->select();
- selectedRegions_ << regionItem;
- }
- }
- }
- else
- {
- foreach(child, root->childItems())
- {
- regionItem = static_cast<RegionItem *>(child);
-
- if(regionItem->intersects(rect))
- {
- regionItem->select();
- selectedRegions_ << regionItem;
- }
- }
- }
-
- emit newSelection();
-}
-
-void Scene::select(const QList<RegionItem *>& selectedRegions)
-{
- RegionItem *child;
- foreach(child, selectedRegions)
- {
- if(!child->isSelected())
- {
- child->select();
- selectedRegions_ << child;
- }
- }
-
- ensureVisible(selectedRegions_.last());
- emit newSelection();
-}
-
-void Scene::unselect(const QList<RegionItem *>& unselectedRegions)
-{
- RegionItem *child;
- foreach(child, unselectedRegions)
- {
- if(child->isSelected())
- {
- child->unselect();
- selectedRegions_.removeOne(child);
- }
- }
-
- // Check if after the removal, the selected list isn't empty.
- if(!selectedRegions_.isEmpty())
- ensureVisible(selectedRegions_.last());
-
- emit newSelection();
-}
-
-
-void Scene::ensureVisible(QGraphicsItem *graphicalItem)
-{
- QGraphicsView *view;
- foreach (view, views())
- view->ensureVisible(graphicalItem);
-}
-
-void Scene::setVisible(const GraphicsRegion::Id& region, bool visible)
-{
- if(root_)
- {
- QGraphicsItem *child;
-
- if(visible)
- {
- foreach(child, root_->childsFrom(region))
- child->setVisible(true);
- }
-
- else
- {
- foreach(child, root_->childsFrom(region))
- child->setVisible(false);
- }
- }
-}
-
-void Scene::setRoot(RootGraphicsItem *root)
-{
- // Delete all items.
- clearRegions();
-
- root_ = root;
- addItem(root);
-
- // Add typo lines separately because can't be selected.
- QGraphicsItem *line;
- foreach(line, root->childsFrom(GraphicsRegion::Baseline))
- addItem(line);
-
- foreach(line, root->childsFrom(GraphicsRegion::Meanline))
- addItem(line);
-}
-
-void Scene::changeScene(const QString& filename, RootGraphicsItem *root)
-{
- // Delete all items.
- clearAll();
- backgroundPath_ = filename;
-
- if(!filename.isEmpty())
- {
- QPixmap pixmap(filename);
- setSceneRect(pixmap.rect());
- // Create the background item and dock it at the maximal depth of the scene.
- backgroundPixmap_ = new QGraphicsPixmapItem(pixmap, 0, this);
- backgroundPixmap_->setZValue(INT_MIN);
- }
- else
- setSceneRect(QRectF());
-
- // Add new items.
- if(root)
- setRoot(root);
-}
diff --git a/GScribo/Rendering/scene.h b/GScribo/Rendering/scene.h
deleted file mode 100644
index 129359b..0000000
--- a/GScribo/Rendering/scene.h
+++ /dev/null
@@ -1,118 +0,0 @@
-#ifndef SCENE_H
-#define SCENE_H
-
-#include <QGraphicsSceneMouseEvent>
-#include <QGraphicsView>
-#include <QGraphicsScene>
-#include <QFileDialog>
-#include <climits>
-
-#include "rootgraphicsitem.h"
-#include "regionitem.h"
-#include "selection.h"
-
-class Scene :
- public QGraphicsScene
-{
- Q_OBJECT
-
- public:
- explicit Scene(QObject *parent = 0);
- explicit Scene(const QRectF &sceneRect, QObject *parent = 0);
- explicit Scene(qreal x, qreal y, qreal width, qreal height, QObject *parent =
0);
-
- inline QString backgroundPath() const;
- inline QGraphicsPixmapItem *backgroundPixmap() const;
-
- inline QList<RegionItem *> selectedRegions() const;
-
- void setRoot(RootGraphicsItem *rootItem);
- inline RootGraphicsItem *root() const;
-
- void select(const QRectF& rect);
- void select(const QPointF& point);
- void selectAll();
-
- inline bool selectionEnable() const;
- inline void setSelectionEnable(bool enable);
-
- void changeScene(const QString& filename, RootGraphicsItem *root = 0);
-
- protected:
- void mousePressEvent(QGraphicsSceneMouseEvent *event);
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
- void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
-
- private:
- void init();
- void select(QGraphicsItem *root, const QPointF& point, const QRectF&
rect);
-
- QGraphicsView *mainView_;
- RootGraphicsItem *root_;
-
- QString backgroundPath_;
- QGraphicsPixmapItem *backgroundPixmap_;
-
- Selection selection_;
- QList<RegionItem *> selectedRegions_;
- QList<RegionItem *> baseSelection_;
-
- QPointF pressPos_;
- bool isPressing_;
- bool isSelectionDisabled_;
-
- public slots:
- void clearAll();
- void clearRegions();
- void clearSelection();
-
- void select(const QList<RegionItem *>& selectedRegions);
- inline void selectBase();
- void unselect(const QList<RegionItem *>& unselectedItems);
-
- void setVisible(const GraphicsRegion::Id& region, bool visible);
- void ensureVisible(QGraphicsItem *graphicsItem);
-
- inline void disableSelection();
- inline void enableSelection();
-
- signals:
- void selectionCleared();
- void newSelection();
- void newSelection(const QList<RegionItem *>& selectedRegions);
-};
-
-inline QString Scene::backgroundPath() const
-{ return backgroundPath_; }
-
-inline QGraphicsPixmapItem *Scene::backgroundPixmap() const
-{ return backgroundPixmap_; }
-
-inline RootGraphicsItem *Scene::root() const
-{ return root_; }
-
-inline QList<RegionItem *> Scene::selectedRegions() const
-{ return selectedRegions_; }
-
-inline void Scene::selectBase()
-{ select(baseSelection_); }
-
-inline void Scene::select(const QPointF& point)
-{ select(root_, point, QRectF()); }
-
-inline void Scene::select(const QRectF& rect)
-{ select(root_, QPointF(), rect); }
-
-inline void Scene::setSelectionEnable(bool enable)
-{ isSelectionDisabled_ = !enable; }
-
-inline bool Scene::selectionEnable() const
-{ return isSelectionDisabled_; }
-
-inline void Scene::disableSelection()
-{ setSelectionEnable(false); }
-
-inline void Scene::enableSelection()
-{ setSelectionEnable(true); }
-
-#endif // SCENE_H
diff --git a/GScribo/Rendering/selection.cpp b/GScribo/Rendering/selection.cpp
deleted file mode 100644
index f5c3f4a..0000000
--- a/GScribo/Rendering/selection.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "selection.h"
-
-Selection::Selection(QGraphicsScene *scene):
- QGraphicsRectItem(0, scene)
-{
- init();
-}
-
-Selection::Selection(const QRectF &rect, QGraphicsScene *scene):
- QGraphicsRectItem(rect, 0, scene)
-{
- init();
-}
-
-Selection::Selection(qreal x, qreal y, qreal width, qreal height, QGraphicsScene
*scene):
- QGraphicsRectItem(x, y, width, height, 0, scene)
-{
- init();
-}
-
-void Selection::init()
-{
- // Always drawn on top of the scene.
- setZValue(INT_MAX);
-
- QPen pen;
- pen.setStyle(Qt::SolidLine);
- pen.setCapStyle(Qt::SquareCap);
- pen.setCosmetic(true);
- setPen(pen);
-
- QBrush brush;
- brush.setStyle(Qt::SolidPattern);
- brush.setColor(QColor::fromRgb(80, 200, 10, 60));
- setBrush(brush);
-}
diff --git a/GScribo/Rendering/selection.h b/GScribo/Rendering/selection.h
deleted file mode 100644
index ace8f01..0000000
--- a/GScribo/Rendering/selection.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef SELECTION_H
-#define SELECTION_H
-
-#include <QGraphicsRectItem>
-#include <climits>
-#include <QPen>
-
-class Selection :
- public QGraphicsRectItem
-{
- public:
- explicit Selection(QGraphicsScene *scene = 0);
- explicit Selection(const QRectF& rect, QGraphicsScene *scene = 0);
- explicit Selection(qreal x, qreal y, qreal width, qreal height, QGraphicsScene
*scene = 0);
-
- private:
- void init();
-};
-
-#endif // SELECTION_H
diff --git a/GScribo/TODO b/GScribo/TODO
deleted file mode 100644
index 8e7b556..0000000
--- a/GScribo/TODO
+++ /dev/null
@@ -1,100 +0,0 @@
-* Concerning the configurations :
- - Register the location of the different widget and if they are visible/ invisible to
restore it on the next utilisation of the gui.
-
-
-* Concerning the menu bar :
- - Assign shortcuts for each buttons.
-
-
-* Concerning the xml widget :
- - Can modify in real time the proxy with a regular expression. When the user click on a
check box in the region widget, a new regular expression is created an sent to the xml
widget but the proxy is not modified by this regular expression.
- - In the table tree (the attributes tree), set the max of the header splitter. Currently
it can be moved indefinitely to the right.
- - Fit the splitter to the content of the first column when an attributes node is
loaded.
- - My be some color corresponding to the graphics item of the scene.
- - The organisation of the class and the two views are not perfect.
-
-
-* Concerning the scene :
- - Give the possibility to the user to remove some region.
- - Can create/ fusion some region : sometimes two line regions are splitted but will not
be.
- - Optimize the collision between the rectangle item and the regions. Currently it do not
take into account if the region is visible by the view before calculating the collision.
- - Use OpenGL to speed up graphics rendering (the gui has been developped with Qt 4.7,
OpenGL was still experimental so it was really slow when updating the scene).
- - Create a little widget at the bottom of the scene with the % of scale, the
possibility to fit the scene rect or to scale it at 100% (just like gwenview).
- - May be give the possibility to change the color.
- - May be some options one right click.
-
-
-* Concerning the region widget :
- - As stated bove, connect this widget with the xml widget.
- - Find a better way to get region names and colors.
-
-
-* Concerning the page widget :
- - Load less thumbnails (just the necessary to draw it on the widget) because sometimes,
pictures are heavy.
- - May be use a progress dialog during the loading where a large number of pictures are
loaded.
- - Offer the possibility to down/ upscale thumbnails.
- - Allow the user to move ine the widget with arrow keys.
- - Create also a button to delete selected items (rather than the key 'delete').
- - During the segmentation, give the possibility to segment selected thumbnails, all
thumbnails or juste the current.
- - For each thumbnails, paint at his bottom a little progress dialog to check if the
picture has already been segmented, not segmented or ongoing segmentation.
-
-* Concerning the progress dialog :
- - Center on the main window.
-
-
-* Concerning the xml file :
- - Stop using the static array representation of the internal data structure for graphics
region.
- - Change the way we check if the user allows OCR to recognize the text or just segment.
- - Find a better way to run through all node representing a graphics item without knowing
it in advance. For exemple, the xml file looks like this :
-
-
-
- -Metadata
- |- ...
- |- ...
- |- ... Some informations about the creator etc...
- -Page
- |- TextRegion
-
- |- Coords
-
- |- Points
- ... ...
-
- |- Line
-
- |- Coords
-
- |- Points
- ...
- ... <---- All the graphical stuff is here.
- ...
-
- |- VerticalSeparatorRegion
-
- |- Coords
-
- |- Points
- ...
- ...
- ...
-
-
- Graphical items are after pages and node containing informations looks like : *Region
-> Coords -> Points and is located in the root node named "Page" so there
is a way to find graphical item without knowing their location and name before.
-
-
-* Concerning tool bar :
- - Create one \o/.
- - Create icons to replace text.
- - Add new functionnalities.
-
-
-* Create a text viewer :
- - Give the possibility to modify the text.
- - ______________________ move picture.
- - ______________________ load arrays, tables, etc ...
- - Create a custom tool bar to save, load, etc ...
-
-
-* For other idea of interfaces using Qt :
- - gwenview (picture visionnary, good ideas here).
diff --git a/GScribo/XmlWidget/attributesmodel.cpp
b/GScribo/XmlWidget/attributesmodel.cpp
deleted file mode 100644
index 783fafb..0000000
--- a/GScribo/XmlWidget/attributesmodel.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-#include "attributesmodel.h"
-
-AttributesModel::AttributesModel(const XmlAttributes& attributes, QObject *parent) :
- QAbstractItemModel(parent)
-{
- attributes_ = attributes;
-}
-
-AttributesModel::AttributesModel(const XmlAttributes& attributes,
QAbstractItemModelPrivate& dd, QObject *parent) :
- QAbstractItemModel(dd, parent)
-{
- attributes_ = attributes;
-}
-
-QVariant AttributesModel::headerData(int section, Qt::Orientation orientation, int role)
const
-{
- if(orientation == Qt::Horizontal && role == Qt::DisplayRole)
- {
- switch(section)
- {
- case 0:
- return tr("Name");
-
- case 1:
- return tr("Value");
-
- default:
- return QVariant();
- }
- }
-
- return QVariant();
-}
-
-QVariant AttributesModel::data(const QModelIndex& index, int role) const
-{
- if(!index.isValid())
- return QVariant();
-
- switch(role)
- {
- case Qt::UserRole:
- return attributes_.names()[index.row()];
-
- case Qt::UserRole+1:
- return attributes_.values()[index.row()];
-
- default:
- return QVariant();
- }
-}
-
-void AttributesModel::load(const XmlAttributes& attributes)
-{
- beginResetModel();
-
- attributes_ = attributes;
-
- endResetModel();
-}
-
-void AttributesModel::reset()
-{
- beginResetModel();
-
- attributes_ = XmlAttributes();
-
- endResetModel();
-}
diff --git a/GScribo/XmlWidget/attributesmodel.h b/GScribo/XmlWidget/attributesmodel.h
deleted file mode 100644
index 1dd3289..0000000
--- a/GScribo/XmlWidget/attributesmodel.h
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef ATTRIBUTESMODEL_H
-#define ATTRIBUTESMODEL_H
-
-#include <QAbstractItemModel>
-
-#include "xmlattributes.h"
-
-class AttributesModel :
- public QAbstractItemModel
-{
- Q_OBJECT
-
- public:
- explicit AttributesModel(const XmlAttributes& attributes = XmlAttributes(),
QObject *parent = 0);
- explicit AttributesModel(const XmlAttributes& attributes,
QAbstractItemModelPrivate& dd, QObject *parent = 0);
-
- inline int rowCount(const QModelIndex& parent) const;
- inline int columnCount(const QModelIndex& parent) const;
-
- QVariant headerData(int section, Qt::Orientation orientation, int role) const;
- QVariant data(const QModelIndex& index, int role) const;
-
- inline QModelIndex index(int row, int column, const QModelIndex &parent)
const;
- inline QModelIndex parent(const QModelIndex &child) const;
-
- public slots:
- void reset();
-
- private:
- XmlAttributes attributes_;
-
- public slots:
- void load(const XmlAttributes& attributes);
-};
-
-inline int AttributesModel::rowCount(const QModelIndex&) const
-{ return attributes_.names().count(); }
-
-inline int AttributesModel::columnCount(const QModelIndex&) const
-{ return 2; }
-
-inline QModelIndex AttributesModel::index(int row, int column, const QModelIndex&
parent) const
-{ if(!hasIndex(row, column, parent)) return QModelIndex(); return createIndex(row,
column, 0); }
-
-inline QModelIndex AttributesModel::parent(const QModelIndex&) const
-{ return QModelIndex(); }
-
-#endif // ATTRIBUTESMODEL_H
diff --git a/GScribo/XmlWidget/selectionproxy.h b/GScribo/XmlWidget/selectionproxy.h
deleted file mode 100644
index 604c46a..0000000
--- a/GScribo/XmlWidget/selectionproxy.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef SELECTIONPROXY_H
-#define SELECTIONPROXY_H
-
-#include <QSortFilterProxyModel>
-#include <QDebug>
-
-#include "xmlitem.h"
-
-class SelectionProxy :
- public QSortFilterProxyModel
-{
- public:
- explicit SelectionProxy(QObject *parent = 0) : QSortFilterProxyModel(parent) {
isAllDisplayed_ = true; }
-
- inline void displayAll();
- inline bool isAllDisplayed();
-
- inline void beginResetModel();
- inline void endResetModel();
- inline void invalidateFilter();
-
- protected:
- inline bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent)
const;
-
- private:
- bool isAllDisplayed_;
-};
-
-inline bool SelectionProxy::filterAcceptsRow(int sourceRow, const QModelIndex&
sourceParent) const
-{ return QSortFilterProxyModel::filterAcceptsRow(sourceRow, sourceParent) &&
(isAllDisplayed_ || sourceModel()->index(sourceRow, 0,
sourceParent).data(Qt::UserRole+2).value<XmlItem *>()->isVisible()); }
-
-inline void SelectionProxy::beginResetModel()
-{ isAllDisplayed_ = false; QSortFilterProxyModel::beginResetModel(); }
-
-inline void SelectionProxy::endResetModel()
-{ QSortFilterProxyModel::endResetModel(); }
-
-inline void SelectionProxy::displayAll()
-{ isAllDisplayed_ = true; }
-
-inline bool SelectionProxy::isAllDisplayed()
-{ return isAllDisplayed_; }
-
-inline void SelectionProxy::invalidateFilter()
-{ QSortFilterProxyModel::invalidateFilter(); }
-
-#endif // SELECTIONPROXY_H
diff --git a/GScribo/XmlWidget/xmlattributes.cpp b/GScribo/XmlWidget/xmlattributes.cpp
deleted file mode 100644
index 0c4221f..0000000
--- a/GScribo/XmlWidget/xmlattributes.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "xmlattributes.h"
-
-XmlAttributes::XmlAttributes()
-{
-}
-
-XmlAttributes::XmlAttributes(const QDomNamedNodeMap& node)
-{
- load(node);
-}
-
-void XmlAttributes::load(const QDomNamedNodeMap& node)
-{
- QDomAttr attr;
-
- for(int i = 0; i < node.count(); i++)
- {
- attr = node.item(i).toAttr();
-
- names_ << attr.name();
- values_ << attr.value();
- }
-}
diff --git a/GScribo/XmlWidget/xmlattributes.h b/GScribo/XmlWidget/xmlattributes.h
deleted file mode 100644
index 8dbf547..0000000
--- a/GScribo/XmlWidget/xmlattributes.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef XMLATTRIBUTES_H
-#define XMLATTRIBUTES_H
-
-#include <QDomNamedNodeMap>
-#include <QStringList>
-#include <QVariant>
-
-class XmlAttributes
-{
- public:
- explicit XmlAttributes();
- explicit XmlAttributes(const QDomNamedNodeMap& node);
-
- void load(const QDomNamedNodeMap& node);
-
- inline QStringList names() const;
- inline QStringList values() const;
-
- private:
- QStringList names_;
- QStringList values_;
-};
-
-inline QStringList XmlAttributes::names() const
-{ return names_; }
-
-inline QStringList XmlAttributes::values() const
-{ return values_; }
-
-Q_DECLARE_METATYPE(XmlAttributes)
-Q_DECLARE_METATYPE(XmlAttributes *)
-
-#endif // XMLATTRIBUTES_H
diff --git a/GScribo/XmlWidget/xmldelegate.h b/GScribo/XmlWidget/xmldelegate.h
deleted file mode 100644
index 3751a94..0000000
--- a/GScribo/XmlWidget/xmldelegate.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef XMLDELEGATE_H
-#define XMLDELEGATE_H
-
-#include <QStyledItemDelegate>
-#include<QPainter>
-
-class XmlDelegate :
- public QStyledItemDelegate
-{
- public:
- explicit XmlDelegate(int role = Qt::DisplayRole, QObject *parent = 0) :
QStyledItemDelegate(parent) { role_ = role; }
- inline void paint(QPainter *painter, const QStyleOptionViewItem& option,
const QModelIndex& index) const;
-
- inline void setRole(int role);
- inline int role() const;
-
- private:
- int role_;
-};
-
-inline void XmlDelegate::paint(QPainter *painter, const QStyleOptionViewItem& option,
const QModelIndex& index) const
-{ QStyledItemDelegate::paint(painter, option, index); painter->drawText(option.rect,
index.data(role_).toString()); }
-
-inline void XmlDelegate::setRole(int role)
-{ role_ = role; }
-
-inline int XmlDelegate::role() const
-{ return role_; }
-
-#endif // XMLDELEGATE_H
diff --git a/GScribo/XmlWidget/xmlitem.cpp b/GScribo/XmlWidget/xmlitem.cpp
deleted file mode 100644
index 53d09aa..0000000
--- a/GScribo/XmlWidget/xmlitem.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-#include "xmlitem.h"
-
-XmlItem::XmlItem(XmlItem *parent, XmlItem *precItem)
-{
- init(parent, precItem);
-}
-
-XmlItem::XmlItem(const QDomElement& node, XmlItem *parent, XmlItem *precItem)
-{
- init(parent, precItem);
- load(node);
-}
-
-XmlItem::~XmlItem()
-{
- // Delete all childs.
- XmlItem *child;
- foreach(child, childs_)
- delete child;
-}
-
-void XmlItem::init(XmlItem *parent, XmlItem *precItem)
-{
- isVisible_ = false;
- regionItem_ = 0;
- parent_ = parent;
-
- if(parent)
- parent->addChild(this);
-
- if(precItem)
- row_ = precItem->row()+1;
- else
- row_ = 0;
-}
-
-void XmlItem::load(const QDomElement& node)
-{
- text_ = node.tagName();
-
- // Load attributes.
- attributes_.load(node.attributes());
-}
diff --git a/GScribo/XmlWidget/xmlitem.h b/GScribo/XmlWidget/xmlitem.h
deleted file mode 100644
index 5b14ba7..0000000
--- a/GScribo/XmlWidget/xmlitem.h
+++ /dev/null
@@ -1,90 +0,0 @@
-#ifndef XMLITEM_H
-#define XMLITEM_H
-
-#include <QDomElement>
-
-#include "xmlattributes.h"
-
-class RegionItem;
-
-class XmlItem
-{
- public:
- explicit XmlItem(XmlItem *parent = 0, XmlItem *precItem = 0);
- explicit XmlItem(const QDomElement& node, XmlItem *parent = 0, XmlItem
*precItem = 0);
- ~XmlItem();
-
- void load(const QDomElement& node);
-
- inline QList<XmlItem *> childs() const;
- inline XmlItem *child(int i) const;
- inline void addChild(XmlItem *child);
- inline XmlItem *parent() const;
-
- inline RegionItem *regionItem();
- inline void setRegionItem(RegionItem *regionItem);
-
- inline bool isVisible() const;
- inline void setVisible(bool visible);
- inline void show();
- inline void hide();
-
- inline QString text() const;
- inline int row() const;
- inline XmlAttributes attributes() const;
-
- private:
- void init(XmlItem *parent = 0, XmlItem *precItem = 0);
-
- int row_;
- bool isVisible_;
- QList<XmlItem *> childs_;
- XmlItem *parent_;
- RegionItem *regionItem_;
- QString text_;
- XmlAttributes attributes_;
-};
-
-inline QList<XmlItem *> XmlItem::childs() const
-{ return childs_; }
-
-inline XmlItem *XmlItem::child(int i) const
-{ if(i > -1 && i < childs_.count()) return childs_[i]; return 0; }
-
-inline void XmlItem::addChild(XmlItem *child)
-{ childs_ << child; }
-
-inline XmlItem *XmlItem::parent() const
-{ return parent_; }
-
-inline RegionItem *XmlItem::regionItem()
-{ return regionItem_; }
-
-inline void XmlItem::setRegionItem(RegionItem *regionItem)
-{ regionItem_ = regionItem; }
-
-inline bool XmlItem::isVisible() const
-{ return isVisible_; }
-
-inline void XmlItem::setVisible(bool visible)
-{ isVisible_ = visible; }
-
-inline void XmlItem::show()
-{ isVisible_ = true; }
-
-inline void XmlItem::hide()
-{ isVisible_ = false; }
-
-inline QString XmlItem::text() const
-{ return text_; }
-
-inline int XmlItem::row() const
-{ return row_; }
-
-inline XmlAttributes XmlItem::attributes() const
-{ return attributes_; }
-
-Q_DECLARE_METATYPE(XmlItem)
-Q_DECLARE_METATYPE(XmlItem *)
-
-#endif // XMLITEM_H
diff --git a/GScribo/XmlWidget/xmlmodel.cpp b/GScribo/XmlWidget/xmlmodel.cpp
deleted file mode 100644
index 0f58075..0000000
--- a/GScribo/XmlWidget/xmlmodel.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-#include "xmlmodel.h"
-
-XmlModel::XmlModel(XmlItem *rootItem, QObject *parent) :
- QAbstractItemModel(parent)
-{
- rootItem_ = rootItem;
-}
-
-XmlModel::XmlModel(XmlItem *rootItem, QAbstractItemModelPrivate& dd, QObject *parent)
:
- QAbstractItemModel(dd, parent)
-{
- rootItem_ = rootItem;
-}
-
-XmlModel::~XmlModel()
-{
- if(rootItem_)
- delete rootItem_;
-}
-
-QVariant XmlModel::headerData(int, Qt::Orientation orientation, int role) const
-{
- if(orientation == Qt::Horizontal && role == Qt::DisplayRole)
- return tr("Tree");
-
- return QVariant();
-}
-
-QVariant XmlModel::data(const QModelIndex& index, int role) const
-{
- if(!index.isValid())
- return QVariant();
-
- switch(role)
- {
- case Qt::UserRole:
- return static_cast<XmlItem *>(index.internalPointer())->text();
-
- case Qt::UserRole+1:
- return QVariant::fromValue(static_cast<XmlItem
*>(index.internalPointer())->attributes());
-
- case Qt::UserRole+2:
- return QVariant::fromValue(static_cast<XmlItem
*>(index.internalPointer()));
-
- default:
- return QVariant();
- }
-}
-
-QModelIndex XmlModel::index(int row, int column, const QModelIndex& parent) const
-{
- if(!hasIndex(row, column, parent))
- return QModelIndex();
-
- XmlItem *childItem = toXmlItem(parent)->child(row);
-
- // Create the model index from the child item.
- if(childItem)
- return createIndex(row, column, childItem);
- else
- return QModelIndex();
-}
-
-QModelIndex XmlModel::parent(const QModelIndex& child) const
-{
- if(!child.isValid())
- return QModelIndex();
-
- XmlItem *parentItem = static_cast<XmlItem
*>(child.internalPointer())->parent();
-
- if(!parentItem || parentItem == rootItem_)
- return QModelIndex();
-
- return createIndex(parentItem->row(), 0, parentItem);
-}
-
-void XmlModel::load(XmlItem *rootItem)
-{
- beginResetModel();
-
- if(rootItem_)
- delete rootItem_;
-
- rootItem_ = rootItem;
-
- endResetModel();
-}
diff --git a/GScribo/XmlWidget/xmlmodel.h b/GScribo/XmlWidget/xmlmodel.h
deleted file mode 100644
index 7e74e6f..0000000
--- a/GScribo/XmlWidget/xmlmodel.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef XMLMODEL_H
-#define XMLMODEL_H
-
-#include <QAbstractItemModel>
-
-#include "variantpointer.h"
-#include "xmlitem.h"
-
-class XmlModel :
- public QAbstractItemModel
-{
- public:
- explicit XmlModel(XmlItem *rootItem = 0, QObject *parent = 0);
- explicit XmlModel(XmlItem *rootItem, QAbstractItemModelPrivate& dd, QObject
*parent = 0);
- ~XmlModel();
-
- void load(XmlItem *rootItem);
-
- inline int rowCount(const QModelIndex& parent) const;
- inline int columnCount(const QModelIndex& parent) const;
-
- QVariant headerData(int section, Qt::Orientation orientation, int role) const;
-
- QVariant data(const QModelIndex& index, int role) const;
-
- QModelIndex index(int row, int column, const QModelIndex& parent) const;
- QModelIndex parent(const QModelIndex& child) const;
-
- private:
- inline XmlItem *toXmlItem(const QModelIndex& index) const;
-
- XmlItem *rootItem_;
-};
-
-inline XmlItem *XmlModel::toXmlItem(const QModelIndex& parent) const
-{ return !parent.isValid() ? rootItem_ : static_cast<XmlItem
*>(parent.internalPointer()); }
-
-inline int XmlModel::rowCount(const QModelIndex& parent) const
-{ if(rootItem_) return toXmlItem(parent)->childs().count(); return 0; }
-
-inline int XmlModel::columnCount(const QModelIndex&) const
-{ return 1; }
-
-#endif // XMLMODEL_H
diff --git a/GScribo/XmlWidget/xmlview.cpp b/GScribo/XmlWidget/xmlview.cpp
deleted file mode 100644
index 70a79b7..0000000
--- a/GScribo/XmlWidget/xmlview.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-#include "xmlview.h"
-
-XmlView::XmlView(QWidget *parent) :
- QTreeView(parent)
-{
- proxy_.setFilterRole(Qt::UserRole);
- proxy_.setDynamicSortFilter(true);
-
- setUniformRowHeights(true);
- setItemDelegate(new XmlDelegate(Qt::UserRole));
- setSelectionMode(QAbstractItemView::ExtendedSelection);
-}
-
-void XmlView::hideAll()
-{
- proxy_.beginResetModel();
-
- XmlItem *child;
- foreach(child, displayedItems_)
- child->hide();
-
- displayedItems_.clear();
- emit resetProperty();
-
- proxy_.endResetModel();
-}
-
-void XmlView::display(QList<XmlItem *> displayedItems, bool addToDisplayedList)
-{
- proxy_.beginResetModel();
-
- if(!addToDisplayedList)
- hideAll();
-
- XmlItem *child;
- foreach(child, displayedItems)
- {
- child->show();
- displayedItems_ << child;
- }
-
- proxy_.endResetModel();
-
- expandAll();
-}
-
-QList<XmlItem *> XmlView::transform(const QModelIndexList& modelIndexList)
const
-{
- QList<XmlItem *> selectedItems;
- QModelIndex index;
-
- foreach(index, modelIndexList)
- selectedItems << index.data(Qt::UserRole+2).value<XmlItem *>();
-
- return selectedItems;
-}
-
-void XmlView::selectionChanged(const QItemSelection& selected, const
QItemSelection& deselected)
-{
- QTreeView::selectionChanged(selected, deselected);
-
- if(selected.indexes() == selectedIndexes())
- emit resetSelection();
-
- if(!selectedIndexes().isEmpty())
- {
- QList<XmlItem *> xmlItems;
- if(!selected.isEmpty())
- {
- xmlItems = transform(selected.indexes());
- emit select(xmlItems);
- }
- else
- {
- xmlItems = transform(deselected.indexes());
- emit unselect(xmlItems);
- }
-
- emit loadAttributes(xmlItems.last()->attributes());
- }
- else
- {
- emit resetProperty();
- emit emptySelection();
- }
-
- emit newSelection();
-}
diff --git a/GScribo/XmlWidget/xmlview.h b/GScribo/XmlWidget/xmlview.h
deleted file mode 100644
index fef7386..0000000
--- a/GScribo/XmlWidget/xmlview.h
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef XMLVIEW_H
-#define XMLVIEW_H
-
-#include <QGraphicsItem>
-#include <QTreeView>
-
-#include "Rendering/regionitem.h"
-#include "selectionproxy.h"
-#include "xmldelegate.h"
-#include "xmlitem.h"
-
-class XmlView :
- public QTreeView
-{
- Q_OBJECT
-
- public:
- explicit XmlView(QWidget *parent = 0);
-
- inline QList<XmlItem *> displayedItems() const;
- void hideAll();
-
- inline QList<XmlItem *> selectedItems() const;
-
- inline void setModel(QAbstractItemModel *model);
-
- protected:
- void selectionChanged(const QItemSelection& selected, const
QItemSelection& deselected);
-
- private:
- QList<XmlItem *> transform(const QModelIndexList& modelIndexList)
const;
- void display(QList<XmlItem *> displayedItems, bool addToDisplayedList);
-
- SelectionProxy proxy_;
- QList<XmlItem *> displayedItems_;
-
- public slots:
- inline void display(QList<XmlItem *> displayedItems);
- inline void displayOnly(QList<XmlItem *> displayedItems);
-
- inline void displayAll();
-
- inline void setFilterString(const QString& filterString);
-
- signals:
- void loadAttributes(const XmlAttributes& xmlAttributes);
-
- void select(const QList<XmlItem *>& selectedItems);
- void unselect(const QList<XmlItem *>& unselectedItems);
-
- void newSelection();
- void emptySelection();
-
- void resetSelection();
- void resetProperty();
-};
-
-inline QList<XmlItem *> XmlView::displayedItems() const
-{ return displayedItems_; }
-
-inline void XmlView::display(QList<XmlItem *> displayedItems)
-{ display(displayedItems, true); }
-
-inline void XmlView::displayOnly(QList<XmlItem *> displayedItems)
-{ display(displayedItems, false); }
-
-inline void XmlView::displayAll()
-{ hideAll(); proxy_.displayAll(); }
-
-inline QList<XmlItem *> XmlView::selectedItems() const
-{ return transform(selectedIndexes()); }
-
-inline void XmlView::setFilterString(const QString& filterString)
-{ proxy_.setFilterRegExp(QRegExp(filterString, Qt::CaseSensitive));
proxy_.invalidateFilter(); }
-
-inline void XmlView::setModel(QAbstractItemModel *model)
-{ proxy_.setSourceModel(model); QTreeView::setModel(&proxy_); }
-
-#endif // XMLVIEW_H
diff --git a/GScribo/XmlWidget/xmlwidget.cpp b/GScribo/XmlWidget/xmlwidget.cpp
deleted file mode 100644
index dc24193..0000000
--- a/GScribo/XmlWidget/xmlwidget.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "xmlwidget.h"
-
-XmlWidget::XmlWidget(QWidget *parent) :
- QSplitter(Qt::Horizontal, parent)
-{
- proxy_.setFilterRegExp(QRegExp("(?:Page|.Region|Line)",
Qt::CaseSensitive));
- proxy_.setDynamicSortFilter(true);
- proxy_.setFilterRole(Qt::UserRole);
- proxy_.setSourceModel(&model_);
-
- view_.setModel(&proxy_);
-
- attributes_.setModel(&attributesModel_);
- attributes_.setSelectionMode(QAbstractItemView::NoSelection);
- attributes_.setItemDelegateForColumn(0, new XmlDelegate(Qt::UserRole));
- attributes_.setItemDelegateForColumn(1, new XmlDelegate(Qt::UserRole+1));
-
- addWidget(&view_);
- addWidget(&attributes_);
-
- connect(&view_, SIGNAL(resetProperty()), &attributesModel_, SLOT(reset()));
- connect(&view_, SIGNAL(clicked(QModelIndex)), this,
SLOT(loadAttributes(QModelIndex)));
- connect(&view_, SIGNAL(loadAttributes(XmlAttributes)), &attributesModel_,
SLOT(load(XmlAttributes)));
-}
-
-void XmlWidget::changeView(XmlItem *rootItem)
-{
- attributesModel_.reset();
-
- model_.load(rootItem);
-
- view_.displayAll();
- view_.expandAll();
-}
diff --git a/GScribo/XmlWidget/xmlwidget.h b/GScribo/XmlWidget/xmlwidget.h
deleted file mode 100644
index 32eca37..0000000
--- a/GScribo/XmlWidget/xmlwidget.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef XMLWIDGET_H
-#define XMLWIDGET_H
-
-#include <QSortFilterProxyModel>
-#include <QTableView>
-#include <QTreeWidget>
-#include <QSplitter>
-#include <QDomElement>
-#include <QWidget>
-
-#include "Rendering/scene.h"
-#include "selectionproxy.h"
-#include "attributesmodel.h"
-#include "variantpointer.h"
-#include "xmldelegate.h"
-#include "xmlmodel.h"
-#include "xmlview.h"
-
-class XmlWidget :
- public QSplitter
-{
- Q_OBJECT
-
- public:
- explicit XmlWidget(QWidget *parent = 0);
-
- inline XmlView *view();
- inline QTableView *attributes();
-
- void changeView(XmlItem *rootItem);
-
- private:
- QSortFilterProxyModel proxy_;
-
- XmlModel model_;
- AttributesModel attributesModel_;
-
- XmlView view_;
- QTableView attributes_;
-
- private slots:
- inline void loadAttributes(const QModelIndex& index);
-};
-
-inline XmlView * XmlWidget::view()
-{ return &view_; }
-
-inline QTableView *XmlWidget::attributes()
-{ return &attributes_; }
-
-inline void XmlWidget::loadAttributes(const QModelIndex& index)
-{ attributesModel_.load(index.data(Qt::UserRole+2).value<XmlItem
*>()->attributes()); }
-
-#endif // XMLWIDGET_H
diff --git a/GScribo/aboutdialog.h b/GScribo/aboutdialog.h
deleted file mode 100644
index fa91ada..0000000
--- a/GScribo/aboutdialog.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef ABOUTDIALOG_H
-#define ABOUTDIALOG_H
-
-#include <QDialog>
-
-#include "ui_aboutdialog.h"
-
-namespace Ui
-{
- class AboutDialog;
-}
-
-class AboutDialog :
- public QDialog
-{
- public:
- explicit AboutDialog(QWidget *parent = 0) : QDialog(parent, Qt::Dialog)
- { ui = new Ui::AboutDialog; ui->setupUi(this); }
- ~AboutDialog() { delete ui; }
-
- private:
- Ui::AboutDialog *ui;
-};
-
-#endif // ABOUTDIALOG_H
diff --git a/GScribo/aboutdialog.ui b/GScribo/aboutdialog.ui
deleted file mode 100644
index d16b076..0000000
--- a/GScribo/aboutdialog.ui
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>AboutDialog</class>
- <widget class="QDialog" name="AboutDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>557</width>
- <height>390</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>557</width>
- <height>390</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>557</width>
- <height>390</height>
- </size>
- </property>
- <property name="windowTitle">
- <string>About</string>
- </property>
- <property name="windowIcon">
- <iconset>
-
<normaloff>:/icons/shared/icons/olena_smaller.jpg</normaloff>:/icons/shared/icons/olena_smaller.jpg</iconset>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QLabel" name="label">
- <property name="text">
- <string/>
- </property>
- <property name="pixmap">
- <pixmap>:/icons/shared/icons/olena_smaller.jpg</pixmap>
- </property>
- <property name="scaledContents">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="label_2">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext"
content="1" /><style
type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style="
font-family:'Sans Serif'; font-size:9pt; font-weight:400;
font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
style=" font-family:'DejaVu Sans'; font-size:12pt;
font-weight:600;">Document Image Analysis
Tool</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px;
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;
font-family:'DejaVu Sans'; font-size:12pt;
font-weight:600;"></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px;
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;
font-family:'DejaVu Sans';"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
style=" font-family:'DejaVu Sans';">This project is
powered by </span><span style=" font-family:'DejaVu
Sans'; font-weight:600;
font-style:italic;">Milena</span><span
style=" font-family:'DejaVu Sans';">, a generic image
processing library.</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px;
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;
font-family:'DejaVu Sans';"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
style=" font-family:'DejaVu Sans';">It is part of
</span><span style=" font-family:'DejaVu Sans';
font-weight:600;
font-style:italic;">Olena</span><span
style=" font-family:'DejaVu Sans';">, an Image Processing
Platform and its module </span><span style="
font-family:'DejaVu Sans'; font-weight:600;
font-style:italic;">Scribo</span><span
style=" font-family:'DejaVu Sans';">, a set of tools for
Document Image Analysis.</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px;
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;
font-family:'DejaVu Sans';"></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px;
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;
font-family:'DejaVu Sans';"></p>
-<p align="center" style=" margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0;
text-indent:0px;"><a
href="http://olena.lrde.epita.fr"><span style="
font-family:'DejaVu Sans'; text-decoration: underline;
color:#0057ae;">http://olena.lrde.epita.fr</span></a></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px;
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;
font-family:'DejaVu Sans';"></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px;
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;
font-family:'DejaVu Sans';"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
style=" font-family:'DejaVu Sans'; font-size:8pt;">Thanks
to Arthur Crépin-Leblond, Samuel Da Mota, Loic Denuziere, Jérôme Galtier, Florent
d'Halluin, Alex Hamelin, Damien Lefortier, Vincent Ordy, Guillaume Sadegh and Warren
Seine for their contribution.</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px;
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;
font-family:'DejaVu Sans'; font-size:8pt;"></p>
-<p align="justify" style="-qt-paragraph-type:empty;
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0;
text-indent:0px; font-family:'DejaVu Sans';
font-size:8pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
style=" font-family:'DejaVu Sans'; font-size:7pt;">This
application has been developed in the context of the SCRIBO project of the Free Software
Thematic Group, part of the &quot;System@tic Paris-Région&quot; Cluster
(France). This project is partially funded by the French Government, its economic
development agencies, and by the Paris-Région
institutions.</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px;
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;
font-family:'DejaVu Sans'; font-size:7pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span
style=" font-family:'DejaVu Sans';
font-size:7pt;">Copyright (C) 2012, 2013 EPITA Research and Development
Laboratory
(LRDE)</span></p></body></html></string>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="standardButtons">
- <set>QDialogButtonBox::Ok</set>
- </property>
- <property name="centerButtons">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>AboutDialog</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>281</x>
- <y>391</y>
- </hint>
- <hint type="destinationlabel">
- <x>240</x>
- <y>203</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
diff --git a/GScribo/configs.h b/GScribo/configs.h
deleted file mode 100644
index c6aac68..0000000
--- a/GScribo/configs.h
+++ /dev/null
@@ -1,134 +0,0 @@
-#ifndef CONFIGS_H
-#define CONFIGS_H
-
-#include <scribo/toolchain/internal/text_in_doc_preprocess_functor.hh>
-#include <QSettings>
-#include <QDir>
-#include <QDebug>
-
-#include "region.h"
-
-class Configs :
- public QSettings
-{
- public:
- inline static Configs *getInstance();
-
- inline bool preprocessingSubsample();
- inline void setPreprocessingSubsample(bool b);
-
- inline bool preprocessingRemoveBg();
- inline void setPreprocessingRemoveBg(bool b);
-
- inline bool preprocessingDeskew();
- inline void setPreprocessingDeskew(bool b);
-
- inline bool preprocessingRemoveNoise();
- inline void setPreprocessingRemoveNoise(bool b);
-
- inline int preprocessingBinAlgo();
- inline void setPreprocessingBinAlgo(int algo);
-
- inline int segmentationFindSeps();
- inline void setSegmentationFindSeps(int seps);
-
- inline bool ocrEnabled();
- inline void setOcrEnabled(bool b);
-
- inline QString ocrLanguage();
- inline void setOcrLanguage(const QString& lang);
-
- inline bool generalSaveXmlEnabled();
- inline void setGeneralSaveXmlEnabled(bool b);
-
- inline bool generalSaveXmlSameDir();
- inline void setGeneralSaveXmlSameDir(bool b);
-
- inline bool generalSaveXmlCustomDir();
- inline void setGeneralSaveXmlCustomDir(bool b);
-
- inline QString generalSaveXmlCustomDirPath();
- inline void setGeneralSaveXmlCustomDirPath(const QString& path);
-
- private:
- explicit Configs() : QSettings("olena-scribo", "gui") { }
-};
-
-inline Configs *Configs::getInstance()
-{ static Configs *conf = new Configs(); return conf; }
-
-inline bool Configs::preprocessingSubsample()
-{ return value("preprocessing/subsample", false).toBool(); }
-
-inline void Configs::setPreprocessingSubsample(bool b)
-{ setValue("preprocessing/subsample", b); }
-
-inline bool Configs::preprocessingRemoveBg()
-{ return value("preprocessing/remove_bg", false).toBool(); }
-
-inline void Configs::setPreprocessingRemoveBg(bool b)
-{ setValue("preprocessing/remove_bg", b); }
-
-inline bool Configs::preprocessingDeskew()
-{ return value("preprocessing/deskew", false).toBool(); }
-
-inline void Configs::setPreprocessingDeskew(bool b)
-{ setValue("preprocessing/deskew", b); }
-
-inline bool Configs::preprocessingRemoveNoise()
-{ return value("preprocessing/remove_noise", true).toBool(); }
-
-inline void Configs::setPreprocessingRemoveNoise(bool b)
-{ setValue("preprocessing/remove_noise", b); }
-
-inline int Configs::preprocessingBinAlgo()
-{ return value("preprocessing/bin_algo",
- scribo::toolchain::internal::SauvolaMs).toInt(); }
-
-inline void Configs::setPreprocessingBinAlgo(int algo)
-{ setValue("preprocessing/bin_algo", algo); }
-
-inline int Configs::segmentationFindSeps()
-{ return value("segmentation/find_seps", Separator::Both).toInt(); }
-
-inline void Configs::setSegmentationFindSeps(int seps)
-{ setValue("segmentation/find_seps", seps); }
-
-inline bool Configs::ocrEnabled()
-{ return value("ocr/enabled", true).toBool(); }
-
-inline void Configs::setOcrEnabled(bool b)
-{ setValue("ocr/enabled", b); }
-
-inline QString Configs::ocrLanguage()
-{ return value("ocr/language", 0).toString(); }
-
-inline void Configs::setOcrLanguage(const QString& lang)
-{ setValue("ocr/language", lang); }
-
-inline bool Configs::generalSaveXmlEnabled()
-{ return value("general/save_xml/enabled", true).toBool(); }
-
-inline void Configs::setGeneralSaveXmlEnabled(bool b)
-{ setValue("general/save_xml/enabled", b); }
-
-inline bool Configs::generalSaveXmlSameDir()
-{ return value("general/save_xml/same_dir", true).toBool(); }
-
-inline void Configs::setGeneralSaveXmlSameDir(bool b)
-{ setValue("general/save_xml/same_dir", b); }
-
-inline bool Configs::generalSaveXmlCustomDir()
-{ return value("general/save_xml/custom_dir", false).toBool(); }
-
-inline void Configs::setGeneralSaveXmlCustomDir(bool b)
-{ setValue("general/save_xml/custom_dir", b); }
-
-inline QString Configs::generalSaveXmlCustomDirPath()
-{ return value("general/save_xml/custom_dir_path",
- QDir::tempPath()).toString(); }
-
-inline void Configs::setGeneralSaveXmlCustomDirPath(const QString& path)
-{ setValue("general/save_xml/custom_dir_path", path); }
-
-#endif // CONFIGS_H
diff --git a/GScribo/dir.h b/GScribo/dir.h
deleted file mode 100644
index a6c036b..0000000
--- a/GScribo/dir.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef DIR_H
-#define DIR_H
-
-#define SCRIBO_LOCAL_DEMODIR
"/lrde/home/stage/froger_a/olena/_build/scribo/demo"
-#define SCRIBO_PREFIX_BINDIR "/usr/local/bin"
-
-#endif // DIR_H
diff --git a/GScribo/dockwidget.h b/GScribo/dockwidget.h
deleted file mode 100644
index a1a2b40..0000000
--- a/GScribo/dockwidget.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef DOCKWIDGET_H
-#define DOCKWIDGET_H
-
-#include <QDockWidget>
-
-class DockWidget :
- public QDockWidget
-{
- Q_OBJECT
-
- public:
- explicit DockWidget(QWidget *parent = 0, Qt::WindowFlags flags = 0) :
QDockWidget(parent, flags) { }
- explicit DockWidget(const QString& title, QWidget *parent = 0,
Qt::WindowFlags flags = 0) : QDockWidget(title, parent, flags) { }
-
- public slots:
- inline void switchVisibility();
-};
-
-inline void DockWidget::switchVisibility()
-{ setVisible(!isVisible()); }
-
-#endif // DOCKWIDGET_H
diff --git a/GScribo/main.cpp b/GScribo/main.cpp
deleted file mode 100644
index d47ec16..0000000
--- a/GScribo/main.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#undef MLN_WO_GLOBAL_VARS
-
-#include <scribo/make/debug_filename.hh>
-#include <mln/labeling/colorize.hh>
-#include <mln/io/magick/load.hh>
-#include <mln/literal/colors.hh>
-#include <mln/debug/filename.hh>
-#include <QtGui/QApplication>
-#include <mln/math/pi.hh>
-
-#include "mainwindow.h"
-
-int main(int argc, char *argv[])
-{
- Magick::InitializeMagick(*argv);
- // On Linux, we NEED to use the raster graphics system.
- // Linux don't really support openGL graphics system (the default one on Linux).
- QApplication::setGraphicsSystem("raster");
- QApplication a(argc, argv);
- MainWindow w;
- w.show();
- return a.exec();
-}
diff --git a/GScribo/mainwindow.cpp b/GScribo/mainwindow.cpp
deleted file mode 100644
index 4bb5c74..0000000
--- a/GScribo/mainwindow.cpp
+++ /dev/null
@@ -1,415 +0,0 @@
-#include "mainwindow.h"
-#include "ui_mainwindow.h"
-
-MainWindow::MainWindow(QWidget *parent) :
- QMainWindow(parent),
- ui(new Ui::MainWindow)
-{
- ui->setupUi(this);
-
- setWindowTitle(tr("GScribo"));
- showMaximized();
-
- initGraphicsRegion();
- initDialogsWidget();
- initXmlWidget();
- initRegionWidget();
- initPageWidget();
- initMenuBar();
-
- // Told the left dock widget (here the pages widget and the region widget) to fill
the bottom left corner.
- setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
- // Merge the region and pages widget in one tab (pages widget over the region
widget).
- tabifyDockWidget(&dockRegion_, &dockPages_);
-
- connectWidgets();
-}
-
-MainWindow::~MainWindow()
-{
- delete preferencesDialog_;
- delete aboutDialog_;
- delete progressDialog_;
- delete ui;
-}
-
-void MainWindow::changeEvent(QEvent *e)
-{
- QMainWindow::changeEvent(e);
- switch (e->type())
- {
- case QEvent::LanguageChange:
- ui->retranslateUi(this);
- break;
- default:
- break;
- }
-}
-
-void MainWindow::initGraphicsRegion()
-{
- graphicsView_.setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
- graphicsView_.setScene(&scene_);
-
- setCentralWidget(&graphicsView_);
-}
-
-void MainWindow::initDialogsWidget()
-{
- preferencesDialog_ = new PreferencesDialog(this);
- aboutDialog_ = new AboutDialog(this);
- progressDialog_ = new ProgressDialog(this);
-}
-
-void MainWindow::initPageWidget()
-{
- dockPages_.setWindowTitle("Pages");
- dockPages_.setFeatures(QDockWidget::DockWidgetClosable |
QDockWidget::DockWidgetMovable);
- dockPages_.setWidget(&pagesWidget_);
- dockPages_.setMinimumWidth(190);
-
- addDockWidget(Qt::LeftDockWidgetArea, &dockPages_);
-}
-
-void MainWindow::initRegionWidget()
-{
- dockRegion_.setWindowTitle("Regions");
- dockRegion_.setFeatures(QDockWidget::DockWidgetClosable |
QDockWidget::DockWidgetMovable);
- dockRegion_.setWidget(®ionWidget_);
-
- addDockWidget(Qt::LeftDockWidgetArea, &dockRegion_);
-}
-
-void MainWindow::initXmlWidget()
-{
- dockXml_.setWindowTitle("Xml");
- dockXml_.setFeatures(QDockWidget::DockWidgetClosable |
QDockWidget::DockWidgetMovable);
- dockXml_.setWidget(&xmlWidget_);
-
- addDockWidget(Qt::BottomDockWidgetArea, &dockXml_);
- dockXml_.setVisible(false);
-}
-
-void MainWindow::initMenuBar()
-{
- QMenu *menuFile = ui->menuBar->addMenu(tr("File"));
-
- QAction *open = menuFile->addAction(tr("Open"));
- connect(open, SIGNAL(triggered()), this, SLOT(onOpen()));
-
- segment_ = menuFile->addAction(tr("Segment"));
- segment_->setEnabled(false);
- connect(segment_, SIGNAL(triggered()), this, SLOT(onSegment()));
-
- menuFile->addSeparator();
-
- previewPrinting_ = menuFile->addAction(tr("Preview Printing"));
- previewPrinting_->setEnabled(false);
- connect(previewPrinting_, SIGNAL(triggered()), this, SLOT(onPreviewPrint()));
-
- print_ = menuFile->addAction(tr("Print"));
- print_->setEnabled(false);
- connect(print_, SIGNAL(triggered()), this, SLOT(onPrint()));
-
- menuFile->addSeparator();
-
- export_ = menuFile->addAction(tr("Exportation"));
- export_->setEnabled(false);
- connect(export_, SIGNAL(triggered()), this, SLOT(onExportation()));
-
- menuFile->addSeparator();
-
- QAction *quit = menuFile->addAction(tr("Quit"));
- connect(quit, SIGNAL(triggered()), this, SLOT(close()));
-
- QMenu *menuAreas = ui->menuBar->addMenu(tr("Areas"));
-
- QAction *page = menuAreas->addAction(tr("Page"));
- page->setCheckable(true);
- page->setChecked(true);
- connect(page, SIGNAL(triggered()), &dockPages_, SLOT(switchVisibility()));
-
- QAction *region = menuAreas->addAction(tr("Region"));
- region->setCheckable(true);
- region->setChecked(true);
- connect(region, SIGNAL(triggered()), &dockRegion_, SLOT(switchVisibility()));
-
- QAction *xml = menuAreas->addAction(tr("Xml"));
- xml->setCheckable(true);
- xml->setChecked(false);
- connect(xml, SIGNAL(triggered()), &dockXml_, SLOT(switchVisibility()));
-
- QAction *preferences = ui->menuBar->addAction(tr("Preferences"));
- connect(preferences, SIGNAL(triggered()), this, SLOT(onPreferences()));
-
- QAction *about = ui->menuBar->addAction(tr("About"));
- connect(about, SIGNAL(triggered()), this, SLOT(onAbout()));
-}
-
-void MainWindow::setActionsEnabled(bool isSegmented)
-{
- segment_->setEnabled(!isSegmented);
- print_->setEnabled(isSegmented);
- previewPrinting_->setEnabled(isSegmented);
-}
-
-void MainWindow::disableActions()
-{
- segment_->setEnabled(false);
- print_->setEnabled(false);
- previewPrinting_->setEnabled(false);
- export_->setEnabled(false);
-}
-
-void MainWindow::connectWidgets()
-{
- // Each time the scene rect change (when a new picture is loaded), we fit the scene
background rectangle in the view.
- connect(&scene_, SIGNAL(sceneRectChanged(QRectF)), &graphicsView_,
SLOT(fitInView(QRectF)));
- // When dragging with right click, disable selection.
- connect(&graphicsView_, SIGNAL(beginDrag()), &scene_,
SLOT(disableSelection()));
- connect(&graphicsView_, SIGNAL(endDrag()), &scene_,
SLOT(enableSelection()));
-
- // If double click on a picture of the page widget -> draw it on background
scene.
- connect(&pagesWidget_, SIGNAL(imageSelectionned(QString)), this,
SLOT(onFileChanged(QString)));
-
- // Connect the scene to the xml widget and vice versa.
- connect(&scene_, SIGNAL(newSelection(QList<RegionItem*>)), this,
SLOT(onRegionSelection(QList<RegionItem*>)));
- connect(xmlWidget_.view(), SIGNAL(select(QList<XmlItem*>)), this,
SLOT(onXmlSelect(QList<XmlItem*>)));
- connect(xmlWidget_.view(), SIGNAL(unselect(QList<XmlItem*>)), this,
SLOT(onXmlUnselect(QList<XmlItem*>)));
- connect(xmlWidget_.view(), SIGNAL(emptySelection()), &scene_,
SLOT(selectBase()));
- connect(xmlWidget_.view(), SIGNAL(resetSelection()), &scene_,
SLOT(clearSelection()));
-
- // Connect the scene with the region widget.
- connect(®ionWidget_, SIGNAL(checkStateChanged(GraphicsRegion::Id,bool)),
&scene_, SLOT(setVisible(GraphicsRegion::Id,bool)));
-
- // Connect the xml widget with the region widget.
- connect(®ionWidget_, SIGNAL(checkStateChanged(QString)), xmlWidget_.view(),
SLOT(setFilterString(QString)));
-
- connect(&runner_, SIGNAL(progress()), progressDialog_, SLOT(run()));
- connect(&runner_, SIGNAL(new_progress_max_value(int)), progressDialog_,
SLOT(setMaximum(int)));
- connect(&runner_, SIGNAL(new_progress_label(QString)), progressDialog_,
SLOT(setLabelText(QString)));
- connect(&runner_, SIGNAL(finished()), progressDialog_, SLOT(close()));
- connect(&runner_, SIGNAL(xml_saved(QString)), this, SLOT(onXmlSaved(QString)));
-}
-
-void MainWindow::onOpen()
-{
- QStringList paths = QFileDialog::getOpenFileNames(this, "Open Image(s)",
QDir::homePath(),
- "Images (*.png *.jpg *.ppm
*.bmp)");
- setWindowTitle(tr("GScribo"));
-
- if(paths.count() > 0)
- {
- QStringList filenames = pagesWidget_.filenames();
- QString path;
-
- int counter = 0;
- bool isContained;
- // Check for an image not already added to the page widget.
- do
- {
- path = paths[counter];
- counter++;
- isContained = filenames.contains(path);
- } while(isContained && counter < paths.count());
-
- if(!isContained)
- {
- pagesWidget_.addPicture(path, QPixmap(path));
-
- // If more than one file, we store it in the page widget.
- for(int i = counter; i < paths.count(); i++)
- {
- // Check if the page widget contains the image.
- if(!filenames.contains(paths[i]))
- {
- path = paths[i];
- pagesWidget_.addPicture(path, QPixmap(path));
- }
- }
-
- pagesWidget_.setCurrentRow(0);
- pagesWidget_.scrollToTop();
- }
-
- // Change current scene.
- onFileChanged(path);
- }
-}
-
-void MainWindow::onSegment()
-{
- QStringList filenames;
-
- filenames << scene_.backgroundPath();
-
- // Run segmentation of page(s).
- progressDialog_->reset();
- runner_.start_demat(filenames);
-}
-
-void MainWindow::onPreviewPrint()
-{
- QPrinter printer(QPrinter::HighResolution);
- printer.setPaperSize(QPrinter::A4);
- printer.setResolution(300);
-
- QPrintPreviewDialog preview(&printer, this);
- connect(&preview, SIGNAL(paintRequested(QPrinter*)), this,
SLOT(printScene(QPrinter*)));
-
- preview.exec();
-}
-
-void MainWindow::onPrint()
-{
- QPrinter printer(QPrinter::HighResolution);
- printer.setPaperSize(QPrinter::A4);
- printer.setResolution(300);
-
- QPrintDialog dialog(&printer, this);
- dialog.setWindowTitle("Print Document");
-
- if(dialog.exec() != QDialog::Accepted)
- return;
-
- printScene(&printer);
-}
-
-void MainWindow::printScene(QPrinter *printer)
-{
- QPainter painter(printer);
- QStyleOptionGraphicsItem options;
-
- scene_.backgroundPixmap()->paint(&painter, &options, 0);
-
- // Paint backwards items first.
- printItems(&painter, scene_.root()->childsFrom(GraphicsRegion::TextRegion),
&options);
- printItems(&painter, scene_.root()->childsFrom(GraphicsRegion::Image),
&options);
-
- for(int i = GraphicsRegion::Line; i < GraphicsRegion::Image; i++)
- printItems(&painter,
scene_.root()->childsFrom(static_cast<GraphicsRegion::Id>(i)), &options);
-
- for(int i = GraphicsRegion::Noise; i <= GraphicsRegion::Meanline; i++)
- printItems(&painter,
scene_.root()->childsFrom(static_cast<GraphicsRegion::Id>(i)), &options);
-}
-
-void MainWindow::printItems(QPainter *painter, const QList<QGraphicsItem *>&
items, QStyleOptionGraphicsItem *options)
-{
- foreach(QGraphicsItem *child, items)
- {
- if(child->isVisible())
- {
- QRect viewport = scene_.backgroundPixmap()->mapRectFromItem(child,
child->boundingRect()).toRect();
- painter->translate(abs(child->boundingRect().x() - viewport.x()),
- abs(child->boundingRect().y() - viewport.y()));
- child->paint(painter, options);
- painter->resetTransform();
- }
- }
-}
-
-void MainWindow::onExportation()
-{
- QMessageBox messageBox(this);
- messageBox.setWindowTitle("Information");
- messageBox.setText("This feature is not available yet");
- messageBox.exec();
- return;
-
- QFileInfo fileInfo(scene_.backgroundPath());
- QString outputSuggestion = fileInfo.baseName() + ".pdf";
- QString output = QFileDialog::getSaveFileName(0, tr("Export Document As
..."), outputSuggestion,
- tr("PDF (*.pdf);; HTML (*.html
*.htm"));
-
- if(!output.isEmpty())
- {
- progressDialog_->reset();
- runner_.start_export(scene_.backgroundPath(), xml_.filename(), output);
- }
-}
-
-void MainWindow::onXmlSaved(const QString& filename)
-{
- xml_.load(filename);
- xmlWidget_.changeView(xml_.xmlItem());
- scene_.setRoot(xml_.graphicsItem());
-
- setActionsEnabled(true);
- export_->setEnabled(xml_.recognized());
-}
-
-void MainWindow::onFileChanged(const QString& filename)
-{
- // If it's not the current scene.
- if(scene_.backgroundPath() != filename)
- {
- QString xmlPath = Xml::getPath(filename);
-
- if(filename.isEmpty())
- {
- xmlPath = QString();
- disableActions();
- }
- // Check if the xml file already exists.
- else if(!QFile(xmlPath).exists())
- {
- xmlPath = QString();
- setActionsEnabled(false);
- }
- else
- setActionsEnabled(true);
-
- xml_.load(xmlPath);
- scene_.changeScene(filename, xml_.graphicsItem());
- xmlWidget_.changeView(xml_.xmlItem());
- export_->setEnabled(xml_.recognized());
- }
-}
-
-void MainWindow::onRegionSelection(QList<RegionItem *> regionItems)
-{
- if(!regionItems.isEmpty())
- xmlWidget_.view()->displayOnly(toXmlItems(regionItems));
- else
- {
- xmlWidget_.view()->reset();
- xmlWidget_.view()->displayAll();
- xmlWidget_.view()->expandAll();
- }
-}
-
-void MainWindow::onXmlChangeSelection(QList<XmlItem *> xmlItems, bool select)
-{
- QList<RegionItem *> regionItems = toRegionItems(xmlItems);
-
- if(!regionItems.isEmpty())
- {
- if(select)
- scene_.select(regionItems);
- else
- scene_.unselect(regionItems);
- }
-}
-
-QList<RegionItem *> MainWindow::toRegionItems(QList<XmlItem *> xmlItems)
const
-{
- QList<RegionItem *> regionItems;
- XmlItem *child;
- foreach(child, xmlItems)
- {
- if(child->regionItem())
- regionItems << child->regionItem();
- }
-
- return regionItems;
-}
-
-QList<XmlItem *> MainWindow::toXmlItems(QList<RegionItem *> regionItems)
const
-{
- QList<XmlItem *> xmlItems;
- RegionItem *child;
- foreach(child, regionItems)
- xmlItems << child->xmlItem();
-
- return xmlItems;
-}
diff --git a/GScribo/mainwindow.h b/GScribo/mainwindow.h
deleted file mode 100644
index 0637f44..0000000
--- a/GScribo/mainwindow.h
+++ /dev/null
@@ -1,120 +0,0 @@
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include <QPrintPreviewDialog>
-#include <QGraphicsView>
-#include <QPrintDialog>
-#include <QMainWindow>
-#include <QHBoxLayout>
-#include <QDockWidget>
-#include <QFileDialog>
-#include <QGroupBox>
-#include <QPrinter>
-
-#include "Preferences/preferencesdialog.h"
-#include "Processing/progressdialog.h"
-#include "PagesWidget/pageswidget.h"
-#include "Rendering/graphicsview.h"
-#include "XmlWidget/xmlwidget.h"
-#include "Processing/runner.h"
-#include "Rendering/scene.h"
-#include "regionwidget.h"
-#include "aboutdialog.h"
-#include "dockwidget.h"
-#include "xml.h"
-
-namespace Ui
-{
- class MainWindow;
-}
-
-class MainWindow:
- public QMainWindow
-{
- Q_OBJECT
-
- public:
- MainWindow(QWidget *parent = 0);
- ~MainWindow();
-
- protected:
- void changeEvent(QEvent *e);
-
- private:
- void initGraphicsRegion();
- void initDialogsWidget();
- void initPageWidget();
- void initRegionWidget();
- void initXmlWidget();
- void initMenuBar();
- void connectWidgets();
-
- void setActionsEnabled(bool isSegmented);
- void disableActions();
-
- void printItems(QPainter *painter, const QList<QGraphicsItem *>& items,
QStyleOptionGraphicsItem *options);
-
- Xml processTmpXml(const QString& filename) const;
- QList<RegionItem *> toRegionItems(QList<XmlItem *> regionItems)
const;
- QList<XmlItem *> toXmlItems(QList<RegionItem *> xmlItems) const;
-
- Ui::MainWindow *ui;
-
- DockWidget dockRegion_;
- DockWidget dockPages_;
- DockWidget dockXml_;
-
- GraphicsView graphicsView_;
- Scene scene_;
-
- PagesWidget pagesWidget_;
- RegionWidget regionWidget_;
-
- AboutDialog *aboutDialog_;
- ProgressDialog *progressDialog_;
- PreferencesDialog *preferencesDialog_;
-
- XmlWidget xmlWidget_;
- Xml xml_;
- Runner runner_;
-
- QAction *segment_;
- QAction *previewPrinting_;
- QAction *print_;
- QAction *export_;
-
- public slots:
- void printScene(QPrinter *printer);
-
- private slots:
- void onOpen();
- void onSegment();
- void onPreviewPrint();
- void onPrint();
- void onExportation();
- inline void onPreferences();
- inline void onAbout();
-
- void onXmlSaved(const QString& filename);
- void onFileChanged(const QString& filename);
-
- void onRegionSelection(QList<RegionItem *> regionItems);
-
- void onXmlChangeSelection(QList<XmlItem *> xmlItems, bool select);
- inline void onXmlSelect(QList<XmlItem *> xmlItems);
- inline void onXmlUnselect(QList<XmlItem *> xmlItems);
-};
-
-inline void MainWindow::onPreferences()
-{ preferencesDialog_->show(); }
-
-inline void MainWindow::onAbout()
-{ aboutDialog_->show(); }
-
-inline void MainWindow::onXmlSelect(QList<XmlItem *> xmlItems)
-{ onXmlChangeSelection(xmlItems, true); }
-
-inline void MainWindow::onXmlUnselect(QList<XmlItem *> xmlItems)
-{ onXmlChangeSelection(xmlItems, false); }
-
-#endif // MAINWINDOW_H
diff --git a/GScribo/mainwindow.ui b/GScribo/mainwindow.ui
deleted file mode 100644
index 0512da9..0000000
--- a/GScribo/mainwindow.ui
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>800</width>
- <height>600</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>MainWindow</string>
- </property>
- <widget class="QWidget" name="centralWidget">
- <property name="enabled">
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QMenuBar" name="menuBar">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>800</width>
- <height>21</height>
- </rect>
- </property>
- </widget>
- </widget>
- <layoutdefault spacing="6" margin="11"/>
- <resources/>
- <connections/>
-</ui>
diff --git a/GScribo/region.h b/GScribo/region.h
deleted file mode 100644
index ee8d836..0000000
--- a/GScribo/region.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef REGION_H
-#define REGION_H
-
-#include <QColor>
-
-namespace GraphicsRegion
-{
- // WARNING : The order is important.
- enum Id
- {
- TextRegion,
- Line,
-
- VerticalSeparator,
- HorizontalSeparator,
- WhiteSpaceSeparator,
-
- Image,
- Noise,
- Table,
- Maths,
- Graphic,
- Chart,
-
- Baseline,
- Meanline,
-
- Text,
- Separators,
- Miscellaneous,
- Typology,
-
- None
- };
-
- struct Data
- {
- QColor color;
- QString name;
- GraphicsRegion::Id region;
- GraphicsRegion::Id parent;
- int zValue;
- };
-}
-
-namespace Separator
-{
- enum FindSeparator
- {
- Lines,
- Whitespaces,
- Both
- };
-}
-
-#endif // REGION_H
diff --git a/GScribo/regionwidget.cpp b/GScribo/regionwidget.cpp
deleted file mode 100644
index 5d1a95e..0000000
--- a/GScribo/regionwidget.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-#include "regionwidget.h"
-
-RegionWidget::RegionWidget(QWidget *parent) :
- QTreeWidget(parent)
-{
- setHeaderHidden(true);
- setSelectionMode(QAbstractItemView::NoSelection);
-
- addTopLevelItem(createRoot("Text", GraphicsRegion::Text,
GraphicsRegion::TextRegion, GraphicsRegion::Line));
- addTopLevelItem(createRoot("Typological Lines", GraphicsRegion::Typology,
GraphicsRegion::Baseline, GraphicsRegion::Meanline));
- addTopLevelItem(createRoot("Separators", GraphicsRegion::Separators,
GraphicsRegion::VerticalSeparator, GraphicsRegion::WhiteSpaceSeparator));
- addTopLevelItem(createRoot("Miscellaneous", GraphicsRegion::Miscellaneous,
GraphicsRegion::Image, GraphicsRegion::Chart));
-
- expandAll();
-
- connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this,
SLOT(checkStateChanged(QTreeWidgetItem*)));
-}
-
-QTreeWidgetItem *RegionWidget::createRoot(const QString& text, const
GraphicsRegion::Id& region, const GraphicsRegion::Id& begin, const
GraphicsRegion::Id& end)
-{
- // Create root.
- QTreeWidgetItem *rootItem = createItem(text, region);
-
- // Fill root with corresponding childs.
- for(int region_ = begin; region_ <= end; region_++)
- fillRoot(rootItem, static_cast<GraphicsRegion::Id>(region_));
-
- return rootItem;
-}
-
-QTreeWidgetItem *RegionWidget::createItem(const QString& text, const
GraphicsRegion::Id& region, const QColor& color)
-{
- QTreeWidgetItem *item = new QTreeWidgetItem;
- item->setText(0, text);
- item->setCheckState(0, Qt::Checked);
- item->setBackgroundColor(0, color);
- // Store graphical id in the object to recognize it afterward.
- item->setData(0, Qt::UserRole, static_cast<int>(region));
-
- return item;
-}
-
-void RegionWidget::checkStateChanged(QTreeWidgetItem *item)
-{
- // If it's a root item, go to childs.
- if(item->childCount() != 0)
- {
- QTreeWidgetItem *child;
- for(int i = 0; i < item->childCount(); i++)
- {
- child = item->child(i);
- child->setCheckState(0, item->checkState(0));
- }
- }
- else
- {
- if(item->checkState(0) == Qt::Checked)
- {
- filterString_.append('|' + item->text(0));
- emit checkStateChanged(static_cast<GraphicsRegion::Id>(item->data(0,
Qt::UserRole).toInt()), true);
- }
- else
- {
- filterString_.remove('|' + item->text(0), Qt::CaseSensitive);
- emit checkStateChanged(static_cast<GraphicsRegion::Id>(item->data(0,
Qt::UserRole).toInt()), false);
- }
-
- //emit checkStateChanged(filterString_);
- }
-}
diff --git a/GScribo/regionwidget.h b/GScribo/regionwidget.h
deleted file mode 100644
index aaa6eda..0000000
--- a/GScribo/regionwidget.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef REGIONWIDGET_H
-#define REGIONWIDGET_H
-
-#include <QTreeWidget>
-#include <QLabel>
-
-#include "xml.h"
-
-class RegionWidget :
- public QTreeWidget
-{
- Q_OBJECT
-
- public:
- explicit RegionWidget(QWidget *parent = 0);
-
- inline QString filterString() const;
-
- private:
- QTreeWidgetItem *createRoot(const QString& text, const
GraphicsRegion::Id& region, const GraphicsRegion::Id& begin, const
GraphicsRegion::Id& end);
- QTreeWidgetItem *createItem(const QString& text, const
GraphicsRegion::Id& region, const QColor& color = QColor::fromRgb(255, 255,
255));
- inline void fillRoot(QTreeWidgetItem *rootItem, const GraphicsRegion::Id&
region);
-
- QString filterString_;
-
- private slots:
- void checkStateChanged(QTreeWidgetItem *item);
-
- signals:
- void checkStateChanged(const GraphicsRegion::Id& region, bool checked);
- void checkStateChanged(const QString& filterString);
-};
-
-inline void RegionWidget::fillRoot(QTreeWidgetItem *rootItem, const
GraphicsRegion::Id& region)
-{ GraphicsRegion::Data data = Xml::dataFromRegion(region);
filterString_.append('|' + data.name); rootItem->addChild(createItem(data.name,
region, data.color)); }
-
-inline QString RegionWidget::filterString() const
-{ return filterString_.right(filterString_.count()-1); }
-
-#endif // REGIONWIDGET_H
diff --git a/GScribo/variantpointer.h b/GScribo/variantpointer.h
deleted file mode 100644
index a11072c..0000000
--- a/GScribo/variantpointer.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef VARIANTPOINTER_H
-#define VARIANTPOINTER_H
-
-#include <QVariant>
-
-template<typename T> class VariantPointer
-{
- public:
- static inline QVariant toQVariant(T *pointer)
- { return QVariant::fromValue(static_cast<void *>(pointer)); }
-
- static inline T *fromQVariant(const QVariant& variant)
- { return static_cast<T *>(variant.value<void *>()); }
-
- private:
- VariantPointer() { }
-};
-
-#endif // VARIANTPOINTER_H
diff --git a/GScribo/xml.cpp b/GScribo/xml.cpp
deleted file mode 100644
index 9b0334d..0000000
--- a/GScribo/xml.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-#include "xml.h"
-
-Xml::Xml(const QString& filename)
-{
- load(filename);
-}
-
-QString Xml::getPath(const QString& filename)
-{
- Configs *const configs = Configs::getInstance();
-
- QString xmlPath = filename;
-
- // Get xml filename from image path.
- xmlPath.remove(0, xmlPath.lastIndexOf('/')+1);
- int pos = xmlPath.lastIndexOf('.');
- xmlPath.remove(pos, xmlPath.length()-pos);
- xmlPath += "_gui.xml";
-
- return configs->generalSaveXmlCustomDirPath() + "/" + xmlPath;
-}
-
-void Xml::isRecognized(const QDomElement& textElement)
-{
- QDomElement lineElement =
textElement.firstChild().nextSiblingElement("Line");
-
- // Check if the attributes "text" exists in the attributes of line in the
xml file.
- isRecognized_ = lineElement.attributeNode("text").isNull() ? false : true;
-}
-
-void Xml::load(const QString& filename)
-{
- if(filename.isEmpty())
- {
- xmlItem_ = 0;
- graphicsItem_ = 0;
- filename_ = QString();
- isRecognized_ = false;
- return;
- }
-
- // Reset graphic and tree items;
- xmlItem_ = new XmlItem;
- graphicsItem_ = new RootGraphicsItem(13);
- filename_ = getPath(filename);
-
- QFile xmlFile(filename);
- xmlFile.open(QIODevice::ReadOnly);
-
- // Fill new xml tree.
- xml_.clear();
- xml_.setContent(&xmlFile);
-
- xmlFile.close();
-
- QDomElement root = xml_.documentElement();
- xmlItem_->load(root);
- xmlItem_->show();
-
- root = root.firstChild().toElement();
- XmlItem *parentTreeItem = init(root, xmlItem_);
-
- // Run through the xml file structure by structure.
- root = root.nextSibling().firstChild().toElement();
- // Check if the xml file has been recognized by the ocr or not.
- isRecognized(root);
-
- processNode(root, datas_[0], parentTreeItem);
- for(int i = 2; i < 11; i++)
- processNode(root.nextSiblingElement(datas_[i].name), datas_[i], parentTreeItem);
-}
-
-XmlItem *Xml::init(const QDomElement& root, XmlItem *rootTreeItem)
-{
- XmlItem *metadataItem = new XmlItem(root, rootTreeItem);
-
- XmlItem *contentItem = 0;
-
- // Run through "METADATA" node and subnodes.
- QDomElement node = root.firstChild().toElement();
- while(!node.isNull())
- {
- contentItem = new XmlItem(node, metadataItem, contentItem);
- node = node.nextSibling().toElement();
- }
-
- // Add "PAGE" root node and return it.
- metadataItem = new XmlItem(root.nextSibling().toElement(), rootTreeItem,
metadataItem);
- metadataItem->show();
-
- return metadataItem;
-}
-
-void Xml::processNode(const QDomElement& root, const GraphicsRegion::Data& data,
XmlItem *pageItem)
-{
- if(!root.isNull())
- {
- // Create corresponding tree item.
- XmlItem *regionItem = new XmlItem(root, pageItem);
-
- QDomElement node = root.firstChild().toElement();
- XmlItem *coordsItem = new XmlItem(node, regionItem);
-
- QPolygon polygon;
- XmlItem *pointItem = 0;
- QString x, y;
-
- // Run through all points data.
- node = node.firstChild().toElement();
- while(!node.isNull())
- {
- x = node.attribute("x", "null");
- y = node.attribute("y", "null");
-
- pointItem = new XmlItem(node, coordsItem, pointItem);
-
- polygon << QPoint(x.toInt(), y.toInt());
- node = node.nextSibling().toElement();
- }
-
- // Create the graphics item from data structure.
- RegionItem *graphicsItem = new RegionItem(polygon, graphicsItem_);
- graphicsItem->loadData(data);
- graphicsItem_->addItemFrom(graphicsItem, data.region);
-
- // Store xml item and graphics item in each object for selection.
- regionItem->setRegionItem(graphicsItem);
- graphicsItem->setXmlItem(regionItem);
-
- if(data.region == GraphicsRegion::TextRegion)
- processLineNode(root.firstChild().nextSiblingElement("Line"),
coordsItem);
-
- // Run through all nodes from the same data structure recursively.
- processNode(root.nextSiblingElement(data.name), data, pageItem);
- }
-}
-
-void Xml::processLineNode(const QDomElement& root, XmlItem *precItem)
-{
- if(!root.isNull())
- {
- // Create corresponding tree item.
- XmlItem *lineItem = new XmlItem(root, precItem->parent(), precItem);
-
- QDomElement node = root.firstChild().toElement();
- XmlItem *coordsItem = new XmlItem(node, lineItem);
-
- QPolygon polygon;
- XmlItem *pointItem = 0;
-
- QString xs, ys;
- int x, y;
-
- int xMin = INT_MAX;
- int xMax = INT_MIN;
-
- // Run through all points data.
- node = node.firstChild().toElement();
- while(!node.isNull())
- {
- xs = node.attribute("x", "null");
- ys = node.attribute("y", "null");
-
- pointItem = new XmlItem(node, coordsItem, pointItem);
-
- x = xs.toInt();
- y = ys.toInt();
-
- // Get beginning and end of line.
- if(xMin > x)
- xMin = x;
- if(xMax < x)
- xMax = x;
-
- polygon << QPoint(x, y);
- node = node.nextSibling().toElement();
- }
-
- // Create the graphics item from data structure.
- RegionItem *graphicsItem = new RegionItem(polygon, graphicsItem_);
- graphicsItem->loadData(datas_[1]);
- graphicsItem_->addItemFrom(graphicsItem, datas_[1].region);
-
- // Store xml item and graphics item in each object for selection.
- lineItem->setRegionItem(graphicsItem);
- graphicsItem->setXmlItem(lineItem);
-
- // Get meanline and baseline.
- processTypoNode(root, QPoint(xMin, xMax));
- // Run through all line nodes recursively.
- processLineNode(root.nextSiblingElement(datas_[1].name), lineItem);
- }
-}
-
-void Xml::processTypoNode(const QDomElement& root, const QPoint& xPoint)
-{
- int yPos = root.attribute("baseline", "null").toInt();
- QGraphicsLineItem *baselineItem = new QGraphicsLineItem(QLine(QPoint(xPoint.x(),
yPos), QPoint(xPoint.y(), yPos)));
- baselineItem->setZValue(datas_[11].zValue);
- graphicsItem_->addItemFrom(baselineItem, datas_[11].region);
-
- yPos = root.attribute("meanline", "null").toInt();
- QGraphicsLineItem *meanlineItem = new QGraphicsLineItem(QLine(QPoint(xPoint.x(),
yPos), QPoint(xPoint.y(), yPos)));
- meanlineItem->setZValue(datas_[12].zValue);
- graphicsItem_->addItemFrom(meanlineItem, datas_[12].region);
-}
diff --git a/GScribo/xml.h b/GScribo/xml.h
deleted file mode 100644
index f9274ed..0000000
--- a/GScribo/xml.h
+++ /dev/null
@@ -1,93 +0,0 @@
-#ifndef XML_H
-#define XML_H
-
-#include <QTreeWidgetItem>
-#include <QGraphicsItem>
-#include <QStringList>
-#include <QDomElement>
-#include <QDomAttr>
-#include <climits>
-#include <QFile>
-
-#include "Rendering/rootgraphicsitem.h"
-#include "Rendering/regionitem.h"
-#include "XmlWidget/xmlitem.h"
-#include "variantpointer.h"
-#include "configs.h"
-#include "region.h"
-
-// WARNING : The order is VERY IMPORTANT (depending on the enum).
-static const GraphicsRegion::Data datas_[] =
-{
- /* COLOR | NAME |
REGION | PARENT | Z */
- { QColor::fromRgb(0, 100, 0, 110), "TextRegion",
GraphicsRegion::TextRegion, GraphicsRegion::Text, 1 },
- { QColor::fromRgb(255, 0, 0, 110), "Line",
GraphicsRegion::Line, GraphicsRegion::Text, 2 },
- { QColor::fromRgb(0, 0, 255, 110), "VerticalSeparatorRegion",
GraphicsRegion::VerticalSeparator, GraphicsRegion::Separators, 2 },
- { QColor::fromRgb(0, 0, 255, 110), "HorizontalSeparatorRegion",
GraphicsRegion::HorizontalSeparator, GraphicsRegion::Separators, 2 },
- { QColor::fromRgb(0, 0, 128, 110), "WhitespaceSeparatorRegion",
GraphicsRegion::WhiteSpaceSeparator, GraphicsRegion::Separators, 2 },
- { QColor::fromRgb(255, 120, 0, 110), "ImageRegion",
GraphicsRegion::Image, GraphicsRegion::Miscellaneous, 1 },
- { QColor::fromRgb(43, 39, 128, 110), "NoiseRegion",
GraphicsRegion::Noise, GraphicsRegion::Miscellaneous, 2 },
- { QColor::fromRgb(220, 246, 0, 110), "TableRegion",
GraphicsRegion::Table, GraphicsRegion::Miscellaneous, 2 },
- { QColor::fromRgb(170, 0, 255, 110), "MathsRegion",
GraphicsRegion::Maths, GraphicsRegion::Miscellaneous, 2 },
- { QColor::fromRgb(255, 0, 144, 110), "GraphicsRegion",
GraphicsRegion::Graphic, GraphicsRegion::Miscellaneous, 2 },
- { QColor::fromRgb(0, 204, 255, 110), "ChartRegion",
GraphicsRegion::Chart, GraphicsRegion::Miscellaneous, 2 },
- { QColor::fromRgb(128, 0, 255), "Baseline",
GraphicsRegion::Baseline, GraphicsRegion::Typology, 3 },
- { QColor::fromRgb(128, 0, 255), "Meanline",
GraphicsRegion::Meanline, GraphicsRegion::Typology, 3 },
- { QColor::fromRgb(255, 255, 255), "Text",
GraphicsRegion::Text, GraphicsRegion::None, 0 },
- { QColor::fromRgb(255, 255, 255), "Separators",
GraphicsRegion::Separators, GraphicsRegion::None, 0 },
- { QColor::fromRgb(255, 255, 255), "Miscellaneous",
GraphicsRegion::Miscellaneous, GraphicsRegion::None, 0 },
- { QColor::fromRgb(255, 255, 255), "Typological Lines",
GraphicsRegion::Typology, GraphicsRegion::None, 0 }
-};
-
-class Xml
-{
- public:
- explicit Xml(const QString& filename = QString());
-
- inline XmlItem *xmlItem();
- inline RootGraphicsItem *graphicsItem();
-
- inline QDomDocument document() const;
- inline QString filename() const;
- inline bool recognized() const;
-
- static QString getPath(const QString& filename);
-
- void load(const QString& filename);
- inline static GraphicsRegion::Data dataFromRegion(GraphicsRegion::Id region);
-
- private:
- XmlItem *init(const QDomElement& root, XmlItem *rootTreeItem);
- void isRecognized(const QDomElement& element);
-
- void processNode(const QDomElement& root, const GraphicsRegion::Data&
data, XmlItem *rootTreeItem);
- void processLineNode(const QDomElement& root, XmlItem *rootTreeItem);
- void processTypoNode(const QDomElement& root, const QPoint& xPoint);
-
- RootGraphicsItem *graphicsItem_;
- XmlItem *xmlItem_;
-
- QDomDocument xml_;
- QString filename_;
- bool isRecognized_;
-};
-
-inline XmlItem *Xml::xmlItem()
-{ return xmlItem_; }
-
-inline RootGraphicsItem *Xml::graphicsItem()
-{ return graphicsItem_; }
-
-inline QDomDocument Xml::document() const
-{ return xml_; }
-
-inline QString Xml::filename() const
-{ return filename_; }
-
-inline GraphicsRegion::Data Xml::dataFromRegion(GraphicsRegion::Id region)
-{ return datas_[region]; }
-
-inline bool Xml::recognized() const
-{ return isRecognized_; }
-
-#endif // XML_H
--
1.7.2.5