Accepting request 196199 from GNOME:Apps
- Add dia-glib-2.35.patch: GLib drop support for adding interfaces after class_init. (forwarded request 196198 from Zaitor) OBS-URL: https://build.opensuse.org/request/show/196199 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/dia?expand=0&rev=35
This commit is contained in:
commit
2617c054f2
101
dia-glib-2.35.patch
Normal file
101
dia-glib-2.35.patch
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
From 7ac3e9ffac09f99a1aa2fe97a4dc0a688c9746b0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hans Breuer <hans@breuer.org>
|
||||||
|
Date: Sat, 16 Mar 2013 16:56:58 +0000
|
||||||
|
Subject: Bug 694025 - GLib drop support for adding interfaces after class_init
|
||||||
|
|
||||||
|
Without this Dia crashes at startup with new GLib version and the
|
||||||
|
DiaGdkRenderer being default. Make a new DiaGdkInteractiveRenderer which
|
||||||
|
follows the pattern also used for DiaCairoInteraciveRenderer. This should
|
||||||
|
be functional equivalent to what was there before and should work for all
|
||||||
|
current GLib versions.
|
||||||
|
|
||||||
|
(cherry picked from commit 213bdfe956bf8fe57c86316f68a09408fef1647e)
|
||||||
|
---
|
||||||
|
diff --git a/app/render_gdk.c b/app/render_gdk.c
|
||||||
|
index 60ccb7a..b1e7ba4 100644
|
||||||
|
--- a/app/render_gdk.c
|
||||||
|
+++ b/app/render_gdk.c
|
||||||
|
@@ -50,7 +50,21 @@ static void copy_to_window (DiaRenderer *renderer,
|
||||||
|
gpointer window,
|
||||||
|
int x, int y, int width, int height);
|
||||||
|
|
||||||
|
-static void dia_gdk_renderer_iface_init (DiaInteractiveRendererInterface* iface)
|
||||||
|
+typedef struct _DiaGdkInteractiveRenderer DiaGdkInteractiveRenderer;
|
||||||
|
+struct _DiaGdkInteractiveRenderer
|
||||||
|
+{
|
||||||
|
+ DiaGdkRenderer parent_instance; /*!< inheritance in object oriented C */
|
||||||
|
+};
|
||||||
|
+typedef struct _DiaGdkInteractiveRendererClass DiaGdkInteractiveRendererClass;
|
||||||
|
+struct _DiaGdkInteractiveRendererClass
|
||||||
|
+{
|
||||||
|
+ DiaGdkRendererClass parent_class; /*!< the base class */
|
||||||
|
+};
|
||||||
|
+#define DIA_TYPE_GDK_INTERACTIVE_RENDERER (dia_gdk_interactive_renderer_get_type ())
|
||||||
|
+#define DIA_GDK_INTERACTIVE_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIA_TYPE_GDK_INTERACTIVE_RENDERER, DiaGdkInteractiveRenderer))
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+dia_gdk_renderer_iface_init (DiaInteractiveRendererInterface* iface)
|
||||||
|
{
|
||||||
|
iface->clip_region_clear = clip_region_clear;
|
||||||
|
iface->clip_region_add_rect = clip_region_add_rect;
|
||||||
|
@@ -61,35 +75,35 @@ static void dia_gdk_renderer_iface_init (DiaInteractiveRendererInterface* iface)
|
||||||
|
iface->set_size = set_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
+G_DEFINE_TYPE_WITH_CODE (DiaGdkInteractiveRenderer, dia_gdk_interactive_renderer, DIA_TYPE_GDK_RENDERER,
|
||||||
|
+ G_IMPLEMENT_INTERFACE (DIA_TYPE_INTERACTIVE_RENDERER_INTERFACE, dia_gdk_renderer_iface_init));
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+dia_gdk_interactive_renderer_class_init(DiaGdkInteractiveRendererClass *klass)
|
||||||
|
+{
|
||||||
|
+}
|
||||||
|
+static void
|
||||||
|
+dia_gdk_interactive_renderer_init(DiaGdkInteractiveRenderer *object)
|
||||||
|
+{
|
||||||
|
+ DiaGdkInteractiveRenderer *ia_renderer = DIA_GDK_INTERACTIVE_RENDERER (object);
|
||||||
|
+ DiaGdkRenderer *renderer = DIA_GDK_RENDERER(object);
|
||||||
|
+ DiaRenderer *dia_renderer = DIA_RENDERER(object);
|
||||||
|
+
|
||||||
|
+ dia_renderer->is_interactive = 1;
|
||||||
|
+
|
||||||
|
+ renderer->gc = NULL;
|
||||||
|
+ renderer->pixmap = NULL;
|
||||||
|
+ renderer->clip_region = NULL;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
DiaRenderer *
|
||||||
|
new_gdk_renderer(DDisplay *ddisp)
|
||||||
|
{
|
||||||
|
DiaGdkRenderer *renderer;
|
||||||
|
GType renderer_type = 0;
|
||||||
|
|
||||||
|
- renderer = g_object_new (DIA_TYPE_GDK_RENDERER, NULL);
|
||||||
|
+ renderer = g_object_new (DIA_TYPE_GDK_INTERACTIVE_RENDERER, NULL);
|
||||||
|
renderer->transform = dia_transform_new (&ddisp->visible, &ddisp->zoom_factor);
|
||||||
|
- if (!DIA_GET_INTERACTIVE_RENDERER_INTERFACE (renderer))
|
||||||
|
- {
|
||||||
|
- static const GInterfaceInfo irenderer_iface_info =
|
||||||
|
- {
|
||||||
|
- (GInterfaceInitFunc) dia_gdk_renderer_iface_init,
|
||||||
|
- NULL, /* iface_finalize */
|
||||||
|
- NULL /* iface_data */
|
||||||
|
- };
|
||||||
|
-
|
||||||
|
- renderer_type = DIA_TYPE_GDK_RENDERER;
|
||||||
|
- /* register the interactive renderer interface */
|
||||||
|
- g_type_add_interface_static (renderer_type,
|
||||||
|
- DIA_TYPE_INTERACTIVE_RENDERER_INTERFACE,
|
||||||
|
- &irenderer_iface_info);
|
||||||
|
-
|
||||||
|
- }
|
||||||
|
- renderer->parent_instance.is_interactive = 1;
|
||||||
|
- renderer->gc = NULL;
|
||||||
|
-
|
||||||
|
- renderer->pixmap = NULL;
|
||||||
|
- renderer->clip_region = NULL;
|
||||||
|
|
||||||
|
return DIA_RENDERER(renderer);
|
||||||
|
}
|
||||||
|
--
|
||||||
|
cgit v0.9.2
|
||||||
|
|
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Aug 24 19:20:09 UTC 2013 - dimstar@opensuse.org
|
||||||
|
|
||||||
|
- Add dia-glib-2.35.patch: GLib drop support for adding interfaces
|
||||||
|
after class_init.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sat Jan 19 17:19:48 UTC 2013 - dimstar@opensuse.org
|
Sat Jan 19 17:19:48 UTC 2013 - dimstar@opensuse.org
|
||||||
|
|
||||||
|
3
dia.spec
3
dia.spec
@ -64,6 +64,8 @@ Patch18: dia-swig-2x.patch
|
|||||||
Patch19: dia-glib-2.31.patch
|
Patch19: dia-glib-2.31.patch
|
||||||
# PATCH-FIX-UPSTREAM dia-libemf-64bit.patch bgo#675495 sbrabec@suse.cz -- Fix build with libEMF on 64-bit platforms.
|
# PATCH-FIX-UPSTREAM dia-libemf-64bit.patch bgo#675495 sbrabec@suse.cz -- Fix build with libEMF on 64-bit platforms.
|
||||||
Patch20: dia-libemf-64bit.patch
|
Patch20: dia-libemf-64bit.patch
|
||||||
|
# PATCH-FIX-UPSTREAM dia-glib-2.35.patch bgo#694025 bnc#835972 dimstar@opensuse.org -- GLib drop support for adding interfaces after class_init, taken from git
|
||||||
|
Patch21: dia-glib-2.35.patch
|
||||||
Url: http://live.gnome.org/Dia
|
Url: http://live.gnome.org/Dia
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
Recommends: %{name}-lang
|
Recommends: %{name}-lang
|
||||||
@ -90,6 +92,7 @@ translation-update-upstream
|
|||||||
%patch18
|
%patch18
|
||||||
%patch19 -p1
|
%patch19 -p1
|
||||||
%patch20 -p1
|
%patch20 -p1
|
||||||
|
%patch21 -p1
|
||||||
cp $RPM_SOURCE_DIR/font-test*dia .
|
cp $RPM_SOURCE_DIR/font-test*dia .
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
Loading…
Reference in New Issue
Block a user