Commit 39572192 authored by Felipe Borges's avatar Felipe Borges 👣

frdp-session, display: Add frdp_display_get_pixbuf()

Returns a GdkPixbuf with the current surface image converted to an
RGB(A) representation.

This should be used by client applications to get screenshots from
remote guests.
parent d7532ad0
......@@ -457,3 +457,19 @@ frdp_display_authenticate (FrdpDisplay *self,
return klass->authenticate (self, username, password, domain);
}
/**
* frdp_display_get_pixbuf:
* @display: (transfer none): the RDP display widget
*
* Take a screenshot of the display.
*
* Returns: (transfer full): a #GdkPixbuf with the screenshot image buffer
*/
GdkPixbuf *
frdp_display_get_pixbuf (FrdpDisplay *display)
{
FrdpDisplayPrivate *priv = frdp_display_get_instance_private (display);
return frdp_session_get_pixbuf (priv->session);
}
......@@ -54,4 +54,6 @@ gboolean frdp_display_authenticate (FrdpDisplay *self,
gchar **password,
gchar **domain);
GdkPixbuf *frdp_display_get_pixbuf (FrdpDisplay *display);
G_END_DECLS
......@@ -707,3 +707,16 @@ frdp_session_send_key (FrdpSession *self,
input->KeyboardEvent (input, flags, scancode);
}
GdkPixbuf *
frdp_session_get_pixbuf (FrdpSession *self)
{
guint width, height;
width = gtk_widget_get_allocated_width (self->priv->display);
height = gtk_widget_get_allocated_height (self->priv->display);
return gdk_pixbuf_get_from_surface (self->priv->surface,
0, 0,
width, height);
}
......@@ -81,4 +81,6 @@ void frdp_session_send_key (FrdpSession *self,
FrdpKeyEvent event,
guint16 keycode);
GdkPixbuf *frdp_session_get_pixbuf (FrdpSession *self);
G_END_DECLS
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment