コード例 #1
0
void
test_clone_no_map (TestConformSimpleFixture *fixture,
                   gconstpointer             data)
{
  ClutterActor *stage;
  ClutterActor *group;
  ClutterActor *actor;
  ClutterActor *clone;

  stage = clutter_stage_get_default ();

  group = clutter_group_new ();
  actor = clutter_rectangle_new ();

  clutter_actor_hide (group);

  clutter_container_add_actor (CLUTTER_CONTAINER (group), actor);
  clutter_container_add_actor (CLUTTER_CONTAINER (stage), group);

  g_assert (!(CLUTTER_ACTOR_IS_MAPPED (group)));
  g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor)));

  clone = clutter_clone_new (group);

  clutter_container_add_actor (CLUTTER_CONTAINER (stage), clone);

  g_assert (CLUTTER_ACTOR_IS_MAPPED (clone));
  g_assert (!(CLUTTER_ACTOR_IS_MAPPED (group)));
  g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor)));

  clutter_actor_destroy (CLUTTER_ACTOR (clone));
  clutter_actor_destroy (CLUTTER_ACTOR (group));
}
コード例 #2
0
ファイル: mex-info-bar.c プロジェクト: tthef/media-explorer
static void
mex_info_bar_dispose (GObject *object)
{
  MexInfoBar *self = MEX_INFO_BAR (object);
  MexInfoBarPrivate *priv = self->priv;

  if (priv->settings_dialog)
    {
      clutter_actor_destroy (priv->settings_dialog);
      priv->settings_dialog = NULL;
    }

  if (priv->group)
    {
      clutter_actor_destroy (priv->group);
      priv->group = NULL;
    }

  if (priv->script)
    {
      g_object_unref (priv->script);
      priv->script = NULL;
    }

  G_OBJECT_CLASS (mex_info_bar_parent_class)->dispose (object);
}
コード例 #3
0
ファイル: actor-invariants.c プロジェクト: Distrotech/clutter
static void
clone_no_map (void)
{
  ClutterActor *stage;
  ClutterActor *group;
  ClutterActor *actor;
  ClutterActor *clone;

  stage = clutter_test_get_stage ();
  clutter_actor_show (stage);

  group = clutter_actor_new ();
  actor = clutter_actor_new ();

  clutter_actor_hide (group);

  clutter_actor_add_child (group, actor);
  clutter_actor_add_child (stage, group);

  g_assert (!(CLUTTER_ACTOR_IS_MAPPED (group)));
  g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor)));

  clone = clutter_clone_new (group);

  clutter_actor_add_child (stage, clone);

  g_assert (CLUTTER_ACTOR_IS_MAPPED (clone));
  g_assert (!(CLUTTER_ACTOR_IS_MAPPED (group)));
  g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor)));

  clutter_actor_destroy (CLUTTER_ACTOR (clone));
  clutter_actor_destroy (CLUTTER_ACTOR (group));
}
コード例 #4
0
ファイル: mx-combo-box.c プロジェクト: ebassi/mx
static void
mx_combo_box_dispose (GObject *object)
{
  MxComboBoxPrivate *priv = MX_COMBO_BOX (object)->priv;

  if (priv->label)
    {
      clutter_actor_destroy (priv->label);
      priv->label = NULL;
    }

  if (priv->icon)
    {
      clutter_actor_destroy (priv->icon);
      priv->icon = NULL;
    }

  if (priv->marker)
    {
      clutter_actor_destroy (priv->marker);
      priv->marker = NULL;
    }

  G_OBJECT_CLASS (mx_combo_box_parent_class)->dispose (object);
}
コード例 #5
0
static void
mex_column_view_dispose (GObject *object)
{
  MexColumnViewPrivate *priv = MEX_COLUMN_VIEW (object)->priv;

  if (priv->header)
    {
      /* The header includes the label and icon */
      clutter_actor_destroy (priv->header);
      priv->header = NULL;
    }

  if (priv->placeholder_actor)
    {
      clutter_actor_unparent (priv->placeholder_actor);
      priv->placeholder_actor = NULL;
    }

  if (priv->column)
    {
      clutter_actor_destroy (priv->column);
      priv->column = NULL;
    }

  G_OBJECT_CLASS (mex_column_view_parent_class)->dispose (object);
}
コード例 #6
0
static void
mnb_fancy_bin_dispose (GObject *object)
{
  MnbFancyBinPrivate *priv = MNB_FANCY_BIN (object)->priv;

  if (priv->clone)
    {
      clutter_actor_destroy (priv->clone);
      priv->clone = NULL;
    }

  if (priv->child)
    {
      clutter_actor_destroy (priv->child);
      priv->child = NULL;
    }

  if (priv->real_child)
    {
	  clutter_actor_remove_child (clutter_actor_get_parent(priv->real_child), priv->real_child);
      priv->real_child = NULL;
    }

  G_OBJECT_CLASS (mnb_fancy_bin_parent_class)->dispose (object);
}
コード例 #7
0
ファイル: st-icon.c プロジェクト: meetparikh7/gnome-shell
static void
st_icon_dispose (GObject *gobject)
{
  StIconPrivate *priv = ST_ICON (gobject)->priv;

  if (priv->icon_texture)
    {
      clutter_actor_destroy (priv->icon_texture);
      priv->icon_texture = NULL;
    }

  if (priv->pending_texture)
    {
      clutter_actor_destroy (priv->pending_texture);
      g_object_unref (priv->pending_texture);
      priv->pending_texture = NULL;
    }

  g_clear_object (&priv->gicon);
  g_clear_object (&priv->fallback_gicon);
  g_clear_pointer (&priv->shadow_pipeline, cogl_object_unref);
  g_clear_pointer (&priv->shadow_spec, st_shadow_unref);

  G_OBJECT_CLASS (st_icon_parent_class)->dispose (gobject);
}
コード例 #8
0
ファイル: clarity_cover.c プロジェクト: Sprezzatech/gtkpod
/* composite actors should implement destroy(), and inside their
 * implementation destroy any actors they are composed from;
 * in this case, we just destroy the child ClutterBox
 */
void clarity_cover_destroy(ClutterActor *self) {
    ClarityCoverPrivate *priv = CLARITY_COVER_GET_PRIVATE(self);

    if (priv) {
        if (CLUTTER_IS_ACTOR(priv->texture)) {
            clutter_actor_destroy(priv->texture);
            priv->texture = NULL;
        }

        if (CLUTTER_IS_ACTOR(priv->reflection)) {
            clutter_actor_destroy(priv->reflection);
            priv->reflection = NULL;
        }

        if (G_IS_OBJECT(priv->rotateBehaviour))
            priv->rotateBehaviour = NULL;
    }

    /* chain up to destroy() on the parent ClutterActorClass;
     * note that we check the parent class has a destroy() implementation
     * before calling it
     */
    if (CLUTTER_ACTOR_CLASS(clarity_cover_parent_class)->destroy)
        CLUTTER_ACTOR_CLASS(clarity_cover_parent_class)->destroy(self);
}
コード例 #9
0
ファイル: text-box.c プロジェクト: tydaikho/xfdashboard
/* Destroy this actor */
static void _xfdashboard_text_box_destroy(ClutterActor *self)
{
	/* Destroy each child actor when this actor is destroyed */
	XfdashboardTextBoxPrivate	*priv=XFDASHBOARD_TEXT_BOX(self)->priv;

	if(priv->actorTextBox)
	{
		clutter_actor_destroy(CLUTTER_ACTOR(priv->actorTextBox));
		priv->actorTextBox=NULL;
	}

	if(priv->actorHintLabel)
	{
		clutter_actor_destroy(CLUTTER_ACTOR(priv->actorHintLabel));
		priv->actorHintLabel=NULL;
	}

	if(priv->actorPrimaryIcon)
	{
		clutter_actor_destroy(CLUTTER_ACTOR(priv->actorPrimaryIcon));
		priv->actorPrimaryIcon=NULL;
	}

	if(priv->actorSecondaryIcon)
	{
		clutter_actor_destroy(CLUTTER_ACTOR(priv->actorSecondaryIcon));
		priv->actorSecondaryIcon=NULL;
	}

	/* Call parent's class destroy method */
	CLUTTER_ACTOR_CLASS(xfdashboard_text_box_parent_class)->destroy(self);
}
コード例 #10
0
ファイル: plugin.c プロジェクト: bighead85/budgie-desktop
static void
on_switch_workspace_effect_complete (ClutterTimeline *timeline, gpointer data)
{
  MetaPlugin               *plugin  = META_PLUGIN (data);
  MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
  MetaScreen *screen = meta_plugin_get_screen (plugin);
  GList *l = meta_get_window_actors (screen);

  while (l)
    {
      ClutterActor *a = l->data;
      MetaWindowActor *window_actor = META_WINDOW_ACTOR (a);
      ActorPrivate *apriv = get_actor_private (window_actor);

      if (apriv->orig_parent)
        {
          clutter_actor_reparent (a, apriv->orig_parent);
          apriv->orig_parent = NULL;
        }

      l = l->next;
    }

  clutter_actor_destroy (priv->desktop1);
  clutter_actor_destroy (priv->desktop2);

  priv->tml_switch_workspace1 = NULL;
  priv->tml_switch_workspace2 = NULL;
  priv->desktop1 = NULL;
  priv->desktop2 = NULL;

  meta_plugin_switch_workspace_completed (plugin);
}
コード例 #11
0
ファイル: st-icon.c プロジェクト: Ak-/Cinnamon
static void
st_icon_update (StIcon *icon)
{
  StIconPrivate *priv = icon->priv;
  StThemeNode *theme_node;
  StTextureCache *cache;

  if (priv->pending_texture)
    {
      clutter_actor_destroy (priv->pending_texture);
      g_object_unref (priv->pending_texture);
      priv->pending_texture = NULL;
      priv->opacity_handler_id = 0;
    }

  theme_node = st_widget_peek_theme_node (ST_WIDGET (icon));
  if (theme_node == NULL)
    return;

  cache = st_texture_cache_get_default ();
  if (priv->gicon)
    {
      priv->pending_texture = st_texture_cache_load_gicon (cache,
                                                           (priv->icon_type != ST_ICON_APPLICATION &&
                                                            priv->icon_type != ST_ICON_DOCUMENT) ?
                                                           theme_node : NULL,
                                                           priv->gicon,
                                                           priv->icon_size);
    }
 else if (priv->icon_name)
    {
      priv->pending_texture = st_texture_cache_load_icon_name (cache,
                                                               theme_node,
                                                               priv->icon_name,
                                                               priv->icon_type,
                                                               priv->icon_size);
    }

  if (priv->pending_texture)
    {
      g_object_ref_sink (priv->pending_texture);

      if (clutter_actor_get_opacity (priv->pending_texture) != 0 || priv->icon_texture == NULL)
        {
          /* This icon is ready for showing, or nothing else is already showing */
          st_icon_finish_update (icon);
        }
      else
        {
          /* Will be shown when fully loaded */
          priv->opacity_handler_id = g_signal_connect (priv->pending_texture, "notify::opacity", G_CALLBACK (opacity_changed_cb), icon);
        }
    }
  else if (priv->icon_texture)
    {
      clutter_actor_destroy (priv->icon_texture);
      priv->icon_texture = NULL;
    }
}
コード例 #12
0
ファイル: slider.c プロジェクト: foolswood/cluttered
static void slider_destroy(ClutterActor *self) {
    SliderPrivate *priv = SLIDER(self)->priv;

    if (priv->box) {
        clutter_actor_destroy(priv->box);
        priv->box = NULL;
        clutter_actor_destroy(priv->handle);
        priv->handle = NULL;
    }

    if (CLUTTER_ACTOR_CLASS(slider_parent_class)->destroy)
        CLUTTER_ACTOR_CLASS(slider_parent_class)->destroy(self);
}
コード例 #13
0
static void
mex_content_box_dispose (GObject *object)
{
  MexContentBoxPrivate *priv = MEX_CONTENT_BOX (object)->priv;

  if (priv->content)
    {
      g_object_unref (priv->content);
      priv->content = NULL;
    }

  if (priv->context)
    {
      g_object_unref (priv->context);
      priv->context = NULL;
    }

  if (priv->tile)
    {
      clutter_actor_destroy (priv->tile);
      priv->tile = NULL;
    }

  if (priv->action_list)
    {
      clutter_actor_destroy (priv->action_list);
      priv->action_list = NULL;
    }

  if (priv->info_panel)
    {
      clutter_actor_destroy (priv->info_panel);
      priv->info_panel = NULL;
    }

  if (priv->timeline)
    {
      g_object_unref (priv->timeline);
      priv->timeline = NULL;
    }

  if (priv->alpha)
    {
      g_object_unref (priv->alpha);
      priv->alpha = NULL;
    }

  G_OBJECT_CLASS (mex_content_box_parent_class)->dispose (object);
}
コード例 #14
0
static void
data_device_end_drag_grab (MetaWaylandDragGrab *drag_grab)
{
  if (drag_grab->drag_origin)
    {
      drag_grab->drag_origin = NULL;
      wl_list_remove (&drag_grab->drag_origin_listener.link);
    }

  if (drag_grab->drag_surface)
    {
      drag_grab->drag_surface = NULL;
      wl_list_remove (&drag_grab->drag_icon_listener.link);
    }

  if (drag_grab->drag_data_source)
    {
      drag_grab->drag_data_source->has_target = FALSE;
      wl_list_remove (&drag_grab->drag_data_source_listener.link);
    }

  if (drag_grab->feedback_actor)
    {
      clutter_actor_remove_all_children (drag_grab->feedback_actor);
      clutter_actor_destroy (drag_grab->feedback_actor);
    }

  drag_grab->seat->data_device.current_grab = NULL;

  drag_grab_focus (&drag_grab->generic, NULL);

  meta_wayland_pointer_end_grab (drag_grab->generic.pointer);
  g_slice_free (MetaWaylandDragGrab, drag_grab);
}
コード例 #15
0
ファイル: mex-tile.c プロジェクト: frankopt/media-explorer
void
mex_tile_set_secondary_icon (MexTile      *tile,
                             ClutterActor *icon)
{
  MexTilePrivate *priv;

  g_return_if_fail (MEX_IS_TILE (tile));
  g_return_if_fail (!icon || CLUTTER_IS_ACTOR (icon));

  priv = tile->priv;
  if (priv->icon2 != icon)
    {
      if (priv->icon2)
        clutter_actor_destroy (priv->icon2);

      if (icon)
        {
          clutter_actor_push_internal (CLUTTER_ACTOR (tile));
          clutter_actor_set_parent (icon, CLUTTER_ACTOR (tile));
          clutter_actor_pop_internal (CLUTTER_ACTOR (tile));
        }

      priv->icon2 = icon;

      g_object_notify (G_OBJECT (tile), "secondary-icon");
    }
}
コード例 #16
0
void
test_cogl_viewport (TestConformSimpleFixture *fixture,
                    gconstpointer data)
{
  guint idle_source;
  ClutterActor *stage;

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

  /* We force continuous redrawing of the stage, since we need to skip
   * the first few frames, and we wont be doing anything else that
   * will trigger redrawing. */
  idle_source = g_idle_add (queue_redraw, stage);
  g_signal_connect_after (stage, "paint", G_CALLBACK (on_paint), NULL);

  clutter_actor_show (stage);
  clutter_main ();

  g_source_remove (idle_source);

  clutter_actor_destroy (stage);

  if (g_test_verbose ())
    g_print ("OK\n");
}
コード例 #17
0
/**
 * mpl_content_pane_set_header_actor:
 * @self: #MplContentPane
 * @actor: #ClutterActor or %NULL
 *
 * Sets the pane header actor. The header actor is an optional actor inserted
 * into the header and packed from its right edge. It can be used, for example,
 * to add a close button to the pane.
 */
void
mpl_content_pane_set_header_actor (MplContentPane *self,
                                   ClutterActor   *actor)
{
  MplContentPanePrivate *priv = GET_PRIVATE (self);

  g_return_if_fail (MPL_IS_CONTENT_PANE (self));

  if (actor != priv->header_actor)
  {
    if (priv->header_actor)
    {
      clutter_actor_destroy (priv->header_actor);
      priv->header_actor = NULL;
    }

    if (actor)
    {
      clutter_actor_add_child (CLUTTER_ACTOR (priv->header), actor);
      clutter_container_child_set (CLUTTER_CONTAINER (priv->header), actor,
                                   "expand", FALSE,
                                   "x-align", MX_ALIGN_END,
                                   "x-fill", TRUE,
                                   NULL);
      priv->header_actor = actor;
    }

    g_object_notify (G_OBJECT (self), "header-actor");
  }
}
コード例 #18
0
static void
mx_label_dispose (GObject *actor)
{
  MxLabelPrivate *priv = MX_LABEL (actor)->priv;

  if (priv->fade_timeline)
    {
      clutter_timeline_stop (priv->fade_timeline);
      g_object_unref (priv->fade_timeline);
      priv->fade_timeline = NULL;
    }

  if (priv->fade_alpha)
    {
      g_object_unref (priv->fade_alpha);
      priv->fade_alpha = NULL;
    }

  if (priv->label)
    {
      clutter_actor_destroy (priv->label);
      priv->label = NULL;
    }

  G_OBJECT_CLASS (mx_label_parent_class)->dispose (actor);
}
コード例 #19
0
ファイル: context_noya.c プロジェクト: tito/noya
static void manager_event_object_del(unsigned short type, void *userdata, void *data)
{
	tuio_object_t	*o = (tuio_object_t *)data;
	manager_actor_t	*it = NULL;

	for ( it = manager_actors_list.lh_first; it != NULL; it = it->next.le_next )
		if ( it->id == o->s_id )
			break;

	if ( it == NULL )
		return;

	/* unprepare object
	 */
	(*it->scene_actor->mod->object_unprepare)(it->scene_actor->data_mod);

	/* remove clutter actor
	 */
	clutter_actor_destroy(it->clutter_actor);

	/* remove from list
	 */
	LIST_REMOVE(it, next);

	/* free entry
	 */
	free(it);

	atomic_set(&c_scene_changed, 1);
}
コード例 #20
0
static void
champlain_viewport_dispose (GObject *gobject)
{
  ChamplainViewportPrivate *priv = CHAMPLAIN_VIEWPORT (gobject)->priv;

  if (priv->hadjustment)
    {
      champlain_adjustment_interpolate_stop (priv->hadjustment);
      g_object_unref (priv->hadjustment);
      priv->hadjustment = NULL;
    }

  if (priv->vadjustment)
    {
      champlain_adjustment_interpolate_stop (priv->vadjustment);
      g_object_unref (priv->vadjustment);
      priv->vadjustment = NULL;
    }

  if (priv->content_group)
    {
      clutter_actor_destroy (priv->content_group);
      priv->content_group = NULL;
    }

  G_OBJECT_CLASS (champlain_viewport_parent_class)->dispose (gobject);
}
コード例 #21
0
int
main (int     argc,
      char  **argv)
{
  ClutterActor *stage;
  ClutterActor *button;

  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
    {
      g_critical ("Could not initialize Clutter");
      return EXIT_FAILURE;
    }
  /* For the icon-theme only. */
  gtk_init (&argc, &argv);

  stage = clutter_stage_new ();

  button = g_object_new (MPD_TYPE_FOLDER_BUTTON,
                         "label", "Documents",
                         "uri", "file:///home/robsta/Documents",
                         NULL);
  g_signal_connect (button, "clicked",
                    G_CALLBACK (_folder_clicked_cb), NULL);
  clutter_container_add_actor (CLUTTER_CONTAINER (stage), button);

  clutter_actor_show_all (stage);
  clutter_main ();
  clutter_actor_destroy (stage);
  return EXIT_SUCCESS;
}
コード例 #22
0
static void rc_free(void *renderer)
{
	RendererClutter *rc = (RendererClutter *)renderer;
	GtkWidget *widget = gtk_bin_get_child(GTK_BIN(rc->pr));

	rc_remove_pending_updates(rc);

	rc_overlay_free_all(rc);

	if (widget)
		{
		/* widget still exists */
		clutter_actor_destroy(rc->group);
		if (clutter_group_get_n_children(CLUTTER_GROUP(rc->stage)) == 0)
			{
			DEBUG_1("destroy %p", rc->widget);
			/* this was the last user */
			gtk_widget_destroy(rc->widget);
			}
		else
			{
			DEBUG_1("keep %p", rc->widget);
			g_object_unref(G_OBJECT(rc->widget));
			}
		}
	g_free(rc);
}
コード例 #23
0
ファイル: st-icon.c プロジェクト: fanpenggogo/gnome-shel
static void
st_icon_finish_update (StIcon *icon)
{
  StIconPrivate *priv = icon->priv;

  if (priv->icon_texture)
    {
      clutter_actor_destroy (priv->icon_texture);
      priv->icon_texture = NULL;
    }

  if (priv->pending_texture)
    {
      priv->icon_texture = priv->pending_texture;
      priv->pending_texture = NULL;
      clutter_actor_add_child (CLUTTER_ACTOR (icon), priv->icon_texture);

      /* Remove the temporary ref we added */
      g_object_unref (priv->icon_texture);

      st_icon_update_shadow_material (icon);

      /* "pixbuf-change" is actually a misnomer for "texture-changed" */
      g_signal_connect_object (priv->icon_texture, "pixbuf-change",
                               G_CALLBACK (on_pixbuf_changed), icon, 0);
    }
}
コード例 #24
0
ファイル: clutter-group.c プロジェクト: spatulasnout/clutter
static void
clutter_group_dispose (GObject *object)
{
  ClutterGroup *self = CLUTTER_GROUP (object);
  ClutterGroupPrivate *priv = self->priv;

  /* Note: we are careful to consider that destroying children could
   * have the side-effect of destroying other children so
   * priv->children may be modified during clutter_actor_destroy. */
  while (priv->children)
    {
      ClutterActor *child = priv->children->data;
      priv->children = g_list_delete_link (priv->children, priv->children);
      clutter_actor_destroy (child);
    }

  if (priv->layout)
    {
      clutter_layout_manager_set_container (priv->layout, NULL);
      g_object_unref (priv->layout);
      priv->layout = NULL;
    }

  G_OBJECT_CLASS (clutter_group_parent_class)->dispose (object);
}
コード例 #25
0
/* Called when a view was removed to viewpad */
static void _xfdashboard_view_selector_on_view_removed(XfdashboardViewSelector *self,
														XfdashboardView *inView,
														gpointer inUserData)
{
	ClutterActorIter					iter;
	ClutterActor						*child;
	gpointer							view;

	g_return_if_fail(XFDASHBOARD_IS_VIEW_SELECTOR(self));

	/* Iterate through create views and lookup view of given type */
	clutter_actor_iter_init(&iter, CLUTTER_ACTOR(self));
	while(clutter_actor_iter_next(&iter, &child))
	{
		/* Check if child is a button otherwise continue iterating */
		if(!XFDASHBOARD_IS_TOGGLE_BUTTON(child)) continue;

		/* If button has reference to view destroy it */
		view=g_object_get_data(G_OBJECT(child), "view");
		if(XFDASHBOARD_IS_VIEW(view) && XFDASHBOARD_VIEW(view)==inView)
		{
			clutter_actor_destroy(child);
		}
	}
}
コード例 #26
0
ファイル: live-workspace.c プロジェクト: tydaikho/xfdashboard
/* A window's workspace has changed */
static void _xfdashboard_live_workspace_on_window_workspace_changed(XfdashboardLiveWorkspace *self,
																	XfdashboardWindowTrackerWindow *inWindow,
																	XfdashboardWindowTrackerWorkspace *inWorkspace,
																	gpointer inUserData)
{
	XfdashboardLiveWorkspacePrivate		*priv;
	ClutterActor						*windowActor;

	g_return_if_fail(XFDASHBOARD_IS_LIVE_WORKSPACE(self));
	g_return_if_fail(XFDASHBOARD_IS_WINDOW_TRACKER_WINDOW(inWindow));

	priv=self->priv;

	/* Check if window was removed from workspace or added */
	if(inWorkspace!=priv->workspace)
	{
		/* Find actor for window */
		windowActor=_xfdashboard_live_workspace_find_by_window(self, inWindow);

		/* Destroy window actor */
		if(windowActor) clutter_actor_destroy(windowActor);
	}
		else
		{
			/* Add window actor */
			_xfdashboard_live_workspace_create_and_add_window_actor(self, inWindow);
		}
}
コード例 #27
0
void
test_realized (TestConformSimpleFixture *fixture,
               gconstpointer             data)
{
  ClutterActor *actor;
  ClutterActor *stage;

  stage = clutter_stage_get_default ();

  actor = clutter_rectangle_new ();

  g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor)));

  clutter_actor_hide (actor); /* don't show, so won't map */
  clutter_container_add_actor (CLUTTER_CONTAINER (stage),
                               actor);
  clutter_actor_realize (actor);

  g_assert (CLUTTER_ACTOR_IS_REALIZED (actor));

  g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor)));
  g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor)));

  clutter_actor_destroy (actor);
}
コード例 #28
0
void
test_cogl_multitexture (TestConformSimpleFixture *fixture,
                        gconstpointer data)
{
  TestState state;
  ClutterActor *stage;
  ClutterActor *group;
  guint idle_source;

  stage = clutter_stage_new ();

  clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);

  group = clutter_group_new ();
  clutter_container_add_actor (CLUTTER_CONTAINER (stage), group);

  /* We force continuous redrawing incase someone comments out the
   * clutter_main_quit and wants visual feedback for the test since we
   * wont be doing anything else that will trigger redrawing. */
  idle_source = clutter_threads_add_idle (queue_redraw, stage);

  g_signal_connect (group, "paint", G_CALLBACK (on_paint), &state);

  clutter_actor_show_all (stage);

  clutter_main ();

  g_source_remove (idle_source);

  clutter_actor_destroy (stage);

  if (g_test_verbose ())
    g_print ("OK\n");
}
コード例 #29
0
ファイル: mnb-statusbar.c プロジェクト: xclaesse/dawati-shell
static void
mnb_statusbar_dispose (GObject *object)
{
  MnbStatusbarPrivate *priv = MNB_STATUSBAR (object)->priv;

  if (priv->timeout_id)
    {
      g_source_remove (priv->timeout_id);
      priv->timeout_id = 0;
    }

  if (priv->trigger_timeout_id)
    {
      g_source_remove (priv->trigger_timeout_id);
      priv->trigger_timeout_id = 0;
    }

  if (priv->datetime)
    {
      clutter_actor_destroy (priv->datetime);
      priv->datetime = NULL;
    }

  G_OBJECT_CLASS (mnb_statusbar_parent_class)->dispose (object);
}
コード例 #30
0
static void
mnp_clock_tile_drag_begin (MxDraggable *draggable, gfloat event_x, gfloat event_y, gint event_button, ClutterModifierType  modifiers)
{
	ClutterActor *self = CLUTTER_ACTOR (draggable);
	ClutterActor *stage = clutter_actor_get_stage (self);
	gfloat orig_x, orig_y;
	MnpClockTile *tile = (MnpClockTile *)draggable;
	gfloat width, height;
	MnpClockTilePriv *priv = tile->priv;
	clutter_actor_get_size (self, &width, &height);
	
	g_object_ref (self);

	if (priv->clone)
		clutter_actor_destroy (priv->clone);
	
	priv->clone = clutter_clone_new (self);

	tile->priv->depth = clutter_actor_get_depth (self);
	clutter_actor_get_transformed_position (self, &orig_x, &orig_y);
	//clutter_actor_reparent (self, stage);
	//clutter_actor_set_size (self, width, -1);
	//clutter_actor_raise_top (self);
	//clutter_actor_set_position (self, orig_x, orig_y);
	
	clutter_container_add_actor (CLUTTER_CONTAINER (stage), priv->clone);
	clutter_actor_set_position (priv->clone, orig_x, orig_y);
	clutter_actor_set_size (priv->clone, width, height);
	
	g_object_unref (self);

	clutter_actor_animate (self, CLUTTER_EASE_OUT_CUBIC, 250,
				"opacity", 0,
				NULL);
}