[poppler] glib/CMakeLists.txt glib/demo glib/poppler-document.cc glib/poppler-document.h glib/poppler-form-field.cc glib/poppler-form-field.h glib/poppler.h glib/reference

2023-06-29 Thread GitLab Mirror
 glib/CMakeLists.txt |6 
 glib/demo/CMakeLists.txt|1 
 glib/demo/main.c|4 
 glib/demo/signature.c   |  437 ++
 glib/demo/signature.h   |   31 +
 glib/poppler-document.cc|   98 +++
 glib/poppler-document.h |5 
 glib/poppler-form-field.cc  | 1088 
 glib/poppler-form-field.h   |  114 +++
 glib/poppler.h  |5 
 glib/reference/poppler-sections.txt |   51 +
 glib/reference/poppler.types|2 
 12 files changed, 1840 insertions(+), 2 deletions(-)

New commits:
commit bdd922b7caaa965828e0e45a6cde0b1585c9740e
Author: Jan-Michael Brummer 
Date:   Wed Oct 5 08:20:13 2022 +0200

Signatures: Add signing API to glib part

Rectangle corrections by Marek Kasik

diff --git a/glib/CMakeLists.txt b/glib/CMakeLists.txt
index 52e8687a..4e17440c 100644
--- a/glib/CMakeLists.txt
+++ b/glib/CMakeLists.txt
@@ -99,6 +99,10 @@ target_link_libraries(poppler-glib poppler PkgConfig::GLIB2 
${CAIRO_LIBRARIES} F
 target_include_directories(poppler-glib SYSTEM PRIVATE ${CAIRO_INCLUDE_DIRS})
 install(TARGETS poppler-glib RUNTIME DESTINATION bin LIBRARY DESTINATION 
${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
 
+if (ENABLE_NSS3)
+target_include_directories(poppler-glib SYSTEM PRIVATE 
${NSS3_INCLUDE_DIRS})
+endif()
+
 install(FILES
   ${poppler_glib_public_headers}
   ${CMAKE_CURRENT_BINARY_DIR}/poppler-enums.h
@@ -150,3 +154,5 @@ endif ()
 if(ENABLE_GTK_DOC)
   add_subdirectory(reference)
 endif()
+
+check_function_exists(explicit_bzero HAVE_EXPLICIT_BZERO)
\ No newline at end of file
diff --git a/glib/demo/CMakeLists.txt b/glib/demo/CMakeLists.txt
index 4c1ae9a5..1520d840 100644
--- a/glib/demo/CMakeLists.txt
+++ b/glib/demo/CMakeLists.txt
@@ -18,6 +18,7 @@ set(poppler_glib_demo_SRCS
   layers.c
   selections.c
   taggedstruct.c
+  signature.c
 )
 poppler_add_test(poppler-glib-demo BUILD_GTK_TESTS ${poppler_glib_demo_SRCS})
 
diff --git a/glib/demo/main.c b/glib/demo/main.c
index e7fdea13..9b95b3ed 100644
--- a/glib/demo/main.c
+++ b/glib/demo/main.c
@@ -38,6 +38,7 @@
 #include "find.h"
 #include "print.h"
 #include "selections.h"
+#include "signature.h"
 
 enum
 {
@@ -69,7 +70,8 @@ static const PopplerGlibDemo demo_list[] = { { "Info", 
pgd_info_create_widget },
  { "Text", pgd_text_create_widget 
},
  { "Tagged Structure", 
pgd_taggedstruct_create_widget },
  { "Find", pgd_find_create_widget 
},
- { "Print", 
pgd_print_create_widget } };
+ { "Print", 
pgd_print_create_widget },
+ { "Signature", 
pgd_signature_create_widget } };
 
 static void pgd_demo_changed(GtkTreeSelection *selection, GtkNotebook 
*notebook)
 {
diff --git a/glib/demo/signature.c b/glib/demo/signature.c
new file mode 100644
index ..15c68c5a
--- /dev/null
+++ b/glib/demo/signature.c
@@ -0,0 +1,437 @@
+/*
+ * Copyright (C) 2022-2023 Jan-Michael Brummer 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, 
USA.
+ */
+
+#include 
+#include 
+
+#include "signature.h"
+#include "utils.h"
+
+typedef struct
+{
+PopplerDocument *doc;
+PopplerPage *page;
+GtkWidget *darea;
+cairo_surface_t *surface;
+gint num_page;
+gint redraw_idle;
+GdkPoint start;
+GdkPoint stop;
+gboolean started;
+GdkCursorType cursor;
+GtkWidget *main_box;
+gdouble scale;
+} PgdSignatureDemo;
+
+/* Render area */
+static cairo_surface_t *pgd_signature_render_page(PgdSignatureDemo *demo)
+{
+cairo_t *cr;
+PopplerPage *page;
+gdouble width, height;
+cairo_surface_t *surface = NULL;
+
+page = poppler_document_get_page(demo->doc, demo->num_page);
+if (!page) {
+return NULL;
+}
+
+poppler_page_get_size(page, , );
+
+width *= demo->scale;
+height *= demo->scale;
+gtk_widget_set_size_request(demo->darea, width, height);
+
+surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height);
+cr = cairo_create(surface);
+
+if 

[poppler] glib/CMakeLists.txt glib/demo

2014-02-09 Thread Albert Astals Cid
 glib/CMakeLists.txt  |2 ++
 glib/demo/CMakeLists.txt |1 +
 2 files changed, 3 insertions(+)

New commits:
commit a865f13def88153fdbe8a0a054d2005e3e2bb737
Author: Albert Astals Cid aa...@kde.org
Date:   Sun Feb 9 23:22:07 2014 +0100

Fix cmake build

diff --git a/glib/CMakeLists.txt b/glib/CMakeLists.txt
index a3a9d4c..35a6197 100644
--- a/glib/CMakeLists.txt
+++ b/glib/CMakeLists.txt
@@ -30,6 +30,7 @@ set(poppler_glib_public_headers
   poppler-movie.h
   poppler-media.h
   poppler.h
+  poppler-structure-element.h
 )
 
 find_program(GLIB2_MKENUMS glib-mkenums)
@@ -71,6 +72,7 @@ set(poppler_glib_SRCS
   poppler.cc
   poppler-cached-file-loader.cc
   poppler-input-stream.cc
+  poppler-structure-element.cc
 )
 set(poppler_glib_generated_SRCS
   ${CMAKE_CURRENT_BINARY_DIR}/poppler-enums.c
diff --git a/glib/demo/CMakeLists.txt b/glib/demo/CMakeLists.txt
index 316371e..465021a 100644
--- a/glib/demo/CMakeLists.txt
+++ b/glib/demo/CMakeLists.txt
@@ -23,6 +23,7 @@ set(poppler_glib_demo_SRCS
   attachments.c
   layers.c
   selections.c
+  taggedstruct.c
 )
 poppler_add_test(poppler-glib-demo BUILD_GTK_TESTS ${poppler_glib_demo_SRCS})
 target_link_libraries(poppler-glib-demo poppler-glib ${GTK3_LIBRARIES})
___
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler


[poppler] glib/CMakeLists.txt glib/demo

2010-07-22 Thread Pino Toscano
 glib/CMakeLists.txt  |5 +++--
 glib/demo/CMakeLists.txt |5 -
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit d0a6f9abdab88ec43004b6766337db304cbf6a25
Author: Pino Toscano p...@kde.org
Date:   Thu Jul 22 21:28:55 2010 +0200

[CMake] improve the way include dirs and cflags for gdk and gtk are set

correctly include_directories() for the include dirs, while add the cflags 
which are not include dirs as definitions

diff --git a/glib/CMakeLists.txt b/glib/CMakeLists.txt
index f3b180e..fded2e8 100644
--- a/glib/CMakeLists.txt
+++ b/glib/CMakeLists.txt
@@ -6,14 +6,15 @@ include_directories(
 )
 add_definitions(
   -DG_LOG_DOMAIN=\Poppler\
-  ${GLIB2_CFLAGS_OTHERS}
+  ${GLIB2_CFLAGS_OTHER}
   ${CAIRO_CFLAGS}
   ${POPPLER_GLIB_DISABLE_DEPRECATED}
   ${POPPLER_GLIB_DISABLE_SINGLE_INCLUDES}
 )
 
 if (GDK_FOUND)
-  add_definitions(${GDK2_CFLAGS})
+  include_directories(${GDK2_INCLUDE_DIRS})
+  add_definitions(${GDK2_CFLAGS_OTHER})
 endif (GDK_FOUND)
 
 configure_file(poppler-features.h.cmake 
${CMAKE_CURRENT_BINARY_DIR}/poppler-features.h @ONLY)
diff --git a/glib/demo/CMakeLists.txt b/glib/demo/CMakeLists.txt
index 4d12822..286fbd7 100644
--- a/glib/demo/CMakeLists.txt
+++ b/glib/demo/CMakeLists.txt
@@ -1,5 +1,8 @@
+include_directories(
+  ${GTK2_INCLUDE_DIRS}
+)
 
-add_definitions(${GTK2_CFLAGS})
+add_definitions(${GTK2_CFLAGS_OTHER})
 
 set(poppler_glib_demo_SRCS
   main.c
___
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler