2006-11-22 Matthew Allum <mallum@openedhand.com>

* clutter/clutter-actor.c:
        * clutter/clutter-alpha.c:
        * clutter/clutter-behaviour-opacity.c:
        * clutter/clutter-behaviour-scale.c:
        * clutter/clutter-clone-texture.c:
        * clutter/clutter-feature.c:
        * clutter/clutter-label.c:
        * clutter/clutter-main.c:
        * clutter/clutter-stage.c:
        * clutter/clutter-texture.c
        * clutter/clutter-timeline.c:
        * clutter/clutter-debug.h:
        Make CLUTTER_NOTE() just take a string rather than a func.
        Add more default context to output.

        * configure.ac:
        Fix flag and add more help docs for --ebable-debug option.
This commit is contained in:
Matthew Allum 2006-11-22 20:52:27 +00:00
parent dae4375d08
commit c57108e030
14 changed files with 107 additions and 88 deletions

View File

@ -1,3 +1,23 @@
2006-11-22 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
* clutter/clutter-alpha.c:
* clutter/clutter-behaviour-opacity.c:
* clutter/clutter-behaviour-scale.c:
* clutter/clutter-clone-texture.c:
* clutter/clutter-feature.c:
* clutter/clutter-label.c:
* clutter/clutter-main.c:
* clutter/clutter-stage.c:
* clutter/clutter-texture.c
* clutter/clutter-timeline.c:
* clutter/clutter-debug.h:
Make CLUTTER_NOTE() just take a string rather than a func.
Add more default context to output.
* configure.ac:
Fix flag and add more help docs for --ebable-debug option.
2006-11-21 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-main.c: Add a --g-fatal-warnings switch

View File

@ -241,12 +241,12 @@ clutter_actor_paint (ClutterActor *self)
if (!CLUTTER_ACTOR_IS_REALIZED (self))
{
CLUTTER_NOTE (PAINT, g_message ("Attempting realize via paint()"));
CLUTTER_NOTE (PAINT, "Attempting realize via paint()");
clutter_actor_realize(self);
if (!CLUTTER_ACTOR_IS_REALIZED (self))
{
CLUTTER_NOTE (PAINT, g_warning ("Attempt failed, aborting paint"));
CLUTTER_NOTE (PAINT, "Attempt failed, aborting paint");
return;
}
}
@ -553,9 +553,9 @@ clutter_actor_dispose (GObject *object)
{
ClutterActor *self = CLUTTER_ACTOR (object);
CLUTTER_NOTE (MISC, g_message ("Disposing of object (id=%d) of type `%s'",
self->priv->id,
g_type_name (G_OBJECT_TYPE (self))));
CLUTTER_NOTE (MISC, "Disposing of object (id=%d) of type `%s'",
self->priv->id,
g_type_name (G_OBJECT_TYPE (self)));
if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_DESTRUCTION))
{

View File

@ -521,7 +521,7 @@ clutter_sine_func (ClutterAlpha *alpha,
x = (gdouble) (current_frame_num * 2.0f * M_PI) / n_frames ;
sine = (sin (x - (M_PI / 2.0f)) + 1.0f) * 0.5f;
CLUTTER_NOTE (ALPHA, g_message ("sine: %2f\n", sine));
CLUTTER_NOTE (ALPHA, "sine: %2f\n", sine);
return (guint32) (sine * (gdouble) CLUTTER_ALPHA_MAX_ALPHA);
}

View File

@ -97,8 +97,7 @@ opacity_frame_foreach (ClutterActor *actor,
opacity += priv->opacity_start;
CLUTTER_NOTE (BEHAVIOUR, g_message ("alpha %i opacity %i\n",
alpha, opacity));
CLUTTER_NOTE (BEHAVIOUR, "alpha %i opacity %i\n", alpha, opacity);
clutter_actor_set_opacity (actor, opacity);
}

View File

@ -123,7 +123,7 @@ scale_frame_foreach (ClutterActor *actor,
case CLUTTER_GRAVITY_WEST:
break;
case CLUTTER_GRAVITY_CENTER:
CLUTTER_NOTE (MISC, g_message (G_STRLOC ": gravity %i vs %i\n", sw, w));
CLUTTER_NOTE (MISC, "gravity %i vs %i\n", sw, w);
clutter_actor_move_by (actor, sw - w, sh - h);
default:
break;

View File

@ -151,9 +151,9 @@ clone_texture_render_to_gl_quad (ClutterCloneTexture *ctexture,
qy2 = qy1 + ((qheight * actual_h) / pheight );
CLUTTER_NOTE (TEXTURE,
g_message ("rendering text tile x: %i, y: %i - %ix%i",
x, y,
actual_w, actual_h));
"rendering text tile x: %i, y: %i - %ix%i",
x, y,
actual_w, actual_h);
glBegin (GL_QUADS);
glTexCoord2f (tx, ty); glVertex2i (qx2, qy2);
@ -204,10 +204,10 @@ clutter_clone_texture_paint (ClutterActor *self)
clutter_actor_get_coords (self, &x1, &y1, &x2, &y2);
CLUTTER_NOTE (PAINT, g_message ("paint to x1: %i, y1: %i x2: %i, y2: %i "
"opacity: %i",
x1, y1, x2, y2,
clutter_actor_get_opacity (self)));
CLUTTER_NOTE (PAINT, "paint to x1: %i, y1: %i x2: %i, y2: %i "
"opacity: %i",
x1, y1, x2, y2,
clutter_actor_get_opacity (self));
/* Parent paint translated us into position */
clone_texture_render_to_gl_quad (CLUTTER_CLONE_TEXTURE(self),

View File

@ -19,12 +19,13 @@ typedef enum {
#ifdef CLUTTER_ENABLE_DEBUG
#define CLUTTER_NOTE(type,action) G_STMT_START { \
#define CLUTTER_NOTE(type,x,a...) G_STMT_START { \
if (clutter_debug_flags & CLUTTER_DEBUG_##type) \
{ action; } } G_STMT_END
{ g_message ("[" #type "] " G_STRLOC ": " x, ##a); } \
} G_STMT_END
#define CLUTTER_MARK() CLUTTER_NOTE(MISC, g_message (G_STRLOC ": mark"))
#define CLUTTER_DBG(x,a...) CLUTTER_NOTE(MISC, g_message (x, ##a))
#define CLUTTER_MARK() CLUTTER_NOTE(MISC, "== mark ==")
#define CLUTTER_DBG(x) { a }
#define CLUTTER_GLERR() G_STMT_START { \
if (clutter_debug_flags & CLUTTER_DEBUG_GL) \
@ -36,7 +37,7 @@ typedef enum {
#else /* !CLUTTER_ENABLE_DEBUG */
#define CLUTTER_NOTE(type,action)
#define CLUTTER_DBG(x,a...)
#define CLUTTER_DBG(x)
#define CLUTTER_GLERR()
#endif /* CLUTTER_ENABLE_DEBUG */

View File

@ -224,7 +224,7 @@ clutter_feature_init (void)
if (getenv("__GL_SYNC_TO_VBLANK") || check_vblank_env("none"))
{
CLUTTER_NOTE (MISC, g_message ("vblank sync: disabled at user request"));
CLUTTER_NOTE (MISC, "vblank sync: disabled at user request");
}
else
{
@ -240,7 +240,7 @@ clutter_feature_init (void)
if (__features->funcs.get_video_sync != NULL
&& __features->funcs.wait_video_sync != NULL)
{
CLUTTER_NOTE (MISC, g_message ("vblank sync: using glx"));
CLUTTER_NOTE (MISC, "vblank sync: using glx");
__features->vblank_type = CLUTTER_VBLANK_GLX;
__features->flags |= CLUTTER_FEATURE_SYNC_TO_VBLANK;
@ -252,7 +252,7 @@ clutter_feature_init (void)
__features->dri_fd = open("/dev/dri/card0", O_RDWR);
if (__features->dri_fd >= 0)
{
CLUTTER_NOTE (MISC, g_message ("vblank sync: using dri"));
CLUTTER_NOTE (MISC, "vblank sync: using dri");
__features->vblank_type = CLUTTER_VBLANK_DRI;
__features->flags |= CLUTTER_FEATURE_SYNC_TO_VBLANK;
@ -262,7 +262,7 @@ clutter_feature_init (void)
if (!(__features->flags & CLUTTER_FEATURE_SYNC_TO_VBLANK))
{
CLUTTER_NOTE (MISC,
g_message ("vblank sync: no use-able mechanism found"));
"vblank sync: no use-able mechanism found");
}
}
}

View File

@ -244,10 +244,10 @@ clutter_label_paint (ClutterActor *self)
if (priv->desc == NULL || priv->text == NULL)
{
CLUTTER_NOTE (ACTOR, g_warning ("layout: %p , desc: %p, text %p",
priv->layout,
priv->desc,
priv->text));
CLUTTER_NOTE (ACTOR, "layout: %p , desc: %p, text %p",
priv->layout,
priv->desc,
priv->text);
return;
}

View File

@ -149,9 +149,9 @@ translate_button_event (ClutterButtonEvent *event,
XEvent *xevent)
{
/* FIXME: catch double click */
CLUTTER_NOTE (EVENT, g_message (G_STRLOC ": button event at %ix%i",
xevent->xbutton.x,
xevent->xbutton.y));
CLUTTER_NOTE (EVENT, " button event at %ix%i",
xevent->xbutton.x,
xevent->xbutton.y);
event->type = xevent->xany.type == ButtonPress ? CLUTTER_BUTTON_PRESS
: CLUTTER_BUTTON_RELEASE;
@ -290,7 +290,7 @@ clutter_redraw (void)
/* FIXME: Should move all this into stage...
*/
CLUTTER_NOTE (PAINT, g_message (G_STRLOC ": Redraw enter"));
CLUTTER_NOTE (PAINT, " Redraw enter");
if (clutter_want_fps ())
{
@ -334,7 +334,7 @@ clutter_redraw (void)
}
}
CLUTTER_NOTE (PAINT, g_message (G_STRLOC ": Redraw leave"));
CLUTTER_NOTE (PAINT, "Redraw leave");
}
/**

View File

@ -437,17 +437,17 @@ clutter_stage_realize (ClutterActor *actor)
}
CLUTTER_NOTE (GL,
g_message ("\n"
"==========================================="
"GL_VENDOR: %s\n"
"GL_RENDERER: %s\n"
"GL_VERSION: %s\n"
"GL_EXTENSIONS: %s\n"
"===========================================",
glGetString (GL_VENDOR),
glGetString (GL_RENDERER),
glGetString (GL_VERSION),
glGetString (GL_EXTENSIONS)));
"\n"
"==========================================="
"GL_VENDOR: %s\n"
"GL_RENDERER: %s\n"
"GL_VERSION: %s\n"
"GL_EXTENSIONS: %s\n"
"===========================================",
glGetString (GL_VENDOR),
glGetString (GL_RENDERER),
glGetString (GL_VERSION),
glGetString (GL_EXTENSIONS));
sync_gl_viewport (stage);
}

View File

@ -115,7 +115,7 @@ can_create (int width,
{
GLint new_width = 0;
CLUTTER_NOTE (TEXTURE, g_message ("checking %ix%i", width, height));
CLUTTER_NOTE (TEXTURE, "checking %ix%i", width, height);
glTexImage2D (GL_PROXY_TEXTURE_2D, 0, GL_RGBA,
width, height, 0 /* border */,
@ -195,15 +195,15 @@ texture_init_tiles (ClutterTexture *texture)
&& (x_pot - priv->width < priv->max_tile_waste)
&& (y_pot - priv->height < priv->max_tile_waste)))
{
CLUTTER_NOTE (TEXTURE, g_message ("x_pot:%i - width:%i < max_waste:%i",
x_pot,
priv->width,
priv->max_tile_waste));
CLUTTER_NOTE (TEXTURE, "x_pot:%i - width:%i < max_waste:%i",
x_pot,
priv->width,
priv->max_tile_waste);
CLUTTER_NOTE (TEXTURE, g_message ("y_pot:%i - height:%i < max_waste:%i",
y_pot,
priv->height,
priv->max_tile_waste));
CLUTTER_NOTE (TEXTURE, "y_pot:%i - height:%i < max_waste:%i",
y_pot,
priv->height,
priv->max_tile_waste);
if (x_pot > y_pot)
x_pot /= 2;
@ -228,11 +228,11 @@ texture_init_tiles (ClutterTexture *texture)
tile_dimension (priv->height, y_pot, priv->max_tile_waste, priv->y_tiles);
CLUTTER_NOTE (TEXTURE,
g_message ("x_pot:%i, width:%i, y_pot:%i, height: %i "
"max_waste:%i, n_x_tiles: %i, n_y_tiles: %i",
x_pot, priv->width, y_pot, priv->height,
priv->max_tile_waste,
priv->n_x_tiles, priv->n_y_tiles));
"x_pot:%i, width:%i, y_pot:%i, height: %i "
"max_waste:%i, n_x_tiles: %i, n_y_tiles: %i",
x_pot, priv->width, y_pot, priv->height,
priv->max_tile_waste,
priv->n_x_tiles, priv->n_y_tiles);
}
@ -309,8 +309,8 @@ texture_render_to_gl_quad (ClutterTexture *texture,
actual_h = priv->y_tiles[y].size - priv->y_tiles[y].waste;
CLUTTER_NOTE (TEXTURE,
g_message ("rendering text tile x: %i, y: %i - %ix%i",
x, y, actual_w, actual_h));
"rendering text tile x: %i, y: %i - %ix%i",
x, y, actual_w, actual_h);
tx = (float) actual_w / priv->x_tiles[x].size;
ty = (float) actual_h / priv->y_tiles[y].size;
@ -398,7 +398,7 @@ texture_upload_data (ClutterTexture *texture,
create_textures = TRUE;
}
CLUTTER_NOTE (TEXTURE, g_message ("syncing for single tile"));
CLUTTER_NOTE (TEXTURE, "syncing for single tile");
glBindTexture(priv->target_type, priv->tiles[0]);
@ -458,8 +458,8 @@ texture_upload_data (ClutterTexture *texture,
/* Multiple tiled texture */
CLUTTER_NOTE (TEXTURE,
g_message ("syncing for multiple tiles for %ix%i pixbuf",
priv->width, priv->height));
"syncing for multiple tiles for %ix%i pixbuf",
priv->width, priv->height);
g_return_if_fail (priv->x_tiles != NULL && priv->y_tiles != NULL);
@ -495,11 +495,11 @@ texture_upload_data (ClutterTexture *texture,
}
CLUTTER_NOTE (TEXTURE,
g_message ("copying tile %i,%i - %ix%i to 0,0 %ix%i",
priv->x_tiles[x].pos, priv->y_tiles[y].pos,
src_w, src_h,
priv->x_tiles[x].size,
priv->y_tiles[y].size));
"copying tile %i,%i - %ix%i to 0,0 %ix%i",
priv->x_tiles[x].pos, priv->y_tiles[y].pos,
src_w, src_h,
priv->x_tiles[x].size,
priv->y_tiles[y].size);
for (dy = 0; dy < src_h; dy++)
{
@ -596,7 +596,7 @@ clutter_texture_unrealize (ClutterActor *actor)
texture_free_gl_resources (texture);
CLUTTER_NOTE (TEXTURE, g_message ("Texture unrealized"));
CLUTTER_NOTE (TEXTURE, "Texture unrealized");
}
static void
@ -625,15 +625,15 @@ clutter_texture_realize (ClutterActor *actor)
* will set realize flags.
*/
CLUTTER_NOTE (TEXTURE,
g_warning ("Texture has no image data cannot realize"));
"Texture has no image data cannot realize");
CLUTTER_NOTE (TEXTURE, g_message ("flags %i", actor->flags));
CLUTTER_NOTE (TEXTURE, "flags %i", actor->flags);
CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REALIZED);
CLUTTER_NOTE (TEXTURE, g_message ("flags %i", actor->flags));
CLUTTER_NOTE (TEXTURE, "flags %i", actor->flags);
return;
}
CLUTTER_NOTE (TEXTURE, g_message ("Texture realized"));
CLUTTER_NOTE (TEXTURE, "Texture realized");
}
static void
@ -656,9 +656,9 @@ clutter_texture_paint (ClutterActor *self)
guint8 opacity;
CLUTTER_NOTE (PAINT,
g_message ("@@@ for '%s' @@@",
clutter_actor_get_name (self) ? clutter_actor_get_name (self)
: "unknown"));
"@@@ for '%s' @@@",
clutter_actor_get_name (self) ? clutter_actor_get_name (self)
: "unknown");
glPushMatrix();
glEnable(GL_BLEND);
@ -667,7 +667,7 @@ clutter_texture_paint (ClutterActor *self)
opacity = clutter_actor_get_opacity(self);
CLUTTER_NOTE (PAINT, g_message ("setting opacity to %i\n", opacity));
CLUTTER_NOTE (PAINT, "setting opacity to %i\n", opacity);
glColor4ub(255, 255, 255, opacity);
clutter_actor_get_coords (self, &x1, &y1, &x2, &y2);
@ -741,8 +741,8 @@ clutter_texture_set_property (GObject *object,
&& priv->tiled == TRUE)
priv->target_type = GL_TEXTURE_2D;
CLUTTER_NOTE (TEXTURE, g_message ("Texture is tiled ? %s",
priv->tiled ? "yes" : "no"));
CLUTTER_NOTE (TEXTURE, "Texture is tiled ? %s",
priv->tiled ? "yes" : "no");
break;
case PROP_MAX_TILE_WASTE:
priv->max_tile_waste = g_value_get_int (value);
@ -1179,9 +1179,9 @@ clutter_texture_set_from_data (ClutterTexture *texture,
texture_init_tiles (texture);
}
CLUTTER_NOTE (TEXTURE, g_message ("set size %ix%i\n",
priv->width,
priv->height));
CLUTTER_NOTE (TEXTURE, "set size %ix%i\n",
priv->width,
priv->height);
texture_upload_data (texture, data, has_alpha,
width, height, rowstride, bpp);

View File

@ -293,7 +293,7 @@ timeline_timeout_func (gpointer data)
n_frames = 1;
if (n_frames > 1)
CLUTTER_NOTE (MISC, g_message ("Skipping %i frames", n_frames));
CLUTTER_NOTE (MISC, "Skipping %i frames", n_frames);
}
else
{

View File

@ -126,7 +126,7 @@ m4_define([debug_default],
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
[turn on debugging @<:@default=debug_default@:>@]),
[turn on debugging. yes; All glib asserts, checks and runtime clutter verbose messages. minimum; Just glib cast checks and runtime clutter verbose messagaes. no; No glib asserts or checks and no runtime clutter verbose messages. @<:@default=debug_default@:>@]),
,
enable_debug=debug_default)
@ -135,10 +135,9 @@ if test "x$enable_debug" = "xyes"; then
CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG"
else
if test "x$enable_debug" = "xno"; then
CLUTTER_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST
_CHECKS"
CLUTTER_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
else # minimum
CLUTTER_DEBUG_CFLAGS="-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"
CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"
fi
fi