changeset 1573:82548d92c922

Some macro additions for handling Gtk+/Glib stuff; Misc merges.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 03 Sep 2007 06:25:55 +0300
parents 64ded0b8f80e
children e566e18e9e3d
files src/sid/xmms-sid.h src/sid/xs_stil.c
diffstat 2 files changed, 29 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/sid/xmms-sid.h	Mon Sep 03 06:24:06 2007 +0300
+++ b/src/sid/xmms-sid.h	Mon Sep 03 06:25:55 2007 +0300
@@ -64,7 +64,7 @@
 /* Configuration section identifier
  */
 #define XS_PACKAGE_STRING	"Audacious-SID v0.8.0beta18"
-#define XS_CONFIG_IDENT		"sid"		/* Configuration file identifier */
+#define XS_CONFIG_IDENT		"sid"
 
 /* Default audio rendering frequency in Hz
  */
@@ -113,8 +113,10 @@
 
 /* Character set conversion helper macros
  */
-#define XS_CS_SID(M)	g_convert(M, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL)
-#define XS_CS_STIL(M)	g_convert(M, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL)
+#define XS_CS_FILENAME(M)	g_filename_to_utf8(M, -1, NULL, NULL, NULL)
+#define XS_CS_SID(M)		g_convert(M, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL)
+#define XS_CS_STIL(M)		g_convert(M, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL)
+#define XS_CS_FREE(M)		g_free(M)
 
 /* Shorthands for linked lists
  */
@@ -191,6 +193,29 @@
 #  endif
 #endif
 
+
+/* And even some Gtk+ macro crap here, yay.
+ */
+#define XS_DEF_WINDOW_DELETE(ME, MV)					\
+gboolean xs_ ## ME ## _delete(GtkWidget *w, GdkEvent *e, gpointer d) {	\
+	(void) w; (void) e; (void) d;					\
+	if (xs_ ## MV ) {						\
+		gtk_widget_destroy(xs_ ## MV );				\
+		xs_ ## MV = NULL;					\
+	}								\
+	return FALSE;							\
+}
+
+#define XS_DEF_WINDOW_CLOSE(ME, MV)			\
+void xs_ ## ME (GtkButton *b, gpointer d) {		\
+	(void) b; (void) d;				\
+	gtk_widget_destroy(xs_ ## MV );			\
+	xs_ ## MV = NULL;				\
+}
+
+#define XS_SIGNAL_CONNECT(SOBJ, SNAME, SFUNC, SDATA)		\
+	g_signal_connect(G_OBJECT(SOBJ), SNAME, G_CALLBACK(SFUNC), SDATA)
+
 #ifdef __cplusplus
 }
 #endif
--- a/src/sid/xs_stil.c	Mon Sep 03 06:24:06 2007 +0300
+++ b/src/sid/xs_stil.c	Mon Sep 03 06:25:55 2007 +0300
@@ -299,7 +299,7 @@
 			break;
 		}
 		
-		g_free(tmpLine);
+		XS_CS_FREE(tmpLine);
 
 	} /* while */