Struct gtk4::PrintOperation
source · #[repr(transparent)]pub struct PrintOperation { /* private fields */ }
Expand description
PrintOperation
is the high-level, portable printing API.
It looks a bit different than other GTK dialogs such as the
FileChooser
, since some platforms don’t expose enough
infrastructure to implement a good print dialog. On such
platforms, PrintOperation
uses the native print dialog.
On platforms which do not provide a native print dialog, GTK
uses its own, see PrintUnixDialog
.
The typical way to use the high-level printing API is to create
a PrintOperation
object with new()
when the user selects to print. Then you set some properties on it,
e.g. the page size, any PrintSettings
from previous print
operations, the number of pages, the current page, etc.
Then you start the print operation by calling PrintOperationExt::run()
.
It will then show a dialog, let the user select a printer and options.
When the user finished the dialog, various signals will be emitted on
the PrintOperation
, the main one being
draw-page
, which you are supposed to handle
and render the page on the provided PrintContext
using Cairo.
The high-level printing API
⚠️ The following code is in c ⚠️
static GtkPrintSettings *settings = NULL;
static void
do_print (void)
{
GtkPrintOperation *print;
GtkPrintOperationResult res;
print = gtk_print_operation_new ();
if (settings != NULL)
gtk_print_operation_set_print_settings (print, settings);
g_signal_connect (print, "begin_print", G_CALLBACK (begin_print), NULL);
g_signal_connect (print, "draw_page", G_CALLBACK (draw_page), NULL);
res = gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
GTK_WINDOW (main_window), NULL);
if (res == GTK_PRINT_OPERATION_RESULT_APPLY)
{
if (settings != NULL)
g_object_unref (settings);
settings = g_object_ref (gtk_print_operation_get_print_settings (print));
}
g_object_unref (print);
}
By default PrintOperation
uses an external application to do
print preview. To implement a custom print preview, an application
must connect to the preview signal. The functions
PrintOperationPreviewExt::render_page()
,
PrintOperationPreviewExt::end_preview()
and
PrintOperationPreviewExt::is_selected()
are useful when implementing a print preview.
Properties
allow-async
Determines whether the print operation may run asynchronously or not.
Some systems don’t support asynchronous printing, but those that do
will return PrintOperationResult::InProgress
as the status, and
emit the done
signal when the operation
is actually done.
The Windows port does not support asynchronous operation at all (this
is unlikely to change). On other platforms, all actions except for
PrintOperationAction::Export
support asynchronous operation.
Readable | Writeable
current-page
The current page in the document.
If this is set before PrintOperationExt::run()
,
the user will be able to select to print only the current page.
Note that this only makes sense for pre-paginated documents.
Readable | Writeable
custom-tab-label
Used as the label of the tab containing custom widgets.
Note that this property may be ignored on some platforms.
If this is None
, GTK uses a default label.
Readable | Writeable
default-page-setup
The PageSetup
used by default.
This page setup will be used by PrintOperationExt::run()
,
but it can be overridden on a per-page basis by connecting
to the request-page-setup
signal.
Readable | Writeable
embed-page-setup
If true
, page size combo box and orientation combo box
are embedded into page setup page.
Readable | Writeable
export-filename
The name of a file to generate instead of showing the print dialog.
Currently, PDF is the only supported format.
The intended use of this property is for implementing “Export to PDF” actions.
“Print to PDF” support is independent of this and is done by letting the user pick the “Print to PDF” item from the list of printers in the print dialog.
Readable | Writeable
has-selection
Determines whether there is a selection in your application.
This can allow your application to print the selection. This is typically used to make a “Selection” button sensitive.
Readable | Writeable
job-name
A string used to identify the job (e.g. in monitoring applications like eggcups).
If you don’t set a job name, GTK picks a default one by numbering successive print jobs.
Readable | Writeable
n-pages
The number of pages in the document.
This must be set to a positive number before the rendering
starts. It may be set in a begin-print
signal handler.
Note that the page numbers passed to the
request-page-setup
and
draw-page
signals are 0-based, i.e.
if the user chooses to print all pages, the last ::draw-page signal
will be for page @n_pages - 1.
Readable | Writeable
n-pages-to-print
The number of pages that will be printed.
Note that this value is set during print preparation phase
(PrintStatus::Preparing
), so this value should never be
get before the data generation phase (PrintStatus::GeneratingData
).
You can connect to the status-changed
signal
and call PrintOperationExt::n_pages_to_print()
when
print status is PrintStatus::GeneratingData
.
This is typically used to track the progress of print operation.
Readable
print-settings
The PrintSettings
used for initializing the dialog.
Setting this property is typically used to re-establish
print settings from a previous print operation, see
PrintOperationExt::run()
.
Readable | Writeable
show-progress
Determines whether to show a progress dialog during the print operation.
Readable | Writeable
status
The status of the print operation.
Readable
status-string
A string representation of the status of the print operation.
The string is translated and suitable for displaying the print
status e.g. in a Statusbar
.
See the status
property for a status
value that is suitable for programmatic use.
Readable
support-selection
If true
, the print operation will support print of selection.
This allows the print dialog to show a “Selection” button.
Readable | Writeable
track-print-status
If true
, the print operation will try to continue report on
the status of the print job in the printer queues and printer.
This can allow your application to show things like “out of paper” issues, and when the print job actually reaches the printer. However, this is often implemented using polling, and should not be enabled unless needed.
Readable | Writeable
unit
The transformation for the cairo context obtained from
PrintContext
is set up in such a way that distances
are measured in units of @unit.
Readable | Writeable
use-full-page
If true
, the transformation for the cairo context obtained
from PrintContext
puts the origin at the top left corner
of the page.
This may not be the top left corner of the sheet, depending on page orientation and the number of pages per sheet. Otherwise, the origin is at the top left corner of the imageable area (i.e. inside the margins).
Readable | Writeable
Signals
begin-print
Emitted after the user has finished changing print settings in the dialog, before the actual rendering starts.
A typical use for ::begin-print is to use the parameters from the
PrintContext
and paginate the document accordingly,
and then set the number of pages with
PrintOperationExt::set_n_pages()
.
create-custom-widget
Emitted when displaying the print dialog.
If you return a widget in a handler for this signal it will be added to a custom tab in the print dialog. You typically return a container widget with multiple widgets in it.
The print dialog owns the returned widget, and its lifetime is not
controlled by the application. However, the widget is guaranteed
to stay around until the custom-widget-apply
signal is emitted on the operation. Then you can read out any
information you need from the widgets.
custom-widget-apply
Emitted right before ::begin-print if you added a custom widget in the ::create-custom-widget handler.
When you get this signal you should read the information from the custom widgets, as the widgets are not guaranteed to be around at a later time.
done
Emitted when the print operation run has finished doing everything required for printing.
@result gives you information about what happened during the run.
If @result is PrintOperationResult::Error
then you can call
Gtk::PrintOperation::get_error()
for more information.
If you enabled print status tracking then
PrintOperationExt::is_finished()
may still return false
after the ::done signal was emitted.
draw-page
Emitted for every page that is printed.
The signal handler must render the @page_nr’s page onto the cairo
context obtained from @context using
PrintContext::cairo_context()
.
⚠️ The following code is in c ⚠️
static void
draw_page (GtkPrintOperation *operation,
GtkPrintContext *context,
int page_nr,
gpointer user_data)
{
cairo_t *cr;
PangoLayout *layout;
double width, text_height;
int layout_height;
PangoFontDescription *desc;
cr = gtk_print_context_get_cairo_context (context);
width = gtk_print_context_get_width (context);
cairo_rectangle (cr, 0, 0, width, HEADER_HEIGHT);
cairo_set_source_rgb (cr, 0.8, 0.8, 0.8);
cairo_fill (cr);
layout = gtk_print_context_create_pango_layout (context);
desc = pango_font_description_from_string ("sans 14");
pango_layout_set_font_description (layout, desc);
pango_font_description_free (desc);
pango_layout_set_text (layout, "some text", -1);
pango_layout_set_width (layout, width * PANGO_SCALE);
pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
pango_layout_get_size (layout, NULL, &layout_height);
text_height = (double)layout_height / PANGO_SCALE;
cairo_move_to (cr, width / 2, (HEADER_HEIGHT - text_height) / 2);
pango_cairo_show_layout (cr, layout);
g_object_unref (layout);
}
Use PrintOperationExt::set_use_full_page()
and
PrintOperationExt::set_unit()
before starting the print
operation to set up the transformation of the cairo context
according to your needs.
end-print
Emitted after all pages have been rendered.
A handler for this signal can clean up any resources that have
been allocated in the begin-print
handler.
paginate
Emitted after the ::begin-print signal, but before the actual rendering starts.
It keeps getting emitted until a connected signal handler returns true
.
The ::paginate signal is intended to be used for paginating a document
in small chunks, to avoid blocking the user interface for a long
time. The signal handler should update the number of pages using
PrintOperationExt::set_n_pages()
, and return true
if the document
has been completely paginated.
If you don’t need to do pagination in chunks, you can simply do it all in the ::begin-print handler, and set the number of pages from there.
preview
Gets emitted when a preview is requested from the native dialog.
The default handler for this signal uses an external viewer application to preview.
To implement a custom print preview, an application must return
true
from its handler for this signal. In order to use the
provided @context for the preview implementation, it must be
given a suitable cairo context with
PrintContext::set_cairo_context()
.
The custom preview implementation can use
PrintOperationPreviewExt::is_selected()
and
PrintOperationPreviewExt::render_page()
to find pages which
are selected for print and render them. The preview must be
finished by calling PrintOperationPreviewExt::end_preview()
(typically in response to the user clicking a close button).
request-page-setup
Emitted once for every page that is printed.
This gives the application a chance to modify the page setup. Any changes done to @setup will be in force only for printing this page.
status-changed
Emitted at between the various phases of the print operation.
See PrintStatus
for the phases that are being discriminated.
Use PrintOperationExt::status()
to find out the current
status.
update-custom-widget
Emitted after change of selected printer.
The actual page setup and print settings are passed to the custom widget, which can actualize itself according to this change.
PrintOperationPreview
got-page-size
Emitted once for each page that gets rendered to the preview.
A handler for this signal should update the @context
according to @page_setup and set up a suitable cairo
context, using PrintContext::set_cairo_context()
.
ready
The ::ready signal gets emitted once per preview operation, before the first page is rendered.
A handler for this signal can be used for setup tasks.
Implements
PrintOperationExt
, glib::ObjectExt
, PrintOperationPreviewExt
Implementations§
source§impl PrintOperation
impl PrintOperation
pub const NONE: Option<&'static PrintOperation> = None
sourcepub fn new() -> PrintOperation
pub fn new() -> PrintOperation
sourcepub fn builder() -> PrintOperationBuilder
pub fn builder() -> PrintOperationBuilder
Creates a new builder-pattern struct instance to construct PrintOperation
objects.
This method returns an instance of PrintOperationBuilder
which can be used to create PrintOperation
objects.
Trait Implementations§
source§impl Clone for PrintOperation
impl Clone for PrintOperation
source§impl Debug for PrintOperation
impl Debug for PrintOperation
source§impl Default for PrintOperation
impl Default for PrintOperation
source§impl Display for PrintOperation
impl Display for PrintOperation
source§impl HasParamSpec for PrintOperation
impl HasParamSpec for PrintOperation
type ParamSpec = ParamSpecObject
§type SetValue = PrintOperation
type SetValue = PrintOperation
type BuilderFn = fn(_: &str) -> ParamSpecObjectBuilder<'_, PrintOperation>
fn param_spec_builder() -> Self::BuilderFn
source§impl Hash for PrintOperation
impl Hash for PrintOperation
source§impl<T: PrintOperationImpl> IsSubclassable<T> for PrintOperation
impl<T: PrintOperationImpl> IsSubclassable<T> for PrintOperation
source§fn class_init(class: &mut Class<Self>)
fn class_init(class: &mut Class<Self>)
source§fn instance_init(instance: &mut InitializingObject<T>)
fn instance_init(instance: &mut InitializingObject<T>)
source§impl Ord for PrintOperation
impl Ord for PrintOperation
source§impl ParentClassIs for PrintOperation
impl ParentClassIs for PrintOperation
source§impl<OT: ObjectType> PartialEq<OT> for PrintOperation
impl<OT: ObjectType> PartialEq<OT> for PrintOperation
source§impl<OT: ObjectType> PartialOrd<OT> for PrintOperation
impl<OT: ObjectType> PartialOrd<OT> for PrintOperation
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl StaticType for PrintOperation
impl StaticType for PrintOperation
source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Eq for PrintOperation
impl IsA<PrintOperationPreview> for PrintOperation
Auto Trait Implementations§
impl RefUnwindSafe for PrintOperation
impl !Send for PrintOperation
impl !Sync for PrintOperation
impl Unpin for PrintOperation
impl UnwindSafe for PrintOperation
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Cast for Twhere
T: ObjectType,
impl<T> Cast for Twhere T: ObjectType,
source§fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast<T>(self) -> Twhere T: ObjectType, Self: IsA<T>,
T
. Read moresource§fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast_ref<T>(&self) -> &Twhere T: ObjectType, Self: IsA<T>,
T
. Read moresource§fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: MayDowncastTo<T>,
fn downcast<T>(self) -> Result<T, Self>where T: ObjectType, Self: MayDowncastTo<T>,
T
. Read moresource§fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: MayDowncastTo<T>,
fn downcast_ref<T>(&self) -> Option<&T>where T: ObjectType, Self: MayDowncastTo<T>,
T
. Read moresource§fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
fn dynamic_cast<T>(self) -> Result<T, Self>where T: ObjectType,
T
. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while upcast
will do many checks at compile-time already. downcast
will
perform the same checks at runtime as dynamic_cast
, but will also ensure some amount of
compile-time safety. Read moresource§fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
fn dynamic_cast_ref<T>(&self) -> Option<&T>where T: ObjectType,
T
. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast
and upcast
will do many checks at compile-time already. Read moresource§unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
unsafe fn unsafe_cast<T>(self) -> Twhere T: ObjectType,
T
unconditionally. Read moresource§unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere T: ObjectType,
&T
unconditionally. Read moresource§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<O> GObjectPropertyExpressionExt for Owhere
O: IsA<Object>,
impl<O> GObjectPropertyExpressionExt for Owhere O: IsA<Object>,
source§fn property_expression(&self, property_name: &str) -> PropertyExpression
fn property_expression(&self, property_name: &str) -> PropertyExpression
source§fn property_expression_weak(&self, property_name: &str) -> PropertyExpression
fn property_expression_weak(&self, property_name: &str) -> PropertyExpression
source§fn this_expression(property_name: &str) -> PropertyExpression
fn this_expression(property_name: &str) -> PropertyExpression
this
object.source§impl<T> IntoClosureReturnValue for Twhere
T: Into<Value>,
impl<T> IntoClosureReturnValue for Twhere T: Into<Value>,
fn into_closure_return_value(self) -> Option<Value>
source§impl<U> IsSubclassableExt for Uwhere
U: IsClass + ParentClassIs,
impl<U> IsSubclassableExt for Uwhere U: IsClass + ParentClassIs,
fn parent_class_init<T>(class: &mut Class<U>)where T: ObjectSubclass, <U as ParentClassIs>::Parent: IsSubclassable<T>,
fn parent_instance_init<T>(instance: &mut InitializingObject<T>)where T: ObjectSubclass, <U as ParentClassIs>::Parent: IsSubclassable<T>,
source§impl<T> ObjectExt for Twhere
T: ObjectType,
impl<T> ObjectExt for Twhere T: ObjectType,
source§fn is<U>(&self) -> boolwhere
U: StaticType,
fn is<U>(&self) -> boolwhere U: StaticType,
true
if the object is an instance of (can be cast to) T
.source§fn object_class(&self) -> &Class<Object>
fn object_class(&self) -> &Class<Object>
ObjectClass
of the object. Read moresource§fn class_of<U>(&self) -> Option<&Class<U>>where
U: IsClass,
fn class_of<U>(&self) -> Option<&Class<U>>where U: IsClass,
T
. Read moresource§fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where
U: IsInterface,
fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where U: IsInterface,
T
of the object. Read moresource§fn set_property_from_value(&self, property_name: &str, value: &Value)
fn set_property_from_value(&self, property_name: &str, value: &Value)
source§fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
source§fn set_properties_from_value(&self, property_values: &[(&str, Value)])
fn set_properties_from_value(&self, property_values: &[(&str, Value)])
source§fn property<V>(&self, property_name: &str) -> Vwhere
V: for<'b> FromValue<'b> + 'static,
fn property<V>(&self, property_name: &str) -> Vwhere V: for<'b> FromValue<'b> + 'static,
property_name
of the object and cast it to the type V. Read moresource§fn property_value(&self, property_name: &str) -> Value
fn property_value(&self, property_name: &str) -> Value
property_name
of the object. Read moresource§fn property_type(&self, property_name: &str) -> Option<Type>
fn property_type(&self, property_name: &str) -> Option<Type>
property_name
of this object. Read moresource§fn find_property(&self, property_name: &str) -> Option<ParamSpec>
fn find_property(&self, property_name: &str) -> Option<ParamSpec>
ParamSpec
of the property property_name
of this object.source§fn list_properties(&self) -> PtrSlice<ParamSpec>
fn list_properties(&self) -> PtrSlice<ParamSpec>
ParamSpec
of the properties of this object.source§fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
source§unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where
QD: 'static,
unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where QD: 'static,
key
. Read moresource§unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where
QD: 'static,
unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where QD: 'static,
key
. Read moresource§unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where
QD: 'static,
unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where QD: 'static,
key
. Read moresource§unsafe fn set_data<QD>(&self, key: &str, value: QD)where
QD: 'static,
unsafe fn set_data<QD>(&self, key: &str, value: QD)where QD: 'static,
key
. Read moresource§unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where
QD: 'static,
unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where QD: 'static,
key
. Read moresource§unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where
QD: 'static,
unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where QD: 'static,
key
. Read moresource§fn block_signal(&self, handler_id: &SignalHandlerId)
fn block_signal(&self, handler_id: &SignalHandlerId)
source§fn unblock_signal(&self, handler_id: &SignalHandlerId)
fn unblock_signal(&self, handler_id: &SignalHandlerId)
source§fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
source§fn stop_signal_emission_by_name(&self, signal_name: &str)
fn stop_signal_emission_by_name(&self, signal_name: &str)
source§fn connect<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
fn connect<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
signal_name
on this object. Read moresource§fn connect_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
signal_id
on this object. Read moresource§fn connect_local<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value> + 'static,
fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value> + 'static,
signal_name
on this object. Read moresource§fn connect_local_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value> + 'static,
fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value> + 'static,
signal_id
on this object. Read moresource§unsafe fn connect_unsafe<F>(
&self,
signal_name: &str,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value>,
unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value>,
signal_name
on this object. Read moresource§unsafe fn connect_unsafe_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F
) -> SignalHandlerIdwhere
F: Fn(&[Value]) -> Option<Value>,
unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F ) -> SignalHandlerIdwhere F: Fn(&[Value]) -> Option<Value>,
signal_id
on this object. Read moresource§fn connect_closure(
&self,
signal_name: &str,
after: bool,
closure: RustClosure
) -> SignalHandlerId
fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure ) -> SignalHandlerId
signal_name
on this object. Read moresource§fn connect_closure_id(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
closure: RustClosure
) -> SignalHandlerId
fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure ) -> SignalHandlerId
signal_id
on this object. Read moresource§fn watch_closure(&self, closure: &impl AsRef<Closure>)
fn watch_closure(&self, closure: &impl AsRef<Closure>)
closure
to the lifetime of the object. When
the object’s reference count drops to zero, the closure will be
invalidated. An invalidated closure will ignore any calls to
invoke_with_values
, or
invoke
when using Rust closures.source§fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> Rwhere R: TryFromClosureReturnValue,
source§fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
Self::emit
but takes Value
for the arguments.source§fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere R: TryFromClosureReturnValue,
source§fn emit_by_name_with_values(
&self,
signal_name: &str,
args: &[Value]
) -> Option<Value>
fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value] ) -> Option<Value>
source§fn emit_by_name_with_details<R>(
&self,
signal_name: &str,
details: Quark,
args: &[&dyn ToValue]
) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_by_name_with_details<R>( &self, signal_name: &str, details: Quark, args: &[&dyn ToValue] ) -> Rwhere R: TryFromClosureReturnValue,
source§fn emit_by_name_with_details_and_values(
&self,
signal_name: &str,
details: Quark,
args: &[Value]
) -> Option<Value>
fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value] ) -> Option<Value>
source§fn emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue]
) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_with_details<R>( &self, signal_id: SignalId, details: Quark, args: &[&dyn ToValue] ) -> Rwhere R: TryFromClosureReturnValue,
source§fn emit_with_details_and_values(
&self,
signal_id: SignalId,
details: Quark,
args: &[Value]
) -> Option<Value>
fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value] ) -> Option<Value>
source§fn disconnect(&self, handler_id: SignalHandlerId)
fn disconnect(&self, handler_id: SignalHandlerId)
source§fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerIdwhere
F: Fn(&T, &ParamSpec) + Send + Sync + 'static,
fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerIdwhere F: Fn(&T, &ParamSpec) + Send + Sync + 'static,
notify
signal of the object. Read moresource§fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerIdwhere
F: Fn(&T, &ParamSpec) + 'static,
fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerIdwhere F: Fn(&T, &ParamSpec) + 'static,
notify
signal of the object. Read moresource§unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerIdwhere
F: Fn(&T, &ParamSpec),
unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F ) -> SignalHandlerIdwhere F: Fn(&T, &ParamSpec),
notify
signal of the object. Read moresource§fn notify(&self, property_name: &str)
fn notify(&self, property_name: &str)
source§fn notify_by_pspec(&self, pspec: &ParamSpec)
fn notify_by_pspec(&self, pspec: &ParamSpec)
source§fn add_weak_ref_notify<F>(&self, f: F) -> WeakRefNotify<T>where
F: FnOnce() + Send + 'static,
fn add_weak_ref_notify<F>(&self, f: F) -> WeakRefNotify<T>where F: FnOnce() + Send + 'static,
source§fn add_weak_ref_notify_local<F>(&self, f: F) -> WeakRefNotify<T>where
F: FnOnce() + 'static,
fn add_weak_ref_notify_local<F>(&self, f: F) -> WeakRefNotify<T>where F: FnOnce() + 'static,
source§fn bind_property<'f, 't, O, 'a>(
&'a self,
source_property: &'a str,
target: &'a O,
target_property: &'a str
) -> BindingBuilder<'a, 'f, 't>where
O: ObjectType,
fn bind_property<'f, 't, O, 'a>( &'a self, source_property: &'a str, target: &'a O, target_property: &'a str ) -> BindingBuilder<'a, 'f, 't>where O: ObjectType,
source§unsafe fn run_dispose(&self)
unsafe fn run_dispose(&self)
source§impl<O> PrintOperationExt for Owhere
O: IsA<PrintOperation>,
impl<O> PrintOperationExt for Owhere O: IsA<PrintOperation>,
source§fn draw_page_finish(&self)
fn draw_page_finish(&self)
source§fn default_page_setup(&self) -> PageSetup
fn default_page_setup(&self) -> PageSetup
source§fn embeds_page_setup(&self) -> bool
fn embeds_page_setup(&self) -> bool
source§fn has_selection(&self) -> bool
fn has_selection(&self) -> bool
source§fn n_pages_to_print(&self) -> i32
fn n_pages_to_print(&self) -> i32
source§fn print_settings(&self) -> Option<PrintSettings>
fn print_settings(&self) -> Option<PrintSettings>
source§fn status(&self) -> PrintStatus
fn status(&self) -> PrintStatus
source§fn status_string(&self) -> GString
fn status_string(&self) -> GString
source§fn supports_selection(&self) -> bool
fn supports_selection(&self) -> bool
source§fn is_finished(&self) -> bool
fn is_finished(&self) -> bool
source§fn run(
&self,
action: PrintOperationAction,
parent: Option<&impl IsA<Window>>
) -> Result<PrintOperationResult, Error>
fn run( &self, action: PrintOperationAction, parent: Option<&impl IsA<Window>> ) -> Result<PrintOperationResult, Error>
source§fn set_allow_async(&self, allow_async: bool)
fn set_allow_async(&self, allow_async: bool)
source§fn set_current_page(&self, current_page: i32)
fn set_current_page(&self, current_page: i32)
source§fn set_custom_tab_label(&self, label: Option<&str>)
fn set_custom_tab_label(&self, label: Option<&str>)
source§fn set_default_page_setup(&self, default_page_setup: Option<&PageSetup>)
fn set_default_page_setup(&self, default_page_setup: Option<&PageSetup>)
source§fn set_defer_drawing(&self)
fn set_defer_drawing(&self)
source§fn set_embed_page_setup(&self, embed: bool)
fn set_embed_page_setup(&self, embed: bool)
source§fn set_export_filename(&self, filename: impl AsRef<Path>)
fn set_export_filename(&self, filename: impl AsRef<Path>)
PrintOperation
to generate a file instead
of showing the print dialog. Read moresource§fn set_has_selection(&self, has_selection: bool)
fn set_has_selection(&self, has_selection: bool)
source§fn set_job_name(&self, job_name: &str)
fn set_job_name(&self, job_name: &str)
source§fn set_n_pages(&self, n_pages: i32)
fn set_n_pages(&self, n_pages: i32)
source§fn set_print_settings(&self, print_settings: Option<&PrintSettings>)
fn set_print_settings(&self, print_settings: Option<&PrintSettings>)
source§fn set_show_progress(&self, show_progress: bool)
fn set_show_progress(&self, show_progress: bool)
source§fn set_support_selection(&self, support_selection: bool)
fn set_support_selection(&self, support_selection: bool)
PrintOperation
. Read moresource§fn set_track_print_status(&self, track_status: bool)
fn set_track_print_status(&self, track_status: bool)
source§fn set_unit(&self, unit: Unit)
fn set_unit(&self, unit: Unit)
PrintContext
in such a way that distances are measured in
units of @unit. Read moresource§fn set_use_full_page(&self, full_page: bool)
fn set_use_full_page(&self, full_page: bool)
true
, the transformation for the cairo context
obtained from PrintContext
puts the origin at the top left
corner of the page. Read moresource§fn allows_async(&self) -> bool
fn allows_async(&self) -> bool
source§fn current_page(&self) -> i32
fn current_page(&self) -> i32
source§fn custom_tab_label(&self) -> Option<GString>
fn custom_tab_label(&self) -> Option<GString>
source§fn export_filename(&self) -> Option<GString>
fn export_filename(&self) -> Option<GString>
source§fn job_name(&self) -> Option<GString>
fn job_name(&self) -> Option<GString>
source§fn shows_progress(&self) -> bool
fn shows_progress(&self) -> bool
source§fn tracks_print_status(&self) -> bool
fn tracks_print_status(&self) -> bool
source§fn unit(&self) -> Unit
fn unit(&self) -> Unit
PrintContext
is set up in such a way that distances
are measured in units of @unit.source§fn uses_full_page(&self) -> bool
fn uses_full_page(&self) -> bool
true
, the transformation for the cairo context obtained
from PrintContext
puts the origin at the top left corner
of the page. Read more