/* $Id: wmh_debug.h,v 1.3 2005/07/30 16:29:01 cegger Exp $
******************************************************************************

   LibGGIWMH debugging macros
   
   Copyright (C) 2004      Eric Faurot	        [eric.faurot@gmail.com]
   Copyright (C) 1998-1999 Marcus Sundberg	[marcus@ggi-project.org]
   
   Permission is hereby granted, free of charge, to any person obtaining a
   copy of this software and associated documentation files (the "Software"),
   to deal in the Software without restriction, including without limitation
   the rights to use, copy, modify, merge, publish, distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the
   Software is furnished to do so, subject to the following conditions:

   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
   THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
   IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
   CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

******************************************************************************
*/

#ifndef _GGI_INTERNAL_WMH_DEBUG_H
#define _GGI_INTERNAL_WMH_DEBUG_H

#include <ggi/wmh-defs.h>
#include <ggi/internal/debug_macros.h>

#define DEBUG_ISSYNC   (_wmhDebug&DEBUG_SYNC)

#define DEBUG_CORE     (1<<1)	/*   2 */
#define DEBUG_MODE     (1<<2)	/*   4 */
#define DEBUG_COLOR    (1<<3)	/*   8 */
#define DEBUG_DRAW     (1<<4)	/*  16 */
#define DEBUG_MISC     (1<<5)	/*  32 */
#define DEBUG_LIBS     (1<<6)	/*  64 */
#define DEBUG_EVENTS   (1<<7)	/* 128 */

__BEGIN_DECLS

GGIWMHAPIVAR uint32_t   _wmhDebug;

static inline void DPRINT(const char *form,...)        { DPRINTIF(_wmhDebug,DEBUG_ALL);    }
static inline void DPRINT_CORE(const char *form,...)   { DPRINTIF(_wmhDebug,DEBUG_CORE);   }
static inline void DPRINT_MODE(const char *form,...)   { DPRINTIF(_wmhDebug,DEBUG_MODE);   }
static inline void DPRINT_COLOR(const char *form,...)  { DPRINTIF(_wmhDebug,DEBUG_COLOR);  }
static inline void DPRINT_DRAW(const char *form,...)   { DPRINTIF(_wmhDebug,DEBUG_DRAW);   }
static inline void DPRINT_MISC(const char *form,...)   { DPRINTIF(_wmhDebug,DEBUG_MISC);   }
static inline void DPRINT_LIBS(const char *form,...)   { DPRINTIF(_wmhDebug,DEBUG_LIBS);   }
static inline void DPRINT_EVENTS(const char *form,...) { DPRINTIF(_wmhDebug,DEBUG_EVENTS); }

__END_DECLS

#endif /* _GGI_INTERNAL_WMH_DEBUG_H */
