2007-06-19 Matthew Allum <mallum@openedhand.com>
* TODO: Sync up a little. * clutter/clutter-main.c: Set a default window title based on g_prgname(). * clutter/clutter-stage.c: * clutter/clutter-stage.h: * clutter/egl/clutter-stage-egl.c: * clutter/glx/clutter-stage-glx.c: * clutter/sdl/clutter-stage-sdl.c: Alter draw_to_pixbuf to return a pixbuf * configure.ac: Only full in gdk-pixbuf-xlib as a GLX backend dep. * tests/test-entry.c: Fix a couple of warnings.
This commit is contained in:
parent
fd0aa08be9
commit
e7332a3778
10 changed files with 77 additions and 41 deletions
20
ChangeLog
20
ChangeLog
|
@ -1,3 +1,23 @@
|
|||
2007-06-19 Matthew Allum <mallum@openedhand.com>
|
||||
|
||||
* TODO:
|
||||
Sync up a little.
|
||||
* clutter/clutter-main.c:
|
||||
Set a default window title based on g_prgname().
|
||||
|
||||
* clutter/clutter-stage.c:
|
||||
* clutter/clutter-stage.h:
|
||||
* clutter/egl/clutter-stage-egl.c:
|
||||
* clutter/glx/clutter-stage-glx.c:
|
||||
* clutter/sdl/clutter-stage-sdl.c:
|
||||
Alter draw_to_pixbuf to return a pixbuf
|
||||
|
||||
* configure.ac:
|
||||
Only full in gdk-pixbuf-xlib as a GLX backend dep.
|
||||
|
||||
* tests/test-entry.c:
|
||||
Fix a couple of warnings.
|
||||
|
||||
2007-06-19 Emmanuele Bassi <ebassi@openedhand.com>
|
||||
|
||||
* Makefile.am: Add README.in to the EXTRA_DIST.
|
||||
|
|
20
TODO
20
TODO
|
@ -9,23 +9,23 @@ Last updated 31/05/2007
|
|||
|
||||
Definetly:
|
||||
|
||||
- YUV texture data, premulled alpha texture data. (ma)
|
||||
- Basic layout code. (eb)
|
||||
- Basic text entry (np)
|
||||
- Perspective setup (ma)
|
||||
- YUV texture data [DONE] premulled alpha texture data. (ma)
|
||||
- Basic layout code. [DONE] (eb)
|
||||
- Basic text entry [DONE] (np)
|
||||
- Perspective setup [DONE] (ma)
|
||||
- API doc fixups (all)
|
||||
- main loop scheduling - paints vs timelimes vs events (ma, eb)
|
||||
- main loop scheduling - paints vs timelimes vs events [DONE] ((ma, eb)
|
||||
- ClutterProxyTexture (ma)
|
||||
- event queue fixups (eb)
|
||||
- clutter_actor_get_vertices (tf)
|
||||
- fix up event queue (eb)
|
||||
- event queue fixups [DONE} (eb)
|
||||
- clutter_actor_get_vertices [Partly DONE?] (tf)
|
||||
- fix up event queue [DONE] (eb)
|
||||
|
||||
Maybe:
|
||||
|
||||
- SDL event fixups
|
||||
- SDL event fixups [DONE - roughly]
|
||||
- Application developers manual
|
||||
- Lookat type functionality.
|
||||
|
||||
- Mipmaps for pango renderer to improving text scaling quality
|
||||
|
||||
0.6
|
||||
===
|
||||
|
|
|
@ -598,6 +598,9 @@ clutter_init_with_args (int *argc,
|
|||
if (clutter_is_initialized)
|
||||
return CLUTTER_INIT_SUCCESS;
|
||||
|
||||
if (*argc > 0)
|
||||
g_set_prgname (*argv[0]);
|
||||
|
||||
clutter_base_init ();
|
||||
|
||||
group = clutter_get_option_group ();
|
||||
|
@ -630,6 +633,9 @@ clutter_init_with_args (int *argc,
|
|||
|
||||
_clutter_feature_init ();
|
||||
|
||||
clutter_stage_set_title (CLUTTER_STAGE(clutter_stage_get_default()),
|
||||
g_get_prgname ());
|
||||
|
||||
return CLUTTER_INIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -688,6 +694,9 @@ clutter_init (int *argc,
|
|||
if (clutter_is_initialized)
|
||||
return CLUTTER_INIT_SUCCESS;
|
||||
|
||||
if (*argc > 0)
|
||||
g_set_prgname (*argv[0]);
|
||||
|
||||
clutter_base_init ();
|
||||
|
||||
/* parse_args will trigger backend creation and things like
|
||||
|
@ -720,6 +729,9 @@ clutter_init (int *argc,
|
|||
/* finally features - will call to backend and cogl */
|
||||
_clutter_feature_init ();
|
||||
|
||||
clutter_stage_set_title (CLUTTER_STAGE(clutter_stage_get_default()),
|
||||
g_get_prgname());
|
||||
|
||||
return CLUTTER_INIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -742,13 +742,7 @@ clutter_stage_snapshot (ClutterStage *stage,
|
|||
|
||||
klass = CLUTTER_STAGE_GET_CLASS (stage);
|
||||
if (klass->draw_to_pixbuf)
|
||||
{
|
||||
GdkPixbuf *retval = NULL;
|
||||
|
||||
klass->draw_to_pixbuf (stage, retval, x, y, width, height);
|
||||
|
||||
return retval;
|
||||
}
|
||||
return klass->draw_to_pixbuf (stage, x, y, width, height);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -84,8 +84,7 @@ struct _ClutterStageClass
|
|||
gboolean visible);
|
||||
void (* set_offscreen) (ClutterStage *stage,
|
||||
gboolean offscreen);
|
||||
void (* draw_to_pixbuf) (ClutterStage *stage,
|
||||
GdkPixbuf *dest,
|
||||
GdkPixbuf* (* draw_to_pixbuf) (ClutterStage *stage,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
|
|
|
@ -323,9 +323,8 @@ clutter_stage_egl_set_offscreen (ClutterStage *stage,
|
|||
G_OBJECT_TYPE_NAME (stage));
|
||||
}
|
||||
|
||||
static void
|
||||
static GdkPixbuf*
|
||||
clutter_stage_egl_draw_to_pixbuf (ClutterStage *stage,
|
||||
GdkPixbuf *dest,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
|
@ -333,6 +332,7 @@ clutter_stage_egl_draw_to_pixbuf (ClutterStage *stage,
|
|||
{
|
||||
g_warning ("Stage of type `%s' do not support ClutterStage::draw_to_pixbuf",
|
||||
G_OBJECT_TYPE_NAME (stage));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -488,9 +488,8 @@ snapshot_pixbuf_free (guchar *pixels,
|
|||
g_free (pixels);
|
||||
}
|
||||
|
||||
static void
|
||||
static GdkPixbuf*
|
||||
clutter_stage_glx_draw_to_pixbuf (ClutterStage *stage,
|
||||
GdkPixbuf *dest,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
|
@ -517,7 +516,7 @@ clutter_stage_glx_draw_to_pixbuf (ClutterStage *stage,
|
|||
{
|
||||
gdk_pixbuf_xlib_init (stage_glx->xdpy, stage_glx->xscreen);
|
||||
|
||||
dest = gdk_pixbuf_xlib_get_from_drawable (NULL,
|
||||
pixb = gdk_pixbuf_xlib_get_from_drawable (NULL,
|
||||
(Drawable) stage_glx->xpixmap,
|
||||
DefaultColormap (stage_glx->xdpy,
|
||||
stage_glx->xscreen),
|
||||
|
@ -528,26 +527,33 @@ clutter_stage_glx_draw_to_pixbuf (ClutterStage *stage,
|
|||
}
|
||||
else
|
||||
{
|
||||
data = g_malloc0 (sizeof (guchar) * width * height * 4);
|
||||
GdkPixbuf *tmp = NULL;
|
||||
gint stride;
|
||||
|
||||
stride = ((width * 4 + 3) &~ 3);
|
||||
|
||||
data = g_malloc0 (sizeof (guchar) * stride * height);
|
||||
|
||||
glReadPixels (x,
|
||||
clutter_actor_get_height (actor) - y - height,
|
||||
width,
|
||||
height, GL_RGBA, GL_UNSIGNED_BYTE, data);
|
||||
|
||||
pixb = gdk_pixbuf_new_from_data (data,
|
||||
GDK_COLORSPACE_RGB,
|
||||
TRUE,
|
||||
8,
|
||||
width, height,
|
||||
width * 4,
|
||||
snapshot_pixbuf_free,
|
||||
NULL);
|
||||
tmp = gdk_pixbuf_new_from_data (data,
|
||||
GDK_COLORSPACE_RGB,
|
||||
TRUE,
|
||||
8,
|
||||
width, height,
|
||||
stride,
|
||||
snapshot_pixbuf_free,
|
||||
NULL);
|
||||
|
||||
dest = gdk_pixbuf_flip (pixb, TRUE);
|
||||
pixb = gdk_pixbuf_flip (tmp, TRUE);
|
||||
|
||||
g_object_unref (pixb);
|
||||
g_object_unref (tmp);
|
||||
}
|
||||
|
||||
return pixb;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -159,7 +159,7 @@ clutter_stage_sdl_set_offscreen (ClutterStage *stage,
|
|||
G_OBJECT_TYPE_NAME (stage));
|
||||
}
|
||||
|
||||
static void
|
||||
static GdkPixbuf*
|
||||
clutter_stage_sdl_draw_to_pixbuf (ClutterStage *stage,
|
||||
GdkPixbuf *dest,
|
||||
gint x,
|
||||
|
@ -169,6 +169,7 @@ clutter_stage_sdl_draw_to_pixbuf (ClutterStage *stage,
|
|||
{
|
||||
g_warning ("Stage of type `%s' do not support ClutterStage::draw_to_pixbuf",
|
||||
G_OBJECT_TYPE_NAME (stage));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
10
configure.ac
10
configure.ac
|
@ -111,6 +111,8 @@ AC_ARG_WITH([flavour],
|
|||
[Select the Clutter backend]),
|
||||
clutterbackend=$with_flavour)
|
||||
|
||||
BACKEND_PC_FILES=""
|
||||
|
||||
case $clutterbackend in
|
||||
|
||||
sdl)
|
||||
|
@ -181,6 +183,9 @@ case $clutterbackend in
|
|||
AC_MSG_ERROR([GLX not found and GLX backend requested]);
|
||||
fi
|
||||
|
||||
# xlib pixbuf needed for exporting the stage
|
||||
BACKEND_PC_FILES="gdk-pixbuf-xlib-2.0"
|
||||
|
||||
GLX_LIBS="$X11_LIBS -lGL"
|
||||
GLX_CFLAGS="$X11_CFLAGS"
|
||||
;;
|
||||
|
@ -198,10 +203,9 @@ case $clutterbackend in
|
|||
if test "x$HAVE_OGLES" = "xno"; then
|
||||
AC_MSG_ERROR([libvincent (ogles) not found and egl backend requested.]);
|
||||
fi
|
||||
|
||||
|
||||
EGL_LIBS="$EGL_LIBS $X11_LIBS"
|
||||
EGL_CFLAGS="$EGL_CFLAGS $X11_CFLAGS"
|
||||
|
||||
;;
|
||||
|
||||
*) AC_MSG_ERROR([Invalid backend for Clutter: use glx or egl])
|
||||
|
@ -218,7 +222,7 @@ AC_SUBST([clutterbackendlib])
|
|||
|
||||
dnl ========================================================================
|
||||
|
||||
pkg_modules="pangoft2 glib-2.0 >= 2.10 gobject-2.0 gthread-2.0 gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0"
|
||||
pkg_modules="pangoft2 glib-2.0 >= 2.10 gobject-2.0 gthread-2.0 gdk-pixbuf-2.0 $BACKEND_PC_FILES"
|
||||
PKG_CHECK_MODULES(CLUTTER_DEPS, [$pkg_modules])
|
||||
|
||||
dnl ========================================================================
|
||||
|
|
|
@ -40,7 +40,7 @@ main (int argc, char *argv[])
|
|||
|
||||
clutter_actor_set_size (stage, 800, 600);
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
|
||||
clutter_stage_set_title (stage, "ClutterEntry Test");
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "ClutterEntry Test");
|
||||
|
||||
entry = clutter_entry_new_with_text ("Sans 14",
|
||||
"Type something, be sure to use the "
|
||||
|
@ -53,7 +53,7 @@ main (int argc, char *argv[])
|
|||
/*clutter_entry_set_max_length (CLUTTER_ENTRY (entry), 50);*/
|
||||
|
||||
clutter_group_add (CLUTTER_GROUP (stage), entry);
|
||||
clutter_actor_show_all (CLUTTER_GROUP (stage));
|
||||
clutter_actor_show_all (stage);
|
||||
|
||||
g_signal_connect (stage, "key-release-event",
|
||||
G_CALLBACK (on_key_release_cb), (gpointer)entry);
|
||||
|
|
Loading…
Reference in a new issue