Blame libxklavier/xklavier.h

Packit 7e555f
/*
Packit 7e555f
 * Copyright (C) 2002-2006 Sergey V. Udaltsov <svu@gnome.org>
Packit 7e555f
 *
Packit 7e555f
 * This library is free software; you can redistribute it and/or
Packit 7e555f
 * modify it under the terms of the GNU Lesser General Public
Packit 7e555f
 * License as published by the Free Software Foundation; either
Packit 7e555f
 * version 2 of the License, or (at your option) any later version.
Packit 7e555f
 *
Packit 7e555f
 * This library is distributed in the hope that it will be useful,
Packit 7e555f
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 7e555f
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 7e555f
 * Lesser General Public License for more details.
Packit 7e555f
 *
Packit 7e555f
 * You should have received a copy of the GNU Lesser General Public
Packit 7e555f
 * License along with this library; if not, write to the
Packit 7e555f
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit 7e555f
 * Boston, MA 02111-1307, USA.
Packit 7e555f
 */
Packit 7e555f
Packit 7e555f
#ifndef __XKLAVIER_H__
Packit 7e555f
#define __XKLAVIER_H__
Packit 7e555f
Packit 7e555f
#include <stdarg.h>
Packit 7e555f
Packit 7e555f
#include <X11/Xlib.h>
Packit 7e555f
Packit 7e555f
#include <glib-object.h>
Packit 7e555f
Packit 7e555f
#include <libxklavier/xkl_engine.h>
Packit 7e555f
#include <libxklavier/xkl_config_rec.h>
Packit 7e555f
#include <libxklavier/xkl_config_item.h>
Packit 7e555f
#include <libxklavier/xkl_config_registry.h>
Packit 7e555f
#include <libxklavier/xkl-enum-types.h>
Packit 7e555f
Packit 7e555f
#ifdef __cplusplus
Packit 7e555f
extern "C" {
Packit 7e555f
#endif
Packit 7e555f
Packit 7e555f
/**
Packit 7e555f
 * xkl_get_last_error:
Packit 7e555f
 *
Packit 7e555f
 * Returns: the text message (statically allocated) of the last error
Packit 7e555f
 */
Packit 7e555f
	extern const gchar *xkl_get_last_error(void);
Packit 7e555f
Packit 7e555f
/**
Packit 7e555f
 * _xkl_debug:
Packit 7e555f
 * @file: the name of the source file. 
Packit 7e555f
 * Preprocessor symbol__FILE__ should be used here
Packit 7e555f
 * @function: name of the function
Packit 7e555f
 * Preprocessor symbol__func__ should be used here
Packit 7e555f
 * @level: level of the message
Packit 7e555f
 * @format: is a format (like in printf)
Packit 7e555f
 *
Packit 7e555f
 * Output (optionally) some debug info
Packit 7e555f
 */
Packit 7e555f
	extern void _xkl_debug(const gchar file[], const gchar function[],
Packit 7e555f
			       gint level, const gchar format[], ...);
Packit 7e555f
Packit 7e555f
/**
Packit 7e555f
 * XklLogAppender:
Packit 7e555f
 * @file: name of the source file. 
Packit 7e555f
 * Preprocessor symbol__FILE__ should be used here
Packit 7e555f
 * @function: name of the function
Packit 7e555f
 * Preprocessor symbol__func__ should be used here
Packit 7e555f
 * @level: level of the message
Packit 7e555f
 * @format: format (like in printf)
Packit 7e555f
 * @args: list of parameters
Packit 7e555f
 *
Packit 7e555f
 * Custom log output method for _xkl_debug. This appender is NOT called if the
Packit 7e555f
 * level of the message is greater than currently set debug level.
Packit 7e555f
 */
Packit 7e555f
	typedef void (*XklLogAppender) (const gchar file[],
Packit 7e555f
					const gchar function[],
Packit 7e555f
					gint level,
Packit 7e555f
					const gchar format[],
Packit 7e555f
					va_list args);
Packit 7e555f
Packit 7e555f
/**
Packit 7e555f
 * xkl_default_log_appender:
Packit 7e555f
 * @file: name of the source file. 
Packit 7e555f
 * Preprocessor symbol__FILE__ should be used here
Packit 7e555f
 * @function: name of the function
Packit 7e555f
 * Preprocessor symbol__func__ should be used here
Packit 7e555f
 * @level: level of the message
Packit 7e555f
 * @format: format (like in printf)
Packit 7e555f
 * @args: list of parameters
Packit 7e555f
 *
Packit 7e555f
 * Default log output method. Sends everything to stdout.
Packit 7e555f
 */
Packit 7e555f
	extern void xkl_default_log_appender(const gchar file[],
Packit 7e555f
					     const gchar function[],
Packit 7e555f
					     gint level,
Packit 7e555f
					     const gchar format[],
Packit 7e555f
					     va_list args);
Packit 7e555f
Packit 7e555f
/**
Packit 7e555f
 * xkl_set_log_appender:
Packit 7e555f
 * @fun: new log appender
Packit 7e555f
 *
Packit 7e555f
 * Installs the custom log appender.function
Packit 7e555f
 */
Packit 7e555f
	extern void xkl_set_log_appender(XklLogAppender fun);
Packit 7e555f
Packit 7e555f
/**
Packit 7e555f
 * xkl_set_debug_level:
Packit 7e555f
 * @level: new debug level
Packit 7e555f
 *
Packit 7e555f
 * Sets maximum debug level. 
Packit 7e555f
 * Message of the level more than the one set here - will be ignored
Packit 7e555f
 */
Packit 7e555f
	extern void xkl_set_debug_level(gint level);
Packit 7e555f
Packit 7e555f
#ifdef G_HAVE_ISO_VARARGS
Packit 7e555f
/**
Packit 7e555f
 * xkl_debug:
Packit 7e555f
 * @level: level of the message
Packit 7e555f
 *
Packit 7e555f
 * Output (optionally) some debug info
Packit 7e555f
 */
Packit 7e555f
#define xkl_debug( level, ... ) \
Packit 7e555f
  _xkl_debug( __FILE__, __func__, level, __VA_ARGS__ )
Packit 7e555f
#elif defined(G_HAVE_GNUC_VARARGS)
Packit 7e555f
/**
Packit 7e555f
 * xkl_debug:
Packit 7e555f
 * @level: level of the message
Packit 7e555f
 * @format: format (like in printf)
Packit 7e555f
 *
Packit 7e555f
 * Output (optionally) some debug info
Packit 7e555f
 */
Packit 7e555f
#define xkl_debug( level, format, args... ) \
Packit 7e555f
   _xkl_debug( __FILE__, __func__, level, format, ## args )
Packit 7e555f
#else
Packit 7e555f
#define xkl_debug( level, ... ) \
Packit 7e555f
  _xkl_debug( __FILE__, __func__, level, __VA_ARGS__ )
Packit 7e555f
#endif
Packit 7e555f
Packit 7e555f
#ifdef __cplusplus
Packit 7e555f
}
Packit 7e555f
#endif				/* __cplusplus */
Packit 7e555f
#endif