static void
bg_filename_changed_cb (GConfClient *client,
                        guint        cnxn_id,
                        GConfEntry  *entry,
                        gpointer     userdata)
{
  PengeViewBackground *pvb = PENGE_VIEW_BACKGROUND (userdata);
  const gchar *filename;
  GConfValue *value;
  GError *error = NULL;

  value = gconf_entry_get_value (entry);

  if (value)
  {
    filename = gconf_value_get_string (value);
    if (!clutter_texture_set_from_file (CLUTTER_TEXTURE (pvb),
                                        filename,
                                        &error))
    {
      g_warning (G_STRLOC ": Error setting magic texture contents: %s",
                 error->message);
      g_clear_error (&error);
    } else {
      clutter_actor_set_opacity ((ClutterActor *)pvb, 0xff);
    }
  } else {
    /* If the key is unset let's just make ourselves invisible */
    clutter_actor_set_opacity ((ClutterActor *)pvb, 0x0);
  }
}
Beispiel #2
0
void
meta_compositor_flash_screen (MetaCompositor *compositor,
                              MetaScreen     *screen)
{
  ClutterActor *stage;
  ClutterActor *flash;
  ClutterTransition *transition;
  gfloat width, height;

  stage = meta_get_stage_for_screen (screen);
  clutter_actor_get_size (stage, &width, &height);

  flash = clutter_actor_new ();
  clutter_actor_set_background_color (flash, CLUTTER_COLOR_Black);
  clutter_actor_set_size (flash, width, height);
  clutter_actor_set_opacity (flash, 0);
  clutter_actor_add_child (stage, flash);

  clutter_actor_save_easing_state (flash);
  clutter_actor_set_easing_mode (flash, CLUTTER_EASE_IN_QUAD);
  clutter_actor_set_easing_duration (flash, FLASH_TIME_MS);
  clutter_actor_set_opacity (flash, 192);

  transition = clutter_actor_get_transition (flash, "opacity");
  clutter_timeline_set_auto_reverse (CLUTTER_TIMELINE (transition), TRUE);
  clutter_timeline_set_repeat_count (CLUTTER_TIMELINE (transition), 2);

  g_signal_connect (transition, "stopped",
                    G_CALLBACK (flash_out_completed), flash);

  clutter_actor_restore_easing_state (flash);
}
Beispiel #3
0
void
meta_compositor_flash_window (MetaCompositor *compositor,
                              MetaWindow     *window)
{
  ClutterActor *window_actor =
    CLUTTER_ACTOR (meta_window_get_compositor_private (window));
  ClutterActor *flash;
  ClutterTransition *transition;

  flash = clutter_actor_new ();
  clutter_actor_set_background_color (flash, CLUTTER_COLOR_Black);
  clutter_actor_set_size (flash, window->rect.width, window->rect.height);
  clutter_actor_set_position (flash,
                              window->custom_frame_extents.left,
                              window->custom_frame_extents.top);
  clutter_actor_set_opacity (flash, 0);
  clutter_actor_add_child (window_actor, flash);

  clutter_actor_save_easing_state (flash);
  clutter_actor_set_easing_mode (flash, CLUTTER_EASE_IN_QUAD);
  clutter_actor_set_easing_duration (flash, FLASH_TIME_MS);
  clutter_actor_set_opacity (flash, 192);

  transition = clutter_actor_get_transition (flash, "opacity");
  clutter_timeline_set_auto_reverse (CLUTTER_TIMELINE (transition), TRUE);
  clutter_timeline_set_repeat_count (CLUTTER_TIMELINE (transition), 2);

  g_signal_connect (transition, "stopped",
                    G_CALLBACK (window_flash_out_completed), flash);

  clutter_actor_restore_easing_state (flash);
}
Beispiel #4
0
static void
add_drag_object (ClutterActor *target)
{
  ClutterActor *parent;

  if (drag == NULL)
    {
      ClutterAction *action;

      drag = clutter_actor_new ();
      clutter_actor_set_background_color (drag, CLUTTER_COLOR_LightSkyBlue);
      clutter_actor_set_size (drag, HANDLE_SIZE, HANDLE_SIZE);
      clutter_actor_set_position (drag,
                                  (TARGET_SIZE - HANDLE_SIZE) / 2.0,
                                  (TARGET_SIZE - HANDLE_SIZE) / 2.0);
      clutter_actor_set_reactive (drag, TRUE);

      action = clutter_drag_action_new ();
      g_signal_connect (action, "drag-begin", G_CALLBACK (on_drag_begin), NULL);
      g_signal_connect (action, "drag-end", G_CALLBACK (on_drag_end), NULL);

      clutter_actor_add_action (drag, action);
    }

  parent = clutter_actor_get_parent (drag);
  if (parent == target)
    {
      clutter_actor_save_easing_state (target);
      clutter_actor_set_easing_mode (target, CLUTTER_LINEAR);
      clutter_actor_set_opacity (target, 255);
      clutter_actor_restore_easing_state (target);
      return;
    }

  g_object_ref (drag);
  if (parent != NULL && parent != stage)
    {
      clutter_actor_remove_child (parent, drag);

      clutter_actor_save_easing_state (parent);
      clutter_actor_set_easing_mode (parent, CLUTTER_LINEAR);
      clutter_actor_set_opacity (parent, 64);
      clutter_actor_restore_easing_state (parent);
    }

  clutter_actor_add_child (target, drag);

  clutter_actor_save_easing_state (target);
  clutter_actor_set_easing_mode (target, CLUTTER_LINEAR);
  clutter_actor_set_opacity (target, 255);
  clutter_actor_restore_easing_state (target);

  g_object_unref (drag);
}
Beispiel #5
0
static void budgie_wm_start(MetaPlugin *plugin)
{
        BudgieWM *self = BUDGIE_WM(plugin);
        MetaScreen *screen = meta_plugin_get_screen(plugin);
        ClutterActor* actors[2];

        /* Init background */
        self->priv->background_group = meta_background_group_new();
        clutter_actor_set_reactive(self->priv->background_group, TRUE);
        clutter_actor_insert_child_below(meta_get_window_group_for_screen(screen),
        self->priv->background_group, NULL);

        g_signal_connect(screen, "monitors-changed",
                G_CALLBACK(on_monitors_changed), plugin);
        on_monitors_changed(screen, plugin);


        /* Now we're in action. */
        clutter_actor_show(meta_get_window_group_for_screen(screen));
        clutter_actor_show(self->priv->background_group);
        clutter_actor_set_opacity(meta_get_window_group_for_screen(screen), 0);
        clutter_actor_set_opacity(self->priv->background_group, 0);

        actors[0] = meta_get_window_group_for_screen(screen);
        actors[1] = self->priv->background_group;

        clutter_actor_set_background_color(meta_get_stage_for_screen(screen),
                clutter_color_get_static(CLUTTER_COLOR_BLACK));
        clutter_actor_show(meta_get_stage_for_screen(screen));

        for (int i = 0; i < 2; i++) {
                clutter_actor_save_easing_state(actors[i]);
                clutter_actor_set_easing_mode(actors[i], CLUTTER_EASE_OUT_QUAD);
                clutter_actor_set_easing_duration(actors[i], SHOW_TIMEOUT);
                g_object_set(actors[i], "opacity", 255, NULL);
                clutter_actor_restore_easing_state(actors[i]);
        }

        /* Set up our own keybinding overrides */
        meta_keybindings_set_custom_handler(BUDGIE_KEYBINDING_MAIN_MENU,
                budgie_launch_menu, NULL, NULL);
        meta_keybindings_set_custom_handler(BUDGIE_KEYBINDING_RUN_DIALOG,
                budgie_launch_rundialog, NULL, NULL);
        meta_keybindings_set_custom_handler("switch-windows",
                (MetaKeyHandlerFunc)switch_windows, self, NULL);
        meta_keybindings_set_custom_handler("switch-applications",
                (MetaKeyHandlerFunc)switch_windows, self, NULL);

        /* Handle keys.. */
        budgie_keys_init(meta_screen_get_display(screen));
        budgie_menus_init(self);
        g_signal_connect(meta_screen_get_display(screen), "overlay-key",
            G_CALLBACK(overlay_cb), NULL);
}
Beispiel #6
0
void
mex_info_bar_show_buttons (MexInfoBar *self, gboolean visible)
{
  MexInfoBarPrivate *priv = self->priv;

  /* use opacity to show and hide the buttons to ensure the correct amount of
   * space is always allocated for them */

  clutter_actor_set_opacity (priv->settings_button, 0xff * visible);
  clutter_actor_set_opacity (priv->back_button, 0xff * !visible);

  mx_widget_set_disabled (MX_WIDGET (priv->settings_button), !visible);
  mx_widget_set_disabled (MX_WIDGET (priv->back_button), visible);
}
Beispiel #7
0
void
mex_info_bar_show_notifications (MexInfoBar *self, gboolean visible)
{
  MexInfoBarPrivate *priv = self->priv;
  ClutterActor *notification_area;

  notification_area =
    CLUTTER_ACTOR (clutter_script_get_object (priv->script,
                                              "notification-area"));
  if (!visible)
    clutter_actor_set_opacity (notification_area, 0x00);
  else
    clutter_actor_set_opacity (notification_area, 0xff);
}
Beispiel #8
0
static void
on_drag_end (ClutterDragAction   *action,
             ClutterActor        *actor,
             gfloat               event_x,
             gfloat               event_y,
             ClutterModifierType  modifiers)
{
  ClutterActor *handle = clutter_drag_action_get_drag_handle (action);

  g_print ("Drag ended at: %.0f, %.0f\n",
           event_x, event_y);

  clutter_actor_save_easing_state (actor);
  clutter_actor_set_easing_mode (actor, CLUTTER_LINEAR);
  clutter_actor_set_opacity (actor, 255);
  clutter_actor_restore_easing_state (actor);

  clutter_actor_save_easing_state (handle);

  if (!drop_successful)
    {
      ClutterActor *parent = clutter_actor_get_parent (actor);
      gfloat x_pos, y_pos;

      clutter_actor_save_easing_state (parent);
      clutter_actor_set_easing_mode (parent, CLUTTER_LINEAR);
      clutter_actor_set_opacity (parent, 255);
      clutter_actor_restore_easing_state (parent);

      clutter_actor_get_transformed_position (actor, &x_pos, &y_pos);

      clutter_actor_set_easing_mode (handle, CLUTTER_EASE_OUT_BOUNCE);
      clutter_actor_set_position (handle, x_pos, y_pos);
      clutter_actor_set_opacity (handle, 0);
      clutter_actor_restore_easing_state (handle);

    }
  else
    {
      clutter_actor_set_easing_mode (handle, CLUTTER_LINEAR);
      clutter_actor_set_opacity (handle, 0);
    }

  clutter_actor_restore_easing_state (handle);

  g_signal_connect (handle, "transitions-completed",
                    G_CALLBACK (clutter_actor_destroy),
                    NULL);
}
Beispiel #9
0
static void
mx_tooltip_init (MxTooltip *tooltip)
{
  tooltip->priv = MX_TOOLTIP_GET_PRIVATE (tooltip);

  tooltip->priv->label = g_object_new (CLUTTER_TYPE_TEXT,
                                       "line-alignment", PANGO_ALIGN_CENTER,
                                       "ellipsize", PANGO_ELLIPSIZE_END,
                                       "use-markup", TRUE,
                                       NULL);

  tooltip->priv->tip_area = NULL;

  clutter_actor_add_child (CLUTTER_ACTOR (tooltip),
                           CLUTTER_ACTOR (tooltip->priv->label));

  g_object_set (tooltip, "show-on-set-parent", FALSE, NULL);

  clutter_actor_set_reactive (CLUTTER_ACTOR (tooltip), FALSE);

  g_signal_connect (tooltip, "style-changed",
                    G_CALLBACK (mx_tooltip_style_changed), NULL);

  /* set opacity to 0 so that the tooltip can fade-in when shown */
  clutter_actor_set_opacity (CLUTTER_ACTOR (tooltip), 0);
}
Beispiel #10
0
static void
bjb_editor_toolbar_fade_out (BjbEditorToolbar *self)
{
  BjbEditorToolbarPrivate *priv = self->priv;

  clutter_actor_set_opacity (priv->actor, 0);
}
Beispiel #11
0
static ClutterActor *
make_button (char *text)
{
  ClutterActor *button, *button_bg, *button_text;
  ClutterColor white = { 0xff, 0xff, 0xff, 0xff };
  ClutterColor black = { 0x00, 0x00, 0x00, 0xff };
  gfloat width, height;

  button = clutter_actor_new ();

  button_bg = clutter_actor_new ();
  clutter_actor_set_background_color (button_bg, &white);
  clutter_actor_add_child (button, button_bg);
  clutter_actor_set_opacity (button_bg, 0xcc);

  button_text = clutter_text_new_full ("Sans 10", text, &black);
  clutter_actor_add_child (button, button_text);
  clutter_actor_get_size (button_text, &width, &height);

  clutter_actor_set_size (button_bg, width + PADDING * 2, height + PADDING * 2);
  clutter_actor_set_position (button_bg, 0, 0);
  clutter_actor_set_position (button_text, PADDING, PADDING);

  return button;
}
Beispiel #12
0
static void
mx_notebook_update_children (MxNotebook *book)
{
  MxNotebookPrivate *priv = book->priv;
  GList *l;

  for (l = priv->children; l; l = l->next)
    {
      ClutterActor *child = CLUTTER_ACTOR (l->data);

      if (child == priv->current_page)
        {
          clutter_actor_show (child);

          clutter_actor_save_easing_state (child);
          clutter_actor_set_easing_mode (child, CLUTTER_LINEAR);
          clutter_actor_set_easing_duration (child, 250);
          clutter_actor_set_opacity (child, 0xff);
          clutter_actor_restore_easing_state (child);

          g_signal_connect (child, "transition-stopped::opacity",
                            G_CALLBACK (mx_notebook_show_complete_cb), book);
        }
    }
}
/* Timeline handler */
void
frame_cb (ClutterTimeline *timeline, 
	  gint             msecs,
	  gpointer         data)
{
  SuperOH        *oh = (SuperOH *)data;
  gint            i;
  guint           rotation = clutter_timeline_get_progress (timeline) * 360.0f;

  /* Rotate everything clockwise about stage center*/
  clutter_actor_set_rotation (CLUTTER_ACTOR (oh->group),
                              CLUTTER_Z_AXIS,
                              rotation,
                              WINWIDTH / 2, WINHEIGHT / 2, 0);

  for (i = 0; i < NHANDS; i++)
    {
      /* rotate each hand around there centers */
      clutter_actor_set_rotation (oh->hand[i],
                                  CLUTTER_Z_AXIS,
                                  - 6.0 * rotation,
                                  clutter_actor_get_width (oh->hand[i]) / 2,
                                  clutter_actor_get_height (oh->hand[i]) / 2,
                                  0);
      if (fade == TRUE)
        clutter_actor_set_opacity (oh->hand[i], (255 - (rotation % 255)));
    }
}
Beispiel #14
0
G_MODULE_EXPORT int
test_animation_main (int argc, char *argv[])
{
  ClutterActor *stage, *rect;
  ClutterColor stage_color = { 0x66, 0x66, 0xdd, 0xff };
  ClutterColor rect_color = { 0x44, 0xdd, 0x44, 0xff };
  ClutterAction *action;

  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
    return 1;

  stage = clutter_stage_get_default ();
  clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);

  rect = clutter_rectangle_new_with_color (&rect_color);
  clutter_container_add_actor (CLUTTER_CONTAINER (stage), rect);
  clutter_actor_set_size (rect, 50, 50);
  clutter_actor_set_anchor_point (rect, 25, 25);
  clutter_actor_set_position (rect,
                              clutter_actor_get_width (stage) / 2,
                              clutter_actor_get_height (stage) / 2);
  clutter_actor_set_opacity (rect, 0x88);
  clutter_actor_set_reactive (rect, TRUE);

  action = clutter_click_action_new ();
  g_signal_connect (action, "clicked", G_CALLBACK (on_clicked), NULL);
  clutter_actor_add_action_with_name (rect, "click", action);

  clutter_actor_show (stage);

  clutter_main ();

  return EXIT_SUCCESS;
}
static void
mnb_fancy_bin_set_property (GObject      *object,
                            guint         property_id,
                            const GValue *value,
                            GParamSpec   *pspec)
{
  MnbFancyBin *self = MNB_FANCY_BIN (object);
  MnbFancyBinPrivate *priv = self->priv;

  switch (property_id)
    {
    case PROP_FANCY :
      mnb_fancy_bin_set_fancy (self, g_value_get_boolean (value));
      break;

    case PROP_FANCINESS :
      priv->fanciness = g_value_get_double (value);

      if (priv->clone)
        clutter_actor_set_opacity (priv->clone,
                                   (guint8)((1.0 - priv->fanciness) * 255));

      break;

    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
    }
}
void
gnome_app_actor_add_background (ClutterActor *actor, gchar *filename)
{
	ClutterActor *texture;
	ClutterActor *parent;
	GError *error;
	gfloat width, height;
	gfloat x, y;

	error = NULL;
	texture = clutter_texture_new_from_file (filename, &error);
	clutter_actor_set_opacity (texture, 128);
	if (error) {
		g_error ("Error in add background: %s\n", error->message);
		g_error_free (error);
		return;
	}
	clutter_actor_get_size (actor, &width, &height);
	clutter_actor_set_size (texture, width, height);
	if (CLUTTER_IS_CONTAINER (actor)) {
		clutter_container_add_actor (CLUTTER_CONTAINER (actor), texture);
		clutter_actor_set_position (texture, 0, 0);
	} else {
		parent = clutter_actor_get_parent (actor);
		clutter_container_add_actor (CLUTTER_CONTAINER (parent), texture);
		clutter_actor_get_position (actor, &x, &y);
		clutter_actor_set_position (texture, x, y);
	}
	/*This make it real background ...
	 * TODO: how about both par/child actor with background */
	clutter_actor_lower_bottom (texture);
}
Beispiel #17
0
IO_METHOD(IoClutterActor, setOpacity) {
  clutter_actor_set_opacity(
    IOCACTOR(self),
    IoMessage_locals_intArgAt_(m, locals, 0)
  );
  return self;
}
Beispiel #18
0
Datei: mx-menu.c Projekt: jku/mx
static void
mx_menu_show (ClutterActor *actor)
{
  ClutterAnimation *animation = NULL;
  ClutterStage *stage;

  /* set reactive and opacity, since these may have been set by the fade-out
   * animation (e.g. from captured_event_handler or button_release_cb) */
  if ((animation = clutter_actor_get_animation (actor)))
    {
      clutter_animation_completed (animation);
    }
  clutter_actor_set_reactive (actor, TRUE);
  clutter_actor_set_opacity (actor, 0xff);

  /* chain up to run show after re-setting properties above */
  CLUTTER_ACTOR_CLASS (mx_menu_parent_class)->show (actor);

  clutter_actor_grab_key_focus (actor);

  stage = (ClutterStage*) clutter_actor_get_stage (actor);

  mx_focus_manager_push_focus (mx_focus_manager_get_for_stage (stage),
                               MX_FOCUSABLE (actor));

}
static void 
alpha_notify_foreach (ClutterBehaviour *behaviour,
		      ClutterActor     *actor,
		      gpointer          data)
{
  clutter_actor_set_opacity (actor, GPOINTER_TO_UINT(data));
}
Beispiel #20
0
GnibblesBoard *
gnibbles_board_new (void)
{
  gchar *filename;
  const char *dirname;
  GValue val = {0,};

  GnibblesBoard *board = g_new (GnibblesBoard, 1);
  board->width = BOARDWIDTH;
  board->height = BOARDHEIGHT;
  board->level = NULL;
  board->surface = NULL;

  dirname = games_runtime_get_directory (GAMES_RUNTIME_GAME_PIXMAP_DIRECTORY);
  filename = g_build_filename (dirname, "wall-small-empty.svg", NULL);

  board->surface = clutter_texture_new_from_file (filename, NULL);

  clutter_actor_set_opacity (CLUTTER_ACTOR (board->surface), 100);
  g_value_init (&val, G_TYPE_BOOLEAN);
  g_value_set_boolean ( &val, TRUE);

  g_object_set_property (G_OBJECT (board->surface), "repeat-y", &val);
  g_object_set_property (G_OBJECT (board->surface), "repeat-x", &val);

  clutter_actor_set_position (CLUTTER_ACTOR (board->surface), 0, 0);
  clutter_actor_set_size (CLUTTER_ACTOR (board->surface),
                          properties->tilesize * BOARDWIDTH,
                          properties->tilesize * BOARDHEIGHT);
  clutter_container_add_actor (CLUTTER_CONTAINER (stage),
                               CLUTTER_ACTOR (board->surface));
  clutter_actor_show (CLUTTER_ACTOR (board->surface));

  return board;
}
Beispiel #21
0
static void
fade_transition_frame_cb (OptTransition   *trans,
			  gint             frame_num,
			  gpointer         data)
{
  OptSlide             *from, *to;
  OptTransitionPrivate *priv;
  gint                  opacity;

  priv = trans->priv;

  from = opt_transition_get_from (trans);
  to   = opt_transition_get_to (trans);

  if (frame_num == 1)
    {
      clutter_actor_show_all (CLUTTER_ACTOR(to));
      clutter_actor_raise_top (CLUTTER_ACTOR(to));
    }

  opacity = (frame_num * 255 ) 
                  / clutter_timeline_get_n_frames (CLUTTER_TIMELINE(trans));

  clutter_actor_set_opacity (CLUTTER_ACTOR(to), opacity);

  /* clutter_actor_set_depth (CLUTTER_ACTOR(from), - opacity/10 ); */
}
Beispiel #22
0
static void
mex_shell_add (ClutterContainer *container,
               ClutterActor     *actor)
{
  ClutterActorBox box;
  MexShellChildData *data;

  MexShell *self = MEX_SHELL (container);
  MexShellPrivate *priv = self->priv;

  data = mex_shell_child_data_new (self, actor);
  priv->children = g_list_append (priv->children, data);
  clutter_actor_set_parent (actor, CLUTTER_ACTOR (container));
  clutter_actor_set_opacity (actor, 0x00);

  clutter_actor_get_allocation_box (CLUTTER_ACTOR (container), &box);
  data->target_width = box.x2 - box.x1;
  data->target_height = box.y2 - box.y1;
  g_object_set (G_OBJECT (actor),
                "natural-width", data->target_width,
                "natural-height", data->target_height,
                NULL);

  g_signal_emit_by_name (container, "actor-added", actor);
}
/**
 * champlain_tile_display_content:
 * @self: the #ChamplainTile
 *
 * Displays the tile's content.
 *
 * Since: 0.8
 */
void
champlain_tile_display_content (ChamplainTile *self)
{
  g_return_if_fail (CHAMPLAIN_TILE (self));

  ChamplainTilePrivate *priv = self->priv;
  ClutterAnimation *animation;

  if (!priv->content_actor || priv->content_displayed || !priv->content_group)
    return;

  clutter_container_add_actor (CLUTTER_CONTAINER (priv->content_group), priv->content_actor);
  g_object_unref (priv->content_actor);
  priv->content_displayed = TRUE;

  clutter_actor_set_opacity (CLUTTER_ACTOR (priv->content_actor), 0);
  if (priv->fade_in)
    {
      animation = clutter_actor_animate (CLUTTER_ACTOR (priv->content_actor),
            CLUTTER_EASE_IN_CUBIC,
            500,
            "opacity", 255,
            NULL);
    }
  else
    {
      animation = clutter_actor_animate (CLUTTER_ACTOR (priv->content_actor),
            CLUTTER_LINEAR,
            150,
            "opacity", 255,
            NULL);
    }

  g_signal_connect (animation, "completed", G_CALLBACK (fade_in_completed), self);
}
Beispiel #24
0
static void
on_drag_begin (ClutterDragAction   *action,
               ClutterActor        *actor,
               gfloat               event_x,
               gfloat               event_y,
               ClutterModifierType  modifiers)
{
  ClutterActor *handle;
  gfloat x_pos, y_pos;

  clutter_actor_get_position (actor, &x_pos, &y_pos);

  handle = clutter_actor_new ();
  clutter_actor_set_background_color (handle, CLUTTER_COLOR_DarkSkyBlue);
  clutter_actor_set_size (handle, 128, 128);
  clutter_actor_set_position (handle, event_x - x_pos, event_y - y_pos);
  clutter_actor_add_child (stage, handle);

  clutter_drag_action_set_drag_handle (action, handle);

  clutter_actor_save_easing_state (actor);
  clutter_actor_set_easing_mode (actor, CLUTTER_LINEAR);
  clutter_actor_set_opacity (actor, 128);
  clutter_actor_restore_easing_state (actor);

  drop_successful = FALSE;
}
Beispiel #25
0
static void
fade_out (ClutterActor *actor)
{
  clutter_actor_save_easing_state (actor);
  clutter_actor_set_easing_duration (actor, FADE_OUT_TIME);
  clutter_actor_set_opacity (actor, 0);
  clutter_actor_restore_easing_state (actor);
}
Beispiel #26
0
static void
mex_tile_init (MexTile *self)
{
  MexTilePrivate *priv = self->priv = TILE_PRIVATE (self);
  const ClutterColor opaque = { 0x00, 0x00, 0x00, 0x00 };
  ClutterEffect *fade;

  /* create a template material for the header background from which cheap
   * copies can be made for each instance */
  if (G_UNLIKELY (!template_material))
    template_material = cogl_material_new ();

  priv->material = cogl_material_copy (template_material);


  /* layout for primary and secondary labels */
  priv->box_layout = mx_box_layout_new ();
  mx_box_layout_set_spacing (MX_BOX_LAYOUT (priv->box_layout), 12);

  /* add fade effect to the box layout */
  fade = (ClutterEffect*) mx_fade_effect_new ();
  mx_fade_effect_set_border (MX_FADE_EFFECT (fade), 0, 50, 0, 0);
  mx_fade_effect_set_color (MX_FADE_EFFECT (fade), &opaque);
  clutter_actor_add_effect_with_name (priv->box_layout, "fade", fade);
  clutter_actor_meta_set_enabled (CLUTTER_ACTOR_META (fade), TRUE);

  clutter_actor_push_internal (CLUTTER_ACTOR (self));
  clutter_actor_set_parent (priv->box_layout, CLUTTER_ACTOR (self));
  clutter_actor_pop_internal (CLUTTER_ACTOR (self));


  priv->label = clutter_text_new ();
  priv->secondary_label = clutter_text_new ();
  clutter_actor_set_opacity (priv->secondary_label, 128);

  clutter_container_add (CLUTTER_CONTAINER (priv->box_layout), priv->label,
                         priv->secondary_label, NULL);

  priv->header_visible = TRUE;

  priv->timeline = clutter_timeline_new (DURATION);
  priv->important_alpha =
    clutter_alpha_new_full (priv->timeline, CLUTTER_EASE_OUT_QUAD);
  g_signal_connect_object (priv->timeline, "new-frame",
                           G_CALLBACK (mex_tile_important_new_frame_cb), self,
                           0);
  g_signal_connect_object (priv->timeline, "completed",
                           G_CALLBACK (mex_tile_timeline_completed_cb), self,
                           0);

  g_signal_connect (self, "style-changed",
                    G_CALLBACK (mex_tile_style_changed_cb), NULL);

  g_signal_connect (self, "actor-added",
                    G_CALLBACK (mex_tile_actor_added), NULL);
  g_signal_connect (self, "actor-removed",
                    G_CALLBACK (mex_tile_actor_removed), NULL);
}
Beispiel #27
0
static void
set_texture_on_actor (MetaBackgroundActor *self)
{
  MetaBackgroundActorPrivate *priv = self->priv;
  MetaBackgroundTransition background_transition;

  if (priv->transition_running)
    cancel_transitions (self);

  background_transition = meta_prefs_get_background_transition();

  if (background_transition == META_BACKGROUND_TRANSITION_NONE)
  {
    // NO TRANSITION
    clutter_actor_set_opacity (CLUTTER_ACTOR (priv->bottom_actor), 0);
    meta_background_set_layer (META_BACKGROUND (priv->top_actor), priv->background->texture);
    on_transition_complete (priv->top_actor, self);
  }
  else
  {
    if (background_transition == META_BACKGROUND_TRANSITION_FADEIN)
    {
      // FADE_IN TRANSITION
      clutter_actor_set_opacity (CLUTTER_ACTOR (priv->bottom_actor), 0);
    }

    // BLEND TRANSITION
    clutter_actor_set_opacity (CLUTTER_ACTOR (priv->top_actor), 0);
    meta_background_set_layer (META_BACKGROUND (priv->top_actor), priv->background->texture);

    priv->transition_running = TRUE;

    clutter_actor_save_easing_state (priv->top_actor);
    clutter_actor_set_easing_duration (priv->top_actor, FADE_DURATION);
    clutter_actor_set_opacity (priv->top_actor, 255);
    clutter_actor_restore_easing_state (priv->top_actor);

    g_signal_connect (priv->top_actor,
                      "transitions-completed",
                      G_CALLBACK (on_transition_complete),
                      self);

    clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
  }
}
void
bacon_video_osd_actor_show (BaconVideoOsdActor *osd)
{
	g_return_if_fail (BACON_IS_VIDEO_OSD_ACTOR (osd));

	remove_hide_timeout (osd);
	clutter_actor_set_opacity (CLUTTER_ACTOR (osd), 0xff);
	clutter_actor_show (CLUTTER_ACTOR (osd));
}
Beispiel #29
0
/**
 * mex_column_set_child_opacity
 *
 * Set the opacity of children in the column.
 */
void
mex_column_set_child_opacity (MexColumn *column,
                              guchar     opacity)
{
  GList *l;

  for (l = column->priv->children; l; l = g_list_next (l))
    clutter_actor_set_opacity (l->data, opacity);
}
Beispiel #30
0
static void
timeline_complete (ClutterTimeline *timeline,
                   ClutterActor    *expander)
{
  guchar opacity;
  MxExpanderPrivate *priv = MX_EXPANDER (expander)->priv;

  g_signal_emit (expander, expander_signals[EXPAND_COMPLETE], 0);

  /* if the expander is now closed, update the style */
  if (!priv->expanded)
    {
      clutter_actor_set_name (priv->arrow, "mx-expander-arrow-closed");
      mx_stylable_set_style_class (MX_STYLABLE (expander), "closed-expander");

      clutter_actor_queue_relayout (expander);
    }

  if (!priv->child)
    return;

  /* continue only if we are "opening" */
  if (!priv->expanded)
    return;

  /* we can't do an animation if there is already one in progress,
   * because we cannot get the actors original opacity */
  if (clutter_actor_get_transition (priv->child, "opacity"))
    {
      clutter_actor_show (priv->child);
      return;
    }

  opacity = clutter_actor_get_opacity (priv->child);
  clutter_actor_set_opacity (priv->child, 0);

  clutter_actor_show (priv->child);

  clutter_actor_save_easing_state (priv->child);
  clutter_actor_set_easing_mode (priv->child, CLUTTER_EASE_IN_SINE);
  clutter_actor_set_easing_duration (priv->child, 100);
  clutter_actor_set_opacity (priv->child, opacity);
  clutter_actor_restore_easing_state (priv->child);
}