[dia/dia-next] Remove diamarshal, rely on GLib to get it right



commit 0d66e74e5017c2bb1b9a0ac5aef67af32af7959a
Author: Zander Brown <zbrown gnome org>
Date:   Wed Jan 9 19:30:29 2019 +0000

    Remove diamarshal, rely on GLib to get it right

 NOTES.md                      |  3 ++-
 app/dia-application.c         | 20 ++++++--------------
 app/diagram.c                 | 11 ++++-------
 app/diapagelayout.c           | 14 ++++++--------
 configure.ac                  |  2 +-
 lib/.gitignore                |  2 --
 lib/Makefile.am               | 23 +++--------------------
 lib/diacellrendererproperty.c |  7 ++-----
 lib/diagramdata.c             | 43 +++++++++++++++++--------------------------
 lib/diamarshal.list           | 31 -------------------------------
 lib/libdia.def                |  2 --
 11 files changed, 41 insertions(+), 117 deletions(-)
---
diff --git a/NOTES.md b/NOTES.md
index 8bbf03d7..d5a51a6a 100644
--- a/NOTES.md
+++ b/NOTES.md
@@ -13,4 +13,5 @@
   wheel by using libpeas which would give us the chance to support plugins in languages
   other than C
 * PyDia is largly broken (not least by being Py2 & using PyGtk) but with libpeas we
-  could probably just drop it without loosing much
\ No newline at end of file
+  could probably just drop it without loosing much
+* Navigation tool is largly broken, esp on Wayland
diff --git a/app/dia-application.c b/app/dia-application.c
index 8ece9762..2288d471 100644
--- a/app/dia-application.c
+++ b/app/dia-application.c
@@ -11,8 +11,6 @@ diagtree_show_callback
 #include "dia-application.h"
 #include "display.h"
 
-#include <lib/diamarshal.h>
-
 enum {
   DIAGRAM_ADD,
   DIAGRAM_CHANGE,
@@ -65,31 +63,25 @@ dia_application_class_init (DiaApplicationClass *klass)
                   G_TYPE_FROM_CLASS (klass),
                   G_SIGNAL_RUN_FIRST,
                   G_STRUCT_OFFSET (DiaApplicationClass, diagram_add),
-                  NULL, NULL,
-                  dia_marshal_VOID__OBJECT,
+                  NULL, NULL, NULL,
                   G_TYPE_NONE, 
-                  1,
-                 DIA_TYPE_DIAGRAM);
+                  1, DIA_TYPE_DIAGRAM);
   _dia_application_signals[DIAGRAM_CHANGE] =
     g_signal_new ("diagram_change",
                   G_TYPE_FROM_CLASS (klass),
                   G_SIGNAL_RUN_FIRST,
                   G_STRUCT_OFFSET (DiaApplicationClass, diagram_change),
-                  NULL, NULL,
-                  dia_marshal_VOID__OBJECT_UINT_POINTER,
+                  NULL, NULL, NULL,
                   G_TYPE_NONE, 
-                  3,
-                 DIA_TYPE_DIAGRAM, G_TYPE_UINT, G_TYPE_POINTER);
+                  3, DIA_TYPE_DIAGRAM, G_TYPE_UINT, G_TYPE_POINTER);
   _dia_application_signals[DIAGRAM_REMOVE] =
     g_signal_new ("diagram_remove",
                   G_TYPE_FROM_CLASS (klass),
                   G_SIGNAL_RUN_FIRST,
                   G_STRUCT_OFFSET (DiaApplicationClass, diagram_remove),
-                  NULL, NULL,
-                  dia_marshal_VOID__OBJECT,
+                  NULL, NULL, NULL,
                   G_TYPE_NONE, 
-                  1,
-                 DIA_TYPE_DIAGRAM);
+                  1, DIA_TYPE_DIAGRAM);
 }
 
 static void 
diff --git a/app/diagram.c b/app/diagram.c
index 2528eeb2..f21fcdae 100644
--- a/app/diagram.c
+++ b/app/diagram.c
@@ -41,7 +41,6 @@
 #include "autosave.h"
 #include "dynamic_refresh.h"
 #include "textedit.h"
-#include "lib/diamarshal.h"
 #include "parent.h"
 #include "diacontext.h"
 
@@ -148,12 +147,10 @@ diagram_class_init (DiagramClass *klass)
 
   diagram_signals[REMOVED] =
     g_signal_new ("removed",
-                 G_TYPE_FROM_CLASS (klass),
-                 G_SIGNAL_RUN_FIRST,
-                 G_STRUCT_OFFSET (DiagramClass, removed),
-                 NULL, NULL,
-                 dia_marshal_VOID__VOID,
-                 G_TYPE_NONE, 0);
+                  G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_FIRST,
+                  G_STRUCT_OFFSET (DiagramClass, removed),
+                  NULL, NULL, NULL, G_TYPE_NONE, 0);
 
   klass->removed = _diagram_removed;
 
diff --git a/app/diapagelayout.c b/app/diapagelayout.c
index 56e767e8..204c3a0a 100644
--- a/app/diapagelayout.c
+++ b/app/diapagelayout.c
@@ -37,7 +37,6 @@
 #include "paper.h"
 #include "prefs.h"
 
-#include "diamarshal.h"
 #include "diaoptionmenu.h"
 
 /* private class : noone wants to inherit and noone needs to mess with details */
@@ -119,13 +118,12 @@ dia_page_layout_class_init(DiaPageLayoutClass *class)
   parent_class = g_type_class_peek_parent (class);
 
   pl_signals[CHANGED] =
-    g_signal_new("changed",
-                G_TYPE_FROM_CLASS (object_class),
-                G_SIGNAL_RUN_FIRST,
-                G_STRUCT_OFFSET(DiaPageLayoutClass, changed),
-                NULL, NULL,
-                dia_marshal_VOID__VOID,
-                G_TYPE_NONE, 0);
+    g_signal_new ("changed",
+                  G_TYPE_FROM_CLASS (object_class),
+                  G_SIGNAL_RUN_FIRST,
+                  G_STRUCT_OFFSET(DiaPageLayoutClass, changed),
+                  NULL, NULL, NULL,
+                  G_TYPE_NONE, 0);
 #if 0 /* FIXME ?*/
   g_object_class_add_signals(object_class, pl_signals, LAST_SIGNAL);
 #endif
diff --git a/configure.ac b/configure.ac
index af9e90df..52b61fbf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,7 +70,6 @@ dnl Checks for libraries
 PKG_CHECK_MODULES(GMODULE, gmodule-2.0 gobject-2.0)
 AC_SUBST(GMODULE_CFLAGS)
 AC_SUBST(GMODULE_LIBS)
-AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
 
 GTK_MODULES="gtk+-3.0 >= 3.10.0 glib-2.0 >= 2.20.0 libxml-2.0 gdk-pixbuf-2.0 gthread-2.0 gmodule-2.0"
 
@@ -576,6 +575,7 @@ else
   fi
 fi
 
+AM_CFLAGS="$AM_CFLAGS -fdiagnostics-color=auto"
 
 AC_OUTPUT(
 Makefile
diff --git a/lib/.gitignore b/lib/.gitignore
index 18a92c40..ff539a09 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -1,5 +1,3 @@
-diamarshal.c
-diamarshal.h
 dia-lib-icons.h
 libdia.la
 html
diff --git a/lib/Makefile.am b/lib/Makefile.am
index fd3e0ab1..f9421e86 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -64,7 +64,7 @@ ICON_PNGS= \
 dia-lib-icons.h: $(ICON_PNGS)
        gdk-pixbuf-csource --build-list $(ICON_PNG_PAIRS) > dia-lib-icons.h
 
-BUILT_SOURCES = dia-lib-icons.h diamarshal.h diamarshal.c
+BUILT_SOURCES = dia-lib-icons.h
 
 libdia_la_SOURCES =  \
                widgets/dialist.c \
@@ -202,8 +202,6 @@ libdia_la_SOURCES =  \
                persistence.h \
                diaerror.c \
                diaerror.h \
-               diamarshal.c \
-               diamarshal.h \
                debug.c \
                debug.h \
                prefs.c \
@@ -246,26 +244,11 @@ AM_CPPFLAGS += -I$(top_srcdir)/intl $(DEBUG_FLAGS) $(GDK_PIXBUF_CFLAGS) \
   -DDIA_SHEETDIR=\"$(sheetdir)\" \
   $(PANGOFT2_CFLAGS) $(UNICODE_CFLAGS)
 
-libdia_la_extra_sources = diamarshal.list
-
 #
 # rules to generate built sources
 #
 # setup autogeneration dependancies
-gen_sources = xgen-gwmh xgen-gwmc diamarshal.c diamarshal.h
+gen_sources = xgen-gwmh xgen-gwmc
 CLEANFILES = $(gen_sources)
 
-diamarshal.h: diamarshal.list
-       $(GLIB_GENMARSHAL) --prefix=dia_marshal $(srcdir)/diamarshal.list --header >> xgen-gwmh \
-       && (cmp -s xgen-gwmh $(@F) || cp xgen-gwmh $(@F)) \
-       && rm -f xgen-gwmh xgen-gwmh~
-
-diamarshal.c: diamarshal.h
-       echo "#include \"diamarshal.h\"" >> xgen-gwmc \
-       && $(GLIB_GENMARSHAL) --prefix=dia_marshal $(srcdir)/diamarshal.list --body >> xgen-gwmc \
-       && cp xgen-gwmc $(@F) \
-       && rm -f xgen-gwmc xgen-gwmc~
-
-
-EXTRA_DIST = libdia.def makefile.msc diamarshal.list
-
+EXTRA_DIST = libdia.def makefile.msc
diff --git a/lib/diacellrendererproperty.c b/lib/diacellrendererproperty.c
index fc52ed75..a21fd058 100644
--- a/lib/diacellrendererproperty.c
+++ b/lib/diacellrendererproperty.c
@@ -30,7 +30,6 @@
 #include "diacellrendererproperty.h"
 
 #include "diarenderer.h"
-#include "diamarshal.h"
 #include "message.h"
 
 enum
@@ -96,11 +95,9 @@ dia_cell_renderer_property_class_init (DiaCellRendererPropertyClass *klass)
                   G_OBJECT_CLASS_TYPE (object_class),
                   G_SIGNAL_RUN_LAST,
                   G_STRUCT_OFFSET (DiaCellRendererPropertyClass, clicked),
-                  NULL, NULL,
-                  dia_marshal_VOID__STRING_FLAGS,
+                  NULL, NULL, NULL,
                   G_TYPE_NONE, 2,
-                  G_TYPE_STRING,
-                  GDK_TYPE_MODIFIER_TYPE);
+                  G_TYPE_STRING, GDK_TYPE_MODIFIER_TYPE);
 
   object_class->finalize     = dia_cell_renderer_property_finalize;
   object_class->get_property = dia_cell_renderer_property_get_property;
diff --git a/lib/diagramdata.c b/lib/diagramdata.c
index 20383dea..14d7b618 100644
--- a/lib/diagramdata.c
+++ b/lib/diagramdata.c
@@ -31,7 +31,6 @@
 #include "persistence.h"
 
 #include "dynamic_obj.h"
-#include "diamarshal.h"
 
 
 static const Rectangle invalid_extents = { -1.0,-1.0,-1.0,-1.0 };
@@ -259,37 +258,29 @@ diagram_data_class_init(DiagramDataClass *klass)
 
   diagram_data_signals[OBJECT_ADD] =
     g_signal_new ("object_add",
-              G_TYPE_FROM_CLASS (klass),
-              G_SIGNAL_RUN_FIRST,
-              G_STRUCT_OFFSET (DiagramDataClass, object_add),
-              NULL, NULL,
-              dia_marshal_VOID__POINTER_POINTER,
-              G_TYPE_NONE, 
-              2,
-              G_TYPE_POINTER,
-              G_TYPE_POINTER);
+                  G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_FIRST,
+                  G_STRUCT_OFFSET (DiagramDataClass, object_add),
+                  NULL, NULL, NULL,
+                  G_TYPE_NONE, 
+                  2, G_TYPE_POINTER, G_TYPE_POINTER);
               
   diagram_data_signals[OBJECT_REMOVE] =
     g_signal_new ("object_remove",
-              G_TYPE_FROM_CLASS (klass),
-              G_SIGNAL_RUN_FIRST,
-              G_STRUCT_OFFSET (DiagramDataClass, object_remove),
-              NULL, NULL,
-              dia_marshal_VOID__POINTER_POINTER,
-              G_TYPE_NONE, 
-              2,
-              G_TYPE_POINTER,
-              G_TYPE_POINTER);
+                  G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_FIRST,
+                  G_STRUCT_OFFSET (DiagramDataClass, object_remove),
+                  NULL, NULL, NULL,
+                  G_TYPE_NONE, 
+                  2, G_TYPE_POINTER, G_TYPE_POINTER);
 
   diagram_data_signals[SELECTION_CHANGED] =
     g_signal_new ("selection_changed",
-                 G_TYPE_FROM_CLASS (klass),
-                 G_SIGNAL_RUN_FIRST,
-                 G_STRUCT_OFFSET (DiagramDataClass, selection_changed),
-                 NULL, NULL,
-                 dia_marshal_VOID__INT,
-                 G_TYPE_NONE, 1,
-                 G_TYPE_INT);
+                  G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_FIRST,
+                  G_STRUCT_OFFSET (DiagramDataClass, selection_changed),
+                  NULL, NULL, NULL,
+                  G_TYPE_NONE, 1, G_TYPE_INT);
 
   object_class->finalize = diagram_data_finalize;
   klass->object_add = _diagram_data_object_add;
diff --git a/lib/libdia.def b/lib/libdia.def
index c3bc9c28..d509f767 100644
--- a/lib/libdia.def
+++ b/lib/libdia.def
@@ -767,8 +767,6 @@ EXPORTS
  libdia_init
  dia_log_message
 
- dia_marshal_VOID__OBJECT_UINT_POINTER
-
  dia_matrix_is_identity
  dia_matrix_get_angle_and_scales
  dia_matrix_set_angle_and_scales


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]