Hello community,

here is the log from the commit of package retro-gtk for openSUSE:Factory 
checked in at 2019-10-18 14:33:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/retro-gtk (Old)
 and      /work/SRC/openSUSE:Factory/.retro-gtk.new.2352 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "retro-gtk"

Fri Oct 18 14:33:04 2019 rev:10 rq:736605 version:0.18.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/retro-gtk/retro-gtk.changes      2019-03-28 
22:49:33.907045193 +0100
+++ /work/SRC/openSUSE:Factory/.retro-gtk.new.2352/retro-gtk.changes    
2019-10-18 14:33:05.652292403 +0200
@@ -1,0 +2,16 @@
+Wed Sep 11 19:27:40 CDT 2019 - [email protected]
+
+- Update to version 0.18.0:
+  + Pixbufs:
+    - Add retro_pixbuf_set_aspect_ratio() for embedding aspect
+      ratio value to a GdkPixbuf.
+    - Add retro_pixbuf_get_aspect_ratio() for retrieving the value
+      set with retro_pixbuf_set_aspect_ratio().
+    - Deprecate x-dpi and y-dpi metadata options.
+  + RetroCoreView:
+    - Take pixbuf aspect ratio into account when drawing a
+      standalone pixbuf instead of using aspect ratio of the
+      current core.
+  + Fix build on Fedora 30.
+
+-------------------------------------------------------------------

Old:
----
  retro-gtk-0.16.1.tar.xz

New:
----
  retro-gtk-0.18.0.tar.xz

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

Other differences:
------------------
++++++ retro-gtk.spec ++++++
--- /var/tmp/diff_new_pack.M6xDqH/_old  2019-10-18 14:33:06.600289935 +0200
+++ /var/tmp/diff_new_pack.M6xDqH/_new  2019-10-18 14:33:06.604289924 +0200
@@ -20,13 +20,13 @@
 %define namever 0_14-0
 %define libver  0.14
 Name:           retro-gtk
-Version:        0.16.1
+Version:        0.18.0
 Release:        0
 Summary:        Toolkit to write Gtk+3-based frontends to libretro
 License:        GPL-3.0-only
 Group:          System/GUI/GNOME
 URL:            https://git.gnome.org/browse/retro-gtk
-Source0:        
https://download.gnome.org/sources/retro-gtk/0.16/%{name}-%{version}.tar.xz
+Source0:        
https://download.gnome.org/sources/retro-gtk/0.18/%{name}-%{version}.tar.xz
 
 BuildRequires:  gobject-introspection-devel >= 0.6.7
 BuildRequires:  meson

++++++ retro-gtk-0.16.1.tar.xz -> retro-gtk-0.18.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/retro-gtk-0.16.1/NEWS new/retro-gtk-0.18.0/NEWS
--- old/retro-gtk-0.16.1/NEWS   2019-03-11 09:44:31.000000000 +0100
+++ new/retro-gtk-0.18.0/NEWS   2019-09-11 20:24:06.000000000 +0200
@@ -1,4 +1,19 @@
 ==============
+Version 0.18.0
+==============
+
+* Pixbufs:
+ - Add retro_pixbuf_set_aspect_ratio() for embedding aspect ratio
+   value to a GdkPixbuf.
+ - Add retro_pixbuf_get_aspect_ratio() for retrieving the value
+   set with retro_pixbuf_set_aspect_ratio().
+ - Deprecate x-dpi and y-dpi metadata options.
+* RetroCoreView:
+ - Take pixbuf aspect ratio into account when drawing a standalone
+   pixbuf instead of using aspect ratio of the current core.
+* Fix build on Fedora 30.
+
+==============
 Version 0.16.1
 ==============
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/retro-gtk-0.16.1/meson.build 
new/retro-gtk-0.18.0/meson.build
--- old/retro-gtk-0.16.1/meson.build    2019-03-11 09:44:31.000000000 +0100
+++ new/retro-gtk-0.18.0/meson.build    2019-09-11 20:24:06.000000000 +0200
@@ -1,5 +1,5 @@
 project('retro-gtk','c',
-  version: '0.16.1',
+  version: '0.18.0',
   meson_version: '>= 0.43.0',
 )
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/retro-gtk-0.16.1/retro-gtk/meson.build 
new/retro-gtk-0.18.0/retro-gtk/meson.build
--- old/retro-gtk-0.16.1/retro-gtk/meson.build  2019-03-11 09:44:31.000000000 
+0100
+++ new/retro-gtk-0.18.0/retro-gtk/meson.build  2019-09-11 20:24:06.000000000 
+0200
@@ -6,7 +6,7 @@
 )
 
 retro_gtk_sources = [
-  retro_gtk_resources[0],
+  retro_gtk_resources,
   'retro-cairo-display.c',
   'retro-controller.c',
   'retro-controller-codes.c',
@@ -33,6 +33,7 @@
   'retro-option.c',
   'retro-option-iterator.c',
   'retro-pa-player.c',
+  'retro-pixbuf.c',
   'retro-pixdata.c',
   'retro-pixel-format.c',
   'retro-rumble-effect.c',
@@ -59,6 +60,7 @@
   'retro-module-query.h',
   'retro-option.h',
   'retro-option-iterator.h',
+  'retro-pixbuf.h',
   'retro-pixdata.h',
   'retro-rumble-effect.h',
   'retro-video-filter.h',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/retro-gtk-0.16.1/retro-gtk/retro-cairo-display.c 
new/retro-gtk-0.18.0/retro-gtk/retro-cairo-display.c
--- old/retro-gtk-0.16.1/retro-gtk/retro-cairo-display.c        2019-03-11 
09:44:31.000000000 +0100
+++ new/retro-gtk-0.18.0/retro-gtk/retro-cairo-display.c        2019-09-11 
20:24:06.000000000 +0200
@@ -2,6 +2,7 @@
 
 #include "retro-cairo-display.h"
 
+#include "retro-pixbuf.h"
 #include "retro-pixdata.h"
 
 struct _RetroCairoDisplay
@@ -312,11 +313,16 @@
  * @pixbuf: a #GdkPixbuf
  *
  * Sets @pixbuf as the currently displayed video frame.
+ *
+ * retro_pixbuf_set_aspect_ratio() can be used to specify the aspect ratio for
+ * the pixbuf. Otherwise the core's aspect ratio will be used.
  */
 void
 retro_cairo_display_set_pixbuf (RetroCairoDisplay *self,
                                 GdkPixbuf         *pixbuf)
 {
+  gfloat aspect_ratio;
+
   g_return_if_fail (self != NULL);
 
   if (self->pixbuf == pixbuf)
@@ -327,6 +333,10 @@
   if (pixbuf != NULL)
     self->pixbuf = g_object_ref (pixbuf);
 
+  aspect_ratio = retro_pixbuf_get_aspect_ratio (pixbuf);
+  if (aspect_ratio != 0.f)
+    self->aspect_ratio = aspect_ratio;
+
   g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_PIXBUF]);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/retro-gtk-0.16.1/retro-gtk/retro-core-view.c 
new/retro-gtk-0.18.0/retro-gtk/retro-core-view.c
--- old/retro-gtk-0.16.1/retro-gtk/retro-core-view.c    2019-03-11 
09:44:31.000000000 +0100
+++ new/retro-gtk-0.18.0/retro-gtk/retro-core-view.c    2019-09-11 
20:24:06.000000000 +0200
@@ -537,6 +537,9 @@
  * @pixbuf: a #GdkPixbuf
  *
  * Sets @pixbuf as the currently displayed video frame.
+ *
+ * retro_pixbuf_set_aspect_ratio() can be used to specify the aspect ratio for
+ * the pixbuf. Otherwise the core's aspect ratio will be used.
  */
 void
 retro_core_view_set_pixbuf (RetroCoreView *self,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/retro-gtk-0.16.1/retro-gtk/retro-gl-display.c 
new/retro-gtk-0.18.0/retro-gtk/retro-gl-display.c
--- old/retro-gtk-0.16.1/retro-gtk/retro-gl-display.c   2019-03-11 
09:44:31.000000000 +0100
+++ new/retro-gtk-0.18.0/retro-gtk/retro-gl-display.c   2019-09-11 
20:24:06.000000000 +0200
@@ -4,6 +4,7 @@
 
 #include <epoxy/gl.h>
 #include "retro-glsl-filter.h"
+#include "retro-pixbuf.h"
 #include "retro-pixdata.h"
 
 struct _RetroGLDisplay
@@ -492,11 +493,16 @@
  * @pixbuf: a #GdkPixbuf
  *
  * Sets @pixbuf as the currently displayed video frame.
+ *
+ * retro_pixbuf_set_aspect_ratio() can be used to specify the aspect ratio for
+ * the pixbuf. Otherwise the core's aspect ratio will be used.
  */
 void
 retro_gl_display_set_pixbuf (RetroGLDisplay *self,
                              GdkPixbuf      *pixbuf)
 {
+  gfloat aspect_ratio;
+
   g_return_if_fail (RETRO_IS_GL_DISPLAY (self));
 
   if (self->pixbuf == pixbuf)
@@ -507,6 +513,10 @@
   if (pixbuf != NULL)
     self->pixbuf = g_object_ref (pixbuf);
 
+  aspect_ratio = retro_pixbuf_get_aspect_ratio (pixbuf);
+  if (aspect_ratio != 0.f)
+    self->aspect_ratio = aspect_ratio;
+
   gtk_widget_queue_draw (GTK_WIDGET (self));
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/retro-gtk-0.16.1/retro-gtk/retro-gtk.h 
new/retro-gtk-0.18.0/retro-gtk/retro-gtk.h
--- old/retro-gtk-0.16.1/retro-gtk/retro-gtk.h  2019-03-11 09:44:31.000000000 
+0100
+++ new/retro-gtk-0.18.0/retro-gtk/retro-gtk.h  2019-09-11 20:24:06.000000000 
+0200
@@ -25,6 +25,7 @@
 #include "retro-module-query.h"
 #include "retro-option.h"
 #include "retro-option-iterator.h"
+#include "retro-pixbuf.h"
 #include "retro-pixdata.h"
 #include "retro-video-filter.h"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/retro-gtk-0.16.1/retro-gtk/retro-pixbuf.c 
new/retro-gtk-0.18.0/retro-gtk/retro-pixbuf.c
--- old/retro-gtk-0.16.1/retro-gtk/retro-pixbuf.c       1970-01-01 
01:00:00.000000000 +0100
+++ new/retro-gtk-0.18.0/retro-gtk/retro-pixbuf.c       2019-09-11 
20:24:06.000000000 +0200
@@ -0,0 +1,54 @@
+// This file is part of retro-gtk. License: GPL-3.0+.
+
+#include "retro-pixbuf.h"
+#include <string.h>
+
+/**
+ * retro_pixbuf_get_aspect_ratio:
+ * @pixbuf: a #GdkPixbuf
+ *
+ * Gets the aspect ratio of @pixbuf by reading the 'aspect-ratio' pixbuf 
option.
+ *
+ * Returns: the aspect ratio, or 0 if the option is not set or its value is 
invalid.
+ */
+gfloat
+retro_pixbuf_get_aspect_ratio (GdkPixbuf *pixbuf)
+{
+  const gchar *aspect_ratio_str;
+  gfloat result = 0.f;
+
+  g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), 0.f);
+
+  aspect_ratio_str = gdk_pixbuf_get_option (pixbuf, "aspect-ratio");
+
+  if (!aspect_ratio_str)
+    return 0.f;
+
+  sscanf (aspect_ratio_str, "%g", &result);
+
+  return result;
+}
+
+/**
+ * retro_pixbuf_set_aspect_ratio:
+ * @pixbuf: a #GdkPixbuf
+ * @aspect_ratio: the aspect ratio value
+ *
+ * Sets the aspect ratio of @pixbuf by setting the 'aspect-ratio' pixbuf 
option.
+ * Use retro_pixbuf_get_aspect_ratio() to retrieve it.
+ */
+void
+retro_pixbuf_set_aspect_ratio (GdkPixbuf *pixbuf,
+                               gfloat     aspect_ratio)
+{
+  g_autofree gchar *aspect_ratio_string = NULL;
+
+  g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
+  g_return_if_fail (aspect_ratio > 0.f);
+
+  aspect_ratio_string = g_strdup_printf ("%g", aspect_ratio);
+
+  gdk_pixbuf_remove_option (pixbuf, "aspect-ratio");
+
+  gdk_pixbuf_set_option (pixbuf, "aspect-ratio", aspect_ratio_string);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/retro-gtk-0.16.1/retro-gtk/retro-pixbuf.h 
new/retro-gtk-0.18.0/retro-gtk/retro-pixbuf.h
--- old/retro-gtk-0.16.1/retro-gtk/retro-pixbuf.h       1970-01-01 
01:00:00.000000000 +0100
+++ new/retro-gtk-0.18.0/retro-gtk/retro-pixbuf.h       2019-09-11 
20:24:06.000000000 +0200
@@ -0,0 +1,21 @@
+// This file is part of retro-gtk. License: GPL-3.0+.
+
+#ifndef RETRO_PIXBUF_H
+#define RETRO_PIXBUF_H
+
+#if !defined(__RETRO_GTK_INSIDE__) && !defined(RETRO_GTK_COMPILATION)
+# error "Only <retro-gtk.h> can be included directly."
+#endif
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+gfloat retro_pixbuf_get_aspect_ratio (GdkPixbuf *pixbuf);
+void   retro_pixbuf_set_aspect_ratio (GdkPixbuf *pixbuf,
+                                      gfloat     aspect_ratio);
+
+G_END_DECLS
+
+#endif /* RETRO_PIXBUF_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/retro-gtk-0.16.1/retro-gtk/retro-pixdata.c 
new/retro-gtk-0.18.0/retro-gtk/retro-pixdata.c
--- old/retro-gtk-0.16.1/retro-gtk/retro-pixdata.c      2019-03-11 
09:44:31.000000000 +0100
+++ new/retro-gtk-0.18.0/retro-gtk/retro-pixdata.c      2019-09-11 
20:24:06.000000000 +0200
@@ -3,6 +3,7 @@
 #include "retro-pixdata-private.h"
 
 #include <epoxy/gl.h>
+#include "retro-pixbuf.h"
 
 G_DEFINE_BOXED_TYPE (RetroPixdata, retro_pixdata, retro_pixdata_copy, 
retro_pixdata_free)
 
@@ -319,8 +320,8 @@
   rgba8888 *rgba8888_data;
   GdkPixbuf *pixbuf;
   gfloat x_dpi;
-  gchar *x_dpi_string;
-  gchar *y_dpi_string;
+  g_autofree gchar *x_dpi_string = NULL;
+  g_autofree gchar *y_dpi_string = NULL;
 
   g_return_val_if_fail (self != NULL, NULL);
 
@@ -343,13 +344,15 @@
                                      self->width * sizeof (rgba8888),
                                      pixels_free, NULL);
 
+  /* x-dpi and y-dpi are deprecated, retro_pixbuf_get_aspect_ratio() and
+   * retro_pixbuf_set_aspect_ratio() should be used instead. */
   x_dpi = self->aspect_ratio * RETRO_CAIRO_DISPLAY_Y_DPI;
   x_dpi_string = g_strdup_printf ("%g", x_dpi);
   y_dpi_string = g_strdup_printf ("%g", RETRO_CAIRO_DISPLAY_Y_DPI);
   gdk_pixbuf_set_option (pixbuf, "x-dpi", x_dpi_string);
   gdk_pixbuf_set_option (pixbuf, "y-dpi", y_dpi_string);
-  g_free (y_dpi_string);
-  g_free (x_dpi_string);
+
+  retro_pixbuf_set_aspect_ratio (pixbuf, self->aspect_ratio);
 
   return pixbuf;
 }


Reply via email to