Top | ![]() |
![]() |
![]() |
![]() |
void | xdp_portal_prepare_print () |
GVariant * | xdp_portal_prepare_print_finish () |
void | xdp_portal_print_file () |
gboolean | xdp_portal_print_file_finish () |
These functions let applications print.
The underlying portal is org.freedesktop.portal.Print.
void xdp_portal_prepare_print (XdpPortal *portal
,XdpParent *parent
,const char *title
,GVariant *settings
,GVariant *page_setup
,XdpPrintFlags flags
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer data
);
Presents a print dialog to the user and returns print settings and page setup.
When the request is done, callback
will be called. You can then
call xdp_portal_prepare_print_finish()
to get the results.
portal |
||
parent |
parent window information. |
[nullable] |
title |
tile for the print dialog |
|
settings |
Serialized print settings. |
[nullable] |
page_setup |
Serialized page setup. |
[nullable] |
flags |
options for this call |
|
cancellable |
optional GCancellable. |
[nullable] |
callback |
a callback to call when the request is done. |
[scope async] |
data |
data to pass to |
[closure] |
GVariant * xdp_portal_prepare_print_finish (XdpPortal *portal
,GAsyncResult *result
,GError **error
);
Finishes the prepare-print request, and returns GVariant dictionary with the following information:
settings a{sv}
: print settings as set up by the user in the print dialog
page-setup `a{sv}: page setup as set up by the user in the print dialog
token u: a token that can by used in a xdp_portal_print_file()
call to
avoid the print dialog
void xdp_portal_print_file (XdpPortal *portal
,XdpParent *parent
,const char *title
,guint token
,const char *file
,XdpPrintFlags flags
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer data
);
Prints a file.
If a valid token is present in the options
, then this call will print
with the settings from the Print call that the token refers to. If
no token is present, then a print dialog will be presented to the user.
When the request is done, callback
will be called. You can then
call xdp_portal_print_file_finish()
to get the results.
portal |
||
parent |
parent window information. |
[nullable] |
title |
tile for the print dialog |
|
token |
token that was returned by a previous |
|
file |
path of the document to print |
|
flags |
options for this call |
|
cancellable |
optional GCancellable. |
[nullable] |
callback |
a callback to call when the request is done. |
[scope async] |
data |
data to pass to |
[closure] |