Commit 34658913 authored by Christopher Davis's avatar Christopher Davis 🌱

api: Regenerate docs

parent 82c8bbf2
......@@ -33,13 +33,28 @@ impl Animation {
pub const NONE_ANIMATION: Option<&Animation> = None;
/// Trait containing all `Animation` methods.
///
/// # Implementors
///
/// [`Animation`](struct.Animation.html)
pub trait AnimationExt: 'static {
//fn add_property(&self, pspec: /*Ignored*/&glib::ParamSpec, value: &glib::Value);
/// Start the animation. When the animation stops, the internal reference will
/// be dropped and the animation may be finalized.
///
/// Side effects: None.
fn start(&self);
/// Stops a running animation. The internal reference to the animation is
/// dropped and therefore may cause the object to finalize.
///
/// As a convenience, this function accepts `None` for `self` but
/// does nothing if that should occur.
fn stop(&self);
/// The "tick" signal is emitted on each frame in the animation.
fn connect_tick<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
......
......@@ -31,18 +31,63 @@ glib_wrapper! {
pub const NONE_APPLICATION: Option<&Application> = None;
/// Trait containing all `Application` methods.
///
/// # Implementors
///
/// [`Application`](struct.Application.html)
pub trait ApplicationExt: 'static {
/// This adds `resource_path` to the list of "automatic resources".
///
/// If `resource_path` starts with "resource://", then the corresponding
/// `GResources` path will be searched for resources. Otherwise, `resource_path`
/// should be a path to a location on disk.
///
/// The `Application` will locate resources such as CSS themes, icons, and
/// keyboard shortcuts using `resource_path`.
/// ## `resource_path`
/// the location of the resources.
fn add_resources(&self, resource_path: &str);
/// Similar to `gtk::ApplicationExt::get_menu_by_id` but takes into account
/// menu merging which could have occurred upon loading plugins.
/// ## `menu_id`
/// the id of the menu to locate
///
/// # Returns
///
/// A `gio::Menu`
fn get_menu_by_id(&self, menu_id: &str) -> Option<gio::Menu>;
/// Gets the menu manager for the application.
///
/// Feature: `v3_26`
///
///
/// # Returns
///
/// A `MenuManager`
#[cfg(any(feature = "v3_26", feature = "dox"))]
fn get_menu_manager(&self) -> Option<MenuManager>;
/// Gets the `ShortcutManager` for the application.
///
/// # Returns
///
/// A `ShortcutManager`
fn get_shortcut_manager(&self) -> Option<ShortcutManager>;
/// Get the theme manager for the application.
///
/// # Returns
///
/// A `ThemeManager`
fn get_theme_manager(&self) -> Option<ThemeManager>;
/// This attempts to undo as many side-effects as possible from a call to
/// `ApplicationExt::add_resources`.
/// ## `resource_path`
/// the location of the resources.
fn remove_resources(&self, resource_path: &str);
fn get_property_menu_manager(&self) -> Option<MenuManager>;
......
......@@ -28,21 +28,76 @@ glib_wrapper! {
pub const NONE_APPLICATION_WINDOW: Option<&ApplicationWindow> = None;
/// Trait containing all `ApplicationWindow` methods.
///
/// Feature: `v3_26`
///
/// # Implementors
///
/// [`ApplicationWindow`](struct.ApplicationWindow.html)
pub trait ApplicationWindowExt: 'static {
/// Gets if the window is in the fullscreen state.
///
/// Feature: `v3_26`
///
///
/// # Returns
///
/// `true` if `self` is fullscreen, otherwise `false`.
#[cfg(any(feature = "v3_26", feature = "dox"))]
fn get_fullscreen(&self) -> bool;
/// Gets the titlebar for the window, if there is one.
///
/// Feature: `v3_26`
///
///
/// # Returns
///
/// A `gtk::Widget` or `None`
#[cfg(any(feature = "v3_26", feature = "dox"))]
fn get_titlebar(&self) -> Option<gtk::Widget>;
/// Sets the `ApplicationWindow` into either the fullscreen or unfullscreen
/// state based on `fullscreen`.
///
/// The titlebar for the window is contained within a `gtk::Revealer` which is
/// repurposed as a floating bar when the application is in fullscreen mode.
///
/// See `ApplicationWindowExt::get_fullscreen` to get the current fullscreen
/// state.
///
/// Feature: `v3_26`
///
/// ## `fullscreen`
/// if the window should be in the fullscreen state
#[cfg(any(feature = "v3_26", feature = "dox"))]
fn set_fullscreen(&self, fullscreen: bool);
/// Sets the titlebar for the window.
///
/// Generally, you want to do this from your GTK ui template by setting
/// the &lt;child type="titlebar"&gt;
///
/// Feature: `v3_26`
///
#[cfg(any(feature = "v3_26", feature = "dox"))]
fn set_titlebar<P: IsA<gtk::Widget>>(&self, titlebar: &P);
/// The "fullscreen" property denotes if the window is in the fullscreen
/// state. The titlebar of the `ApplicationWindow` contains a revealer
/// which will be repurposed into a floating bar while the window is in
/// the fullscreen mode.
///
/// Set this property to `false` to unfullscreen.
fn get_property_fullscreen(&self) -> bool;
/// The "fullscreen" property denotes if the window is in the fullscreen
/// state. The titlebar of the `ApplicationWindow` contains a revealer
/// which will be repurposed into a floating bar while the window is in
/// the fullscreen mode.
///
/// Set this property to `false` to unfullscreen.
fn set_property_fullscreen(&self, fullscreen: bool);
fn connect_property_fullscreen_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
......
......@@ -23,6 +23,11 @@ glib_wrapper! {
}
impl BindingGroup {
/// Creates a new `BindingGroup`.
///
/// # Returns
///
/// a new `BindingGroup`
pub fn new() -> BindingGroup {
assert_initialized_main_thread!();
unsafe {
......@@ -39,15 +44,72 @@ impl Default for BindingGroup {
pub const NONE_BINDING_GROUP: Option<&BindingGroup> = None;
/// Trait containing all `BindingGroup` methods.
///
/// # Implementors
///
/// [`BindingGroup`](struct.BindingGroup.html)
pub trait BindingGroupExt: 'static {
/// Creates a binding between `source_property` on the source object
/// and `target_property` on `target`. Whenever the `source_property`
/// is changed the `target_property` is updated using the same value.
/// The binding flags `gobject::BindingFlags::SyncCreate` is automatically specified.
///
/// See: `gobject::ObjectExt::bind_property`.
/// ## `source_property`
/// the property on the source to bind
/// ## `target`
/// the target `gobject::Object`
/// ## `target_property`
/// the property on `target` to bind
/// ## `flags`
/// the flags used to create the `gobject::Binding`
fn bind<P: IsA<glib::Object>>(&self, source_property: &str, target: &P, target_property: &str, flags: glib::BindingFlags);
//fn bind_full<P: IsA<glib::Object>>(&self, source_property: &str, target: &P, target_property: &str, flags: glib::BindingFlags, transform_to: glib::Option<Box<dyn Fn(&glib::Binding, &glib::Value, &glib::Value) -> bool + 'static>>, transform_from: glib::Option<Box<dyn Fn(&glib::Binding, &glib::Value, &glib::Value) -> bool + 'static>>);
/// Creates a binding between `source_property` on the source object and
/// `target_property` on `target`, allowing you to set the transformation
/// functions to be used by the binding. The binding flags
/// `gobject::BindingFlags::SyncCreate` is automatically specified.
///
/// This function is the language bindings friendly version of
/// `dzl_binding_group_bind_property_full`, using `GClosures`
/// instead of function pointers.
///
/// See: `gobject::ObjectExt::bind_property_with_closures`.
/// ## `source_property`
/// the property on the source to bind
/// ## `target`
/// the target `gobject::Object`
/// ## `target_property`
/// the property on `target` to bind
/// ## `flags`
/// the flags used to create the `gobject::Binding`
/// ## `transform_to`
/// a `gobject::Closure` wrapping the
/// transformation function from the source object to the `target`,
/// or `None` to use the default
/// ## `transform_from`
/// a `gobject::Closure` wrapping the
/// transformation function from the `target` to the source object,
/// or `None` to use the default
fn bind_with_closures<P: IsA<glib::Object>>(&self, source_property: &str, target: &P, target_property: &str, flags: glib::BindingFlags, transform_to: Option<&glib::Closure>, transform_from: Option<&glib::Closure>);
/// Gets the source object used for binding properties.
///
/// # Returns
///
/// the source object.
fn get_source(&self) -> Option<glib::Object>;
/// Sets `source` as the source object used for creating property
/// bindings. If there is already a source object all bindings from it
/// will be removed.
///
/// Note: All properties that have been bound must exist on `source`.
/// ## `source`
/// the source `gobject::Object`
fn set_source<P: IsA<glib::Object>>(&self, source: Option<&P>);
fn connect_property_source_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
......
......@@ -25,6 +25,11 @@ glib_wrapper! {
pub const NONE_BOLDING_LABEL: Option<&BoldingLabel> = None;
/// Trait containing all `BoldingLabel` methods.
///
/// # Implementors
///
/// [`BoldingLabel`](struct.BoldingLabel.html)
pub trait BoldingLabelExt: 'static {
fn set_bold(&self, bold: bool);
......
......@@ -39,9 +39,21 @@ impl Default for Box {
pub const NONE_BOX: Option<&Box> = None;
/// Trait containing all `Box` methods.
///
/// # Implementors
///
/// [`Box`](struct.Box.html)
pub trait BoxExt: 'static {
fn get_max_width_request(&self) -> i32;
/// Gets the nth child of `self`.
/// ## `nth`
/// the index of the child starting from 0
///
/// # Returns
///
/// A `gtk::Widget` or `None`
fn get_nth_child(&self, nth: u32) -> Option<gtk::Widget>;
fn set_max_width_request(&self, max_width_request: i32);
......
......@@ -29,6 +29,11 @@ glib_wrapper! {
pub const NONE_BOX_THEATRIC: Option<&BoxTheatric> = None;
/// Trait containing all `BoxTheatric` methods.
///
/// # Implementors
///
/// [`BoxTheatric`](struct.BoxTheatric.html)
pub trait BoxTheatricExt: 'static {
fn get_property_alpha(&self) -> f64;
......
......@@ -42,6 +42,11 @@ impl Default for CenteringBin {
pub const NONE_CENTERING_BIN: Option<&CenteringBin> = None;
/// Trait containing all `CenteringBin` methods.
///
/// # Implementors
///
/// [`CenteringBin`](struct.CenteringBin.html)
pub trait CenteringBinExt: 'static {
fn get_property_max_width_request(&self) -> i32;
......
......@@ -28,6 +28,20 @@ glib_wrapper! {
}
impl ChildPropertyAction {
/// This creates a new `gio::Action` that will change when the underlying child
/// property of `container` changes for `child`.
/// ## `name`
/// the name of the action
/// ## `container`
/// the container of the widget
/// ## `child`
/// the widget for the child property
/// ## `child_property_name`
/// the name of the child property
///
/// # Returns
///
/// A new `ChildPropertyAction`.
pub fn new<P: IsA<gtk::Container>, Q: IsA<gtk::Widget>>(name: &str, container: &P, child: &Q, child_property_name: &str) -> Option<gio::Action> {
assert_initialized_main_thread!();
unsafe {
......@@ -38,6 +52,11 @@ impl ChildPropertyAction {
pub const NONE_CHILD_PROPERTY_ACTION: Option<&ChildPropertyAction> = None;
/// Trait containing all `ChildPropertyAction` methods.
///
/// # Implementors
///
/// [`ChildPropertyAction`](struct.ChildPropertyAction.html)
pub trait ChildPropertyActionExt: 'static {
fn get_property_child(&self) -> Option<gtk::Widget>;
......
......@@ -39,6 +39,11 @@ impl Default for ColumnLayout {
pub const NONE_COLUMN_LAYOUT: Option<&ColumnLayout> = None;
/// Trait containing all `ColumnLayout` methods.
///
/// # Implementors
///
/// [`ColumnLayout`](struct.ColumnLayout.html), [`PreferencesFlowBox`](struct.PreferencesFlowBox.html)
pub trait ColumnLayoutExt: 'static {
fn get_column_spacing(&self) -> i32;
......
......@@ -32,6 +32,11 @@ impl CpuGraph {
pub const NONE_CPU_GRAPH: Option<&CpuGraph> = None;
/// Trait containing all `CpuGraph` methods.
///
/// # Implementors
///
/// [`CpuGraph`](struct.CpuGraph.html)
pub trait CpuGraphExt: 'static {
fn get_property_max_samples(&self) -> u32;
......
......@@ -32,6 +32,11 @@ impl CssProvider {
pub const NONE_CSS_PROVIDER: Option<&CssProvider> = None;
/// Trait containing all `CssProvider` methods.
///
/// # Implementors
///
/// [`CssProvider`](struct.CssProvider.html)
pub trait CssProviderExt: 'static {
fn get_property_base_path(&self) -> Option<GString>;
}
......
......@@ -23,6 +23,13 @@ glib_wrapper! {
}
impl DirectoryModel {
/// Creates a new `DirectoryModel` using `directory` as the directory to monitor.
/// ## `directory`
/// A `gio::File`
///
/// # Returns
///
/// A newly created `DirectoryModel`
pub fn new<P: IsA<gio::File>>(directory: &P) -> Option<gio::ListModel> {
assert_initialized_main_thread!();
unsafe {
......@@ -33,7 +40,17 @@ impl DirectoryModel {
pub const NONE_DIRECTORY_MODEL: Option<&DirectoryModel> = None;
/// Trait containing all `DirectoryModel` methods.
///
/// # Implementors
///
/// [`DirectoryModel`](struct.DirectoryModel.html)
pub trait DirectoryModelExt: 'static {
/// Gets the directory the model is observing.
///
/// # Returns
///
/// A `gio::File`
fn get_directory(&self) -> Option<gio::File>;
fn set_directory<P: IsA<gio::File>>(&self, directory: &P);
......
......@@ -50,6 +50,11 @@ impl Default for DirectoryReaper {
pub const NONE_DIRECTORY_REAPER: Option<&DirectoryReaper> = None;
/// Trait containing all `DirectoryReaper` methods.
///
/// # Implementors
///
/// [`DirectoryReaper`](struct.DirectoryReaper.html)
pub trait DirectoryReaperExt: 'static {
fn add_directory<P: IsA<gio::File>>(&self, directory: &P, min_age: glib::TimeSpan);
......@@ -64,6 +69,14 @@ pub trait DirectoryReaperExt: 'static {
#[cfg(feature = "futures")]
fn execute_async_future(&self) -> Box_<futures_core::Future<Item = (Self, ()), Error = (Self, Error)>> where Self: Sized + Clone;
/// The "remove-file" signal is emitted for each file that is removed by the
/// `DirectoryReaper` instance. This may be useful if you want to show the
/// user what was processed by the reaper.
///
/// Feature: `v3_32`
///
/// ## `file`
/// a `gio::File`
#[cfg(any(feature = "v3_32", feature = "dox"))]
fn connect_remove_file<F: Fn(&Self, &gio::File) + 'static>(&self, f: F) -> SignalHandlerId;
}
......
......@@ -28,6 +28,11 @@ glib_wrapper! {
pub const NONE_DOCK: Option<&Dock> = None;
/// Trait containing all `Dock` methods.
///
/// # Implementors
///
/// [`DockBin`](struct.DockBin.html), [`DockOverlay`](struct.DockOverlay.html), [`DockWindow`](struct.DockWindow.html), [`Dock`](struct.Dock.html)
pub trait DockExt: 'static {
fn get_property_manager(&self) -> Option<DockManager>;
......
......@@ -43,15 +43,41 @@ impl Default for DockBin {
pub const NONE_DOCK_BIN: Option<&DockBin> = None;
/// Trait containing all `DockBin` methods.
///
/// # Implementors
///
/// [`DockBin`](struct.DockBin.html)
pub trait DockBinExt: 'static {
///
/// # Returns
///
/// A `gtk::Widget`
fn get_bottom_edge(&self) -> Option<gtk::Widget>;
/// Gets the center widget for the dock.
///
/// # Returns
///
/// A `gtk::Widget` or `None`.
fn get_center_widget(&self) -> Option<gtk::Widget>;
///
/// # Returns
///
/// A `gtk::Widget`
fn get_left_edge(&self) -> Option<gtk::Widget>;
///
/// # Returns
///
/// A `gtk::Widget`
fn get_right_edge(&self) -> Option<gtk::Widget>;
///
/// # Returns
///
/// A `gtk::Widget`
fn get_top_edge(&self) -> Option<gtk::Widget>;
fn get_property_bottom_visible(&self) -> bool;
......
......@@ -30,6 +30,11 @@ glib_wrapper! {
pub const NONE_DOCK_BIN_EDGE: Option<&DockBinEdge> = None;
/// Trait containing all `DockBinEdge` methods.
///
/// # Implementors
///
/// [`DockBinEdge`](struct.DockBinEdge.html)
pub trait DockBinEdgeExt: 'static {
fn get_edge(&self) -> gtk::PositionType;
......
......@@ -39,7 +39,24 @@ impl Default for DockManager {
pub const NONE_DOCK_MANAGER: Option<&DockManager> = None;
/// Trait containing all `DockManager` methods.
///
/// # Implementors
///
/// [`DockManager`](struct.DockManager.html)
pub trait DockManagerExt: 'static {
/// Requests that the transient grab monitoring stop until
/// `DockManagerExt::unpause_grabs` is called.
///
/// This might be useful while setting up UI so that you don't focus
/// something unexpectedly.
///
/// This function may be called multiple times and after an equivalent
/// number of calls to `DockManagerExt::unpause_grabs`, transient
/// grab monitoring will continue.
///
/// Feature: `v3_26`
///
#[cfg(any(feature = "v3_26", feature = "dox"))]
fn pause_grabs(&self);
......@@ -47,6 +64,13 @@ pub trait DockManagerExt: 'static {
fn release_transient_grab(&self);
/// Unpauses a previous call to `DockManagerExt::pause_grabs`.
///
/// Once the pause count returns to zero, transient grab monitoring
/// will be restored.
///
/// Feature: `v3_26`
///
#[cfg(any(feature = "v3_26", feature = "dox"))]
fn unpause_grabs(&self);
......
......@@ -44,9 +44,26 @@ impl Default for DockOverlay {
pub const NONE_DOCK_OVERLAY: Option<&DockOverlay> = None;
/// Trait containing all `DockOverlay` methods.
///
/// # Implementors
///
/// [`DockOverlay`](struct.DockOverlay.html)
pub trait DockOverlayExt: 'static {
/// ## `position`
/// the edge position.
///
/// # Returns
///
/// The corresponding `DockOverlayEdge`.
fn get_edge(&self, position: gtk::PositionType) -> Option<DockOverlayEdge>;
/// ## `position`
/// the edge position.
///
/// # Returns
///
/// The corresponding `gtk::Adjustment`.
fn get_edge_adjustment(&self, position: gtk::PositionType) -> Option<gtk::Adjustment>;
fn connect_hide_edges<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
......
......@@ -25,6 +25,11 @@ glib_wrapper! {
pub const NONE_DOCK_OVERLAY_EDGE: Option<&DockOverlayEdge> = None;
/// Trait containing all `DockOverlayEdge` methods.
///
/// # Implementors
///
/// [`DockOverlayEdge`](struct.DockOverlayEdge.html)
pub trait DockOverlayEdgeExt: 'static {
fn get_edge(&self) -> gtk::PositionType;
......
......@@ -41,6 +41,11 @@ impl Default for DockRevealer {
pub const NONE_DOCK_REVEALER: Option<&DockRevealer> = None;
/// Trait containing all `DockRevealer` methods.
///
/// # Implementors
///
/// [`DockBinEdge`](struct.DockBinEdge.html), [`DockRevealer`](struct.DockRevealer.html)
pub trait DockRevealerExt: 'static {
fn animate_to_position(&self, position: i32, transition_duration: u32);
......@@ -56,6 +61,13 @@ pub trait DockRevealerExt: 'static {
fn get_transition_type(&self) -> DockRevealerTransitionType;