ivi-shell: bugfix, update event_mask when new propertiy is not same as before.

In previous code, it sends notification whenever setter calls. This
patch fixs that notification will not happens if there is no change of
properties by setter.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
dev
Nobuhiko Tanibata 10 years ago committed by Pekka Paalanen
parent 6ce3ef864d
commit 5d4a323c36
  1. 52
      ivi-shell/ivi-layout.c

@ -1951,7 +1951,10 @@ ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer,
prop = &ivilayer->pending.prop; prop = &ivilayer->pending.prop;
prop->visibility = newVisibility; prop->visibility = newVisibility;
if (ivilayer->prop.visibility != newVisibility)
ivilayer->event_mask |= IVI_NOTIFICATION_VISIBILITY; ivilayer->event_mask |= IVI_NOTIFICATION_VISIBILITY;
else
ivilayer->event_mask &= ~IVI_NOTIFICATION_VISIBILITY;
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
@ -1983,7 +1986,10 @@ ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer,
prop = &ivilayer->pending.prop; prop = &ivilayer->pending.prop;
prop->opacity = opacity; prop->opacity = opacity;
if (ivilayer->prop.opacity != opacity)
ivilayer->event_mask |= IVI_NOTIFICATION_OPACITY; ivilayer->event_mask |= IVI_NOTIFICATION_OPACITY;
else
ivilayer->event_mask &= ~IVI_NOTIFICATION_OPACITY;
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
@ -2017,7 +2023,12 @@ ivi_layout_layer_set_source_rectangle(struct ivi_layout_layer *ivilayer,
prop->source_width = width; prop->source_width = width;
prop->source_height = height; prop->source_height = height;
if (ivilayer->prop.source_x != x || ivilayer->prop.source_y != y ||
ivilayer->prop.source_width != width ||
ivilayer->prop.source_height != height)
ivilayer->event_mask |= IVI_NOTIFICATION_SOURCE_RECT; ivilayer->event_mask |= IVI_NOTIFICATION_SOURCE_RECT;
else
ivilayer->event_mask &= ~IVI_NOTIFICATION_SOURCE_RECT;
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
@ -2040,7 +2051,12 @@ ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer,
prop->dest_width = width; prop->dest_width = width;
prop->dest_height = height; prop->dest_height = height;
if (ivilayer->prop.dest_x != x || ivilayer->prop.dest_y != y ||
ivilayer->prop.dest_width != width ||
ivilayer->prop.dest_height != height)
ivilayer->event_mask |= IVI_NOTIFICATION_DEST_RECT; ivilayer->event_mask |= IVI_NOTIFICATION_DEST_RECT;
else
ivilayer->event_mask &= ~IVI_NOTIFICATION_DEST_RECT;
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
@ -2076,7 +2092,11 @@ ivi_layout_layer_set_dimension(struct ivi_layout_layer *ivilayer,
prop->dest_width = dest_width; prop->dest_width = dest_width;
prop->dest_height = dest_height; prop->dest_height = dest_height;
if (ivilayer->prop.dest_width != dest_width ||
ivilayer->prop.dest_height != dest_height)
ivilayer->event_mask |= IVI_NOTIFICATION_DIMENSION; ivilayer->event_mask |= IVI_NOTIFICATION_DIMENSION;
else
ivilayer->event_mask &= ~IVI_NOTIFICATION_DIMENSION;
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
@ -2111,7 +2131,10 @@ ivi_layout_layer_set_position(struct ivi_layout_layer *ivilayer,
prop->dest_x = dest_x; prop->dest_x = dest_x;
prop->dest_y = dest_y; prop->dest_y = dest_y;
if (ivilayer->prop.dest_x != dest_x || ivilayer->prop.dest_y != dest_y)
ivilayer->event_mask |= IVI_NOTIFICATION_POSITION; ivilayer->event_mask |= IVI_NOTIFICATION_POSITION;
else
ivilayer->event_mask &= ~IVI_NOTIFICATION_POSITION;
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
@ -2130,7 +2153,10 @@ ivi_layout_layer_set_orientation(struct ivi_layout_layer *ivilayer,
prop = &ivilayer->pending.prop; prop = &ivilayer->pending.prop;
prop->orientation = orientation; prop->orientation = orientation;
if (ivilayer->prop.orientation != orientation)
ivilayer->event_mask |= IVI_NOTIFICATION_ORIENTATION; ivilayer->event_mask |= IVI_NOTIFICATION_ORIENTATION;
else
ivilayer->event_mask &= ~IVI_NOTIFICATION_ORIENTATION;
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
@ -2211,7 +2237,10 @@ ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf,
prop = &ivisurf->pending.prop; prop = &ivisurf->pending.prop;
prop->visibility = newVisibility; prop->visibility = newVisibility;
if (ivisurf->prop.visibility != newVisibility)
ivisurf->event_mask |= IVI_NOTIFICATION_VISIBILITY; ivisurf->event_mask |= IVI_NOTIFICATION_VISIBILITY;
else
ivisurf->event_mask &= ~IVI_NOTIFICATION_VISIBILITY;
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
@ -2243,7 +2272,10 @@ ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
prop = &ivisurf->pending.prop; prop = &ivisurf->pending.prop;
prop->opacity = opacity; prop->opacity = opacity;
if (ivisurf->prop.opacity != opacity)
ivisurf->event_mask |= IVI_NOTIFICATION_OPACITY; ivisurf->event_mask |= IVI_NOTIFICATION_OPACITY;
else
ivisurf->event_mask &= ~IVI_NOTIFICATION_OPACITY;
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
@ -2281,7 +2313,12 @@ ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf,
prop->dest_width = width; prop->dest_width = width;
prop->dest_height = height; prop->dest_height = height;
if (ivisurf->prop.dest_x != x || ivisurf->prop.dest_y != y ||
ivisurf->prop.dest_width != width ||
ivisurf->prop.dest_height != height)
ivisurf->event_mask |= IVI_NOTIFICATION_DEST_RECT; ivisurf->event_mask |= IVI_NOTIFICATION_DEST_RECT;
else
ivisurf->event_mask &= ~IVI_NOTIFICATION_DEST_RECT;
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
@ -2301,7 +2338,11 @@ ivi_layout_surface_set_dimension(struct ivi_layout_surface *ivisurf,
prop->dest_width = dest_width; prop->dest_width = dest_width;
prop->dest_height = dest_height; prop->dest_height = dest_height;
if (ivisurf->prop.dest_width != dest_width ||
ivisurf->prop.dest_height != dest_height)
ivisurf->event_mask |= IVI_NOTIFICATION_DIMENSION; ivisurf->event_mask |= IVI_NOTIFICATION_DIMENSION;
else
ivisurf->event_mask &= ~IVI_NOTIFICATION_DIMENSION;
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
@ -2336,7 +2377,10 @@ ivi_layout_surface_set_position(struct ivi_layout_surface *ivisurf,
prop->dest_x = dest_x; prop->dest_x = dest_x;
prop->dest_y = dest_y; prop->dest_y = dest_y;
if (ivisurf->prop.dest_x != dest_x || ivisurf->prop.dest_y != dest_y)
ivisurf->event_mask |= IVI_NOTIFICATION_POSITION; ivisurf->event_mask |= IVI_NOTIFICATION_POSITION;
else
ivisurf->event_mask &= ~IVI_NOTIFICATION_POSITION;
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
@ -2370,7 +2414,10 @@ ivi_layout_surface_set_orientation(struct ivi_layout_surface *ivisurf,
prop = &ivisurf->pending.prop; prop = &ivisurf->pending.prop;
prop->orientation = orientation; prop->orientation = orientation;
if (ivisurf->prop.orientation != orientation)
ivisurf->event_mask |= IVI_NOTIFICATION_ORIENTATION; ivisurf->event_mask |= IVI_NOTIFICATION_ORIENTATION;
else
ivisurf->event_mask &= ~IVI_NOTIFICATION_ORIENTATION;
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }
@ -2644,7 +2691,12 @@ ivi_layout_surface_set_source_rectangle(struct ivi_layout_surface *ivisurf,
prop->source_width = width; prop->source_width = width;
prop->source_height = height; prop->source_height = height;
if (ivisurf->prop.source_x != x || ivisurf->prop.source_y != y ||
ivisurf->prop.source_width != width ||
ivisurf->prop.source_height != height)
ivisurf->event_mask |= IVI_NOTIFICATION_SOURCE_RECT; ivisurf->event_mask |= IVI_NOTIFICATION_SOURCE_RECT;
else
ivisurf->event_mask &= ~IVI_NOTIFICATION_SOURCE_RECT;
return IVI_SUCCEEDED; return IVI_SUCCEEDED;
} }

Loading…
Cancel
Save