Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package zathura-plugin-pdf-poppler for 
openSUSE:Factory checked in at 2022-12-15 19:25:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/zathura-plugin-pdf-poppler (Old)
 and      /work/SRC/openSUSE:Factory/.zathura-plugin-pdf-poppler.new.1835 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "zathura-plugin-pdf-poppler"

Thu Dec 15 19:25:36 2022 rev:9 rq:1043060 version:0.3.1

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/zathura-plugin-pdf-poppler/zathura-plugin-pdf-poppler.changes
    2020-02-11 22:25:18.263564253 +0100
+++ 
/work/SRC/openSUSE:Factory/.zathura-plugin-pdf-poppler.new.1835/zathura-plugin-pdf-poppler.changes
  2022-12-15 19:26:07.188368528 +0100
@@ -1,0 +2,6 @@
+Tue Dec 13 19:14:09 UTC 2022 - llyyr <[email protected]>
+
+- Update to 0.3.1
+  * Implement better text selection
+
+-------------------------------------------------------------------

Old:
----
  zathura-pdf-poppler-0.3.0.tar.xz

New:
----
  zathura-pdf-poppler-0.3.1.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ zathura-plugin-pdf-poppler.spec ++++++
--- /var/tmp/diff_new_pack.09zO0J/_old  2022-12-15 19:26:07.672371282 +0100
+++ /var/tmp/diff_new_pack.09zO0J/_new  2022-12-15 19:26:07.676371304 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package zathura-plugin-pdf-poppler
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %define realname zathura-pdf-poppler
 Name:           zathura-plugin-pdf-poppler
-Version:        0.3.0
+Version:        0.3.1
 Release:        0
 Summary:        PDF support for zathura via poppler
 License:        Zlib
@@ -29,9 +29,9 @@
 BuildRequires:  pkgconfig
 BuildRequires:  pkgconfig(cairo)
 BuildRequires:  pkgconfig(girara-gtk3)
-BuildRequires:  pkgconfig(poppler-glib)
-BuildRequires:  pkgconfig(zathura)
-Requires:       zathura
+BuildRequires:  pkgconfig(poppler-glib) >= 0.18
+BuildRequires:  pkgconfig(zathura) >= 0.5.2
+Requires:       zathura >= 0.5.2
 Provides:       zathura-pdf-poppler-plugin
 
 %description

++++++ zathura-pdf-poppler-0.3.0.tar.xz -> zathura-pdf-poppler-0.3.1.tar.xz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zathura-pdf-poppler-0.3.0/.gitignore 
new/zathura-pdf-poppler-0.3.1/.gitignore
--- old/zathura-pdf-poppler-0.3.0/.gitignore    1970-01-01 01:00:00.000000000 
+0100
+++ new/zathura-pdf-poppler-0.3.1/.gitignore    2022-11-27 16:49:24.000000000 
+0100
@@ -0,0 +1,10 @@
+*.o
+*.do
+*~
+*.so
+*.swp
+build
+compile_commands.json
+.ycm_extra_conf.*
+subprojects/girara
+subprojects/zathura
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zathura-pdf-poppler-0.3.0/.gitlab-ci.yml 
new/zathura-pdf-poppler-0.3.1/.gitlab-ci.yml
--- old/zathura-pdf-poppler-0.3.0/.gitlab-ci.yml        1970-01-01 
01:00:00.000000000 +0100
+++ new/zathura-pdf-poppler-0.3.1/.gitlab-ci.yml        2022-11-27 
16:49:24.000000000 +0100
@@ -0,0 +1,106 @@
+stages:
+  - build
+  - test
+
+# Cache
+cache: &dependency_cache
+  key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
+  paths:
+    - subprojects/girara
+    - subprojects/zathura
+
+# Archlinux
+build:archlinux:
+  tags:
+    - pwmt
+  stage: build
+  image: registry.pwmt.org/pwmt/gitlab-runner-images/archlinux:latest
+  script:
+    - mkdir -p build && cd build
+    - meson ..
+    - ninja
+  cache:
+    <<: *dependency_cache
+  artifacts:
+    expire_in: 1 day
+    paths:
+      - build
+  except:
+    - tags
+
+# Debian 11 (bullseye)
+build:debian-bullseye:
+  tags:
+    - pwmt
+  stage: build
+  image: registry.pwmt.org/pwmt/gitlab-runner-images/debian:bullseye
+  script:
+    - mkdir -p build && cd build
+    - meson ..
+    - ninja
+  cache:
+    <<: *dependency_cache
+  artifacts:
+    expire_in: 1 day
+    paths:
+      - build
+  except:
+    - tags
+
+# Debian 12 (bookworm)
+build:debian-bookworm:
+  tags:
+    - pwmt
+  stage: build
+  image: registry.pwmt.org/pwmt/gitlab-runner-images/debian:bookworm
+  script:
+    - mkdir -p build && cd build
+    - meson ..
+    - ninja
+  cache:
+    <<: *dependency_cache
+  artifacts:
+    expire_in: 1 day
+    paths:
+      - build
+  except:
+    - tags
+
+
+# Ubuntu 20.04 LTS (focal)
+build:ubuntu-focal:
+  tags:
+    - pwmt
+  stage: build
+  image: registry.pwmt.org/pwmt/gitlab-runner-images/ubuntu:focal
+  script:
+    - mkdir -p build && cd build
+    - meson ..
+    - ninja
+  cache:
+    <<: *dependency_cache
+  artifacts:
+    expire_in: 1 day
+    paths:
+      - build
+  except:
+    - tags
+
+# Ubuntu 22.04 LTS (jammy)
+build:ubuntu-jammy:
+  tags:
+    - pwmt
+  stage: build
+  image: registry.pwmt.org/pwmt/gitlab-runner-images/ubuntu:jammy
+  script:
+    - mkdir -p build && cd build
+    - meson ..
+    - ninja
+  cache:
+    <<: *dependency_cache
+  artifacts:
+    expire_in: 1 day
+    paths:
+      - build
+  except:
+    - tags
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zathura-pdf-poppler-0.3.0/README 
new/zathura-pdf-poppler-0.3.1/README
--- old/zathura-pdf-poppler-0.3.0/README        2020-01-07 21:21:28.000000000 
+0100
+++ new/zathura-pdf-poppler-0.3.1/README        1970-01-01 01:00:00.000000000 
+0100
@@ -1,22 +0,0 @@
-zathura-pdf-poppler
-===================
-The zathura-pdf-poppler plugin adds PDF support to zathura by using the poppler
-rendering library.
-
-Requirements
-------------
-zathura (>= 0.4.4)
-girara
-poppler-glib (>= 0.18)
-
-Installation
-------------
-To build and install the plugin:
-
-  make install
-
-Uninstall:
-----------
-To delete the plugin from your system, just type:
-
-  make uninstall
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zathura-pdf-poppler-0.3.0/README.md 
new/zathura-pdf-poppler-0.3.1/README.md
--- old/zathura-pdf-poppler-0.3.0/README.md     1970-01-01 01:00:00.000000000 
+0100
+++ new/zathura-pdf-poppler-0.3.1/README.md     2022-11-27 16:49:24.000000000 
+0100
@@ -0,0 +1,33 @@
+zathura-pdf-poppler
+===================
+
+zathura is a highly customizable and functional document viewer based on the 
girara user interface
+library and several document libraries. This plugin for zathura provides PDF 
support using the
+`poppler` rendering library.
+
+Requirements
+------------
+
+The following dependencies are required:
+
+* `zathura` (>= 0.4.4)
+* `girara`
+* `poppler-glib` (>= 0.18)
+
+Installation
+------------
+
+To build and install the plugin using meson's ninja backend:
+
+    meson build
+    cd build
+    ninja
+    ninja install
+
+Note that the default backend for meson might vary based on the platform. 
Please
+refer to the meson documentation for platform specific dependencies.
+
+Bugs
+----
+
+Please report bugs at http://git.pwmt.org/pwmt/zathura-pdf-poppler.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zathura-pdf-poppler-0.3.0/meson.build 
new/zathura-pdf-poppler-0.3.1/meson.build
--- old/zathura-pdf-poppler-0.3.0/meson.build   2020-01-07 21:21:28.000000000 
+0100
+++ new/zathura-pdf-poppler-0.3.1/meson.build   2022-11-27 16:49:24.000000000 
+0100
@@ -1,6 +1,6 @@
 project('zathura-pdf-poppler', 'c',
-  version: '0.3.0',
-  meson_version: '>=0.43',
+  version: '0.3.1',
+  meson_version: '>=0.56',
   default_options: 'c_std=c11'
 )
 
@@ -15,7 +15,7 @@
 desktopdir = join_paths(datadir, 'applications')
 
 # required dependencies
-zathura = dependency('zathura', version: '>=0.4.4', fallback: ['zathura', 
'zathura_dependency'])
+zathura = dependency('zathura', version: '>=0.5.2', fallback: ['zathura', 
'zathura_dependency'])
 girara = dependency('girara-gtk3', fallback: ['girara', 'girara_dependency'])
 glib = dependency('glib-2.0')
 poppler = dependency('poppler-glib', version: '>=0.18')
@@ -24,7 +24,7 @@
 
 if get_option('plugindir') == ''
   if zathura.type_name() == 'pkgconfig'
-    plugindir = zathura.get_pkgconfig_variable('plugindir')
+    plugindir = zathura.get_variable(pkgconfig: 'plugindir')
   else
     zathura_subproject = subproject('zathura')
     plugindir = zathura_subproject.get_variable('plugindir')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/zathura-pdf-poppler-0.3.0/zathura-pdf-poppler/plugin.c 
new/zathura-pdf-poppler-0.3.1/zathura-pdf-poppler/plugin.c
--- old/zathura-pdf-poppler-0.3.0/zathura-pdf-poppler/plugin.c  2020-01-07 
21:21:28.000000000 +0100
+++ new/zathura-pdf-poppler-0.3.1/zathura-pdf-poppler/plugin.c  2022-11-27 
16:49:24.000000000 +0100
@@ -20,6 +20,7 @@
     .page_form_fields_get     = pdf_page_form_fields_get,
     .page_images_get          = pdf_page_images_get,
     .page_get_text            = pdf_page_get_text,
+    .page_get_selection       = pdf_page_get_selection,
     .page_render_cairo        = pdf_page_render_cairo,
     .page_image_get_cairo     = pdf_page_image_get_cairo,
     .page_get_label           = pdf_page_get_label
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/zathura-pdf-poppler-0.3.0/zathura-pdf-poppler/plugin.h 
new/zathura-pdf-poppler-0.3.1/zathura-pdf-poppler/plugin.h
--- old/zathura-pdf-poppler-0.3.0/zathura-pdf-poppler/plugin.h  2020-01-07 
21:21:28.000000000 +0100
+++ new/zathura-pdf-poppler-0.3.1/zathura-pdf-poppler/plugin.h  2022-11-27 
16:49:24.000000000 +0100
@@ -175,6 +175,9 @@
 GIRARA_HIDDEN char* pdf_page_get_text(zathura_page_t* page, void* poppler_page,
     zathura_rectangle_t rectangle, zathura_error_t* error);
 
+GIRARA_HIDDEN girara_list_t*
+pdf_page_get_selection(zathura_page_t* page, void* data, zathura_rectangle_t 
rectangle, zathura_error_t* error);
+
 /**
  * Renders a page onto a cairo object
  *
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/zathura-pdf-poppler-0.3.0/zathura-pdf-poppler/search.c 
new/zathura-pdf-poppler-0.3.1/zathura-pdf-poppler/search.c
--- old/zathura-pdf-poppler-0.3.0/zathura-pdf-poppler/search.c  2020-01-07 
21:21:28.000000000 +0100
+++ new/zathura-pdf-poppler-0.3.1/zathura-pdf-poppler/search.c  2022-11-27 
16:49:24.000000000 +0100
@@ -12,7 +12,7 @@
     if (error != NULL) {
       *error = ZATHURA_ERROR_INVALID_ARGUMENTS;
     }
-    goto error_ret;
+    return NULL;
   }
 
   PopplerPage* poppler_page = data;
@@ -36,15 +36,15 @@
     goto error_free;
   }
 
-  GList* entry = NULL;
-  for (entry = results; entry && entry->data; entry = g_list_next(entry)) {
+  const double page_height = zathura_page_get_height(page);
+  for (GList* entry = results; entry && entry->data; entry = 
g_list_next(entry)) {
     PopplerRectangle* poppler_rectangle = (PopplerRectangle*) entry->data;
     zathura_rectangle_t* rectangle      = 
g_malloc0(sizeof(zathura_rectangle_t));
 
     rectangle->x1 = poppler_rectangle->x1;
     rectangle->x2 = poppler_rectangle->x2;
-    rectangle->y1 = zathura_page_get_height(page) - poppler_rectangle->y2;
-    rectangle->y2 = zathura_page_get_height(page) - poppler_rectangle->y1;
+    rectangle->y1 = page_height - poppler_rectangle->y2;
+    rectangle->y2 = page_height - poppler_rectangle->y1;
 
     girara_list_append(list, rectangle);
     poppler_rectangle_free(poppler_rectangle);
@@ -54,7 +54,6 @@
   return list;
 
 error_free:
-
   if (results != NULL) {
     g_list_free(results);
   }
@@ -63,7 +62,5 @@
     girara_list_free(list);
   }
 
-error_ret:
-
   return NULL;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/zathura-pdf-poppler-0.3.0/zathura-pdf-poppler/select.c 
new/zathura-pdf-poppler-0.3.1/zathura-pdf-poppler/select.c
--- old/zathura-pdf-poppler-0.3.0/zathura-pdf-poppler/select.c  2020-01-07 
21:21:28.000000000 +0100
+++ new/zathura-pdf-poppler-0.3.1/zathura-pdf-poppler/select.c  2022-11-27 
16:49:24.000000000 +0100
@@ -24,3 +24,51 @@
   /* get selected text */
   return poppler_page_get_selected_text(poppler_page, POPPLER_SELECTION_GLYPH, 
&rect);
 }
+
+girara_list_t*
+pdf_page_get_selection(zathura_page_t* page, void* data, zathura_rectangle_t 
rectangle, zathura_error_t* error) {
+  if (page == NULL || data == NULL) {
+    if (error != NULL) {
+      *error = ZATHURA_ERROR_INVALID_ARGUMENTS;
+    }
+    return NULL;
+  }
+
+  PopplerRectangle rect = {
+    .x1 = rectangle.x1,
+    .x2 = rectangle.x2,
+    .y1 = rectangle.y1,
+    .y2 = rectangle.y2
+  };
+  PopplerPage* poppler_page = data;
+
+  girara_list_t* list = girara_list_new2(g_free);
+  if (list == NULL) {
+    if (error != NULL) {
+      *error = ZATHURA_ERROR_OUT_OF_MEMORY;
+    }
+    goto error_free;
+  }
+
+  cairo_region_t* region = poppler_page_get_selected_region(poppler_page, 1.0, 
POPPLER_SELECTION_GLYPH, &rect);
+  const int num_rectangles = cairo_region_num_rectangles(region);
+  for (int n = 0; n < num_rectangles; ++n) {
+    cairo_rectangle_int_t r;
+    cairo_region_get_rectangle(region, n, &r);
+
+    zathura_rectangle_t* inner_rectangle = 
g_malloc0(sizeof(zathura_rectangle_t));
+    inner_rectangle->x1 = r.x;
+    inner_rectangle->x2 = r.x + r.width;
+    inner_rectangle->y1 = r.y;
+    inner_rectangle->y2 = r.y + r.height;
+    girara_list_append(list, inner_rectangle);
+  }
+  cairo_region_destroy(region);
+  return list;
+
+error_free:
+  if (list != NULL ) {
+      girara_list_free(list);
+  }
+  return NULL;
+}

Reply via email to