static void
empathy_rounded_rectangle_update_surface_size (EmpathyRoundedRectangle *self)
{
    clutter_cairo_texture_set_surface_size (CLUTTER_CAIRO_TEXTURE (self),
                                            self->priv->width + self->priv->border_width,
                                            self->priv->height + self->priv->border_width);
}
Beispiel #2
0
static void
pkg_graph_2d_allocation_changed (PkgGraph2d             *graph,
                                 const ClutterActorBox  *box,
                                 ClutterAllocationFlags  flags)
{
	PkgGraph2dPrivate *priv = graph->priv;
	gdouble x0, x1, x2;
	gdouble y0, y1, y2;

	clutter_actor_set_size(priv->texture,
	                       clutter_actor_box_get_width(box),
	                       clutter_actor_box_get_height(box));
	clutter_cairo_texture_set_surface_size(CLUTTER_CAIRO_TEXTURE(priv->texture),
	                                       clutter_actor_box_get_width(box),
	                                       clutter_actor_box_get_height(box));

	if (priv->renderer) {
		pkg_graph_2d_place_child(graph, PKG_RENDERER(priv->renderer));
		pkg_renderer_clear(PKG_RENDERER(priv->renderer));
	}

	pkg_graph_2d_get_primary_extents(graph, &x0, &x1, &x2, &y0, &y1, &y2);
	pkg_scale_set_pixel_range(priv->x_scale, x1, x2);
	pkg_scale_set_pixel_range(priv->y_scale, y2, y1);
	pkg_graph_2d_paint(graph);
}
static void
shell_drawing_area_allocate (ClutterActor          *self,
                             const ClutterActorBox *box,
                             ClutterAllocationFlags flags)
{
  ShellDrawingArea *area = SHELL_DRAWING_AREA (self);
  int width = box->x2 - box->x1;
  int height = box->y2 - box->y1;
  ClutterActorBox child_box;

  /* Chain up directly to ClutterActor to set actor->allocation.  We explicitly skip our parent class
   * ClutterGroup here because we want to override the allocate function. */
  (CLUTTER_ACTOR_CLASS (g_type_class_peek (clutter_actor_get_type ())))->allocate (self, box, flags);

  child_box.x1 = 0;
  child_box.x2 = width;
  child_box.y1 = 0;
  child_box.y2 = height;

  clutter_actor_allocate (CLUTTER_ACTOR (area->priv->texture), &child_box, flags);
  if (width > 0 && height > 0)
    {
      clutter_cairo_texture_set_surface_size (area->priv->texture,
                                              width, height);
      g_signal_emit (G_OBJECT (self), shell_drawing_area_signals[REDRAW], 0,
                     area->priv->texture);
    }
}
Beispiel #4
0
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);
}
ClutterActor *
empathy_rounded_rectangle_new (guint width,
    guint height)
{
  ClutterActor *self;

  self = CLUTTER_ACTOR (g_object_new (EMPATHY_TYPE_ROUNDED_RECTANGLE, NULL));

  clutter_cairo_texture_set_surface_size (CLUTTER_CAIRO_TEXTURE (self),
      width, height);

  empathy_rounded_rectangle_paint (EMPATHY_ROUNDED_RECTANGLE (self));

  return self;
}
Beispiel #6
0
static void
on_box_allocation_changed (ClutterActor           *box,
                           const ClutterActorBox  *allocation,
                           ClutterAllocationFlags  flags,
                           ClutterActor           *background)
{
  gfloat new_width, new_height;

  clutter_actor_box_get_size (allocation, &new_width, &new_height);
  clutter_cairo_texture_set_surface_size (CLUTTER_CAIRO_TEXTURE (background),
                                          new_width,
                                          new_height);

  update_background (background, &bg_color, new_width, new_height);
}
Beispiel #7
0
void ease_welcome_actor_set_slide_size (EaseWelcomeActor* self, gint w, gint h) {
#line 240 "ease-welcome-actor.c"
	GError * _inner_error_ = NULL;
#line 150 "ease-welcome-actor.vala"
	g_return_if_fail (self != NULL);
#line 153 "ease-welcome-actor.vala"
	clutter_cairo_texture_set_surface_size (self->priv->slide_actor, (guint) w, (guint) h);
#line 246 "ease-welcome-actor.c"
	{
		EaseSlide* slide;
		cairo_t* _tmp0_;
#line 158 "ease-welcome-actor.vala"
		slide = ease_welcome_actor_create_slide (self, w, h);
#line 159 "ease-welcome-actor.vala"
		ease_slide_cairo_render_sized (slide, _tmp0_ = clutter_cairo_texture_create (self->priv->slide_actor), w, h, &_inner_error_);
#line 254 "ease-welcome-actor.c"
		_cairo_destroy0 (_tmp0_);
		if (_inner_error_ != NULL) {
			_g_object_unref0 (slide);
			goto __catch20_g_error;
		}
		_g_object_unref0 (slide);
	}
	goto __finally20;
	__catch20_g_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		{
#line 163 "ease-welcome-actor.vala"
			g_critical (_ ("Error rendering preview: %s"), e->message);
#line 271 "ease-welcome-actor.c"
			_g_error_free0 (e);
		}
	}
	__finally20:
	if (_inner_error_ != NULL) {
		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;
	}
}