[sapwood] extract the debug message handling
- From: Sven Herzberg <herzi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sapwood] extract the debug message handling
- Date: Fri, 6 Aug 2010 12:06:53 +0000 (UTC)
commit a7fd7eda3caeb130a581ef67b465bc2d44bb72b0
Author: Sven Herzberg <herzi gnome-de org>
Date: Fri Aug 6 13:15:19 2010 +0200
extract the debug message handling
* engine/Makefile.am: updated
* engine/sapwood-debug.h: add a new home for the macro to avoid
redefining it in each and every .c file
* engine/sapwood-style.c,
* engine/theme-pixbuf.c: include the new header instead of creating new
#define statements
engine/Makefile.am | 1 +
engine/sapwood-debug.h | 38 ++++++++++++++++++++++++++++++++++++++
engine/sapwood-style.c | 11 +++--------
engine/theme-pixbuf.c | 9 ++-------
4 files changed, 44 insertions(+), 15 deletions(-)
---
diff --git a/engine/Makefile.am b/engine/Makefile.am
index 6b2bb18..0db260d 100644
--- a/engine/Makefile.am
+++ b/engine/Makefile.am
@@ -35,6 +35,7 @@ libsapwood_client_la_LIBADD=\
$(NULL)
libsapwood_private_la_SOURCES=\
+ sapwood-debug.h \
sapwood-pixmap.c \
sapwood-pixmap.h \
sapwood-pixmap-priv.h \
diff --git a/engine/sapwood-debug.h b/engine/sapwood-debug.h
new file mode 100644
index 0000000..e56ca5e
--- /dev/null
+++ b/engine/sapwood-debug.h
@@ -0,0 +1,38 @@
+/* This file is part of sapwood
+ *
+ * Copyright (C) 2010 Sven Herzberg
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+#ifndef SAPWOOD_DEBUG_H
+#define SAPWOOD_DEBUG_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+#ifdef ENABLE_DEBUG
+#define LOG(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, __VA_ARGS__)
+#else
+#define LOG(...)
+#endif
+
+G_END_DECLS
+
+#endif /* !SAPWOOD_DEBUG_H */
+
+/* vim:set et sw=2 cino=t0,f0,(0,{s,>2s,n-1s,^-1s,e2s: */
diff --git a/engine/sapwood-style.c b/engine/sapwood-style.c
index fe255a1..4ceef2a 100644
--- a/engine/sapwood-style.c
+++ b/engine/sapwood-style.c
@@ -26,16 +26,11 @@
#include <math.h>
#include <string.h>
-#include "theme-image.h"
-#include "theme-pixbuf.h"
+#include "sapwood-debug.h"
#include "sapwood-rc-style.h"
#include "sapwood-style.h"
-
-#ifdef ENABLE_DEBUG
-#define LOG(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, __VA_ARGS__)
-#else
-#define LOG(...)
-#endif
+#include "theme-image.h"
+#include "theme-pixbuf.h"
#if !GTK_CHECK_VERSION(2,18,0)
#define gtk_widget_get_state(w) GTK_WIDGET_STATE(w)
diff --git a/engine/theme-pixbuf.c b/engine/theme-pixbuf.c
index 9dd6bcb..45409f2 100644
--- a/engine/theme-pixbuf.c
+++ b/engine/theme-pixbuf.c
@@ -27,15 +27,10 @@
#include <limits.h>
#include <stdlib.h>
#include <string.h>
-
-#include "theme-pixbuf.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
-#ifdef ENABLE_DEBUG
-#define LOG(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, __VA_ARGS__)
-#else
-#define LOG(...)
-#endif
+#include "sapwood-debug.h"
+#include "theme-pixbuf.h"
static GHashTable *pixbuf_hash = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]