diff options
author | Emmanuele Bassi <ebassi@openedhand.com> | 2006-11-21 21:27:53 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@openedhand.com> | 2006-11-21 21:27:53 +0000 |
commit | e4b9a507e3610dce70b516dca393602da7dcb8a8 (patch) | |
tree | 1a44722d99b0ab7f475ab9a63179df008eae2124 /clutter/clutter-feature.c | |
parent | ff844061439d1226f481b30de73fa97b79bdc997 (diff) | |
download | clutter-e4b9a507e3610dce70b516dca393602da7dcb8a8.tar.gz |
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.
Diffstat (limited to 'clutter/clutter-feature.c')
-rw-r--r-- | clutter/clutter-feature.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/clutter/clutter-feature.c b/clutter/clutter-feature.c index 02c42400d..4655a8251 100644 --- a/clutter/clutter-feature.c +++ b/clutter/clutter-feature.c @@ -31,8 +31,6 @@ */ #include "config.h" -#include "clutter-main.h" -#include "clutter-feature.h" #include <stdlib.h> #include <string.h> @@ -42,7 +40,12 @@ #include <fcntl.h> #include <errno.h> - #include <dlfcn.h> +#include <dlfcn.h> + +#include "clutter-feature.h" +#include "clutter-main.h" +#include "clutter-private.h" +#include "clutter-debug.h" typedef void (*FuncPtr) (void); typedef int (*GLXGetVideoSyncProc) (unsigned int *count); @@ -221,7 +224,7 @@ clutter_feature_init (void) if (getenv("__GL_SYNC_TO_VBLANK") || check_vblank_env("none")) { - CLUTTER_DBG("vblank sync: disabled at user request"); + CLUTTER_NOTE (MISC, g_message ("vblank sync: disabled at user request")); } else { @@ -237,8 +240,9 @@ clutter_feature_init (void) if (__features->funcs.get_video_sync != NULL && __features->funcs.wait_video_sync != NULL) { - CLUTTER_DBG("vblank sync: using glx"); - __features->vblank_type = CLUTTER_VBLANK_GLX; + CLUTTER_NOTE (MISC, g_message ("vblank sync: using glx")); + + __features->vblank_type = CLUTTER_VBLANK_GLX; __features->flags |= CLUTTER_FEATURE_SYNC_TO_VBLANK; } } @@ -248,14 +252,18 @@ clutter_feature_init (void) __features->dri_fd = open("/dev/dri/card0", O_RDWR); if (__features->dri_fd >= 0) { - CLUTTER_DBG("vblank sync: using dri"); + CLUTTER_NOTE (MISC, g_message ("vblank sync: using dri")); + __features->vblank_type = CLUTTER_VBLANK_DRI; __features->flags |= CLUTTER_FEATURE_SYNC_TO_VBLANK; } } if (!(__features->flags & CLUTTER_FEATURE_SYNC_TO_VBLANK)) - CLUTTER_DBG("vblank sync: no use-able mechanism found"); + { + CLUTTER_NOTE (MISC, + g_message ("vblank sync: no use-able mechanism found")); + } } } |