[nautilus] [ln-p] autogenerate marshallers



commit 6509c91b48f52c72c868f2ca7a9b47c46b9e0bc6
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Aug 20 10:58:28 2010 +0200

    [ln-p] autogenerate marshallers

 libnautilus-private/Makefile.am               |   40 +++++++++++++++++--------
 libnautilus-private/nautilus-icon-container.c |   14 ++++----
 libnautilus-private/nautilus-marshal.c        |    2 -
 libnautilus-private/nautilus-marshal.list     |   23 --------------
 4 files changed, 34 insertions(+), 45 deletions(-)
---
diff --git a/libnautilus-private/Makefile.am b/libnautilus-private/Makefile.am
index 1643489..57e43d2 100644
--- a/libnautilus-private/Makefile.am
+++ b/libnautilus-private/Makefile.am
@@ -17,6 +17,11 @@ INCLUDES = 						\
 	-DNAUTILUS_EXTENSIONDIR=\""$(libdir)/nautilus/extensions-2.0"\" \
 	$(NULL)
 
+BUILT_SOURCES = \
+	nautilus-marshal.c \
+	nautilus-marshal.h \
+	$(NULL)
+
 dependency_static_libs = \
 	$(top_builddir)/cut-n-paste-code/libegg/libegg.la \
         $(NULL)
@@ -35,11 +40,6 @@ libnautilus_private_la_LIBADD =		\
 	$(CORE_LIBS)			\
 	$(NULL)
 
-marshal_sources = \
-	nautilus-marshal.h \
-	nautilus-marshal-guts.c \
-	$(NULL)
-
 libnautilus_private_la_SOURCES = \
 	nautilus-autorun.c \
 	nautilus-autorun.h \
@@ -118,8 +118,6 @@ libnautilus_private_la_SOURCES = \
 	nautilus-lib-self-check-functions.h \
 	nautilus-link.c \
 	nautilus-link.h \
-	nautilus-marshal.c \
-	nautilus-marshal.h \
 	nautilus-merged-directory.c \
 	nautilus-merged-directory.h \
 	nautilus-metadata.h \
@@ -195,14 +193,29 @@ libnautilus_private_la_SOURCES = \
 	nautilus-window-slot-info.h \
 	$(NULL)
 
+nodist_libnautilus_private_la_SOURCES =\
+	$(BUILT_SOURCES) \
+	$(NULL)
+
 $(lib_LTLIBRARIES): $(dependency_static_libs)
 
-nautilus-marshal.h: nautilus-marshal.list $(GLIB_GENMARSHAL)
-	$(AM_V_GEN)$(GLIB_GENMARSHAL) $< --header --prefix=nautilus_marshal > $@
-nautilus-marshal-guts.c: nautilus-marshal.list $(GLIB_GENMARSHAL)
-	$(AM_V_GEN)$(GLIB_GENMARSHAL) $< --body --prefix=nautilus_marshal > $@
+nautilus-marshal.list: $(libnautilus_private_la_SOURCES) Makefile.am
+	$(AM_V_GEN)( cd $(srcdir) && \
+	sed -n -e 's/.*nautilus_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
+	$(libnautilus_private_la_SOURCES) ) \
+	| sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $  tmp
+	@if cmp -s $  tmp $@; then \
+		rm $  tmp; \
+	else \
+		mv $  tmp $@; \
+	fi
+
+%-marshal.h: %-marshal.list Makefile
+	$(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=$(subst -,_,$*)_marshal $< > $*-marshal.h
 
-$(libnautilus_private_la_OBJECTS): $(marshal_sources)
+%-marshal.c: %-marshal.list Makefile
+	$(AM_V_GEN)echo "#include \"nautilus-marshal.h\"" > $@ && \
+	$(GLIB_GENMARSHAL) --body --prefix=$(subst -,_,$*)_marshal $< >> $*-marshal.c
 
 gsettingsschema_in_files = org.gnome.nautilus.gschema.xml.in org.gnome.media-handling.gschema.xml.in
 gsettings_SCHEMAS = $(gsettingsschema_in_files:.xml.in=.xml)
@@ -224,8 +237,9 @@ EXTRA_DIST =				\
 	$(NULL)
 
 CLEANFILES = \
-	$(marshal_sources)				\
+	$(BUILT_SOURCES)				\
 	$(gsettings_SCHEMAS)				\
+	nautilus-marshal.list				\
 	$(NULL)
 
 dist-hook:
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c
index d7a448c..3a16df4 100644
--- a/libnautilus-private/nautilus-icon-container.c
+++ b/libnautilus-private/nautilus-icon-container.c
@@ -5797,7 +5797,7 @@ nautilus_icon_container_class_init (NautilusIconContainerClass *class)
 		                G_STRUCT_OFFSET (NautilusIconContainerClass,
 						 get_icon_uri),
 		                NULL, NULL,
-		                eel_marshal_STRING__POINTER,
+		                nautilus_marshal_STRING__POINTER,
 		                G_TYPE_STRING, 1,
 				G_TYPE_POINTER);
 	signals[GET_ICON_DROP_TARGET_URI]
@@ -5807,7 +5807,7 @@ nautilus_icon_container_class_init (NautilusIconContainerClass *class)
 		                G_STRUCT_OFFSET (NautilusIconContainerClass,
 						 get_icon_drop_target_uri),
 		                NULL, NULL,
-		                eel_marshal_STRING__POINTER,
+		                nautilus_marshal_STRING__POINTER,
 		                G_TYPE_STRING, 1,
 				G_TYPE_POINTER);
 	signals[MOVE_COPY_ITEMS] 
@@ -5890,7 +5890,7 @@ nautilus_icon_container_class_init (NautilusIconContainerClass *class)
 		                G_STRUCT_OFFSET (NautilusIconContainerClass, 
 						 get_container_uri),
 		                NULL, NULL,
-		                eel_marshal_STRING__VOID,
+		                nautilus_marshal_STRING__VOID,
 		                G_TYPE_STRING, 0);
 	signals[CAN_ACCEPT_ITEM] 
 		= g_signal_new ("can_accept_item",
@@ -5899,7 +5899,7 @@ nautilus_icon_container_class_init (NautilusIconContainerClass *class)
 		                G_STRUCT_OFFSET (NautilusIconContainerClass, 
 						 can_accept_item),
 		                NULL, NULL,
-		                eel_marshal_INT__POINTER_STRING,
+		                nautilus_marshal_INT__POINTER_STRING,
 		                G_TYPE_INT, 2,
 				G_TYPE_POINTER,
 				G_TYPE_STRING);
@@ -5910,7 +5910,7 @@ nautilus_icon_container_class_init (NautilusIconContainerClass *class)
 		                G_STRUCT_OFFSET (NautilusIconContainerClass,
 						 get_stored_icon_position),
 		                NULL, NULL,
-		                eel_marshal_BOOLEAN__POINTER_POINTER,
+		                nautilus_marshal_BOOLEAN__POINTER_POINTER,
 		                G_TYPE_BOOLEAN, 2,
 				G_TYPE_POINTER,
 				G_TYPE_POINTER);
@@ -5921,7 +5921,7 @@ nautilus_icon_container_class_init (NautilusIconContainerClass *class)
 		                G_STRUCT_OFFSET (NautilusIconContainerClass,
 						 get_stored_layout_timestamp),
 		                NULL, NULL,
-		                eel_marshal_BOOLEAN__POINTER_POINTER,
+		                nautilus_marshal_BOOLEAN__POINTER_POINTER,
 		                G_TYPE_BOOLEAN, 2,
 				G_TYPE_POINTER,
 				G_TYPE_POINTER);
@@ -5932,7 +5932,7 @@ nautilus_icon_container_class_init (NautilusIconContainerClass *class)
 		                G_STRUCT_OFFSET (NautilusIconContainerClass,
 						 store_layout_timestamp),
 		                NULL, NULL,
-		                eel_marshal_BOOLEAN__POINTER_POINTER,
+		                nautilus_marshal_BOOLEAN__POINTER_POINTER,
 		                G_TYPE_BOOLEAN, 2,
 				G_TYPE_POINTER,
 				G_TYPE_POINTER);



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