mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
Merge branch 'master' into msvc-support-master
This commit is contained in:
commit
9e822d9ae4
@ -8,7 +8,7 @@
|
||||
TOR_URL="http://ftp.gnome.org/pub/gnome/binaries/win32";
|
||||
|
||||
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 \
|
||||
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/"
|
||||
SOURCES_DEPS=(\
|
||||
cogl/1.8/cogl-1.8.0.tar.bz2 \
|
||||
json-glib/0.12/json-glib-0.12.2.tar.bz2 \
|
||||
atk/2.1/atk-2.1.91.tar.bz2 );
|
||||
|
||||
GL_HEADER_URLS=( \
|
||||
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 );
|
||||
|
||||
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 ()
|
||||
{
|
||||
local url="$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
|
||||
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;
|
||||
|
||||
@ -184,7 +191,7 @@ function do_cross_compile ()
|
||||
local builddir="$BUILD_DIR/$dep";
|
||||
|
||||
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
|
||||
echo "Failed to configure $dep";
|
||||
@ -263,6 +270,8 @@ for dep in "${SOURCES_DEPS[@]}"; do
|
||||
download_file "$GNOME_SOURCES_URL/$dep" "$src";
|
||||
done;
|
||||
|
||||
download_file "$CONFIG_GUESS_URL" "config.guess";
|
||||
|
||||
##
|
||||
# Extract files
|
||||
##
|
||||
@ -338,6 +347,8 @@ chmod a+x "$RUN_PKG_CONFIG";
|
||||
|
||||
find_compiler;
|
||||
|
||||
build_config=`bash $DOWNLOAD_DIR/config.guess`;
|
||||
|
||||
##
|
||||
# Build source dependencies
|
||||
##
|
||||
@ -357,7 +368,7 @@ echo
|
||||
echo "To get started, you should be able to configure and build from"
|
||||
echo "the top of your clutter source directory as follows:"
|
||||
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
|
||||
echo "Note: the explicit --build option is often necessary to ensure autoconf"
|
||||
|
@ -2864,6 +2864,29 @@ clutter_actor_paint (ClutterActor *self)
|
||||
cogl_get_modelview_matrix (&matrix);
|
||||
_clutter_actor_apply_modelview_transform (self, &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)
|
||||
@ -4707,8 +4730,8 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
||||
* Since: 1.4
|
||||
*/
|
||||
pspec = g_param_spec_object ("effect",
|
||||
"Effect",
|
||||
"Add an effect to be applied on the actor",
|
||||
P_("Effect"),
|
||||
P_("Add an effect to be applied on the actor"),
|
||||
CLUTTER_TYPE_EFFECT,
|
||||
CLUTTER_PARAM_WRITABLE);
|
||||
obj_props[PROP_EFFECT] = pspec;
|
||||
@ -12021,7 +12044,7 @@ clutter_actor_remove_effect_by_name (ClutterActor *self,
|
||||
if (meta == NULL)
|
||||
return;
|
||||
|
||||
_clutter_meta_group_remove_meta (priv->effects, meta);
|
||||
clutter_actor_remove_effect (self, CLUTTER_EFFECT (meta));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -26,7 +26,8 @@ typedef enum {
|
||||
CLUTTER_DEBUG_LAYOUT = 1 << 15,
|
||||
CLUTTER_DEBUG_PICK = 1 << 16,
|
||||
CLUTTER_DEBUG_EVENTLOOP = 1 << 17,
|
||||
CLUTTER_DEBUG_CLIPPING = 1 << 18
|
||||
CLUTTER_DEBUG_CLIPPING = 1 << 18,
|
||||
CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 19
|
||||
} ClutterDebugFlag;
|
||||
|
||||
typedef enum {
|
||||
@ -40,7 +41,8 @@ typedef enum {
|
||||
CLUTTER_DEBUG_REDRAWS = 1 << 2,
|
||||
CLUTTER_DEBUG_PAINT_VOLUMES = 1 << 3,
|
||||
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;
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
|
@ -167,7 +167,8 @@ static const GDebugKey clutter_debug_keys[] = {
|
||||
{ "multistage", CLUTTER_DEBUG_MULTISTAGE },
|
||||
{ "animation", CLUTTER_DEBUG_ANIMATION },
|
||||
{ "layout", CLUTTER_DEBUG_LAYOUT },
|
||||
{ "clipping", CLUTTER_DEBUG_CLIPPING }
|
||||
{ "clipping", CLUTTER_DEBUG_CLIPPING },
|
||||
{ "oob-transforms", CLUTTER_DEBUG_OOB_TRANSFORMS }
|
||||
};
|
||||
#endif /* CLUTTER_ENABLE_DEBUG */
|
||||
|
||||
@ -182,7 +183,8 @@ static const GDebugKey clutter_paint_debug_keys[] = {
|
||||
{ "redraws", CLUTTER_DEBUG_REDRAWS },
|
||||
{ "paint-volumes", CLUTTER_DEBUG_PAINT_VOLUMES },
|
||||
{ "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
|
||||
@ -481,11 +483,12 @@ clutter_get_text_direction (void)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Translate to default:RTL if you want your widgets
|
||||
* to be RTL, otherwise translate to default:LTR.
|
||||
/* Translators: Leave this UNTRANSLATED if your language is
|
||||
* 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
|
||||
* it isn't default:LTR or default:RTL it will not work
|
||||
* Do NOT translate it to non-English e.g. "predefinito:LTR"! If
|
||||
* it isn't default:LTR or default:RTL it will not work.
|
||||
*/
|
||||
char *e = _("default:LTR");
|
||||
|
||||
|
@ -277,6 +277,20 @@ clutter_clock_prepare (GSource *source,
|
||||
int delay;
|
||||
|
||||
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);
|
||||
clutter_threads_leave ();
|
||||
|
||||
|
@ -215,7 +215,6 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
||||
ClutterActorBox box;
|
||||
CoglMatrix projection;
|
||||
CoglColor transparent;
|
||||
CoglMatrix modelview;
|
||||
gfloat fbo_width, fbo_height;
|
||||
gfloat width, height;
|
||||
gfloat xexpand, yexpand;
|
||||
@ -249,19 +248,18 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
||||
if (!update_fbo (effect, fbo_width, fbo_height))
|
||||
return FALSE;
|
||||
|
||||
/* get the current modelview matrix so that we can copy it
|
||||
* to the framebuffer
|
||||
*/
|
||||
cogl_get_modelview_matrix (&modelview);
|
||||
|
||||
/* 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;
|
||||
/* get the current modelview matrix so that we can copy it to the
|
||||
* 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
|
||||
* update the FBO to paint a second time */
|
||||
cogl_get_modelview_matrix (&priv->last_matrix_drawn);
|
||||
|
||||
/* let's draw 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,
|
||||
* but offset it so that the actor of interest lands on our
|
||||
* framebuffer. */
|
||||
@ -289,32 +287,25 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
|
||||
/* Copy the stage's projection matrix across to the framebuffer */
|
||||
_clutter_stage_get_projection_matrix (CLUTTER_STAGE (priv->stage),
|
||||
&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
|
||||
* original viewport and not our expanded one).
|
||||
*/
|
||||
if (xexpand > 0.f || yexpand > 0.f)
|
||||
{
|
||||
CoglMatrix correction;
|
||||
gfloat new_width, new_height;
|
||||
|
||||
new_width = width + (2 * xexpand);
|
||||
new_height = height + (2 * yexpand);
|
||||
|
||||
cogl_matrix_init_identity (&correction);
|
||||
cogl_matrix_scale (&correction,
|
||||
cogl_matrix_scale (&projection,
|
||||
width / new_width,
|
||||
height / new_height,
|
||||
1);
|
||||
|
||||
cogl_matrix_multiply (&correction, &correction, &modelview);
|
||||
modelview = correction;
|
||||
}
|
||||
|
||||
/* Copy the modelview that would have been used if rendering onscreen */
|
||||
cogl_set_modelview_matrix (&modelview);
|
||||
cogl_set_projection_matrix (&projection);
|
||||
|
||||
cogl_color_init_from_4ub (&transparent, 0, 0, 0, 0);
|
||||
cogl_clear (&transparent,
|
||||
|
@ -967,10 +967,6 @@ _clutter_actor_set_default_paint_volume (ClutterActor *self,
|
||||
|
||||
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_height (volume, box.y2 - box.y1);
|
||||
|
||||
|
@ -235,6 +235,10 @@ void _clutter_util_fully_transform_vertices (const CoglMatrix *modelview,
|
||||
ClutterVertex *vertices_out,
|
||||
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
|
||||
{
|
||||
CoglVector3 v0;
|
||||
|
@ -69,6 +69,8 @@ struct _ClutterSettings
|
||||
gint long_press_duration;
|
||||
|
||||
guint last_fontconfig_timestamp;
|
||||
|
||||
guint password_hint_time;
|
||||
};
|
||||
|
||||
struct _ClutterSettingsClass
|
||||
@ -99,6 +101,8 @@ enum
|
||||
|
||||
PROP_FONTCONFIG_TIMESTAMP,
|
||||
|
||||
PROP_PASSWORD_HINT_TIME,
|
||||
|
||||
PROP_LAST
|
||||
};
|
||||
|
||||
@ -304,6 +308,10 @@ clutter_settings_set_property (GObject *gobject,
|
||||
settings_update_fontmap (self, g_value_get_uint (value));
|
||||
break;
|
||||
|
||||
case PROP_PASSWORD_HINT_TIME:
|
||||
self->password_hint_time = g_value_get_uint (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||
break;
|
||||
@ -360,6 +368,10 @@ clutter_settings_get_property (GObject *gobject,
|
||||
g_value_set_int (value, self->long_press_duration);
|
||||
break;
|
||||
|
||||
case PROP_PASSWORD_HINT_TIME:
|
||||
g_value_set_uint (value, self->password_hint_time);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
||||
break;
|
||||
@ -584,6 +596,24 @@ clutter_settings_class_init (ClutterSettingsClass *klass)
|
||||
0,
|
||||
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->get_property = clutter_settings_get_property;
|
||||
gobject_class->dispatch_properties_changed =
|
||||
|
@ -35,8 +35,10 @@ typedef struct _ClutterStageQueueRedrawEntry ClutterStageQueueRedrawEntry;
|
||||
|
||||
/* stage */
|
||||
ClutterStageWindow *_clutter_stage_get_default_window (void);
|
||||
void _clutter_stage_do_paint (ClutterStage *stage,
|
||||
const ClutterGeometry *clip);
|
||||
|
||||
void _clutter_stage_do_paint (ClutterStage *stage,
|
||||
const cairo_rectangle_int_t *clip);
|
||||
|
||||
void _clutter_stage_set_window (ClutterStage *stage,
|
||||
ClutterStageWindow *stage_window);
|
||||
ClutterStageWindow *_clutter_stage_get_window (ClutterStage *stage);
|
||||
|
@ -95,8 +95,8 @@ _clutter_stage_window_resize (ClutterStageWindow *window,
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_stage_window_get_geometry (ClutterStageWindow *window,
|
||||
ClutterGeometry *geometry)
|
||||
_clutter_stage_window_get_geometry (ClutterStageWindow *window,
|
||||
cairo_rectangle_int_t *geometry)
|
||||
{
|
||||
CLUTTER_STAGE_WINDOW_GET_IFACE (window)->get_geometry (window, geometry);
|
||||
}
|
||||
@ -119,15 +119,15 @@ _clutter_stage_window_get_pending_swaps (ClutterStageWindow *window)
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
|
||||
ClutterGeometry *stage_clip)
|
||||
_clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
|
||||
cairo_rectangle_int_t *stage_clip)
|
||||
{
|
||||
ClutterStageWindowIface *iface;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (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);
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ _clutter_stage_window_has_redraw_clips (ClutterStageWindow *window)
|
||||
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
||||
|
||||
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 FALSE;
|
||||
@ -169,7 +169,7 @@ _clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window)
|
||||
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
|
||||
|
||||
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 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);
|
||||
|
||||
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 FALSE;
|
||||
|
@ -57,15 +57,15 @@ struct _ClutterStageWindowIface
|
||||
gint width,
|
||||
gint height);
|
||||
void (* get_geometry) (ClutterStageWindow *stage_window,
|
||||
ClutterGeometry *geometry);
|
||||
cairo_rectangle_int_t *geometry);
|
||||
|
||||
int (* get_pending_swaps) (ClutterStageWindow *stage_window);
|
||||
|
||||
void (* add_redraw_clip) (ClutterStageWindow *stage_window,
|
||||
ClutterGeometry *stage_rectangle);
|
||||
gboolean (* has_redraw_clips) (ClutterStageWindow *stage_window);
|
||||
gboolean (* ignoring_redraw_clips) (ClutterStageWindow *stage_window);
|
||||
gboolean (* get_redraw_clip_bounds) (ClutterStageWindow *stage_window,
|
||||
void (* add_redraw_clip) (ClutterStageWindow *stage_window,
|
||||
cairo_rectangle_int_t *stage_rectangle);
|
||||
gboolean (* has_redraw_clips) (ClutterStageWindow *stage_window);
|
||||
gboolean (* ignoring_redraw_clips) (ClutterStageWindow *stage_window);
|
||||
gboolean (* get_redraw_clip_bounds) (ClutterStageWindow *stage_window,
|
||||
cairo_rectangle_int_t *clip);
|
||||
|
||||
|
||||
@ -101,18 +101,18 @@ void _clutter_stage_window_resize (ClutterStageWin
|
||||
gint width,
|
||||
gint height);
|
||||
void _clutter_stage_window_get_geometry (ClutterStageWindow *window,
|
||||
ClutterGeometry *geometry);
|
||||
cairo_rectangle_int_t *geometry);
|
||||
int _clutter_stage_window_get_pending_swaps (ClutterStageWindow *window);
|
||||
|
||||
void _clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
|
||||
ClutterGeometry *stage_clip);
|
||||
gboolean _clutter_stage_window_has_redraw_clips (ClutterStageWindow *window);
|
||||
gboolean _clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window);
|
||||
gboolean _clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
|
||||
void _clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
|
||||
cairo_rectangle_int_t *stage_clip);
|
||||
gboolean _clutter_stage_window_has_redraw_clips (ClutterStageWindow *window);
|
||||
gboolean _clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window);
|
||||
gboolean _clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
|
||||
cairo_rectangle_int_t *clip);
|
||||
|
||||
void _clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
|
||||
gboolean accept_focus);
|
||||
gboolean accept_focus);
|
||||
|
||||
void _clutter_stage_window_redraw (ClutterStageWindow *window);
|
||||
|
||||
|
@ -225,7 +225,7 @@ clutter_stage_get_preferred_width (ClutterActor *self,
|
||||
gfloat *natural_width_p)
|
||||
{
|
||||
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
|
||||
ClutterGeometry geom = { 0, };
|
||||
cairo_rectangle_int_t geom;
|
||||
|
||||
if (priv->impl == NULL)
|
||||
return;
|
||||
@ -246,7 +246,7 @@ clutter_stage_get_preferred_height (ClutterActor *self,
|
||||
gfloat *natural_height_p)
|
||||
{
|
||||
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
|
||||
ClutterGeometry geom = { 0, };
|
||||
cairo_rectangle_int_t geom;
|
||||
|
||||
if (priv->impl == NULL)
|
||||
return;
|
||||
@ -287,25 +287,32 @@ clutter_stage_allocate (ClutterActor *self,
|
||||
ClutterAllocationFlags flags)
|
||||
{
|
||||
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
|
||||
ClutterGeometry prev_geom;
|
||||
ClutterGeometry geom = { 0, };
|
||||
ClutterGeometry prev_geom, geom;
|
||||
cairo_rectangle_int_t window_size;
|
||||
gboolean origin_changed;
|
||||
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)
|
||||
return;
|
||||
|
||||
/* our old allocation */
|
||||
clutter_actor_get_allocation_geometry (self, &prev_geom);
|
||||
|
||||
/* the current allocation */
|
||||
width = clutter_actor_box_get_width (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
|
||||
* allocation chain.
|
||||
* allocation chain - because we cannot forcibly change the size of the
|
||||
* stage window.
|
||||
*/
|
||||
if ((!clutter_feature_available (CLUTTER_FEATURE_STAGE_STATIC)))
|
||||
{
|
||||
@ -347,8 +354,11 @@ clutter_stage_allocate (ClutterActor *self,
|
||||
priv->min_size_changed = FALSE;
|
||||
}
|
||||
|
||||
if ((geom.width != width) || (geom.height != height))
|
||||
_clutter_stage_window_resize (priv->impl, width, height);
|
||||
if (window_size.width != width ||
|
||||
window_size.height != height)
|
||||
{
|
||||
_clutter_stage_window_resize (priv->impl, width, height);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -356,10 +366,11 @@ clutter_stage_allocate (ClutterActor *self,
|
||||
ClutterActorBox override = { 0, };
|
||||
ClutterActorClass *klass;
|
||||
|
||||
/* override the passed allocation */
|
||||
override.x1 = 0;
|
||||
override.y1 = 0;
|
||||
override.x2 = geom.width;
|
||||
override.y2 = geom.height;
|
||||
override.x2 = window_size.width;
|
||||
override.y2 = window_size.height;
|
||||
|
||||
CLUTTER_NOTE (LAYOUT,
|
||||
"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
|
||||
* size. We do this after the allocation above so that the stage
|
||||
* window has a chance to update the window size based on the
|
||||
* allocation. */
|
||||
_clutter_stage_window_get_geometry (priv->impl, &geom);
|
||||
cogl_onscreen_clutter_backend_set_size (geom.width, geom.height);
|
||||
* allocation.
|
||||
*/
|
||||
_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);
|
||||
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),
|
||||
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
|
||||
* 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));
|
||||
}
|
||||
}
|
||||
@ -525,28 +543,28 @@ _clutter_stage_update_active_framebuffer (ClutterStage *stage)
|
||||
* be able to cull them.
|
||||
*/
|
||||
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;
|
||||
float clip_poly[8];
|
||||
cairo_rectangle_int_t geom;
|
||||
|
||||
_clutter_stage_window_get_geometry (priv->impl, &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;
|
||||
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
|
||||
{
|
||||
ClutterGeometry geom;
|
||||
|
||||
_clutter_stage_window_get_geometry (priv->impl, &geom);
|
||||
|
||||
clip_poly[0] = 0;
|
||||
clip_poly[1] = 0;
|
||||
clip_poly[2] = geom.width;
|
||||
@ -762,7 +780,7 @@ static void
|
||||
clutter_stage_real_fullscreen (ClutterStage *stage)
|
||||
{
|
||||
ClutterStagePrivate *priv = stage->priv;
|
||||
ClutterGeometry geom;
|
||||
cairo_rectangle_int_t geom;
|
||||
ClutterActorBox box;
|
||||
|
||||
/* 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);
|
||||
ClutterStageWindow *stage_window;
|
||||
ClutterGeometry stage_clip;
|
||||
ClutterPaintVolume *redraw_clip;
|
||||
ClutterActorBox bounding_box;
|
||||
ClutterActorBox intersection_box;
|
||||
cairo_rectangle_int_t geom, stage_clip;
|
||||
|
||||
if (CLUTTER_ACTOR_IN_DESTRUCTION (actor))
|
||||
return;
|
||||
@ -1151,12 +1170,24 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
|
||||
stage,
|
||||
&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
|
||||
* clip rectangle outwards... */
|
||||
stage_clip.x = bounding_box.x1;
|
||||
stage_clip.y = bounding_box.y1;
|
||||
stage_clip.width = bounding_box.x2 - stage_clip.x;
|
||||
stage_clip.height = bounding_box.y2 - stage_clip.y;
|
||||
stage_clip.x = intersection_box.x1;
|
||||
stage_clip.y = intersection_box.y1;
|
||||
stage_clip.width = intersection_box.x2 - stage_clip.x;
|
||||
stage_clip.height = intersection_box.y2 - stage_clip.y;
|
||||
|
||||
_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))
|
||||
{
|
||||
ClutterGeometry geometry;
|
||||
|
||||
/* Set clip to the full extents of the stage */
|
||||
_clutter_stage_window_get_geometry (priv->impl, &geometry);
|
||||
clip->x = 0;
|
||||
clip->y = 0;
|
||||
clip->width = geometry.width;
|
||||
clip->height = geometry.height;
|
||||
_clutter_stage_window_get_geometry (priv->impl, clip);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2013,7 +2038,7 @@ clutter_stage_init (ClutterStage *self)
|
||||
{
|
||||
ClutterStagePrivate *priv;
|
||||
ClutterBackend *backend;
|
||||
ClutterGeometry geom;
|
||||
cairo_rectangle_int_t geom;
|
||||
|
||||
/* a stage is a top-level object */
|
||||
CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IS_TOPLEVEL);
|
||||
|
@ -1969,8 +1969,13 @@ clutter_state_get_duration (ClutterState *state,
|
||||
if (target_state != NULL)
|
||||
{
|
||||
if (source_state_name)
|
||||
ret = GPOINTER_TO_INT (g_hash_table_lookup (target_state->durations,
|
||||
source_state_name));
|
||||
{
|
||||
ret = GPOINTER_TO_INT (g_hash_table_lookup (target_state->durations,
|
||||
source_state_name));
|
||||
if(!ret)
|
||||
ret = GPOINTER_TO_INT (g_hash_table_lookup (target_state->durations,
|
||||
NULL));
|
||||
}
|
||||
else
|
||||
ret = GPOINTER_TO_INT (g_hash_table_lookup (target_state->durations,
|
||||
NULL));
|
||||
|
@ -188,8 +188,11 @@ struct _ClutterTextPrivate
|
||||
|
||||
gunichar password_char;
|
||||
|
||||
guint password_hint_id;
|
||||
guint password_hint_timeout;
|
||||
|
||||
/* 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 */
|
||||
guint direction_changed_id;
|
||||
@ -215,6 +218,8 @@ struct _ClutterTextPrivate
|
||||
guint has_focus : 1;
|
||||
guint selected_text_color_set : 1;
|
||||
guint paint_volume_valid : 1;
|
||||
guint show_password_hint : 1;
|
||||
guint password_hint_visible : 1;
|
||||
};
|
||||
|
||||
enum
|
||||
@ -267,7 +272,7 @@ enum
|
||||
|
||||
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
|
||||
clutter_text_dirty_paint_volume (ClutterText *text)
|
||||
@ -362,8 +367,21 @@ clutter_text_get_display_text (ClutterText *self)
|
||||
memset (buf, 0, sizeof (buf));
|
||||
char_len = g_unichar_to_utf8 (invisible_char, buf);
|
||||
|
||||
for (i = 0; i < priv->n_chars; i++)
|
||||
g_string_append_len (str, buf, char_len);
|
||||
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++)
|
||||
g_string_append_len (str, buf, char_len);
|
||||
}
|
||||
|
||||
return g_string_free (str, FALSE);
|
||||
}
|
||||
@ -557,15 +575,24 @@ clutter_text_set_font_description_internal (ClutterText *self,
|
||||
}
|
||||
|
||||
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;
|
||||
ClutterSettings *settings;
|
||||
|
||||
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;
|
||||
ClutterSettings *settings;
|
||||
gchar *font_name = NULL;
|
||||
|
||||
settings = clutter_settings_get_default ();
|
||||
g_object_get (settings, "font-name", &font_name, NULL);
|
||||
|
||||
CLUTTER_NOTE (ACTOR, "Text[%p]: default font changed to '%s'",
|
||||
@ -1435,11 +1462,17 @@ clutter_text_dispose (GObject *gobject)
|
||||
priv->direction_changed_id = 0;
|
||||
}
|
||||
|
||||
if (priv->font_changed_id)
|
||||
if (priv->settings_changed_id)
|
||||
{
|
||||
g_signal_handler_disconnect (clutter_get_default_backend (),
|
||||
priv->font_changed_id);
|
||||
priv->font_changed_id = 0;
|
||||
priv->settings_changed_id);
|
||||
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);
|
||||
@ -1919,6 +1952,20 @@ clutter_text_button_release (ClutterActor *actor,
|
||||
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
|
||||
clutter_text_key_press (ClutterActor *actor,
|
||||
ClutterKeyEvent *event)
|
||||
@ -1976,6 +2023,18 @@ clutter_text_key_press (ClutterActor *actor,
|
||||
clutter_text_delete_selection (self);
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -3573,7 +3632,7 @@ clutter_text_init (ClutterText *self)
|
||||
ClutterSettings *settings;
|
||||
ClutterTextPrivate *priv;
|
||||
gchar *font_name;
|
||||
int i;
|
||||
int i, password_hint_time;
|
||||
|
||||
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
|
||||
*/
|
||||
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_desc = pango_font_description_from_string (font_name);
|
||||
@ -3625,6 +3687,8 @@ clutter_text_init (ClutterText *self)
|
||||
priv->preedit_set = FALSE;
|
||||
|
||||
priv->password_char = 0;
|
||||
priv->show_password_hint = password_hint_time > 0;
|
||||
priv->password_hint_timeout = password_hint_time;
|
||||
|
||||
priv->max_length = 0;
|
||||
|
||||
@ -3633,10 +3697,10 @@ clutter_text_init (ClutterText *self)
|
||||
priv->cursor_size = DEFAULT_CURSOR_SIZE;
|
||||
memset (&priv->cursor_pos, 0, sizeof (ClutterGeometry));
|
||||
|
||||
priv->font_changed_id =
|
||||
priv->settings_changed_id =
|
||||
g_signal_connect_swapped (clutter_get_default_backend (),
|
||||
"settings-changed",
|
||||
G_CALLBACK (clutter_text_font_changed_cb),
|
||||
G_CALLBACK (clutter_text_settings_changed_cb),
|
||||
self);
|
||||
|
||||
priv->direction_changed_id =
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -205,8 +205,8 @@ clutter_stage_cogl_hide (ClutterStageWindow *stage_window)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_stage_cogl_get_geometry (ClutterStageWindow *stage_window,
|
||||
ClutterGeometry *geometry)
|
||||
clutter_stage_cogl_get_geometry (ClutterStageWindow *stage_window,
|
||||
cairo_rectangle_int_t *geometry)
|
||||
{
|
||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
||||
|
||||
@ -288,8 +288,8 @@ clutter_stage_cogl_ignoring_redraw_clips (ClutterStageWindow *stage_window)
|
||||
* buffer.
|
||||
*/
|
||||
static void
|
||||
clutter_stage_cogl_add_redraw_clip (ClutterStageWindow *stage_window,
|
||||
ClutterGeometry *stage_clip)
|
||||
clutter_stage_cogl_add_redraw_clip (ClutterStageWindow *stage_window,
|
||||
cairo_rectangle_int_t *stage_clip)
|
||||
{
|
||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
||||
|
||||
@ -313,32 +313,27 @@ clutter_stage_cogl_add_redraw_clip (ClutterStageWindow *stage_window,
|
||||
|
||||
if (!stage_cogl->initialized_redraw_clip)
|
||||
{
|
||||
stage_cogl->bounding_redraw_clip.x = stage_clip->x;
|
||||
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;
|
||||
stage_cogl->bounding_redraw_clip = *stage_clip;
|
||||
}
|
||||
else if (stage_cogl->bounding_redraw_clip.width > 0)
|
||||
{
|
||||
clutter_geometry_union (&stage_cogl->bounding_redraw_clip, stage_clip,
|
||||
&stage_cogl->bounding_redraw_clip);
|
||||
_clutter_util_rectangle_union (&stage_cogl->bounding_redraw_clip,
|
||||
stage_clip,
|
||||
&stage_cogl->bounding_redraw_clip);
|
||||
}
|
||||
|
||||
stage_cogl->initialized_redraw_clip = TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_stage_cogl_get_redraw_clip_bounds (ClutterStageWindow *stage_window,
|
||||
clutter_stage_cogl_get_redraw_clip_bounds (ClutterStageWindow *stage_window,
|
||||
cairo_rectangle_int_t *stage_clip)
|
||||
{
|
||||
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_window);
|
||||
|
||||
if (stage_cogl->using_clipped_redraw)
|
||||
{
|
||||
stage_clip->x = stage_cogl->bounding_redraw_clip.x;
|
||||
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;
|
||||
*stage_clip = stage_cogl->bounding_redraw_clip;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -457,7 +452,7 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
|
||||
G_UNLIKELY ((clutter_paint_debug_flags & CLUTTER_DEBUG_REDRAWS)))
|
||||
{
|
||||
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);
|
||||
CoglHandle vbo;
|
||||
float x_1 = clip->x;
|
||||
@ -504,7 +499,7 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
|
||||
/* push on the screen */
|
||||
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];
|
||||
|
||||
/* XXX: It seems there will be a race here in that the stage
|
||||
|
@ -6,6 +6,7 @@
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <cairo.h>
|
||||
#include <clutter/clutter-stage.h>
|
||||
|
||||
#ifdef COGL_HAS_X11_SUPPORT
|
||||
@ -57,7 +58,7 @@ struct _ClutterStageCogl
|
||||
* junk frames to start with. */
|
||||
unsigned long frame_count;
|
||||
|
||||
ClutterGeometry bounding_redraw_clip;
|
||||
cairo_rectangle_int_t bounding_redraw_clip;
|
||||
|
||||
guint initialized_redraw_clip : 1;
|
||||
|
||||
|
@ -434,8 +434,8 @@ clutter_stage_osx_hide (ClutterStageWindow *stage_window)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_stage_osx_get_geometry (ClutterStageWindow *stage_window,
|
||||
ClutterGeometry *geometry)
|
||||
clutter_stage_osx_get_geometry (ClutterStageWindow *stage_window,
|
||||
cairo_rectangle_int_t *geometry)
|
||||
{
|
||||
ClutterBackend *backend = clutter_get_default_backend ();
|
||||
ClutterStageOSX *self = CLUTTER_STAGE_OSX (stage_window);
|
||||
|
@ -91,7 +91,7 @@ get_visual (struct wl_display *display, CoglPixelFormat format)
|
||||
}
|
||||
static ClutterStageWaylandWaylandBuffer *
|
||||
wayland_create_shm_buffer (ClutterBackendWayland *backend_wayland,
|
||||
ClutterGeometry *geom)
|
||||
cairo_rectangle_int_t *geom)
|
||||
{
|
||||
ClutterStageWaylandWaylandBufferSHM *buffer;
|
||||
struct wl_visual *visual;
|
||||
@ -105,9 +105,9 @@ wayland_create_shm_buffer (ClutterBackendWayland *backend_wayland,
|
||||
|
||||
buffer->buffer.type = BUFFER_TYPE_SHM;
|
||||
|
||||
tex = cogl_texture_new_with_size ((unsigned int)geom->width,
|
||||
(unsigned int)geom->height,
|
||||
flags, format);
|
||||
tex = cogl_texture_new_with_size ((unsigned int) geom->width,
|
||||
(unsigned int) geom->height,
|
||||
flags, format);
|
||||
buffer->format = format;
|
||||
buffer->stride = cogl_texture_get_rowstride(tex);
|
||||
buffer->size = cogl_texture_get_data(tex, format, buffer->stride, NULL);
|
||||
@ -134,7 +134,7 @@ wayland_create_shm_buffer (ClutterBackendWayland *backend_wayland,
|
||||
|
||||
static ClutterStageWaylandWaylandBuffer *
|
||||
wayland_create_drm_buffer (ClutterBackendWayland *backend_wayland,
|
||||
ClutterGeometry *geom)
|
||||
cairo_rectangle_int_t *geom)
|
||||
{
|
||||
EGLDisplay edpy = clutter_wayland_get_egl_display ();
|
||||
struct wl_visual *visual;
|
||||
@ -181,7 +181,7 @@ wayland_create_drm_buffer (ClutterBackendWayland *backend_wayland,
|
||||
}
|
||||
|
||||
static ClutterStageWaylandWaylandBuffer *
|
||||
wayland_create_buffer (ClutterGeometry *geom)
|
||||
wayland_create_buffer (cairo_rectangle_int_t *geom)
|
||||
{
|
||||
ClutterBackend *backend = clutter_get_default_backend ();
|
||||
ClutterBackendWayland *backend_wayland = CLUTTER_BACKEND_WAYLAND (backend);
|
||||
@ -346,13 +346,14 @@ clutter_stage_wayland_hide (ClutterStageWindow *stage_window)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_stage_wayland_get_geometry (ClutterStageWindow *stage_window,
|
||||
ClutterGeometry *geometry)
|
||||
clutter_stage_wayland_get_geometry (ClutterStageWindow *stage_window,
|
||||
cairo_rectangle_int_t *geometry)
|
||||
{
|
||||
ClutterStageWayland *stage_wayland = CLUTTER_STAGE_WAYLAND (stage_window);
|
||||
|
||||
if (geometry)
|
||||
if (geometry != NULL)
|
||||
{
|
||||
ClutterStageWayland *stage_wayland =
|
||||
CLUTTER_STAGE_WAYLAND (stage_window);
|
||||
|
||||
*geometry = stage_wayland->allocation;
|
||||
}
|
||||
}
|
||||
@ -363,7 +364,6 @@ clutter_stage_wayland_resize (ClutterStageWindow *stage_window,
|
||||
gint height)
|
||||
{
|
||||
ClutterStageWayland *stage_wayland = CLUTTER_STAGE_WAYLAND (stage_window);
|
||||
cairo_rectangle_int_t rect;
|
||||
|
||||
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;
|
||||
|
||||
/* FIXME: Shouldn't the stage repaint everything when it gets resized? */
|
||||
rect.x = stage_wayland->pending_allocation.x;
|
||||
rect.y = stage_wayland->pending_allocation.y;
|
||||
rect.width = stage_wayland->pending_allocation.width;
|
||||
rect.height = stage_wayland->pending_allocation.height;
|
||||
cairo_region_union_rectangle (stage_wayland->repaint_region, &rect);
|
||||
cairo_region_union_rectangle (stage_wayland->repaint_region,
|
||||
&stage_wayland->pending_allocation);
|
||||
}
|
||||
|
||||
#define CAIRO_REGION_FULL ((cairo_region_t *) 1)
|
||||
@ -393,26 +390,16 @@ clutter_stage_wayland_ignoring_redraw_clips (ClutterStageWindow *stage_window)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_stage_wayland_add_redraw_clip (ClutterStageWindow *stage_window,
|
||||
ClutterGeometry *stage_clip)
|
||||
clutter_stage_wayland_add_redraw_clip (ClutterStageWindow *stage_window,
|
||||
cairo_rectangle_int_t *stage_clip)
|
||||
{
|
||||
ClutterStageWayland *stage_wayland = CLUTTER_STAGE_WAYLAND (stage_window);
|
||||
cairo_rectangle_int_t rect;
|
||||
|
||||
if (stage_clip == NULL)
|
||||
{
|
||||
rect.x = stage_wayland->allocation.x;
|
||||
rect.y = stage_wayland->allocation.y;
|
||||
rect.width = stage_wayland->allocation.width;
|
||||
rect.height = stage_wayland->allocation.height;
|
||||
}
|
||||
rect = stage_wayland->allocation;
|
||||
else
|
||||
{
|
||||
rect.x = stage_clip->x;
|
||||
rect.y = stage_clip->y;
|
||||
rect.width = stage_clip->width;
|
||||
rect.height = stage_clip->height;
|
||||
}
|
||||
rect = stage_clip;
|
||||
|
||||
if (stage_wayland->repaint_region == NULL)
|
||||
stage_wayland->repaint_region = cairo_region_create_rectangle (&rect);
|
||||
@ -606,7 +593,6 @@ void
|
||||
_clutter_stage_wayland_repaint_region (ClutterStageWayland *stage_wayland,
|
||||
ClutterStage *stage)
|
||||
{
|
||||
ClutterGeometry geom;
|
||||
cairo_rectangle_int_t rect;
|
||||
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);
|
||||
|
||||
cogl_clip_push_window_rectangle (rect.x - 1, rect.y - 1,
|
||||
rect.width + 2, rect.height + 2);
|
||||
cogl_clip_push_window_rectangle (rect.x - 1,
|
||||
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
|
||||
* cull themselves a little to much. Disable for now.*/
|
||||
_clutter_stage_do_paint (stage, NULL);
|
||||
@ -637,8 +621,10 @@ _clutter_stage_wayland_redraw (ClutterStageWayland *stage_wayland,
|
||||
stage_wayland->allocation = stage_wayland->pending_allocation;
|
||||
|
||||
if (!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);
|
||||
_clutter_stage_maybe_setup_viewport (stage_wayland->wrapper);
|
||||
|
@ -89,9 +89,9 @@ struct _ClutterStageWayland
|
||||
/* back pointer to the backend */
|
||||
ClutterBackendWayland *backend;
|
||||
|
||||
ClutterGeometry allocation;
|
||||
ClutterGeometry save_allocation;
|
||||
ClutterGeometry pending_allocation;
|
||||
cairo_rectangle_int_t allocation;
|
||||
cairo_rectangle_int_t save_allocation;
|
||||
cairo_rectangle_int_t pending_allocation;
|
||||
struct wl_surface *wayland_surface;
|
||||
int pending_swaps;
|
||||
|
||||
|
@ -79,17 +79,17 @@ clutter_stage_win32_hide (ClutterStageWindow *stage_window)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_stage_win32_get_geometry (ClutterStageWindow *stage_window,
|
||||
ClutterGeometry *geometry)
|
||||
clutter_stage_win32_get_geometry (ClutterStageWindow *stage_window,
|
||||
cairo_rectangle_int_t *geometry)
|
||||
{
|
||||
ClutterStageWin32 *stage_win32 = CLUTTER_STAGE_WIN32 (stage_window);
|
||||
|
||||
if ((stage_win32->state & CLUTTER_STAGE_STATE_FULLSCREEN))
|
||||
{
|
||||
geometry->width = (stage_win32->fullscreen_rect.right
|
||||
- stage_win32->fullscreen_rect.left);
|
||||
geometry->height = (stage_win32->fullscreen_rect.bottom
|
||||
- stage_win32->fullscreen_rect.top);
|
||||
geometry->width = stage_win32->fullscreen_rect.right
|
||||
- stage_win32->fullscreen_rect.left;
|
||||
geometry->height = stage_win32->fullscreen_rect.bottom
|
||||
- stage_win32->fullscreen_rect.top;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -193,8 +193,8 @@ clutter_stage_x11_set_wm_protocols (ClutterStageX11 *stage_x11)
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_stage_x11_get_geometry (ClutterStageWindow *stage_window,
|
||||
ClutterGeometry *geometry)
|
||||
clutter_stage_x11_get_geometry (ClutterStageWindow *stage_window,
|
||||
cairo_rectangle_int_t *geometry)
|
||||
{
|
||||
ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window);
|
||||
ClutterBackendX11 *backend_x11 = stage_x11->backend;
|
||||
|
@ -9,8 +9,8 @@
|
||||
# - increase clutter_micro_version to the next odd number
|
||||
# - increase clutter_interface_version to the next odd number
|
||||
m4_define([clutter_major_version], [1])
|
||||
m4_define([clutter_minor_version], [7])
|
||||
m4_define([clutter_micro_version], [91])
|
||||
m4_define([clutter_minor_version], [9])
|
||||
m4_define([clutter_micro_version], [1])
|
||||
|
||||
# • 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
|
||||
@ -113,8 +113,8 @@ LT_INIT([disable-static])
|
||||
AC_HEADER_STDC
|
||||
|
||||
# required versions for dependencies
|
||||
m4_define([glib_req_version], [2.26.0])
|
||||
m4_define([cogl_req_version], [1.7.6])
|
||||
m4_define([glib_req_version], [2.28.0])
|
||||
m4_define([cogl_req_version], [1.8.0])
|
||||
m4_define([json_glib_req_version], [0.12.0])
|
||||
m4_define([atk_req_version], [2.1.5])
|
||||
m4_define([cairo_req_version], [1.10])
|
||||
|
1138
po/ca@valencia.po
1138
po/ca@valencia.po
File diff suppressed because it is too large
Load Diff
2
po/or.po
2
po/or.po
@ -1167,7 +1167,7 @@ msgstr ""
|
||||
|
||||
#: clutter/clutter-main.c:490
|
||||
msgid "default:LTR"
|
||||
msgstr "ପୂର୍ବ ନିର୍ଦ୍ଧାରିତ:LTR"
|
||||
msgstr "default:LTR"
|
||||
|
||||
#: clutter/clutter-main.c:1321
|
||||
msgid "Show frames per second"
|
||||
|
2194
po/sr@latin.po
Normal file
2194
po/sr@latin.po
Normal file
File diff suppressed because it is too large
Load Diff
1192
po/zh_HK.po
1192
po/zh_HK.po
File diff suppressed because it is too large
Load Diff
1192
po/zh_TW.po
1192
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user