[poppler] 3 commits - glib/demo glib/poppler-document.cc glib/poppler-document.h gtk-doc.make

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Fri May 6 05:49:29 PDT 2011


 glib/demo/info.cc        |   39 +++++++++++-
 glib/poppler-document.cc |    6 +
 glib/poppler-document.h  |   10 ++-
 gtk-doc.make             |  151 ++++++++++++++++++++++++++++++-----------------
 4 files changed, 149 insertions(+), 57 deletions(-)

New commits:
commit 3e3284de3fe1916d7f8161ede7bf49c76d01f303
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Fri May 6 14:49:05 2011 +0200

    glib: Update gtk-doc.make

diff --git a/gtk-doc.make b/gtk-doc.make
index 5574645..16543f5 100644
--- a/gtk-doc.make
+++ b/gtk-doc.make
@@ -23,16 +23,19 @@ GPATH = $(srcdir)
 
 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
 
-EXTRA_DIST = 				\
+SETUP_FILES = \
 	$(content_files)		\
-	$(HTML_IMAGES)			\
 	$(DOC_MAIN_SGML_FILE)		\
 	$(DOC_MODULE)-sections.txt	\
 	$(DOC_MODULE)-overrides.txt
 
-DOC_STAMPS=scan-build.stamp sgml-build.stamp html-build.stamp pdf-build.stamp \
-	$(srcdir)/sgml.stamp $(srcdir)/html.stamp  \
-	$(srcdir)/pdf.stamp
+EXTRA_DIST = 				\
+	$(HTML_IMAGES)			\
+	$(SETUP_FILES)
+
+DOC_STAMPS=setup-build.stamp scan-build.stamp sgml-build.stamp \
+	html-build.stamp pdf-build.stamp \
+	sgml.stamp html.stamp pdf.stamp
 
 SCANOBJ_FILES = 		 \
 	$(DOC_MODULE).args 	 \
@@ -69,22 +72,45 @@ docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
 
 $(REPORT_FILES): sgml-build.stamp
 
+#### setup ####
+
+setup-build.stamp:
+	- at if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+	    echo '  DOC   Preparing build'; \
+	    files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
+	    if test "x$$files" != "x" ; then \
+	        for file in $$files ; do \
+	            test -f $(abs_srcdir)/$$file && \
+	                cp -p $(abs_srcdir)/$$file $(abs_builddir)/ || true; \
+	        done; \
+	    fi \
+	fi
+	@touch setup-build.stamp
+
+
 #### scan ####
 
 scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
-	@echo 'gtk-doc: Scanning header files'
-	@-chmod -R u+w $(srcdir)
-	@_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+	@echo '  DOC   Scanning header files'
+	@_source_dir='' ; \
+	for i in $(DOC_SOURCE_DIR) ; do \
 	    _source_dir="$${_source_dir} --source-dir=$$i" ; \
-	  done ; \
-	  cd $(srcdir) && \
-	  gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
-	@if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
-	    CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
+	done ; \
+	gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
+	@if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
+	    echo "  DOC   Introspecting gobjects"; \
+	    scanobj_options=""; \
+	    gtkdoc-scangobj 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
+	    if test "$(?)" = "0"; then \
+	        if test "x$(V)" = "x1"; then \
+	            scanobj_options="--verbose"; \
+	        fi; \
+	    fi; \
+	    CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
+	    gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \
 	else \
-	    cd $(srcdir) ; \
 	    for i in $(SCANOBJ_FILES) ; do \
-               test -f $$i || touch $$i ; \
+	        test -f $$i || touch $$i ; \
 	    done \
 	fi
 	@touch scan-build.stamp
@@ -94,14 +120,13 @@ $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)
 
 #### xml ####
 
-sgml-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files)
-	@echo 'gtk-doc: Building XML'
-	@-chmod -R u+w $(srcdir)
-	@_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files)
+	@echo '  DOC   Building XML'
+	@_source_dir='' ; \
+	for i in $(DOC_SOURCE_DIR) ; do \
 	    _source_dir="$${_source_dir} --source-dir=$$i" ; \
-	  done ; \
-	  cd $(srcdir) && \
-	  gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
+	done ; \
+	gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
 	@touch sgml-build.stamp
 
 sgml.stamp: sgml-build.stamp
@@ -110,58 +135,78 @@ sgml.stamp: sgml-build.stamp
 #### html ####
 
 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
-	@echo 'gtk-doc: Building HTML'
-	@-chmod -R u+w $(srcdir)
-	@rm -rf $(srcdir)/html
-	@mkdir $(srcdir)/html
+	@echo '  DOC   Building HTML'
+	@rm -rf html
+	@mkdir html
 	@mkhtml_options=""; \
+	gtkdoc-mkhtml 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
+	if test "$(?)" = "0"; then \
+	  if test "x$(AM_DEFAULT_VERBOSITY)" = "x1"; then \
+	    mkhtml_options="$$mkhtml_options --verbose"; \
+	  fi; \
+	fi; \
 	gtkdoc-mkhtml 2>&1 --help | grep  >/dev/null "\-\-path"; \
 	if test "$(?)" = "0"; then \
-	  mkhtml_options=--path="$(srcdir)"; \
+	  mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \
 	fi; \
-	cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
-	@test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
-	@echo 'gtk-doc: Fixing cross-references'
-	@cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
+	cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
+	- at test "x$(HTML_IMAGES)" = "x" || \
+	for file in $(HTML_IMAGES) ; do \
+	  if test -f $(abs_srcdir)/$$file ; then \
+	    cp $(abs_srcdir)/$$file $(abs_builddir)/html; \
+	  fi; \
+	  if test -f $(abs_builddir)/$$file ; then \
+	    cp $(abs_builddir)/$$file $(abs_builddir)/html; \
+	  fi; \
+	done;
+	@echo '  DOC   Fixing cross-references'
+	@gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
 	@touch html-build.stamp
 
 #### pdf ####
 
 pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
-	@echo 'gtk-doc: Building PDF'
-	@-chmod -R u+w $(srcdir)
-	@rm -rf $(srcdir)/$(DOC_MODULE).pdf
-	@mkpdf_imgdirs=""; \
+	@echo '  DOC   Building PDF'
+	@rm -f $(DOC_MODULE).pdf
+	@mkpdf_options=""; \
+	gtkdoc-mkpdf 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
+	if test "$(?)" = "0"; then \
+	  if test "x$(AM_DEFAULT_VERBOSITY)" = "x1"; then \
+	    mkpdf_options="$$mkpdf_options --verbose"; \
+	  fi; \
+	fi; \
 	if test "x$(HTML_IMAGES)" != "x"; then \
 	  for img in $(HTML_IMAGES); do \
 	    part=`dirname $$img`; \
-	    echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \
+	    echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \
 	    if test $$? != 0; then \
-	      mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \
+	      mkpdf_options="$$mkpdf_options --imgdir=$$part"; \
 	    fi; \
 	  done; \
 	fi; \
-	cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
+	gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
 	@touch pdf-build.stamp
 
 ##############
 
 clean-local:
-	rm -f *~ *.bak
-	rm -rf .libs
+	@rm -f *~ *.bak
+	@rm -rf .libs
 
 distclean-local:
-	cd $(srcdir) && \
-	  rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \
-	         $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+	@rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
+	    $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+	@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+	    rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \
+	fi
 
 maintainer-clean-local: clean
-	cd $(srcdir) && rm -rf html
+	@rm -rf xml html
 
 install-data-local:
 	@installfiles=`echo $(srcdir)/html/*`; \
 	if test "$$installfiles" = '$(srcdir)/html/*'; \
-	then echo '-- Nothing to install' ; \
+	then echo 1>&2 'Nothing to install' ; \
 	else \
 	  if test -n "$(DOC_MODULE_VERSION)"; then \
 	    installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
@@ -170,7 +215,7 @@ install-data-local:
 	  fi; \
 	  $(mkinstalldirs) $${installdir} ; \
 	  for i in $$installfiles; do \
-	    echo '-- Installing '$$i ; \
+	    echo ' $(INSTALL_DATA) '$$i ; \
 	    $(INSTALL_DATA) $$i $${installdir}; \
 	  done; \
 	  if test -n "$(DOC_MODULE_VERSION)"; then \
@@ -202,12 +247,12 @@ dist-check-gtkdoc:
 endif
 
 dist-hook: dist-check-gtkdoc dist-hook-local
-	mkdir $(distdir)/html
-	cp $(srcdir)/html/* $(distdir)/html
-	-cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/
-	-cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
-	-cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
-	cd $(distdir) && rm -f $(DISTCLEANFILES)
-	$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
+	@mkdir $(distdir)/html
+	@cp ./html/* $(distdir)/html
+	@-cp ./$(DOC_MODULE).pdf $(distdir)/
+	@-cp ./$(DOC_MODULE).types $(distdir)/
+	@-cp ./$(DOC_MODULE)-sections.txt $(distdir)/
+	@cd $(distdir) && rm -f $(DISTCLEANFILES)
+	@$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
 
 .PHONY : dist-hook-local docs
commit 9a77bd7706a08d9aeabe600e3500c14493ac8519
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Fri May 6 14:48:38 2011 +0200

    glib-demo: Add missing permission flags to info demo

diff --git a/glib/demo/info.cc b/glib/demo/info.cc
index 930f2be..e05cc15 100644
--- a/glib/demo/info.cc
+++ b/glib/demo/info.cc
@@ -27,7 +27,7 @@ pgd_info_add_permissions (GtkTable           *table,
 			  PopplerPermissions  permissions,
 			  gint               *row)
 {
-	GtkWidget *label, *hbox;
+	GtkWidget *label, *hbox, *vbox;
 	GtkWidget *checkbox;
 
 	label = gtk_label_new (NULL);
@@ -37,6 +37,7 @@ pgd_info_add_permissions (GtkTable           *table,
 			  GTK_FILL, GTK_FILL, 0, 0);
 	gtk_widget_show (label);
 
+        vbox = gtk_vbox_new (FALSE, 0);
 	hbox = gtk_hbox_new (FALSE, 6);
 
 	checkbox = gtk_check_button_new_with_label ("Print");
@@ -63,9 +64,41 @@ pgd_info_add_permissions (GtkTable           *table,
 	gtk_box_pack_start (GTK_BOX (hbox), checkbox, FALSE, TRUE, 0);
 	gtk_widget_show (checkbox);
 
-	gtk_table_attach (GTK_TABLE (table), hbox, 1, 2, *row, *row + 1,
+        checkbox = gtk_check_button_new_with_label ("Fill forms");
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox),
+                                      (permissions & POPPLER_PERMISSIONS_OK_TO_FILL_FORM));
+        gtk_box_pack_start (GTK_BOX (hbox), checkbox, FALSE, TRUE, 0);
+        gtk_widget_show (checkbox);
+
+        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
+        gtk_widget_show (hbox);
+
+        hbox = gtk_hbox_new (FALSE, 6);
+
+        checkbox = gtk_check_button_new_with_label ("Extract contents");
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox),
+                                      (permissions & POPPLER_PERMISSIONS_OK_TO_EXTRACT_CONTENTS));
+        gtk_box_pack_start (GTK_BOX (hbox), checkbox, FALSE, TRUE, 0);
+        gtk_widget_show (checkbox);
+
+        checkbox = gtk_check_button_new_with_label ("Assemble");
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox),
+                                      (permissions & POPPLER_PERMISSIONS_OK_TO_ASSEMBLE));
+        gtk_box_pack_start (GTK_BOX (hbox), checkbox, FALSE, TRUE, 0);
+        gtk_widget_show (checkbox);
+
+        checkbox = gtk_check_button_new_with_label ("Print at high resolution");
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox),
+                                      (permissions & POPPLER_PERMISSIONS_OK_TO_PRINT_HIGH_RESOLUTION));
+        gtk_box_pack_start (GTK_BOX (hbox), checkbox, FALSE, TRUE, 0);
+        gtk_widget_show (checkbox);
+
+        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
+        gtk_widget_show (hbox);
+
+	gtk_table_attach (GTK_TABLE (table), vbox, 1, 2, *row, *row + 1,
 			  GTK_FILL, GTK_FILL, 0, 0);
-	gtk_widget_show (hbox);
+	gtk_widget_show (vbox);
 	
 	*row += 1;
 }
commit 091c155f8a7bc79da84cd21877be389de1f2b1a3
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Fri May 6 14:47:36 2011 +0200

    glib: Add missing permissions flags to PopplerPermissions

diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc
index 710a5b3..99af651 100644
--- a/glib/poppler-document.cc
+++ b/glib/poppler-document.cc
@@ -1048,6 +1048,12 @@ poppler_document_get_permissions (PopplerDocument *document)
     flag |= POPPLER_PERMISSIONS_OK_TO_ADD_NOTES;
   if (document->doc->okToFillForm ())
     flag |= POPPLER_PERMISSIONS_OK_TO_FILL_FORM;
+  if (document->doc->okToAccessibility())
+    flag |= POPPLER_PERMISSIONS_OK_TO_EXTRACT_CONTENTS;
+  if (document->doc->okToAssemble())
+    flag |= POPPLER_PERMISSIONS_OK_TO_ASSEMBLE;
+  if (document->doc->okToPrintHighRes())
+    flag |= POPPLER_PERMISSIONS_OK_TO_PRINT_HIGH_RESOLUTION;
 
   return (PopplerPermissions)flag;
 }
diff --git a/glib/poppler-document.h b/glib/poppler-document.h
index 5cec9ae..70cd5f3 100644
--- a/glib/poppler-document.h
+++ b/glib/poppler-document.h
@@ -139,6 +139,11 @@ typedef enum /*< flags >*/
  * @POPPLER_PERMISSIONS_OK_TO_COPY: document can be copied
  * @POPPLER_PERMISSIONS_OK_TO_ADD_NOTES: annotations can added to the document
  * @POPPLER_PERMISSIONS_OK_TO_FILL_FORM: interactive form fields can be filled in
+ * @POPPLER_PERMISSIONS_OK_TO_EXTRACT_CONTENTS: extract text and graphics
+ * (in support of accessibility to users with disabilities or for other purposes). Since 0.18
+ * @POPPLER_PERMISSIONS_OK_TO_ASSEMBLE: assemble the document (insert, rotate, or delete pages and create
+ * bookmarks or thumbnail images). Since 0.18
+ * @POPPLER_PERMISSIONS_OK_TO_PRINT_HIGH_RESOLUTION: document can be printer at high resolution. Since 0.18
  * @POPPLER_PERMISSIONS_FULL:
  *
  * Permissions
@@ -150,7 +155,10 @@ typedef enum /*< flags >*/
   POPPLER_PERMISSIONS_OK_TO_COPY = 1 << 2,
   POPPLER_PERMISSIONS_OK_TO_ADD_NOTES = 1 << 3,
   POPPLER_PERMISSIONS_OK_TO_FILL_FORM = 1 << 4,
-  POPPLER_PERMISSIONS_FULL = (POPPLER_PERMISSIONS_OK_TO_PRINT | POPPLER_PERMISSIONS_OK_TO_MODIFY | POPPLER_PERMISSIONS_OK_TO_COPY | POPPLER_PERMISSIONS_OK_TO_ADD_NOTES | POPPLER_PERMISSIONS_OK_TO_FILL_FORM)
+  POPPLER_PERMISSIONS_OK_TO_EXTRACT_CONTENTS = 1 << 5,
+  POPPLER_PERMISSIONS_OK_TO_ASSEMBLE = 1 << 6,
+  POPPLER_PERMISSIONS_OK_TO_PRINT_HIGH_RESOLUTION = 1 << 7,
+  POPPLER_PERMISSIONS_FULL = (POPPLER_PERMISSIONS_OK_TO_PRINT | POPPLER_PERMISSIONS_OK_TO_MODIFY | POPPLER_PERMISSIONS_OK_TO_COPY | POPPLER_PERMISSIONS_OK_TO_ADD_NOTES | POPPLER_PERMISSIONS_OK_TO_FILL_FORM | POPPLER_PERMISSIONS_OK_TO_EXTRACT_CONTENTS | POPPLER_PERMISSIONS_OK_TO_ASSEMBLE | POPPLER_PERMISSIONS_OK_TO_PRINT_HIGH_RESOLUTION)
 
 } PopplerPermissions;
 


More information about the poppler mailing list