Merge branch 'master' into msvc-support-master

This commit is contained in:
Chun-wei Fan 2011-09-27 14:35:26 +08:00
commit 9e822d9ae4
38 changed files with 14832 additions and 5611 deletions

View File

@ -8,7 +8,7 @@
TOR_URL="http://ftp.gnome.org/pub/gnome/binaries/win32"; TOR_URL="http://ftp.gnome.org/pub/gnome/binaries/win32";
TOR_BINARIES=( \ TOR_BINARIES=( \
glib/2.26/glib{-dev,}_2.26.0-2_win32.zip \ glib/2.28/glib{-dev,}_2.28.1-1_win32.zip \
gtk+/2.16/gtk+{-dev,}_2.16.6-2_win32.zip \ gtk+/2.16/gtk+{-dev,}_2.16.6-2_win32.zip \
pango/1.28/pango{-dev,}_1.28.0-1_win32.zip ); pango/1.28/pango{-dev,}_1.28.0-1_win32.zip );
@ -25,27 +25,34 @@ TOR_DEPS=( \
GNOME_SOURCES_URL="http://ftp.gnome.org/pub/GNOME/sources/" GNOME_SOURCES_URL="http://ftp.gnome.org/pub/GNOME/sources/"
SOURCES_DEPS=(\ SOURCES_DEPS=(\
cogl/1.8/cogl-1.8.0.tar.bz2 \
json-glib/0.12/json-glib-0.12.2.tar.bz2 \ json-glib/0.12/json-glib-0.12.2.tar.bz2 \
atk/2.1/atk-2.1.91.tar.bz2 ); atk/2.1/atk-2.1.91.tar.bz2 );
GL_HEADER_URLS=( \ GL_HEADER_URLS=( \
http://cgit.freedesktop.org/mesa/mesa/plain/include/GL/gl.h \ http://cgit.freedesktop.org/mesa/mesa/plain/include/GL/gl.h \
http://cgit.freedesktop.org/mesa/mesa/plain/include/GL/mesa_wgl.h \
http://www.opengl.org/registry/api/glext.h ); http://www.opengl.org/registry/api/glext.h );
GL_HEADERS=( gl.h mesa_wgl.h glext.h ); GL_HEADERS=( gl.h glext.h );
CONFIG_GUESS_URL="http://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/config.guess"
function download_file () function download_file ()
{ {
local url="$1"; shift; local url="$1"; shift;
local filename="$1"; shift; local filename="$1"; shift;
if test -f "$DOWNLOAD_DIR/$filename"; then
echo "Skipping download of $filename because the file already exists";
return 0;
fi;
case "$DOWNLOAD_PROG" in case "$DOWNLOAD_PROG" in
curl) curl)
curl -C - -o "$DOWNLOAD_DIR/$filename" "$url"; curl -o "$DOWNLOAD_DIR/$filename" "$url";
;; ;;
*) *)
$DOWNLOAD_PROG -O "$DOWNLOAD_DIR/$filename" -c "$url"; $DOWNLOAD_PROG -O "$DOWNLOAD_DIR/$filename" "$url";
;; ;;
esac; esac;
@ -184,7 +191,7 @@ function do_cross_compile ()
local builddir="$BUILD_DIR/$dep"; local builddir="$BUILD_DIR/$dep";
cd "$builddir" cd "$builddir"
./configure --prefix="$ROOT_DIR" --host="$TARGET" --target="$TARGET" --build="`./config.guess`" CFLAGS="-mms-bitfields" PKG_CONFIG="$RUN_PKG_CONFIG"; ./configure --prefix="$ROOT_DIR" --host="$TARGET" --target="$TARGET" --build="`./config.guess`" CFLAGS="-mms-bitfields -I$ROOT_DIR/include" PKG_CONFIG="$RUN_PKG_CONFIG";
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "Failed to configure $dep"; echo "Failed to configure $dep";
@ -263,6 +270,8 @@ for dep in "${SOURCES_DEPS[@]}"; do
download_file "$GNOME_SOURCES_URL/$dep" "$src"; download_file "$GNOME_SOURCES_URL/$dep" "$src";
done; done;
download_file "$CONFIG_GUESS_URL" "config.guess";
## ##
# Extract files # Extract files
## ##
@ -338,6 +347,8 @@ chmod a+x "$RUN_PKG_CONFIG";
find_compiler; find_compiler;
build_config=`bash $DOWNLOAD_DIR/config.guess`;
## ##
# Build source dependencies # Build source dependencies
## ##
@ -357,7 +368,7 @@ echo
echo "To get started, you should be able to configure and build from" echo "To get started, you should be able to configure and build from"
echo "the top of your clutter source directory as follows:" echo "the top of your clutter source directory as follows:"
echo echo
echo "./configure --host=\"$TARGET\" --target=\"$TARGET\" --build=\"`./config.guess`\" --with-flavour=win32 CFLAGS=\"-mms-bitfields\" PKG_CONFIG=\"$RUN_PKG_CONFIG\"" echo "./configure --host=\"$TARGET\" --target=\"$TARGET\" --build=\"$build_config\" --with-flavour=win32 CFLAGS=\"-mms-bitfields -I$ROOT_DIR/include\" PKG_CONFIG=\"$RUN_PKG_CONFIG\""
echo "make" echo "make"
echo echo
echo "Note: the explicit --build option is often necessary to ensure autoconf" echo "Note: the explicit --build option is often necessary to ensure autoconf"

View File

@ -2864,6 +2864,29 @@ clutter_actor_paint (ClutterActor *self)
cogl_get_modelview_matrix (&matrix); cogl_get_modelview_matrix (&matrix);
_clutter_actor_apply_modelview_transform (self, &matrix); _clutter_actor_apply_modelview_transform (self, &matrix);
cogl_set_modelview_matrix (&matrix); cogl_set_modelview_matrix (&matrix);
/* Catch when out-of-band transforms have been made by actors not as part
* of an apply_transform vfunc... */
if (G_UNLIKELY (clutter_debug_flags & CLUTTER_DEBUG_OOB_TRANSFORMS))
{
CoglMatrix expected_matrix;
_clutter_actor_get_relative_transformation_matrix (self, NULL,
&expected_matrix);
if (!cogl_matrix_equal (&matrix, &expected_matrix))
{
ClutterActor *parent = self;
GString *parents = g_string_new ("");
while ((parent = clutter_actor_get_parent (parent)))
g_string_append_printf (parents, "->%s", G_OBJECT_TYPE_NAME (parent));
g_warning ("Unexpected transform found when painting actor "
"\"%s\". This will be caused by one of the actor's "
"ancestors (%s) using the Cogl API directly to transform "
"children instead of using ::apply_transform().",
_clutter_actor_get_debug_name (self),
parents->str);
g_string_free (parents, TRUE);
}
}
} }
if (priv->has_clip) if (priv->has_clip)
@ -4707,8 +4730,8 @@ clutter_actor_class_init (ClutterActorClass *klass)
* Since: 1.4 * Since: 1.4
*/ */
pspec = g_param_spec_object ("effect", pspec = g_param_spec_object ("effect",
"Effect", P_("Effect"),
"Add an effect to be applied on the actor", P_("Add an effect to be applied on the actor"),
CLUTTER_TYPE_EFFECT, CLUTTER_TYPE_EFFECT,
CLUTTER_PARAM_WRITABLE); CLUTTER_PARAM_WRITABLE);
obj_props[PROP_EFFECT] = pspec; obj_props[PROP_EFFECT] = pspec;
@ -12021,7 +12044,7 @@ clutter_actor_remove_effect_by_name (ClutterActor *self,
if (meta == NULL) if (meta == NULL)
return; return;
_clutter_meta_group_remove_meta (priv->effects, meta); clutter_actor_remove_effect (self, CLUTTER_EFFECT (meta));
} }
/** /**

View File

@ -26,7 +26,8 @@ typedef enum {
CLUTTER_DEBUG_LAYOUT = 1 << 15, CLUTTER_DEBUG_LAYOUT = 1 << 15,
CLUTTER_DEBUG_PICK = 1 << 16, CLUTTER_DEBUG_PICK = 1 << 16,
CLUTTER_DEBUG_EVENTLOOP = 1 << 17, CLUTTER_DEBUG_EVENTLOOP = 1 << 17,
CLUTTER_DEBUG_CLIPPING = 1 << 18 CLUTTER_DEBUG_CLIPPING = 1 << 18,
CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 19
} ClutterDebugFlag; } ClutterDebugFlag;
typedef enum { typedef enum {
@ -40,7 +41,8 @@ typedef enum {
CLUTTER_DEBUG_REDRAWS = 1 << 2, CLUTTER_DEBUG_REDRAWS = 1 << 2,
CLUTTER_DEBUG_PAINT_VOLUMES = 1 << 3, CLUTTER_DEBUG_PAINT_VOLUMES = 1 << 3,
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4, CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5 CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6
} ClutterDrawDebugFlag; } ClutterDrawDebugFlag;
#ifdef CLUTTER_ENABLE_DEBUG #ifdef CLUTTER_ENABLE_DEBUG

View File

@ -167,7 +167,8 @@ static const GDebugKey clutter_debug_keys[] = {
{ "multistage", CLUTTER_DEBUG_MULTISTAGE }, { "multistage", CLUTTER_DEBUG_MULTISTAGE },
{ "animation", CLUTTER_DEBUG_ANIMATION }, { "animation", CLUTTER_DEBUG_ANIMATION },
{ "layout", CLUTTER_DEBUG_LAYOUT }, { "layout", CLUTTER_DEBUG_LAYOUT },
{ "clipping", CLUTTER_DEBUG_CLIPPING } { "clipping", CLUTTER_DEBUG_CLIPPING },
{ "oob-transforms", CLUTTER_DEBUG_OOB_TRANSFORMS }
}; };
#endif /* CLUTTER_ENABLE_DEBUG */ #endif /* CLUTTER_ENABLE_DEBUG */
@ -182,7 +183,8 @@ static const GDebugKey clutter_paint_debug_keys[] = {
{ "redraws", CLUTTER_DEBUG_REDRAWS }, { "redraws", CLUTTER_DEBUG_REDRAWS },
{ "paint-volumes", CLUTTER_DEBUG_PAINT_VOLUMES }, { "paint-volumes", CLUTTER_DEBUG_PAINT_VOLUMES },
{ "disable-culling", CLUTTER_DEBUG_DISABLE_CULLING }, { "disable-culling", CLUTTER_DEBUG_DISABLE_CULLING },
{ "disable-offscreen-redirect", CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT } { "disable-offscreen-redirect", CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT },
{ "continuous-redraw", CLUTTER_DEBUG_CONTINUOUS_REDRAW }
}; };
#ifdef CLUTTER_ENABLE_PROFILE #ifdef CLUTTER_ENABLE_PROFILE
@ -481,11 +483,12 @@ clutter_get_text_direction (void)
} }
else else
{ {
/* Translate to default:RTL if you want your widgets /* Translators: Leave this UNTRANSLATED if your language is
* to be RTL, otherwise translate to default:LTR. * left-to-right. If your language is right-to-left
* (e.g. Hebrew, Arabic), translate it to "default:RTL".
* *
* Do *not* translate it to "predefinito:LTR": if it * Do NOT translate it to non-English e.g. "predefinito:LTR"! If
* it isn't default:LTR or default:RTL it will not work * it isn't default:LTR or default:RTL it will not work.
*/ */
char *e = _("default:LTR"); char *e = _("default:LTR");

View File

@ -277,6 +277,20 @@ clutter_clock_prepare (GSource *source,
int delay; int delay;
clutter_threads_enter (); clutter_threads_enter ();
if (G_UNLIKELY (clutter_paint_debug_flags &
CLUTTER_DEBUG_CONTINUOUS_REDRAW))
{
ClutterStageManager *stage_manager = clutter_stage_manager_get_default ();
const GSList *stages, *l;
stages = clutter_stage_manager_peek_stages (stage_manager);
/* Queue a full redraw on all of the stages */
for (l = stages; l != NULL; l = l->next)
clutter_actor_queue_redraw (l->data);
}
delay = master_clock_next_frame_delay (master_clock); delay = master_clock_next_frame_delay (master_clock);
clutter_threads_leave (); clutter_threads_leave ();

View File

@ -215,7 +215,6 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
ClutterActorBox box; ClutterActorBox box;
CoglMatrix projection; CoglMatrix projection;
CoglColor transparent; CoglColor transparent;
CoglMatrix modelview;
gfloat fbo_width, fbo_height; gfloat fbo_width, fbo_height;
gfloat width, height; gfloat width, height;
gfloat xexpand, yexpand; gfloat xexpand, yexpand;
@ -249,19 +248,18 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
if (!update_fbo (effect, fbo_width, fbo_height)) if (!update_fbo (effect, fbo_width, fbo_height))
return FALSE; return FALSE;
/* get the current modelview matrix so that we can copy it /* get the current modelview matrix so that we can copy it to the
* to the framebuffer * framebuffer. We also store the matrix that was last used when we
*/ * updated the FBO so that we can detect when we don't need to
cogl_get_modelview_matrix (&modelview); * update the FBO to paint a second time */
cogl_get_modelview_matrix (&priv->last_matrix_drawn);
/* Store the matrix that was last used when we updated the FBO so
that we can detect when we don't need to update the FBO to paint
a second time */
priv->last_matrix_drawn = modelview;
/* let's draw offscreen */ /* let's draw offscreen */
cogl_push_framebuffer (priv->offscreen); cogl_push_framebuffer (priv->offscreen);
/* Copy the modelview that would have been used if rendering onscreen */
cogl_set_modelview_matrix (&priv->last_matrix_drawn);
/* Set up the viewport so that it has the same size as the stage, /* Set up the viewport so that it has the same size as the stage,
* but offset it so that the actor of interest lands on our * but offset it so that the actor of interest lands on our
* framebuffer. */ * framebuffer. */
@ -289,32 +287,25 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
/* Copy the stage's projection matrix across to the framebuffer */ /* Copy the stage's projection matrix across to the framebuffer */
_clutter_stage_get_projection_matrix (CLUTTER_STAGE (priv->stage), _clutter_stage_get_projection_matrix (CLUTTER_STAGE (priv->stage),
&projection); &projection);
cogl_set_projection_matrix (&projection);
/* If we've expanded the viewport, make sure to scale the modelview /* If we've expanded the viewport, make sure to scale the projection
* matrix accordingly (as it's been initialised to work with the * matrix accordingly (as it's been initialised to work with the
* original viewport and not our expanded one). * original viewport and not our expanded one).
*/ */
if (xexpand > 0.f || yexpand > 0.f) if (xexpand > 0.f || yexpand > 0.f)
{ {
CoglMatrix correction;
gfloat new_width, new_height; gfloat new_width, new_height;
new_width = width + (2 * xexpand); new_width = width + (2 * xexpand);
new_height = height + (2 * yexpand); new_height = height + (2 * yexpand);
cogl_matrix_init_identity (&correction); cogl_matrix_scale (&projection,
cogl_matrix_scale (&correction,
width / new_width, width / new_width,
height / new_height, height / new_height,
1); 1);
cogl_matrix_multiply (&correction, &correction, &modelview);
modelview = correction;
} }
/* Copy the modelview that would have been used if rendering onscreen */ cogl_set_projection_matrix (&projection);
cogl_set_modelview_matrix (&modelview);
cogl_color_init_from_4ub (&transparent, 0, 0, 0, 0); cogl_color_init_from_4ub (&transparent, 0, 0, 0, 0);
cogl_clear (&transparent, cogl_clear (&transparent,

View File

@ -967,10 +967,6 @@ _clutter_actor_set_default_paint_volume (ClutterActor *self,
clutter_actor_get_allocation_box (self, &box); clutter_actor_get_allocation_box (self, &box);
/* a zero-sized actor has no paint volume */
if (box.x1 == box.x2 || box.y1 == box.y2)
return FALSE;
clutter_paint_volume_set_width (volume, box.x2 - box.x1); clutter_paint_volume_set_width (volume, box.x2 - box.x1);
clutter_paint_volume_set_height (volume, box.y2 - box.y1); clutter_paint_volume_set_height (volume, box.y2 - box.y1);

View File

@ -235,6 +235,10 @@ void _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
ClutterVertex *vertices_out, ClutterVertex *vertices_out,
int n_vertices); int n_vertices);
void _clutter_util_rectangle_union (const cairo_rectangle_int_t *src1,
const cairo_rectangle_int_t *src2,
cairo_rectangle_int_t *dest);
typedef struct _ClutterPlane typedef struct _ClutterPlane
{ {
CoglVector3 v0; CoglVector3 v0;

View File

@ -69,6 +69,8 @@ struct _ClutterSettings
gint long_press_duration; gint long_press_duration;
guint last_fontconfig_timestamp; guint last_fontconfig_timestamp;
guint password_hint_time;
}; };
struct _ClutterSettingsClass struct _ClutterSettingsClass
@ -99,6 +101,8 @@ enum
PROP_FONTCONFIG_TIMESTAMP, PROP_FONTCONFIG_TIMESTAMP,
PROP_PASSWORD_HINT_TIME,
PROP_LAST PROP_LAST
}; };
@ -304,6 +308,10 @@ clutter_settings_set_property (GObject *gobject,
settings_update_fontmap (self, g_value_get_uint (value)); settings_update_fontmap (self, g_value_get_uint (value));
break; break;
case PROP_PASSWORD_HINT_TIME:
self->password_hint_time = g_value_get_uint (value);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
break; break;
@ -360,6 +368,10 @@ clutter_settings_get_property (GObject *gobject,
g_value_set_int (value, self->long_press_duration); g_value_set_int (value, self->long_press_duration);
break; break;
case PROP_PASSWORD_HINT_TIME:
g_value_set_uint (value, self->password_hint_time);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
break; break;
@ -584,6 +596,24 @@ clutter_settings_class_init (ClutterSettingsClass *klass)
0, 0,
CLUTTER_PARAM_WRITABLE); CLUTTER_PARAM_WRITABLE);
/**
* ClutterText:password-hint-time:
*
* How long should Clutter show the last input character in editable
* ClutterText actors. The value is in milliseconds. A value of 0
* disables showing the password hint. 600 is a good value for
* enabling the hint.
*
* Since: 1.10
*/
obj_props[PROP_PASSWORD_HINT_TIME] =
g_param_spec_uint ("password-hint-time",
P_("Password Hint Time"),
P_("How long to show the last input character in hidden entries"),
0, G_MAXUINT,
0,
CLUTTER_PARAM_READWRITE);
gobject_class->set_property = clutter_settings_set_property; gobject_class->set_property = clutter_settings_set_property;
gobject_class->get_property = clutter_settings_get_property; gobject_class->get_property = clutter_settings_get_property;
gobject_class->dispatch_properties_changed = gobject_class->dispatch_properties_changed =

View File

@ -35,8 +35,10 @@ typedef struct _ClutterStageQueueRedrawEntry ClutterStageQueueRedrawEntry;
/* stage */ /* stage */
ClutterStageWindow *_clutter_stage_get_default_window (void); ClutterStageWindow *_clutter_stage_get_default_window (void);
void _clutter_stage_do_paint (ClutterStage *stage, void _clutter_stage_do_paint (ClutterStage *stage,
const ClutterGeometry *clip); const cairo_rectangle_int_t *clip);
void _clutter_stage_set_window (ClutterStage *stage, void _clutter_stage_set_window (ClutterStage *stage,
ClutterStageWindow *stage_window); ClutterStageWindow *stage_window);
ClutterStageWindow *_clutter_stage_get_window (ClutterStage *stage); ClutterStageWindow *_clutter_stage_get_window (ClutterStage *stage);

View File

@ -96,7 +96,7 @@ _clutter_stage_window_resize (ClutterStageWindow *window,
void void
_clutter_stage_window_get_geometry (ClutterStageWindow *window, _clutter_stage_window_get_geometry (ClutterStageWindow *window,
ClutterGeometry *geometry) cairo_rectangle_int_t *geometry)
{ {
CLUTTER_STAGE_WINDOW_GET_IFACE (window)->get_geometry (window, geometry); CLUTTER_STAGE_WINDOW_GET_IFACE (window)->get_geometry (window, geometry);
} }
@ -120,14 +120,14 @@ _clutter_stage_window_get_pending_swaps (ClutterStageWindow *window)
void void
_clutter_stage_window_add_redraw_clip (ClutterStageWindow *window, _clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
ClutterGeometry *stage_clip) cairo_rectangle_int_t *stage_clip)
{ {
ClutterStageWindowIface *iface; ClutterStageWindowIface *iface;
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window)); g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window); iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->add_redraw_clip) if (iface->add_redraw_clip != NULL)
iface->add_redraw_clip (window, stage_clip); iface->add_redraw_clip (window, stage_clip);
} }
@ -147,7 +147,7 @@ _clutter_stage_window_has_redraw_clips (ClutterStageWindow *window)
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE); g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window); iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->has_redraw_clips) if (iface->has_redraw_clips != NULL)
return iface->has_redraw_clips (window); return iface->has_redraw_clips (window);
return FALSE; return FALSE;
@ -169,7 +169,7 @@ _clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window)
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE); g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window); iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->ignoring_redraw_clips) if (iface->ignoring_redraw_clips != NULL)
return iface->ignoring_redraw_clips (window); return iface->ignoring_redraw_clips (window);
return TRUE; return TRUE;
@ -184,7 +184,7 @@ _clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE); g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window); iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->get_redraw_clip_bounds) if (iface->get_redraw_clip_bounds != NULL)
return iface->get_redraw_clip_bounds (window, stage_clip); return iface->get_redraw_clip_bounds (window, stage_clip);
return FALSE; return FALSE;

View File

@ -57,12 +57,12 @@ struct _ClutterStageWindowIface
gint width, gint width,
gint height); gint height);
void (* get_geometry) (ClutterStageWindow *stage_window, void (* get_geometry) (ClutterStageWindow *stage_window,
ClutterGeometry *geometry); cairo_rectangle_int_t *geometry);
int (* get_pending_swaps) (ClutterStageWindow *stage_window); int (* get_pending_swaps) (ClutterStageWindow *stage_window);
void (* add_redraw_clip) (ClutterStageWindow *stage_window, void (* add_redraw_clip) (ClutterStageWindow *stage_window,
ClutterGeometry *stage_rectangle); cairo_rectangle_int_t *stage_rectangle);
gboolean (* has_redraw_clips) (ClutterStageWindow *stage_window); gboolean (* has_redraw_clips) (ClutterStageWindow *stage_window);
gboolean (* ignoring_redraw_clips) (ClutterStageWindow *stage_window); gboolean (* ignoring_redraw_clips) (ClutterStageWindow *stage_window);
gboolean (* get_redraw_clip_bounds) (ClutterStageWindow *stage_window, gboolean (* get_redraw_clip_bounds) (ClutterStageWindow *stage_window,
@ -101,11 +101,11 @@ void _clutter_stage_window_resize (ClutterStageWin
gint width, gint width,
gint height); gint height);
void _clutter_stage_window_get_geometry (ClutterStageWindow *window, void _clutter_stage_window_get_geometry (ClutterStageWindow *window,
ClutterGeometry *geometry); cairo_rectangle_int_t *geometry);
int _clutter_stage_window_get_pending_swaps (ClutterStageWindow *window); int _clutter_stage_window_get_pending_swaps (ClutterStageWindow *window);
void _clutter_stage_window_add_redraw_clip (ClutterStageWindow *window, void _clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
ClutterGeometry *stage_clip); cairo_rectangle_int_t *stage_clip);
gboolean _clutter_stage_window_has_redraw_clips (ClutterStageWindow *window); gboolean _clutter_stage_window_has_redraw_clips (ClutterStageWindow *window);
gboolean _clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window); gboolean _clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window);
gboolean _clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window, gboolean _clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,

View File

@ -225,7 +225,7 @@ clutter_stage_get_preferred_width (ClutterActor *self,
gfloat *natural_width_p) gfloat *natural_width_p)
{ {
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv; ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
ClutterGeometry geom = { 0, }; cairo_rectangle_int_t geom;
if (priv->impl == NULL) if (priv->impl == NULL)
return; return;
@ -246,7 +246,7 @@ clutter_stage_get_preferred_height (ClutterActor *self,
gfloat *natural_height_p) gfloat *natural_height_p)
{ {
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv; ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
ClutterGeometry geom = { 0, }; cairo_rectangle_int_t geom;
if (priv->impl == NULL) if (priv->impl == NULL)
return; return;
@ -287,25 +287,32 @@ clutter_stage_allocate (ClutterActor *self,
ClutterAllocationFlags flags) ClutterAllocationFlags flags)
{ {
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv; ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
ClutterGeometry prev_geom; ClutterGeometry prev_geom, geom;
ClutterGeometry geom = { 0, }; cairo_rectangle_int_t window_size;
gboolean origin_changed; gboolean origin_changed;
gint width, height; gint width, height;
origin_changed = (flags & CLUTTER_ABSOLUTE_ORIGIN_CHANGED) ? TRUE : FALSE; origin_changed = (flags & CLUTTER_ABSOLUTE_ORIGIN_CHANGED)
? TRUE
: FALSE;
if (priv->impl == NULL) if (priv->impl == NULL)
return; return;
/* our old allocation */
clutter_actor_get_allocation_geometry (self, &prev_geom); clutter_actor_get_allocation_geometry (self, &prev_geom);
/* the current allocation */
width = clutter_actor_box_get_width (box); width = clutter_actor_box_get_width (box);
height = clutter_actor_box_get_height (box); height = clutter_actor_box_get_height (box);
_clutter_stage_window_get_geometry (priv->impl, &geom);
/* if the stage is fixed size (for instance, it's using a frame-buffer) /* the current Stage implementation size */
_clutter_stage_window_get_geometry (priv->impl, &window_size);
/* if the stage is fixed size (for instance, it's using a EGL framebuffer)
* then we simply ignore any allocation request and override the * then we simply ignore any allocation request and override the
* allocation chain. * allocation chain - because we cannot forcibly change the size of the
* stage window.
*/ */
if ((!clutter_feature_available (CLUTTER_FEATURE_STAGE_STATIC))) if ((!clutter_feature_available (CLUTTER_FEATURE_STAGE_STATIC)))
{ {
@ -347,19 +354,23 @@ clutter_stage_allocate (ClutterActor *self,
priv->min_size_changed = FALSE; priv->min_size_changed = FALSE;
} }
if ((geom.width != width) || (geom.height != height)) if (window_size.width != width ||
window_size.height != height)
{
_clutter_stage_window_resize (priv->impl, width, height); _clutter_stage_window_resize (priv->impl, width, height);
} }
} }
}
else else
{ {
ClutterActorBox override = { 0, }; ClutterActorBox override = { 0, };
ClutterActorClass *klass; ClutterActorClass *klass;
/* override the passed allocation */
override.x1 = 0; override.x1 = 0;
override.y1 = 0; override.y1 = 0;
override.x2 = geom.width; override.x2 = window_size.width;
override.y2 = geom.height; override.y2 = window_size.height;
CLUTTER_NOTE (LAYOUT, CLUTTER_NOTE (LAYOUT,
"Overrigin original allocation of %dx%d " "Overrigin original allocation of %dx%d "
@ -378,19 +389,26 @@ clutter_stage_allocate (ClutterActor *self,
* Clutter need to manually keep it informed of the current window * Clutter need to manually keep it informed of the current window
* size. We do this after the allocation above so that the stage * size. We do this after the allocation above so that the stage
* window has a chance to update the window size based on the * window has a chance to update the window size based on the
* allocation. */ * allocation.
_clutter_stage_window_get_geometry (priv->impl, &geom); */
cogl_onscreen_clutter_backend_set_size (geom.width, geom.height); _clutter_stage_window_get_geometry (priv->impl, &window_size);
cogl_onscreen_clutter_backend_set_size (window_size.width,
window_size.height);
/* reset the viewport if the allocation effectively changed */
clutter_actor_get_allocation_geometry (self, &geom); clutter_actor_get_allocation_geometry (self, &geom);
if (geom.width != prev_geom.width || geom.height != prev_geom.height) if (geom.width != prev_geom.width ||
geom.height != prev_geom.height)
{ {
_clutter_stage_set_viewport (CLUTTER_STAGE (self), _clutter_stage_set_viewport (CLUTTER_STAGE (self),
0, 0, geom.width, geom.height); 0, 0,
geom.width,
geom.height);
/* Note: we don't assume that set_viewport will queue a full redraw /* Note: we don't assume that set_viewport will queue a full redraw
* since it may bail-out early if something preemptively set the * since it may bail-out early if something preemptively set the
* viewport before the stage was really allocated its new size. */ * viewport before the stage was really allocated its new size.
*/
queue_full_redraw (CLUTTER_STAGE (self)); queue_full_redraw (CLUTTER_STAGE (self));
} }
} }
@ -525,28 +543,28 @@ _clutter_stage_update_active_framebuffer (ClutterStage *stage)
* be able to cull them. * be able to cull them.
*/ */
void void
_clutter_stage_do_paint (ClutterStage *stage, const ClutterGeometry *clip) _clutter_stage_do_paint (ClutterStage *stage,
const cairo_rectangle_int_t *clip)
{ {
ClutterStagePrivate *priv = stage->priv; ClutterStagePrivate *priv = stage->priv;
float clip_poly[8]; float clip_poly[8];
cairo_rectangle_int_t geom;
if (clip)
{
clip_poly[0] = clip->x;
clip_poly[1] = clip->y;
clip_poly[2] = clip->x + clip->width;
clip_poly[3] = clip->y;
clip_poly[4] = clip->x + clip->width;
clip_poly[5] = clip->y + clip->height;
clip_poly[6] = clip->x;
clip_poly[7] = clip->y + clip->height;
}
else
{
ClutterGeometry geom;
_clutter_stage_window_get_geometry (priv->impl, &geom); _clutter_stage_window_get_geometry (priv->impl, &geom);
if (clip)
{
clip_poly[0] = MAX (clip->x, 0);
clip_poly[1] = MAX (clip->y, 0);
clip_poly[2] = MIN (clip->x + clip->width, geom.width);
clip_poly[3] = clip_poly[1];
clip_poly[4] = clip_poly[2];
clip_poly[5] = MIN (clip->y + clip->height, geom.height);
clip_poly[6] = clip_poly[0];
clip_poly[7] = clip_poly[5];
}
else
{
clip_poly[0] = 0; clip_poly[0] = 0;
clip_poly[1] = 0; clip_poly[1] = 0;
clip_poly[2] = geom.width; clip_poly[2] = geom.width;
@ -762,7 +780,7 @@ static void
clutter_stage_real_fullscreen (ClutterStage *stage) clutter_stage_real_fullscreen (ClutterStage *stage)
{ {
ClutterStagePrivate *priv = stage->priv; ClutterStagePrivate *priv = stage->priv;
ClutterGeometry geom; cairo_rectangle_int_t geom;
ClutterActorBox box; ClutterActorBox box;
/* we need to force an allocation here because the size /* we need to force an allocation here because the size
@ -1115,9 +1133,10 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
{ {
ClutterStage *stage = CLUTTER_STAGE (actor); ClutterStage *stage = CLUTTER_STAGE (actor);
ClutterStageWindow *stage_window; ClutterStageWindow *stage_window;
ClutterGeometry stage_clip;
ClutterPaintVolume *redraw_clip; ClutterPaintVolume *redraw_clip;
ClutterActorBox bounding_box; ClutterActorBox bounding_box;
ClutterActorBox intersection_box;
cairo_rectangle_int_t geom, stage_clip;
if (CLUTTER_ACTOR_IN_DESTRUCTION (actor)) if (CLUTTER_ACTOR_IN_DESTRUCTION (actor))
return; return;
@ -1151,12 +1170,24 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
stage, stage,
&bounding_box); &bounding_box);
_clutter_stage_window_get_geometry (stage_window, &geom);
intersection_box.x1 = MAX (bounding_box.x1, 0);
intersection_box.y1 = MAX (bounding_box.y1, 0);
intersection_box.x2 = MIN (bounding_box.x2, geom.width);
intersection_box.y2 = MIN (bounding_box.y2, geom.height);
/* There is no need to track degenerate/empty redraw clips */
if (intersection_box.x2 <= intersection_box.x1 ||
intersection_box.y2 <= intersection_box.y1)
return;
/* when converting to integer coordinates make sure we round the edges of the /* when converting to integer coordinates make sure we round the edges of the
* clip rectangle outwards... */ * clip rectangle outwards... */
stage_clip.x = bounding_box.x1; stage_clip.x = intersection_box.x1;
stage_clip.y = bounding_box.y1; stage_clip.y = intersection_box.y1;
stage_clip.width = bounding_box.x2 - stage_clip.x; stage_clip.width = intersection_box.x2 - stage_clip.x;
stage_clip.height = bounding_box.y2 - stage_clip.y; stage_clip.height = intersection_box.y2 - stage_clip.y;
_clutter_stage_window_add_redraw_clip (stage_window, &stage_clip); _clutter_stage_window_add_redraw_clip (stage_window, &stage_clip);
} }
@ -1206,14 +1237,8 @@ clutter_stage_get_redraw_clip_bounds (ClutterStage *stage,
if (!_clutter_stage_window_get_redraw_clip_bounds (priv->impl, clip)) if (!_clutter_stage_window_get_redraw_clip_bounds (priv->impl, clip))
{ {
ClutterGeometry geometry;
/* Set clip to the full extents of the stage */ /* Set clip to the full extents of the stage */
_clutter_stage_window_get_geometry (priv->impl, &geometry); _clutter_stage_window_get_geometry (priv->impl, clip);
clip->x = 0;
clip->y = 0;
clip->width = geometry.width;
clip->height = geometry.height;
} }
} }
@ -2013,7 +2038,7 @@ clutter_stage_init (ClutterStage *self)
{ {
ClutterStagePrivate *priv; ClutterStagePrivate *priv;
ClutterBackend *backend; ClutterBackend *backend;
ClutterGeometry geom; cairo_rectangle_int_t geom;
/* a stage is a top-level object */ /* a stage is a top-level object */
CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IS_TOPLEVEL); CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IS_TOPLEVEL);

View File

@ -1969,8 +1969,13 @@ clutter_state_get_duration (ClutterState *state,
if (target_state != NULL) if (target_state != NULL)
{ {
if (source_state_name) if (source_state_name)
{
ret = GPOINTER_TO_INT (g_hash_table_lookup (target_state->durations, ret = GPOINTER_TO_INT (g_hash_table_lookup (target_state->durations,
source_state_name)); source_state_name));
if(!ret)
ret = GPOINTER_TO_INT (g_hash_table_lookup (target_state->durations,
NULL));
}
else else
ret = GPOINTER_TO_INT (g_hash_table_lookup (target_state->durations, ret = GPOINTER_TO_INT (g_hash_table_lookup (target_state->durations,
NULL)); NULL));

View File

@ -188,8 +188,11 @@ struct _ClutterTextPrivate
gunichar password_char; gunichar password_char;
guint password_hint_id;
guint password_hint_timeout;
/* Signal handler for when the backend changes its font settings */ /* Signal handler for when the backend changes its font settings */
guint font_changed_id; guint settings_changed_id;
/* Signal handler for when the :text-direction changes */ /* Signal handler for when the :text-direction changes */
guint direction_changed_id; guint direction_changed_id;
@ -215,6 +218,8 @@ struct _ClutterTextPrivate
guint has_focus : 1; guint has_focus : 1;
guint selected_text_color_set : 1; guint selected_text_color_set : 1;
guint paint_volume_valid : 1; guint paint_volume_valid : 1;
guint show_password_hint : 1;
guint password_hint_visible : 1;
}; };
enum enum
@ -267,7 +272,7 @@ enum
static guint text_signals[LAST_SIGNAL] = { 0, }; static guint text_signals[LAST_SIGNAL] = { 0, };
static void clutter_text_font_changed_cb (ClutterText *text); static void clutter_text_settings_changed_cb (ClutterText *text);
static void static void
clutter_text_dirty_paint_volume (ClutterText *text) clutter_text_dirty_paint_volume (ClutterText *text)
@ -362,8 +367,21 @@ clutter_text_get_display_text (ClutterText *self)
memset (buf, 0, sizeof (buf)); memset (buf, 0, sizeof (buf));
char_len = g_unichar_to_utf8 (invisible_char, buf); char_len = g_unichar_to_utf8 (invisible_char, buf);
if (priv->show_password_hint && priv->password_hint_visible)
{
char *last_char;
for (i = 0; i < priv->n_chars - 1; i++)
g_string_append_len (str, buf, char_len);
last_char = g_utf8_offset_to_pointer (priv->text, priv->n_chars - 1);
g_string_append (str, last_char);
}
else
{
for (i = 0; i < priv->n_chars; i++) for (i = 0; i < priv->n_chars; i++)
g_string_append_len (str, buf, char_len); g_string_append_len (str, buf, char_len);
}
return g_string_free (str, FALSE); return g_string_free (str, FALSE);
} }
@ -557,15 +575,24 @@ clutter_text_set_font_description_internal (ClutterText *self,
} }
static void static void
clutter_text_font_changed_cb (ClutterText *text) clutter_text_settings_changed_cb (ClutterText *text)
{ {
if (text->priv->is_default_font) ClutterTextPrivate *priv = text->priv;
{ guint password_hint_time = 0;
PangoFontDescription *font_desc;
ClutterSettings *settings; ClutterSettings *settings;
gchar *font_name = NULL;
settings = clutter_settings_get_default (); settings = clutter_settings_get_default ();
g_object_get (settings, "password-hint-time", &password_hint_time, NULL);
priv->show_password_hint = password_hint_time > 0;
priv->password_hint_timeout = password_hint_time;
if (priv->is_default_font)
{
PangoFontDescription *font_desc;
gchar *font_name = NULL;
g_object_get (settings, "font-name", &font_name, NULL); g_object_get (settings, "font-name", &font_name, NULL);
CLUTTER_NOTE (ACTOR, "Text[%p]: default font changed to '%s'", CLUTTER_NOTE (ACTOR, "Text[%p]: default font changed to '%s'",
@ -1435,11 +1462,17 @@ clutter_text_dispose (GObject *gobject)
priv->direction_changed_id = 0; priv->direction_changed_id = 0;
} }
if (priv->font_changed_id) if (priv->settings_changed_id)
{ {
g_signal_handler_disconnect (clutter_get_default_backend (), g_signal_handler_disconnect (clutter_get_default_backend (),
priv->font_changed_id); priv->settings_changed_id);
priv->font_changed_id = 0; priv->settings_changed_id = 0;
}
if (priv->password_hint_id)
{
g_source_remove (priv->password_hint_id);
priv->password_hint_id = 0;
} }
G_OBJECT_CLASS (clutter_text_parent_class)->dispose (gobject); G_OBJECT_CLASS (clutter_text_parent_class)->dispose (gobject);
@ -1919,6 +1952,20 @@ clutter_text_button_release (ClutterActor *actor,
return FALSE; return FALSE;
} }
static gboolean
clutter_text_remove_password_hint (gpointer data)
{
ClutterText *self = data;
self->priv->password_hint_visible = FALSE;
self->priv->password_hint_id = 0;
clutter_text_dirty_cache (data);
clutter_text_queue_redraw (data);
return FALSE;
}
static gboolean static gboolean
clutter_text_key_press (ClutterActor *actor, clutter_text_key_press (ClutterActor *actor,
ClutterKeyEvent *event) ClutterKeyEvent *event)
@ -1976,6 +2023,18 @@ clutter_text_key_press (ClutterActor *actor,
clutter_text_delete_selection (self); clutter_text_delete_selection (self);
clutter_text_insert_unichar (self, key_unichar); clutter_text_insert_unichar (self, key_unichar);
if (priv->show_password_hint)
{
if (priv->password_hint_id != 0)
g_source_remove (priv->password_hint_id);
priv->password_hint_visible = TRUE;
priv->password_hint_id =
g_timeout_add (priv->password_hint_timeout,
clutter_text_remove_password_hint,
self);
}
return TRUE; return TRUE;
} }
} }
@ -3573,7 +3632,7 @@ clutter_text_init (ClutterText *self)
ClutterSettings *settings; ClutterSettings *settings;
ClutterTextPrivate *priv; ClutterTextPrivate *priv;
gchar *font_name; gchar *font_name;
int i; int i, password_hint_time;
self->priv = priv = CLUTTER_TEXT_GET_PRIVATE (self); self->priv = priv = CLUTTER_TEXT_GET_PRIVATE (self);
@ -3605,7 +3664,10 @@ clutter_text_init (ClutterText *self)
* the Text and we don't need notifications and sanity checks * the Text and we don't need notifications and sanity checks
*/ */
settings = clutter_settings_get_default (); settings = clutter_settings_get_default ();
g_object_get (settings, "font-name", &font_name, NULL); g_object_get (settings,
"font-name", &font_name,
"password-hint-time", &password_hint_time,
NULL);
priv->font_name = font_name; /* font_name is allocated */ priv->font_name = font_name; /* font_name is allocated */
priv->font_desc = pango_font_description_from_string (font_name); priv->font_desc = pango_font_description_from_string (font_name);
@ -3625,6 +3687,8 @@ clutter_text_init (ClutterText *self)
priv->preedit_set = FALSE; priv->preedit_set = FALSE;
priv->password_char = 0; priv->password_char = 0;
priv->show_password_hint = password_hint_time > 0;
priv->password_hint_timeout = password_hint_time;
priv->max_length = 0; priv->max_length = 0;
@ -3633,10 +3697,10 @@ clutter_text_init (ClutterText *self)
priv->cursor_size = DEFAULT_CURSOR_SIZE; priv->cursor_size = DEFAULT_CURSOR_SIZE;
memset (&priv->cursor_pos, 0, sizeof (ClutterGeometry)); memset (&priv->cursor_pos, 0, sizeof (ClutterGeometry));
priv->font_changed_id = priv->settings_changed_id =
g_signal_connect_swapped (clutter_get_default_backend (), g_signal_connect_swapped (clutter_get_default_backend (),
"settings-changed", "settings-changed",
G_CALLBACK (clutter_text_font_changed_cb), G_CALLBACK (clutter_text_settings_changed_cb),
self); self);
priv->direction_changed_id = priv->direction_changed_id =

View File

@ -148,3 +148,33 @@ _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
} }
} }
/*< private >
* _clutter_util_rectangle_union:
* @src1: first rectangle to union
* @src2: second rectangle to union
* @dest: (out): return location for the unioned rectangle
*
* Calculates the union of two rectangles.
*
* The union of rectangles @src1 and @src2 is the smallest rectangle which
* includes both @src1 and @src2 within it.
*
* It is allowed for @dest to be the same as either @src1 or @src2.
*
* This function should really be in Cairo.
*/
void
_clutter_util_rectangle_union (const cairo_rectangle_int_t *src1,
const cairo_rectangle_int_t *src2,
cairo_rectangle_int_t *dest)
{
int dest_x, dest_y;
dest_x = MIN (src1->x, src2->x);
dest_y = MIN (src1->y, src2->y);
dest->width = MAX (src1->x + src1->width, src2->x + src2->width) - dest_x;
dest->height = MAX (src1->y + src1->height, src2->y + src2->height) - dest_y;
dest->x = dest_x;
dest->y = dest_y;
}

View File

@ -206,7 +206,7 @@ clutter_stage_cogl_hide (ClutterStageWindow *stage_window)
static void static void
clutter_stage_cogl_get_geometry (ClutterStageWindow *stage_window, clutter_stage_cogl_get_geometry (ClutterStageWindow *stage_window,
ClutterGeometry *geometry) cairo_rectangle_int_t *geometry)
{ {
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window); ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
@ -289,7 +289,7 @@ clutter_stage_cogl_ignoring_redraw_clips (ClutterStageWindow *stage_window)
*/ */
static void static void
clutter_stage_cogl_add_redraw_clip (ClutterStageWindow *stage_window, clutter_stage_cogl_add_redraw_clip (ClutterStageWindow *stage_window,
ClutterGeometry *stage_clip) cairo_rectangle_int_t *stage_clip)
{ {
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window); ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
@ -313,14 +313,12 @@ clutter_stage_cogl_add_redraw_clip (ClutterStageWindow *stage_window,
if (!stage_cogl->initialized_redraw_clip) if (!stage_cogl->initialized_redraw_clip)
{ {
stage_cogl->bounding_redraw_clip.x = stage_clip->x; stage_cogl->bounding_redraw_clip = *stage_clip;
stage_cogl->bounding_redraw_clip.y = stage_clip->y;
stage_cogl->bounding_redraw_clip.width = stage_clip->width;
stage_cogl->bounding_redraw_clip.height = stage_clip->height;
} }
else if (stage_cogl->bounding_redraw_clip.width > 0) else if (stage_cogl->bounding_redraw_clip.width > 0)
{ {
clutter_geometry_union (&stage_cogl->bounding_redraw_clip, stage_clip, _clutter_util_rectangle_union (&stage_cogl->bounding_redraw_clip,
stage_clip,
&stage_cogl->bounding_redraw_clip); &stage_cogl->bounding_redraw_clip);
} }
@ -335,10 +333,7 @@ clutter_stage_cogl_get_redraw_clip_bounds (ClutterStageWindow *stage_window,
if (stage_cogl->using_clipped_redraw) if (stage_cogl->using_clipped_redraw)
{ {
stage_clip->x = stage_cogl->bounding_redraw_clip.x; *stage_clip = stage_cogl->bounding_redraw_clip;
stage_clip->y = stage_cogl->bounding_redraw_clip.y;
stage_clip->width = stage_cogl->bounding_redraw_clip.width;
stage_clip->height = stage_cogl->bounding_redraw_clip.height;
return TRUE; return TRUE;
} }
@ -457,7 +452,7 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_REDRAWS))) G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_REDRAWS)))
{ {
static CoglMaterial *outline = NULL; static CoglMaterial *outline = NULL;
ClutterGeometry *clip = &stage_cogl->bounding_redraw_clip; cairo_rectangle_int_t *clip = &stage_cogl->bounding_redraw_clip;
ClutterActor *actor = CLUTTER_ACTOR (wrapper); ClutterActor *actor = CLUTTER_ACTOR (wrapper);
CoglHandle vbo; CoglHandle vbo;
float x_1 = clip->x; float x_1 = clip->x;
@ -504,7 +499,7 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
/* push on the screen */ /* push on the screen */
if (use_clipped_redraw) if (use_clipped_redraw)
{ {
ClutterGeometry *clip = &stage_cogl->bounding_redraw_clip; cairo_rectangle_int_t *clip = &stage_cogl->bounding_redraw_clip;
int copy_area[4]; int copy_area[4];
/* XXX: It seems there will be a race here in that the stage /* XXX: It seems there will be a race here in that the stage

View File

@ -6,6 +6,7 @@
#endif #endif
#include <glib-object.h> #include <glib-object.h>
#include <cairo.h>
#include <clutter/clutter-stage.h> #include <clutter/clutter-stage.h>
#ifdef COGL_HAS_X11_SUPPORT #ifdef COGL_HAS_X11_SUPPORT
@ -57,7 +58,7 @@ struct _ClutterStageCogl
* junk frames to start with. */ * junk frames to start with. */
unsigned long frame_count; unsigned long frame_count;
ClutterGeometry bounding_redraw_clip; cairo_rectangle_int_t bounding_redraw_clip;
guint initialized_redraw_clip : 1; guint initialized_redraw_clip : 1;

View File

@ -435,7 +435,7 @@ clutter_stage_osx_hide (ClutterStageWindow *stage_window)
static void static void
clutter_stage_osx_get_geometry (ClutterStageWindow *stage_window, clutter_stage_osx_get_geometry (ClutterStageWindow *stage_window,
ClutterGeometry *geometry) cairo_rectangle_int_t *geometry)
{ {
ClutterBackend *backend = clutter_get_default_backend (); ClutterBackend *backend = clutter_get_default_backend ();
ClutterStageOSX *self = CLUTTER_STAGE_OSX (stage_window); ClutterStageOSX *self = CLUTTER_STAGE_OSX (stage_window);

View File

@ -91,7 +91,7 @@ get_visual (struct wl_display *display, CoglPixelFormat format)
} }
static ClutterStageWaylandWaylandBuffer * static ClutterStageWaylandWaylandBuffer *
wayland_create_shm_buffer (ClutterBackendWayland *backend_wayland, wayland_create_shm_buffer (ClutterBackendWayland *backend_wayland,
ClutterGeometry *geom) cairo_rectangle_int_t *geom)
{ {
ClutterStageWaylandWaylandBufferSHM *buffer; ClutterStageWaylandWaylandBufferSHM *buffer;
struct wl_visual *visual; struct wl_visual *visual;
@ -134,7 +134,7 @@ wayland_create_shm_buffer (ClutterBackendWayland *backend_wayland,
static ClutterStageWaylandWaylandBuffer * static ClutterStageWaylandWaylandBuffer *
wayland_create_drm_buffer (ClutterBackendWayland *backend_wayland, wayland_create_drm_buffer (ClutterBackendWayland *backend_wayland,
ClutterGeometry *geom) cairo_rectangle_int_t *geom)
{ {
EGLDisplay edpy = clutter_wayland_get_egl_display (); EGLDisplay edpy = clutter_wayland_get_egl_display ();
struct wl_visual *visual; struct wl_visual *visual;
@ -181,7 +181,7 @@ wayland_create_drm_buffer (ClutterBackendWayland *backend_wayland,
} }
static ClutterStageWaylandWaylandBuffer * static ClutterStageWaylandWaylandBuffer *
wayland_create_buffer (ClutterGeometry *geom) wayland_create_buffer (cairo_rectangle_int_t *geom)
{ {
ClutterBackend *backend = clutter_get_default_backend (); ClutterBackend *backend = clutter_get_default_backend ();
ClutterBackendWayland *backend_wayland = CLUTTER_BACKEND_WAYLAND (backend); ClutterBackendWayland *backend_wayland = CLUTTER_BACKEND_WAYLAND (backend);
@ -347,12 +347,13 @@ clutter_stage_wayland_hide (ClutterStageWindow *stage_window)
static void static void
clutter_stage_wayland_get_geometry (ClutterStageWindow *stage_window, clutter_stage_wayland_get_geometry (ClutterStageWindow *stage_window,
ClutterGeometry *geometry) cairo_rectangle_int_t *geometry)
{ {
ClutterStageWayland *stage_wayland = CLUTTER_STAGE_WAYLAND (stage_window); if (geometry != NULL)
{
ClutterStageWayland *stage_wayland =
CLUTTER_STAGE_WAYLAND (stage_window);
if (geometry)
{
*geometry = stage_wayland->allocation; *geometry = stage_wayland->allocation;
} }
} }
@ -363,7 +364,6 @@ clutter_stage_wayland_resize (ClutterStageWindow *stage_window,
gint height) gint height)
{ {
ClutterStageWayland *stage_wayland = CLUTTER_STAGE_WAYLAND (stage_window); ClutterStageWayland *stage_wayland = CLUTTER_STAGE_WAYLAND (stage_window);
cairo_rectangle_int_t rect;
fprintf (stderr, "resize %dx%d\n", width, height); fprintf (stderr, "resize %dx%d\n", width, height);
@ -371,11 +371,8 @@ clutter_stage_wayland_resize (ClutterStageWindow *stage_window,
stage_wayland->pending_allocation.height = height; stage_wayland->pending_allocation.height = height;
/* FIXME: Shouldn't the stage repaint everything when it gets resized? */ /* FIXME: Shouldn't the stage repaint everything when it gets resized? */
rect.x = stage_wayland->pending_allocation.x; cairo_region_union_rectangle (stage_wayland->repaint_region,
rect.y = stage_wayland->pending_allocation.y; &stage_wayland->pending_allocation);
rect.width = stage_wayland->pending_allocation.width;
rect.height = stage_wayland->pending_allocation.height;
cairo_region_union_rectangle (stage_wayland->repaint_region, &rect);
} }
#define CAIRO_REGION_FULL ((cairo_region_t *) 1) #define CAIRO_REGION_FULL ((cairo_region_t *) 1)
@ -394,25 +391,15 @@ clutter_stage_wayland_ignoring_redraw_clips (ClutterStageWindow *stage_window)
static void static void
clutter_stage_wayland_add_redraw_clip (ClutterStageWindow *stage_window, clutter_stage_wayland_add_redraw_clip (ClutterStageWindow *stage_window,
ClutterGeometry *stage_clip) cairo_rectangle_int_t *stage_clip)
{ {
ClutterStageWayland *stage_wayland = CLUTTER_STAGE_WAYLAND (stage_window); ClutterStageWayland *stage_wayland = CLUTTER_STAGE_WAYLAND (stage_window);
cairo_rectangle_int_t rect; cairo_rectangle_int_t rect;
if (stage_clip == NULL) if (stage_clip == NULL)
{ rect = stage_wayland->allocation;
rect.x = stage_wayland->allocation.x;
rect.y = stage_wayland->allocation.y;
rect.width = stage_wayland->allocation.width;
rect.height = stage_wayland->allocation.height;
}
else else
{ rect = stage_clip;
rect.x = stage_clip->x;
rect.y = stage_clip->y;
rect.width = stage_clip->width;
rect.height = stage_clip->height;
}
if (stage_wayland->repaint_region == NULL) if (stage_wayland->repaint_region == NULL)
stage_wayland->repaint_region = cairo_region_create_rectangle (&rect); stage_wayland->repaint_region = cairo_region_create_rectangle (&rect);
@ -606,7 +593,6 @@ void
_clutter_stage_wayland_repaint_region (ClutterStageWayland *stage_wayland, _clutter_stage_wayland_repaint_region (ClutterStageWayland *stage_wayland,
ClutterStage *stage) ClutterStage *stage)
{ {
ClutterGeometry geom;
cairo_rectangle_int_t rect; cairo_rectangle_int_t rect;
int i, count; int i, count;
@ -615,13 +601,11 @@ _clutter_stage_wayland_repaint_region (ClutterStageWayland *stage_wayland,
{ {
cairo_region_get_rectangle (stage_wayland->repaint_region, i, &rect); cairo_region_get_rectangle (stage_wayland->repaint_region, i, &rect);
cogl_clip_push_window_rectangle (rect.x - 1, rect.y - 1, cogl_clip_push_window_rectangle (rect.x - 1,
rect.width + 2, rect.height + 2); rect.y - 1,
rect.width + 2,
rect.height + 2);
geom.x = rect.x;
geom.y = rect.y;
geom.width = rect.width;
geom.height = rect.height;
/* FIXME: We should pass geom in as second arg, but some actors /* FIXME: We should pass geom in as second arg, but some actors
* cull themselves a little to much. Disable for now.*/ * cull themselves a little to much. Disable for now.*/
_clutter_stage_do_paint (stage, NULL); _clutter_stage_do_paint (stage, NULL);
@ -637,8 +621,10 @@ _clutter_stage_wayland_redraw (ClutterStageWayland *stage_wayland,
stage_wayland->allocation = stage_wayland->pending_allocation; stage_wayland->allocation = stage_wayland->pending_allocation;
if (!stage_wayland->back_buffer) if (!stage_wayland->back_buffer)
{
stage_wayland->back_buffer = stage_wayland->back_buffer =
wayland_create_buffer (&stage_wayland->allocation); wayland_create_buffer (&stage_wayland->allocation);
}
cogl_set_framebuffer (stage_wayland->back_buffer->offscreen); cogl_set_framebuffer (stage_wayland->back_buffer->offscreen);
_clutter_stage_maybe_setup_viewport (stage_wayland->wrapper); _clutter_stage_maybe_setup_viewport (stage_wayland->wrapper);

View File

@ -89,9 +89,9 @@ struct _ClutterStageWayland
/* back pointer to the backend */ /* back pointer to the backend */
ClutterBackendWayland *backend; ClutterBackendWayland *backend;
ClutterGeometry allocation; cairo_rectangle_int_t allocation;
ClutterGeometry save_allocation; cairo_rectangle_int_t save_allocation;
ClutterGeometry pending_allocation; cairo_rectangle_int_t pending_allocation;
struct wl_surface *wayland_surface; struct wl_surface *wayland_surface;
int pending_swaps; int pending_swaps;

View File

@ -80,16 +80,16 @@ clutter_stage_win32_hide (ClutterStageWindow *stage_window)
static void static void
clutter_stage_win32_get_geometry (ClutterStageWindow *stage_window, clutter_stage_win32_get_geometry (ClutterStageWindow *stage_window,
ClutterGeometry *geometry) cairo_rectangle_int_t *geometry)
{ {
ClutterStageWin32 *stage_win32 = CLUTTER_STAGE_WIN32 (stage_window); ClutterStageWin32 *stage_win32 = CLUTTER_STAGE_WIN32 (stage_window);
if ((stage_win32->state & CLUTTER_STAGE_STATE_FULLSCREEN)) if ((stage_win32->state & CLUTTER_STAGE_STATE_FULLSCREEN))
{ {
geometry->width = (stage_win32->fullscreen_rect.right geometry->width = stage_win32->fullscreen_rect.right
- stage_win32->fullscreen_rect.left); - stage_win32->fullscreen_rect.left;
geometry->height = (stage_win32->fullscreen_rect.bottom geometry->height = stage_win32->fullscreen_rect.bottom
- stage_win32->fullscreen_rect.top); - stage_win32->fullscreen_rect.top;
return; return;
} }

View File

@ -194,7 +194,7 @@ clutter_stage_x11_set_wm_protocols (ClutterStageX11 *stage_x11)
static void static void
clutter_stage_x11_get_geometry (ClutterStageWindow *stage_window, clutter_stage_x11_get_geometry (ClutterStageWindow *stage_window,
ClutterGeometry *geometry) cairo_rectangle_int_t *geometry)
{ {
ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window); ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window);
ClutterBackendX11 *backend_x11 = stage_x11->backend; ClutterBackendX11 *backend_x11 = stage_x11->backend;

View File

@ -9,8 +9,8 @@
# - increase clutter_micro_version to the next odd number # - increase clutter_micro_version to the next odd number
# - increase clutter_interface_version to the next odd number # - increase clutter_interface_version to the next odd number
m4_define([clutter_major_version], [1]) m4_define([clutter_major_version], [1])
m4_define([clutter_minor_version], [7]) m4_define([clutter_minor_version], [9])
m4_define([clutter_micro_version], [91]) m4_define([clutter_micro_version], [1])
# • for stable releases: increase the interface age by 1 for each release; # • for stable releases: increase the interface age by 1 for each release;
# if the API changes, set to 0. interface_age and binary_age are used to # if the API changes, set to 0. interface_age and binary_age are used to
@ -113,8 +113,8 @@ LT_INIT([disable-static])
AC_HEADER_STDC AC_HEADER_STDC
# required versions for dependencies # required versions for dependencies
m4_define([glib_req_version], [2.26.0]) m4_define([glib_req_version], [2.28.0])
m4_define([cogl_req_version], [1.7.6]) m4_define([cogl_req_version], [1.8.0])
m4_define([json_glib_req_version], [0.12.0]) m4_define([json_glib_req_version], [0.12.0])
m4_define([atk_req_version], [2.1.5]) m4_define([atk_req_version], [2.1.5])
m4_define([cairo_req_version], [1.10]) m4_define([cairo_req_version], [1.10])

2191
po/as.po Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1747
po/da.po

File diff suppressed because it is too large Load Diff

1172
po/de.po

File diff suppressed because it is too large Load Diff

1847
po/fr.po

File diff suppressed because it is too large Load Diff

View File

@ -1167,7 +1167,7 @@ msgstr ""
#: clutter/clutter-main.c:490 #: clutter/clutter-main.c:490
msgid "default:LTR" msgid "default:LTR"
msgstr "ପୂର୍ବ ନିର୍ଦ୍ଧାରିତ:LTR" msgstr "default:LTR"
#: clutter/clutter-main.c:1321 #: clutter/clutter-main.c:1321
msgid "Show frames per second" msgid "Show frames per second"

1197
po/pa.po

File diff suppressed because it is too large Load Diff

2216
po/pt.po Normal file

File diff suppressed because it is too large Load Diff

2194
po/sr.po Normal file

File diff suppressed because it is too large Load Diff

2194
po/sr@latin.po Normal file

File diff suppressed because it is too large Load Diff

449
po/ta.po

File diff suppressed because it is too large Load Diff

1126
po/te.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff