+2006-09-14 Matthew Allum <mallum@openedhand.com>
+
+ Various fixes from Bastien Nocera:
+
+ * clutter/clutter-event.h:
+ * clutter/clutter-stage.c: (clutter_stage_unrealize),
+ (clutter_stage_realize), (clutter_stage_request_coords),
+ (clutter_stage_dispose), (clutter_stage_init):
+ * clutter/clutter-stage.h:
+ * gtk/gtk-clutter-test.c: (input_cb), (frame_cb), (main):
+ * gtk/gtk-clutter.c: (realize):
+ Misc fixes (#152)
+
+ * clutter/clutter-group.c: (clutter_group_remove):
+ Remove uneeded ref count (#143)
+
+ * examples/super-oh.c: (input_cb):
+ Handle key release rather than presses (#154)
+
+ * configure.ac:
+ Add old style X libs check when x11.pc unavailable (#101)
+
2006-09-01 Matthew Allum <mallum@openedhand.com>
* clutter/Makefile.am:
guint clutter_key_event_state (ClutterKeyEvent *keyev);
+gint clutter_button_event_x (ClutterButtonEvent *buttev);
+
+gint clutter_button_event_y (ClutterButtonEvent *buttev);
+
guint clutter_key_event_symbol (ClutterKeyEvent *keyev);
guint16 clutter_key_event_code (ClutterKeyEvent *keyev);
g_return_if_fail (CLUTTER_IS_GROUP (self));
g_return_if_fail (CLUTTER_IS_ACTOR (actor));
- g_object_ref (actor);
-
parent = clutter_actor_get_parent (actor);
if (parent != CLUTTER_ACTOR (self))
{
}
else
{
- if (priv->xwin)
+ if (priv->xwin != None)
{
XDestroyWindow (clutter_xdisplay(), priv->xwin);
priv->xwin = None;
}
glXMakeCurrent(clutter_xdisplay(), None, NULL);
- glXDestroyContext (clutter_xdisplay(), priv->gl_context);
- priv->gl_context = None;
+ if (priv->gl_context != None)
+ {
+ glXDestroyContext (clutter_xdisplay(), priv->gl_context);
+ priv->gl_context = None;
+ }
}
static void
return;
}
- if (priv->gl_context)
+ if (priv->gl_context != None)
glXDestroyContext (clutter_xdisplay(), priv->gl_context);
priv->xpixmap = XCreatePixmap (clutter_xdisplay(),
sync_fullscreen (stage);
sync_cursor_visible (stage);
- if (priv->gl_context)
+ if (priv->gl_context != None)
glXDestroyContext (clutter_xdisplay(), priv->gl_context);
priv->gl_context = glXCreateContext (clutter_xdisplay(),
priv->xwin_width = new_width;
priv->xwin_height = new_height;
- if (priv->xwin)
+ if (priv->xwin != None)
XResizeWindow (clutter_xdisplay(),
priv->xwin,
priv->xwin_width,
sync_gl_viewport (stage);
}
- if (priv->xwin) /* Do we want to bother ? */
+ if (priv->xwin != None) /* Do we want to bother ? */
XMoveWindow (clutter_xdisplay(),
priv->xwin,
box->x1,
{
ClutterStage *self = CLUTTER_STAGE (object);
- if (self->priv->xwin)
+ if (self->priv->xwin != None)
clutter_stage_unrealize (CLUTTER_ACTOR (self));
G_OBJECT_CLASS (clutter_stage_parent_class)->dispose (object);
priv->want_offscreen = FALSE;
priv->want_fullscreen = FALSE;
priv->hide_cursor = FALSE;
+ priv->xwin = None;
+ priv->gl_context = None;
priv->xwin_width = 100;
priv->xwin_height = 100;
#include <X11/Xlib.h>
#include <X11/Xatom.h>
+#include <GL/glx.h>
G_BEGIN_DECLS
gint y,
gint width,
gint height);
+const XVisualInfo * clutter_stage_get_xvisual (ClutterStage *stage);
G_END_DECLS
dnl ========================================================================
-PKG_CHECK_MODULES(X11, x11)
+PKG_CHECK_MODULES(X11, x11, [have_x11=yes], [have_x11=no])
+if test x$have_x11 = xno
+then
+ AC_PATH_X
+ if test x"$x_includes" != x"NONE" && test -n "$x_includes" ; then
+ X11_CFLAGS=-I`echo $x_includes | sed -e "s/:/ -I/g"`
+ fi
+ if test x"$x_libraries" != x"NONE" && test -n "$x_libraries" ; then
+ X11_LIBS=-L`echo $x_libraries | sed -e "s/:/ -L/g"`
+ fi
+fi
+
# FIXME: Needed ?
AC_MSG_CHECKING([for XTHREADS in Xlib])
if (e)
clutter_actor_hide(e);
}
- else if (event->type == CLUTTER_KEY_PRESS)
+ else if (event->type == CLUTTER_KEY_RELEASE)
{
ClutterKeyEvent *kev = (ClutterKeyEvent *) event;
ClutterEvent *event,
gpointer data)
{
- SuperOH *oh = (SuperOH *)data;
-
if (event->type == CLUTTER_BUTTON_PRESS)
{
ClutterButtonEvent *bev = (ClutterButtonEvent *) event;
bev->button);
e = clutter_stage_get_actor_at_pos (stage,
- clutter_button_event_x (event),
- clutter_button_event_y (event));
+ clutter_button_event_x (bev),
+ clutter_button_event_y (bev));
if (e)
clutter_actor_hide(e);
gpointer data)
{
SuperOH *oh = (SuperOH *)data;
- ClutterActor *stage = clutter_stage_get_default ();
gint i;
#if TRAILS
#endif
/* create a new group to hold multiple actors in a group */
- oh->group = clutter_group_new();
+ oh->group = CLUTTER_GROUP (clutter_group_new());
for (i = 0; i < NHANDS; i++)
{
gint x, y, w, h;
- ClutterColor colour = { 255, 0, 0, 255 };
#if 1
/* Create a texture from pixbuf, then clone in to same resources */
if (i == 0)
else
oh->hand[i] = clutter_clone_texture_new (CLUTTER_TEXTURE(oh->hand[0]));
#else
+ ClutterColor colour = { 255, 0, 0, 255 };
oh->hand[i] = clutter_rectangle_new_with_color (&colour);
clutter_actor_set_size (oh->hand[i], 50, 50);
{
GtkClutter *clutter;
GtkClutterPrivate *priv;
- XVisualInfo *xvinfo;
+ const XVisualInfo *xvinfo;
GdkVisual *visual;
GdkColormap *colormap;
- gboolean foreign_success;
clutter = GTK_CLUTTER (widget);
priv = GTK_CLUTTER_GET_PRIVATE (clutter);