diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ec30cb..0c956a9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,9 +13,13 @@ include_directories(${CMAKE_CURRENT_LIST_DIR}
Resources/InsaneWidget
Resources/Utilities
Resources/InsaneWidget/UI
+ Resources/StampWidget
+ Resources/StampWidget/UI
+
Resources/UI/S7)
add_subdirectory(Resources/Utilities)
+add_subdirectory(Resources/StampWidget)
add_subdirectory(Resources/InsaneWidget)
add_executable(s7
@@ -25,6 +29,6 @@ add_executable(s7
install(TARGETS s7 RUNTIME DESTINATION bin)
-target_link_libraries(s7 minutils insanewidget
+target_link_libraries(s7 insanewidget
${wxWidgets_LIBRARIES}
)
diff --git a/README.md b/README.md
index c62aab7..cff1034 100644
--- a/README.md
+++ b/README.md
@@ -5,9 +5,10 @@ This is a simple scanning application with these goals:
- full page scan
- known number of pages to scan
- double-sided handling
- - multiple output file format: PNG, JPEG, TIFF, PNM and PDF.
+ - multiple output file format: PNG, JPEG, TIFF, PNM and PDF
+ - apply an optional stamp on each page.
-It is based on [libinsane](https://gitlab.gnome.org/World/OpenPaperwork/libinsane) and written with [wxWidgets](https://wxwidgets.org).
+It is based on [libinsane](https://gitlab.gnome.org/World/OpenPaperwork/libinsane) and [wxWidgets](https://wxwidgets.org).

@@ -22,6 +23,7 @@ Inputs:
- the scanner and its minimal parameters (source, mode, resolution)
- page size
- output file format.
+ - an optional stamp text
Right click on the 'New' label to specify the number of faces and whether double-sided scanning is needed.
diff --git a/Resources/InsaneWidget/CMakeLists.txt b/Resources/InsaneWidget/CMakeLists.txt
index 31fff91..8bb6658 100644
--- a/Resources/InsaneWidget/CMakeLists.txt
+++ b/Resources/InsaneWidget/CMakeLists.txt
@@ -9,23 +9,24 @@ find_package(LibInsane REQUIRED)
find_package(PoDoFo REQUIRED)
find_package(Paper REQUIRED)
-
include_directories(${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/UI
+ ${CMAKE_CURRENT_LIST_DIR}/../StampWidget
+ ${CMAKE_CURRENT_LIST_DIR}/../StampWidget/UI
${CMAKE_CURRENT_LIST_DIR}/../Utilities)
-
+
add_library(insanewidget STATIC
UI/InsaneWidget.cpp
UI/ScannerWidget.cpp
- Common.h
+ DefsInsaneWidget.h
XInsaneWidget.cpp
XScannerWidget.cpp
InsaneWorker.cpp
PixelToImageWriter.cpp
PixelToPdfWriter.cpp)
-target_link_libraries(insanewidget minutils
+target_link_libraries(insanewidget minutils stampwidget
${wxWidgets_LIBRARIES}
${LIBINSANE_LIBRARIES}
${PODOFO_LIBRARIES}
diff --git a/Resources/InsaneWidget/Common.h b/Resources/InsaneWidget/DefsInsaneWidget.h
similarity index 75%
rename from Resources/InsaneWidget/Common.h
rename to Resources/InsaneWidget/DefsInsaneWidget.h
index d5f1ee8..0b85a4d 100644
--- a/Resources/InsaneWidget/Common.h
+++ b/Resources/InsaneWidget/DefsInsaneWidget.h
@@ -1,14 +1,14 @@
// /*
-// * File: Common.h
+// * File: DefsInsaneWidget.h
// * Author: Saleem Edah-Tally - nmset@yandex.com
// * License : CeCILL-C
// * Copyright Saleem Edah-Tally - © 2025
// *
-// * Created on 27 06 2025, 20:34
+// * Created on 08 07 2025, 20:44
// */
-#ifndef COMMON_H
-#define COMMON_H
+#ifndef DEFSINSANEWIDGET_H
+#define DEFSINSANEWIDGET_H
#include
#include
0
-1
-1
- "wxTextCtrl: ID_TEXTCTRL"
+ "wxTextCtrl: ID_TEXTCTRL_S7"
0
"dialog-control-document"
diff --git a/Resources/UI/S7/s7.cpp b/Resources/UI/S7/s7.cpp
index 1bf37a3..695dd3a 100644
--- a/Resources/UI/S7/s7.cpp
+++ b/Resources/UI/S7/s7.cpp
@@ -126,7 +126,7 @@ void S7::CreateControls()
dpkDestination->SetToolTip(_("Select a destination directory.\nDouble-click to go to the selected directory."));
szMain->Add(dpkDestination, 0, wxGROW|wxALL, 5);
- txtBasename = new wxTextCtrl( panMain, ID_TEXTCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
+ txtBasename = new wxTextCtrl( panMain, ID_TEXTCTRL_S7, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
txtBasename->SetHelpText(_("Basename"));
if (S7::ShowToolTips())
txtBasename->SetToolTip(_("Specify a destination file basename (without extension).\n\n'CTRL + click' for about information."));
diff --git a/Resources/UI/S7/s7.h b/Resources/UI/S7/s7.h
index f69647a..cf9ad7c 100644
--- a/Resources/UI/S7/s7.h
+++ b/Resources/UI/S7/s7.h
@@ -39,7 +39,7 @@ class wxDirPickerCtrl;
#define ID_S7 10000
#define ID_PANEL 10001
#define ID_DIRPICKERCTRL 10002
-#define ID_TEXTCTRL 10003
+#define ID_TEXTCTRL_S7 10003
#define SYMBOL_S7_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_S7_TITLE _("S7")
#define SYMBOL_S7_IDNAME ID_S7
diff --git a/XS7.cpp b/XS7.cpp
index 24c18bc..367da14 100644
--- a/XS7.cpp
+++ b/XS7.cpp
@@ -17,6 +17,8 @@
using namespace std;
+IMPLEMENT_CLASS( XS7, S7 )
+
XS7::XS7(wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style)
: S7(parent, id, caption, pos, size, style)
{}
@@ -63,7 +65,8 @@ void XS7::Setup()
SetStatusBar(sb);
m_insaneWidget = new XInsaneWidget(panMain, sb, m_config.get());
- szMain->Add(m_insaneWidget, 0, wxGROW | wxALL);
+ m_insaneWidget->Setup();
+ szMain->Insert(2, m_insaneWidget, 1, wxGROW | wxALL);
dpkDestination->Bind ( wxEVT_DIRPICKER_CHANGED, &XS7::OnDpkRepositoryChange, this );
dpkDestination->GetTextCtrl()->Bind ( wxEVT_LEFT_DCLICK, &XS7::OnDpkDoubleClick, this );
diff --git a/XS7.h b/XS7.h
index 35f71c8..a63c978 100644
--- a/XS7.h
+++ b/XS7.h
@@ -17,6 +17,7 @@
class XS7 : public S7
{
+ DECLARE_DYNAMIC_CLASS( XS7 )
public:
XS7(wxWindow* parent, wxWindowID id = SYMBOL_S7_IDNAME, const wxString& caption = SYMBOL_S7_TITLE,
const wxPoint& pos = SYMBOL_S7_POSITION, const wxSize& size = SYMBOL_S7_SIZE, long style = SYMBOL_S7_STYLE );
diff --git a/globals.h b/globals.h
index 7dd7423..4a97682 100644
--- a/globals.h
+++ b/globals.h
@@ -11,7 +11,7 @@
#define GLOBALS_H
#define _APPNAME_ "S7"
-#define _APPVERSION_ 1
+#define _APPVERSION_ 2
#define _INSANEWIDGET_NAME "InsaneWidget"
#endif /* GLOBALS_H */