Example #1
0
/**
 * clutter_page_turn_effect_set_radius:
 * @effect: a #ClutterPageTurnEffect:
 * @radius: the radius of the page curling, in pixels
 *
 * Sets the radius of the page curling
 *
 * Since: 1.4
 */
void
clutter_page_turn_effect_set_radius (ClutterPageTurnEffect *effect,
                                     gfloat                 radius)
{
  g_return_if_fail (CLUTTER_IS_PAGE_TURN_EFFECT (effect));

  effect->radius = radius;

  clutter_deform_effect_invalidate (CLUTTER_DEFORM_EFFECT (effect));

  g_object_notify_by_pspec (G_OBJECT (effect), obj_props[PROP_RADIUS]);
}
Example #2
0
/**
 * clutter_page_turn_effect_set_angle:
 * @effect: #ClutterPageTurnEffect
 * @angle: the angle of the page curl, in degrees
 *
 * Sets the angle of the page curling, in degrees
 *
 * Since: 1.4
 */
void
clutter_page_turn_effect_set_angle (ClutterPageTurnEffect *effect,
                                    gdouble                angle)
{
  g_return_if_fail (CLUTTER_IS_PAGE_TURN_EFFECT (effect));
  g_return_if_fail (angle >= 0.0 && angle <= 360.0);

  effect->angle = angle;

  clutter_deform_effect_invalidate (CLUTTER_DEFORM_EFFECT (effect));

  g_object_notify_by_pspec (G_OBJECT (effect), obj_props[PROP_ANGLE]);
}
Example #3
0
/**
 * clutter_page_turn_effect_set_period:
 * @effect: a #ClutterPageTurnEffect
 * @period: the period of the page curl, between 0.0 and 1.0
 *
 * Sets the period of the page curling, between 0.0 (no curling)
 * and 1.0 (fully curled)
 *
 * Since: 1.4
 */
void
clutter_page_turn_effect_set_period (ClutterPageTurnEffect *effect,
                                     gdouble                period)
{
  g_return_if_fail (CLUTTER_IS_PAGE_TURN_EFFECT (effect));
  g_return_if_fail (period >= 0.0 && period <= 1.0);

  effect->period = period;

  clutter_deform_effect_invalidate (CLUTTER_DEFORM_EFFECT (effect));

  g_object_notify_by_pspec (G_OBJECT (effect), obj_props[PROP_PERIOD]);
}
Example #4
0
/**
 * clutter_deform_effect_set_back_material:
 * @effect: a #ClutterDeformEffect
 * @material: (allow-none): a handle to a Cogl material
 *
 * Sets the material that should be used when drawing the back face
 * of the actor during a deformation
 *
 * The #ClutterDeformEffect will take a reference on the material's
 * handle
 *
 * Since: 1.4
 */
void
clutter_deform_effect_set_back_material (ClutterDeformEffect *effect,
                                         CoglHandle           material)
{
  ClutterDeformEffectPrivate *priv;

  g_return_if_fail (CLUTTER_IS_DEFORM_EFFECT (effect));
  g_return_if_fail (material == COGL_INVALID_HANDLE || cogl_is_material (material));

  priv = effect->priv;

  clutter_deform_effect_free_back_material (effect);

  priv->back_material = material;
  if (priv->back_material != COGL_INVALID_HANDLE)
    cogl_handle_ref (priv->back_material);

  clutter_deform_effect_invalidate (effect);
}
Example #5
0
/**
 * clutter_deform_effect_set_back_material:
 * @effect: a #ClutterDeformEffect
 * @material: (allow-none): a handle to a Cogl material
 *
 * Sets the material that should be used when drawing the back face
 * of the actor during a deformation
 *
 * The #ClutterDeformEffect will take a reference on the material's
 * handle
 *
 * Since: 1.4
 */
void
clutter_deform_effect_set_back_material (ClutterDeformEffect *effect,
                                         CoglHandle           material)
{
  ClutterDeformEffectPrivate *priv;
  CoglPipeline *pipeline = COGL_PIPELINE (material);

  g_return_if_fail (CLUTTER_IS_DEFORM_EFFECT (effect));
  g_return_if_fail (pipeline == NULL || cogl_is_pipeline (pipeline));

  priv = effect->priv;

  clutter_deform_effect_free_back_pipeline (effect);

  priv->back_pipeline = material;
  if (priv->back_pipeline != NULL)
    cogl_object_ref (priv->back_pipeline);

  clutter_deform_effect_invalidate (effect);
}
Example #6
0
/**
 * clutter_deform_effect_set_n_tiles:
 * @effect: a #ClutterDeformEffect
 * @x_tiles: number of horizontal tiles
 * @y_tiles: number of vertical tiles
 *
 * Sets the number of horizontal and vertical tiles to be used
 * when applying the effect
 *
 * More tiles allow a finer grained deformation at the expenses
 * of computation
 *
 * Since: 1.4
 */
void
clutter_deform_effect_set_n_tiles (ClutterDeformEffect *effect,
                                   guint                x_tiles,
                                   guint                y_tiles)
{
  ClutterDeformEffectPrivate *priv;
  gboolean tiles_changed = FALSE;

  g_return_if_fail (CLUTTER_IS_DEFORM_EFFECT (effect));
  g_return_if_fail (x_tiles > 0 && y_tiles > 0);

  priv = effect->priv;

  g_object_freeze_notify (G_OBJECT (effect));

  if (priv->x_tiles != x_tiles)
    {
      priv->x_tiles = x_tiles;

      g_object_notify_by_pspec (G_OBJECT (effect), obj_props[PROP_X_TILES]);

      tiles_changed = TRUE;
    }

  if (priv->y_tiles != y_tiles)
    {
      priv->y_tiles = y_tiles;

      g_object_notify_by_pspec (G_OBJECT (effect), obj_props[PROP_Y_TILES]);

      tiles_changed = TRUE;
    }

  if (tiles_changed)
    {
      clutter_deform_effect_init_arrays (effect);
      clutter_deform_effect_invalidate (effect);
    }

  g_object_thaw_notify (G_OBJECT (effect));
}