1
0
Fork 0
mutter-performance-source/clutter/clutter-private.h
Emmanuele Bassi e4b9a507e3 2006-11-21 Emmanuele Bassi <ebassi@openedhand.com>
* configure.ac: Enable debug messages also when
	--enable-debug is set to "minimum".

	* clutter/Makefile.am:
	* clutter/clutter-debug.h: Move all debugging macros inside
	this private header; make all debug macros depend on the
	CLUTTER_ENABLE_DEBUG compile time define, controlled by
	the --enable-debug configure switch; add G_LOG_DOMAIN define.

	* clutter/clutter-main.c: Clean up the debug stuff; add
	command line argument parsing using GOption; the debug
	messages now are triggered like this:

	  CLUTTER_DEBUG=section:section:... clutter-app
	
	or like this:

	  clutter-app --clutter-debug=section:section:...
	
	where "section" is one of the sections listed in clutter-main.c,
	or "all", for all sections; each section is bound to a flag,
	which can be used to define a domain when adding a debug note
	using the CLUTTER_NOTE() macro; the old CLUTTER_DBG() macro is
	just a wrapper around that, under the CLUTTER_DEBUG_MISC domain;
	CLUTTER_NOTE() is used like this:

	  CLUTTER_NOTE (DOMAIN, log-function);
	
	where log function is g_printerr(), g_message(), g_warning(),
	g_critical() or directly g_log() - for instance:

	  CLUTTER_NOTE (PANGO, g_warning ("Cache miss: %d", glyph));

	will print the warning only if the "pango" flag has been
	set to the CLUTTER_DEBUG envvar or passed to the --clutter-debug
	command line argument.

	similar to CLUTTER_SHOW_FPS, there's also the --clutter-show-fps
	command line switch; also, the --display and --screen command
	line switches have been added: the first overrides the DISPLAY
	envvar and the second controls the X screen used by Clutter to
	get the root window on the display.

	* clutter/clutter-main.h:
	* clutter/clutter-main.c: Add extended support for GOption
	in Clutter; use clutter_init_with_args() to let Clutter
	parse your own command line arguments; use instead
	clutter_get_option_group() to get the GOptionGroup used by
	Clutter if you want to do the parsing yourself with
	g_option_context_parse(). The init sequence has been verified,
	updated and moved into common functions where possible.

	* clutter/pango/pangoclutter-render.c:
	* clutter/*.c: Include "clutter-debug.h" where needed; use
	CLUTTER_NOTE() instead of CLUTTER_DBG().

	* examples/super-oh.c: Use the new clutter_init_with_args()
	function, and add a --num-hands command line switch to
	the SuperOH example code controlling the number of hands at
	runtime.
2006-11-21 21:27:53 +00:00

92 lines
2.3 KiB
C

/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Authored By Matthew Allum <mallum@openedhand.com>
*
* Copyright (C) 2006 OpenedHand
*
* This library 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 of the License, or (at your option) any later version.
*
* This library 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 library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef _HAVE_CLUTTER_PRIVATE_H
#define _HAVE_CLUTTER_PRIVATE_H
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/keysym.h>
#include <GL/glx.h>
#include <GL/gl.h>
#include <glib.h>
#include <pango/pangoft2.h>
#include <clutter/clutter-debug.h>
G_BEGIN_DECLS
typedef struct _ClutterMainContext ClutterMainContext;
struct _ClutterMainContext
{
Display *xdpy;
Window xwin_root;
int xscreen;
GC xgc;
PangoFT2FontMap *font_map;
GMutex *gl_lock;
guint update_idle;
guint main_loop_level;
GSList *main_loops;
ClutterStage *stage;
guint is_initialized : 1;
};
#define CLUTTER_CONTEXT() (clutter_context_get_default ())
ClutterMainContext *clutter_context_get_default (void);
typedef enum {
CLUTTER_ACTOR_UNUSED_FLAG = 0,
CLUTTER_ACTOR_IN_DESTRUCTION = 1 << 0,
CLUTTER_ACTOR_IS_TOPLEVEL = 1 << 1,
CLUTTER_ACTOR_IN_REPARENT = 1 << 2
} ClutterPrivateFlags;
#define CLUTTER_PRIVATE_FLAGS(a) (CLUTTER_ACTOR ((a))->private_flags)
#define CLUTTER_SET_PRIVATE_FLAGS(a,f) G_STMT_START{ (CLUTTER_PRIVATE_FLAGS (a) |= (f)); }G_STMT_END
#define CLUTTER_UNSET_PRIVATE_FLAGS(a,f) G_STMT_START{ (CLUTTER_PRIVATE_FLAGS (a) &= ~(f)); }G_STMT_END
void clutter_feature_init (void);
G_END_DECLS
#endif