当前位置: 首页>>代码示例>>C++>>正文


C++ clutter_actor_get_height函数代码示例

本文整理汇总了C++中clutter_actor_get_height函数的典型用法代码示例。如果您正苦于以下问题:C++ clutter_actor_get_height函数的具体用法?C++ clutter_actor_get_height怎么用?C++ clutter_actor_get_height使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了clutter_actor_get_height函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: tick

static void
tick (ClutterTimeline *timeline,
      gint             msecs,
      gpointer         data)
{
    Flower **flowers = data;
    gint i = 0;

    for (i = 0; i < N_FLOWERS; i++)
    {
        flowers[i]->y   += flowers[i]->v;
        flowers[i]->rot += flowers[i]->rv;

        if (flowers[i]->y > (gint) clutter_actor_get_height (stage))
            flowers[i]->y = -clutter_actor_get_height (flowers[i]->ctex);

        clutter_actor_set_position (flowers[i]->ctex,
                                    flowers[i]->x, flowers[i]->y);

        clutter_actor_set_rotation (flowers[i]->ctex,
                                    CLUTTER_Z_AXIS,
                                    flowers[i]->rot,
                                    clutter_actor_get_width (flowers[i]->ctex)/2,
                                    clutter_actor_get_height (flowers[i]->ctex)/2,
                                    0);
    }
}
开发者ID:jigpu,项目名称:clutter,代码行数:27,代码来源:test-cairo-flowers.c

示例2: clutter_actor_get_width

void Platform::windowSizeChanged (ClutterStage * stage, gpointer data)
{
    Platform* pThis = static_cast<Platform*>(data);
    gfloat stageWidth = clutter_actor_get_width (pThis->m_stage);
    gfloat stageHeight = clutter_actor_get_height (pThis->m_stage);
    gfloat videoTextureWidth = clutter_actor_get_width (pThis->m_videoTexture);
    gfloat videoTextureHeight = clutter_actor_get_height (pThis->m_videoTexture);

    gfloat width = stageWidth;
    gfloat height = stageHeight;
    gfloat stageAspectRatio = stageWidth / stageHeight;
    gfloat videoTextureAspectRatio = videoTextureWidth / videoTextureHeight;

    if(videoTextureAspectRatio > stageAspectRatio) {
        height = stageWidth / videoTextureAspectRatio;
    }
    else {
        width = stageHeight * videoTextureAspectRatio;
    }

    g_print("stage: %f, %f\n", stageWidth, stageHeight);
    g_print("video texture: %f, %f\n", videoTextureWidth, videoTextureHeight);
    clutter_actor_set_size (pThis->m_videoTexture, width, height);
//		clutter_actor_set_position (pThis->m_videoTexture, w / 2,h / 2);

    videoTextureWidth = clutter_actor_get_width (pThis->m_videoTexture);
    videoTextureHeight = clutter_actor_get_height (pThis->m_videoTexture);
    g_print("stage: %f, %f\n", stageWidth, stageHeight);
    g_print("video texture: %f, %f\n", videoTextureWidth, videoTextureHeight);
}
开发者ID:shakin,项目名称:pheobe,代码行数:30,代码来源:Platform.cpp

示例3: show_helper_text_title

static void
show_helper_text_title (CalibArea *area)
{
  ClutterTransition *transition;

  gfloat height = clutter_actor_get_height (area->helper_text_title);
  clutter_actor_set_y (area->helper_text_title,
                       - clutter_actor_get_height (area->helper_text_title));
  clutter_actor_show (area->helper_text_title);

  transition = clutter_property_transition_new ("y");
  clutter_timeline_set_progress_mode (CLUTTER_TIMELINE (transition),
                                      CLUTTER_EASE_OUT);
  clutter_timeline_set_duration (CLUTTER_TIMELINE (transition),
                                 HELP_TEXT_ANIMATION_DURATION);
  clutter_transition_set_animatable (transition,
                                     CLUTTER_ANIMATABLE (area->helper_text_title));
  clutter_transition_set_from (transition, G_TYPE_FLOAT, -height);
  clutter_transition_set_to (transition, G_TYPE_FLOAT, 0.0);

  g_signal_connect (CLUTTER_TIMELINE (transition),
                    "completed",
                    G_CALLBACK (on_helper_text_title_shown),
                    area);

  clutter_timeline_start (CLUTTER_TIMELINE (transition));

  g_clear_object (&area->helper_msg_timeline);
  area->helper_msg_timeline = transition;
}
开发者ID:Amphiboly,项目名称:gnome-control-center,代码行数:30,代码来源:calibrator-gui.c

示例4: test_texture_quality_main

G_MODULE_EXPORT gint
test_texture_quality_main (int argc, char *argv[])
{
  ClutterTimeline  *timeline;
  ClutterAlpha     *alpha;
  ClutterBehaviour *depth_behavior;
  ClutterActor     *stage;
  ClutterActor     *image;
  ClutterColor      stage_color = { 0x12, 0x34, 0x56, 0xff };
  ClutterFog        stage_fog = { 10.0, -50.0 };
  GError           *error;

  clutter_init (&argc, &argv);

  stage = clutter_stage_get_default ();
  clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
  clutter_stage_set_use_fog (CLUTTER_STAGE (stage), TRUE);
  clutter_stage_set_fog (CLUTTER_STAGE (stage), &stage_fog);

  g_signal_connect (stage,
                    "button-press-event", G_CALLBACK (clutter_main_quit),
                    NULL);

  error = NULL;
  image = clutter_texture_new_from_file (argv[1]?argv[1]:"redhand.png", &error);
  if (error)
    g_error ("Unable to load image: %s", error->message);

  if (!argv[1])
    g_print ("Hint: the redhand.png isn't a good test image for this test.\n"
             "This test can take any clutter loadable image as an argument\n");

  /* center the image */
  clutter_actor_set_position (image, 
    (clutter_actor_get_width (stage) - clutter_actor_get_width (image))/2,
    (clutter_actor_get_height (stage) - clutter_actor_get_height (image))/2);
  clutter_container_add (CLUTTER_CONTAINER (stage), image, NULL);

  timeline = clutter_timeline_new (5000);
  g_signal_connect (timeline,
                    "completed", G_CALLBACK (timeline_completed),
                    NULL);

  alpha = clutter_alpha_new_full (timeline, CLUTTER_LINEAR);
  depth_behavior = clutter_behaviour_depth_new (alpha, -2500, 400);
  clutter_behaviour_apply (depth_behavior, image);

  clutter_actor_show (stage);
  clutter_timeline_start (timeline);

  g_timeout_add (10000, change_filter, image);

  clutter_main ();

  g_object_unref (depth_behavior);
  g_object_unref (timeline);

  return EXIT_SUCCESS;
}
开发者ID:Docworld,项目名称:chromiumos,代码行数:59,代码来源:test-texture-quality.c

示例5: test_clip_main

G_MODULE_EXPORT int
test_clip_main (int argc, char **argv)
{
  CallbackData data;
  ClutterActor *stub_actor, *label;
  gchar *file;

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

  data.current_clip.type = CLIP_NONE;
  data.clips = NULL;

  data.stage = clutter_stage_new ();
  clutter_stage_set_title (CLUTTER_STAGE (data.stage), "Clipping");
  g_signal_connect (data.stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);

  stub_actor = clutter_rectangle_new ();
  clutter_container_add (CLUTTER_CONTAINER (data.stage), stub_actor, NULL);

  file = g_build_filename (TESTS_DATADIR, "redhand.png", NULL);
  data.hand = cogl_texture_new_from_file (file,
                                          COGL_TEXTURE_NONE,
                                          COGL_PIXEL_FORMAT_ANY,
                                          NULL);
  g_free (file);

  label = clutter_text_new_with_text ("Sans 12px", instructions);
  clutter_text_set_line_wrap (CLUTTER_TEXT (label), TRUE);
  clutter_actor_set_width (label, clutter_actor_get_width (data.stage) - 310);
  clutter_actor_set_y (label,
                       clutter_actor_get_height (data.stage)
                       - clutter_actor_get_height (label));
  clutter_container_add (CLUTTER_CONTAINER (data.stage), label, NULL);

  g_signal_connect (stub_actor, "paint", G_CALLBACK (on_paint), &data);

  g_signal_connect (data.stage, "button-press-event",
                    G_CALLBACK (on_button_press), &data);
  g_signal_connect (data.stage, "button-release-event",
                    G_CALLBACK (on_button_release), &data);
  g_signal_connect (data.stage, "motion-event",
                    G_CALLBACK (on_motion), &data);
  g_signal_connect (data.stage, "key-press-event",
                    G_CALLBACK (on_key_press), &data);

  clutter_actor_show (data.stage);

  clutter_main ();

  cogl_handle_unref (data.hand);

  free_clips (&data);

  return 0;
}
开发者ID:ChrisCummins,项目名称:clutter,代码行数:56,代码来源:test-clip.c

示例6: size_change

static void
size_change (ClutterStage * stage, UserInterface * ui)
{
  gfloat stage_width, stage_height;
  gfloat new_width, new_height;
  gfloat media_width, media_height;
  gfloat stage_ar, media_ar;

  media_width = clutter_actor_get_width (ui->texture);
  media_height = clutter_actor_get_height (ui->texture);

  stage_width = clutter_actor_get_width (ui->stage);
  stage_height = clutter_actor_get_height (ui->stage);

  ui->stage_width = stage_width;
  ui->stage_height = stage_height;

  stage_ar = stage_width / stage_height;

  new_width = stage_width;
  new_height = stage_height;

  if (media_height > 0.0f && media_width > 0.0f) {
    /* if we're rotated, the media_width and media_height are swapped */
    if (ui->rotated) {
      media_ar = media_height / media_width;
    } else {
      media_ar = media_width / media_height;
    }

    /* calculate new width and height
     * note: when we're done, new_width/new_height should equal media_ar */
    if (media_ar > stage_ar) {
      /* media has wider aspect than stage so use new width as stage width and
       * scale down height */
      new_height = stage_width / media_ar;
    } else {
      new_width = stage_height * media_ar;
    }
  } else {
    g_debug ("Warning: not considering texture dimensions %fx%f\n", media_width,
        media_height);
  }

  clutter_actor_set_size (CLUTTER_ACTOR (ui->texture), new_width, new_height);
  clutter_actor_set_position (CLUTTER_ACTOR (ui->texture), stage_width / 2,
      stage_height / 2);

  update_controls_size (ui);
  center_controls (ui);
  progress_timing (ui);
}
开发者ID:phako,项目名称:snappy,代码行数:52,代码来源:user_interface.c

示例7: _lambda46_

static void _lambda46_ (GObject* _self_, GParamSpec* pspec, EaseSelectionRectangle* self) {
#line 58 "ease-selection-rectangle.vala"
	g_return_if_fail (_self_ != NULL);
#line 58 "ease-selection-rectangle.vala"
	g_return_if_fail (pspec != NULL);
#line 59 "ease-selection-rectangle.vala"
	clutter_actor_set_height ((ClutterActor*) self->priv->left, clutter_actor_get_height ((ClutterActor*) self));
#line 60 "ease-selection-rectangle.vala"
	clutter_actor_set_height ((ClutterActor*) self->priv->right, clutter_actor_get_height ((ClutterActor*) self));
#line 61 "ease-selection-rectangle.vala"
	clutter_actor_set_y ((ClutterActor*) self->priv->bottom, clutter_actor_get_height ((ClutterActor*) self));
#line 115 "ease-selection-rectangle.c"
}
开发者ID:rmujica,项目名称:Nitido,代码行数:13,代码来源:ease-selection-rectangle.c

示例8: on_new_frame

/* rotation */
void
on_new_frame (ClutterTimeline * timeline, gint frame_num, gpointer data)
{
  ClutterActor *rect_actor = CLUTTER_ACTOR (data);
  ClutterActor *texture_actor =
      g_object_get_data (G_OBJECT (timeline), "texture_actor");

  clutter_actor_set_rotation (rect_actor, CLUTTER_Z_AXIS, (gdouble) frame_num,
      clutter_actor_get_width (rect_actor) / 2,
      clutter_actor_get_height (rect_actor) / 2, 0);

  clutter_actor_set_rotation (texture_actor, CLUTTER_Z_AXIS,
      (gdouble) frame_num, clutter_actor_get_width (texture_actor) / 6,
      clutter_actor_get_height (texture_actor) / 6, 0);
}
开发者ID:zsx,项目名称:ossbuild,代码行数:16,代码来源:cluttershare.c

示例9: mex_column_get_allocation

/* MexScrollableContainerInterface */
static void
mex_column_get_allocation (MexScrollableContainer *self,
                           ClutterActor           *child,
                           ClutterActorBox        *box)
{
  MexColumnPrivate *priv = MEX_COLUMN (self)->priv;
  gfloat width, height;
  gfloat child_height;
  gint i;

  box->y1 = 0;

  if (!priv->children)
    return;

  child_height = clutter_actor_get_height (priv->children->data);
  i = g_list_index (priv->children, child);

  if (i >= 0)
    box->y1 += child_height * i;

  clutter_actor_get_size (child, &width, &height);

  box->x1 = 0;
  box->x2 = width;
  box->y2 = box->y1 + height;
}
开发者ID:ocrete,项目名称:media-explorer,代码行数:28,代码来源:mex-column.c

示例10: clarity_cover_set_album_item

void clarity_cover_set_album_item (ClarityCover *self, AlbumItem *item) {
    g_return_if_fail(CLARITY_IS_COVER(self));

    ClarityCoverPrivate *priv = CLARITY_COVER_GET_PRIVATE (self);
    g_return_if_fail(priv);

    GError *error = NULL;
    gint y_offset;

    if (!priv->texture) {
        priv->texture = gtk_clutter_texture_new();
        clutter_container_add_actor(CLUTTER_CONTAINER(self), priv->texture);
    }

    // Set cover artwork
    gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE(priv->texture), item->albumart, &error);
    if (error) {
        g_warning("%s", error->message);
        g_error_free(error);
        return;
    }

    // Add reflection
    if (! priv->reflection) {
        y_offset = clutter_actor_get_height (priv->texture) + V_PADDING;

        priv->reflection = clutter_clone_new (priv->texture);
        clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_X, 0.0));
        clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_Y, y_offset));
        clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_WIDTH, 0.0));
        clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_HEIGHT, 0.0));
        g_signal_connect (priv->reflection,
                       "paint",
                       G_CALLBACK (_clone_paint_cb),
                       NULL);

        clutter_container_add_actor(CLUTTER_CONTAINER(self), priv->reflection);
    }

    ClutterActorBox box;
    gfloat w, h;
    clutter_actor_get_allocation_box (priv->texture, &box);
    clutter_actor_box_get_size (&box, &w, &h);

    if( h > DEFAULT_IMG_SIZE) {
        gfloat temp = w * DEFAULT_IMG_SIZE / h;
        clutter_actor_set_size(priv->texture, temp, DEFAULT_IMG_SIZE);
    }

    // Add title / artist data
    if (priv->title)
        g_free(priv->title);

    priv->title = g_strdup(item->albumname);

    if (priv->artist)
            g_free(priv->artist);

    priv->artist = g_strdup(item->artist);
}
开发者ID:Sprezzatech,项目名称:gtkpod,代码行数:60,代码来源:clarity_cover.c

示例11: _xfdashboard_stage_interface_get_preferred_height

/* Get preferred width/height */
static void _xfdashboard_stage_interface_get_preferred_height(ClutterActor *inActor,
																gfloat inForWidth,
																gfloat *outMinHeight,
																gfloat *outNaturalHeight)
{
	XfdashboardStageInterface			*self=XFDASHBOARD_STAGE_INTERFACE(inActor);
	XfdashboardStageInterfacePrivate	*priv=self->priv;
	gfloat								minHeight, naturalHeight;
	gint								h;
	ClutterActor						 *stage;

	/* Set up default values */
	minHeight=naturalHeight=0.0f;

	/* Get monitor size if available otherwise get stage size */
	if(priv->monitor)
	{
		xfdashboard_window_tracker_monitor_get_geometry(priv->monitor, NULL, NULL, NULL, &h);
		minHeight=naturalHeight=h;
	}
		else
		{
			stage=clutter_actor_get_stage(inActor);
			minHeight=naturalHeight=clutter_actor_get_height(stage);
		}

	/* Store sizes computed */
	if(outMinHeight) *outMinHeight=minHeight;
	if(outNaturalHeight) *outNaturalHeight=naturalHeight;
}
开发者ID:gmc-holle,项目名称:xfdashboard,代码行数:31,代码来源:stage-interface.c

示例12: make_source

ClutterActor *
make_source (void)
{
  ClutterActor *source, *actor;
  GError *error = NULL;
  gchar *file;

  ClutterColor  yellow = {0xff, 0xff, 0x00, 0xff};

  source  = clutter_group_new ();

  file = g_build_filename (TESTS_DATADIR, "redhand.png", NULL);
  actor = clutter_texture_new_from_file (file, &error);
  if (!actor)
    g_error("pixbuf load failed: %s", error ? error->message : "Unknown");

  g_free (file);

  clutter_group_add (source, actor);

  actor = clutter_text_new_with_text ("Sans Bold 50px", "Clutter");

  clutter_text_set_color (CLUTTER_TEXT (actor), &yellow);
  clutter_actor_set_y (actor, clutter_actor_get_height(source) + 5);
  clutter_group_add (source, actor);

  return source;
}
开发者ID:nobled,项目名称:clutter,代码行数:28,代码来源:test-fbo.c

示例13: test_fullscreen_main

G_MODULE_EXPORT int
test_fullscreen_main (int argc, char *argv[])
{
  ClutterActor *stage;

  clutter_init (&argc, &argv);

  stage = clutter_stage_get_default ();
  g_signal_connect (stage,
                    "fullscreen", G_CALLBACK (on_fullscreen),
                    NULL);
  g_signal_connect (stage,
                    "unfullscreen", G_CALLBACK (on_unfullscreen),
                    NULL);

  clutter_stage_set_fullscreen (CLUTTER_STAGE (stage), TRUE);
  clutter_actor_show (stage);

  g_debug ("stage size: %.2fx%.2f, mapped: %s",
           clutter_actor_get_width (stage),
           clutter_actor_get_height (stage),
           CLUTTER_ACTOR_IS_MAPPED (stage) ? "true" : "false");

  g_timeout_add (1000, toggle_fullscreen, NULL);

  clutter_main ();

  return EXIT_SUCCESS;
}
开发者ID:Docworld,项目名称:chromiumos,代码行数:29,代码来源:test-fullscreen.c

示例14: ease_pdf_actor_draw_page

static void ease_pdf_actor_draw_page (EasePdfActor* self) {
#line 415 "ease-pdf-actor.c"
	PopplerPage* page;
	double width;
	double height;
	cairo_t* cr;
	GError * _inner_error_ = NULL;
#line 58 "ease-pdf-actor.vala"
	g_return_if_fail (self != NULL);
#line 61 "ease-pdf-actor.vala"
	page = _g_object_ref0 (poppler_document_get_page (self->priv->doc, self->priv->current_page));
#line 62 "ease-pdf-actor.vala"
	width = (double) 0;
#line 62 "ease-pdf-actor.vala"
	height = (double) 0;
#line 63 "ease-pdf-actor.vala"
	poppler_page_get_size (page, &width, &height);
#line 66 "ease-pdf-actor.vala"
	if (self->priv->texture == NULL) {
#line 433 "ease-pdf-actor.c"
		ClutterCairoTexture* _tmp0_;
		ClutterActor* _tmp1_;
#line 68 "ease-pdf-actor.vala"
		self->priv->texture = (_tmp0_ = g_object_ref_sink ((ClutterCairoTexture*) clutter_cairo_texture_new ((guint) ((gint) width), (guint) ((gint) height))), _g_object_unref0 (self->priv->texture), _tmp0_);
#line 69 "ease-pdf-actor.vala"
		clutter_container_add_actor ((ClutterContainer*) (_tmp1_ = ((EaseActor*) self)->contents, CLUTTER_IS_GROUP (_tmp1_) ? ((ClutterGroup*) _tmp1_) : NULL), (ClutterActor*) self->priv->texture);
#line 71 "ease-pdf-actor.vala"
		clutter_actor_set_width ((ClutterActor*) self->priv->texture, clutter_actor_get_width (((EaseActor*) self)->contents));
#line 72 "ease-pdf-actor.vala"
		clutter_actor_set_height ((ClutterActor*) self->priv->texture, clutter_actor_get_height (((EaseActor*) self)->contents));
#line 74 "ease-pdf-actor.vala"
		g_signal_connect_object ((GObject*) ((EaseActor*) self)->contents, "notify::width", (GCallback) __lambda53__g_object_notify, self, 0);
#line 78 "ease-pdf-actor.vala"
		g_signal_connect_object ((GObject*) ((EaseActor*) self)->contents, "notify::height", (GCallback) __lambda54__g_object_notify, self, 0);
#line 448 "ease-pdf-actor.c"
	} else {
#line 86 "ease-pdf-actor.vala"
		clutter_cairo_texture_set_surface_size (self->priv->texture, (guint) ((gint) width), (guint) ((gint) height));
#line 452 "ease-pdf-actor.c"
	}
#line 90 "ease-pdf-actor.vala"
	clutter_cairo_texture_clear (self->priv->texture);
#line 91 "ease-pdf-actor.vala"
	cr = clutter_cairo_texture_create (self->priv->texture);
#line 92 "ease-pdf-actor.vala"
	ease_background_cairo_render (self->priv->pdf_element->background, cr, (gint) width, (gint) height, ease_document_get_path (ease_slide_get_parent (ease_element_get_parent (((EaseActor*) self)->element))), &_inner_error_);
#line 460 "ease-pdf-actor.c"
	if (_inner_error_ != NULL) {
		_cairo_destroy0 (cr);
		_g_object_unref0 (page);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
#line 94 "ease-pdf-actor.vala"
	poppler_page_render (page, cr);
#line 470 "ease-pdf-actor.c"
	_cairo_destroy0 (cr);
	_g_object_unref0 (page);
}
开发者ID:rmujica,项目名称:Nitido,代码行数:60,代码来源:ease-pdf-actor.c

示例15: _resize_alpha

static void
_resize_alpha (ClutterBehaviour *behave, 
               guint32           alpha,
               AstroContactRow  *row)
{
  AstroContactRowPrivate *priv;
  gfloat factor;
  gint dest_height = ROW_HEIGHT;
  gint current_height, diff_height;

  g_return_if_fail (ASTRO_IS_CONTACT_ROW (row));
  priv = row->priv;

  factor = (gfloat)alpha/CLUTTER_ALPHA_MAX_ALPHA;

  if (priv->active)
    dest_height = (ROW_HEIGHT * 2) + PADDING;

  current_height = clutter_actor_get_height (priv->bg);

  if (current_height > dest_height)
    diff_height = (current_height - dest_height) * -1;
  else
    diff_height = dest_height - current_height;

  clutter_actor_set_height (priv->bg, 
            current_height + ((diff_height * alpha)/CLUTTER_ALPHA_MAX_ALPHA));
} 
开发者ID:UIKit0,项目名称:toys,代码行数:28,代码来源:astro-contact-row.c


注:本文中的clutter_actor_get_height函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。