code: Use pub(super) in GObject impl structs
This helps with getting warnings for fields we no longer use Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/143>
This commit is contained in:
parent
f64008b278
commit
889c818c14
4 changed files with 48 additions and 48 deletions
|
|
@ -79,65 +79,65 @@ mod imp {
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct LpImage {
|
pub struct LpImage {
|
||||||
pub file: RefCell<Option<gio::File>>,
|
pub(super) file: RefCell<Option<gio::File>>,
|
||||||
pub path: RefCell<Option<PathBuf>>,
|
pub(super) path: RefCell<Option<PathBuf>>,
|
||||||
pub is_deleted: Cell<bool>,
|
pub(super) is_deleted: Cell<bool>,
|
||||||
/// Track changes to this image
|
/// Track changes to this image
|
||||||
pub file_monitor: RefCell<Option<gio::FileMonitor>>,
|
pub(super) file_monitor: RefCell<Option<gio::FileMonitor>>,
|
||||||
pub tiles: Arc<ArcSwap<tiling::TilingStore>>,
|
pub(super) tiles: Arc<ArcSwap<tiling::TilingStore>>,
|
||||||
pub decoder: RefCell<Option<Arc<Decoder>>>,
|
pub(super) decoder: RefCell<Option<Arc<Decoder>>>,
|
||||||
pub format: RefCell<Option<decoder::ImageFormat>>,
|
pub(super) format: RefCell<Option<decoder::ImageFormat>>,
|
||||||
|
|
||||||
/// Set to true when image is ready for displaying
|
/// Set to true when image is ready for displaying
|
||||||
pub is_loaded: Cell<bool>,
|
pub(super) is_loaded: Cell<bool>,
|
||||||
/// Set if an error has occurred, shown on error_page
|
/// Set if an error has occurred, shown on error_page
|
||||||
pub error: RefCell<Option<String>>,
|
pub(super) error: RefCell<Option<String>>,
|
||||||
|
|
||||||
/// Rotation final value (can differ from `rotation` during animation)
|
/// Rotation final value (can differ from `rotation` during animation)
|
||||||
pub rotation_target: Cell<f64>,
|
pub(super) rotation_target: Cell<f64>,
|
||||||
/// Rotated presentation of original image in degrees clockwise
|
/// Rotated presentation of original image in degrees clockwise
|
||||||
pub rotation: Cell<f64>,
|
pub(super) rotation: Cell<f64>,
|
||||||
// Animates the `rotation` property
|
// Animates the `rotation` property
|
||||||
pub rotation_animation: OnceCell<adw::TimedAnimation>,
|
pub(super) rotation_animation: OnceCell<adw::TimedAnimation>,
|
||||||
/// Mirrored presentation of original image
|
/// Mirrored presentation of original image
|
||||||
pub mirrored: Cell<bool>,
|
pub(super) mirrored: Cell<bool>,
|
||||||
|
|
||||||
/// Displayed zoom level
|
/// Displayed zoom level
|
||||||
pub zoom: Cell<f64>,
|
pub(super) zoom: Cell<f64>,
|
||||||
pub zoom_animation: OnceCell<adw::TimedAnimation>,
|
pub(super) zoom_animation: OnceCell<adw::TimedAnimation>,
|
||||||
/// Targeted zoom level, might differ from `zoom` when animation is running
|
/// Targeted zoom level, might differ from `zoom` when animation is running
|
||||||
pub zoom_target: Cell<f64>,
|
pub(super) zoom_target: Cell<f64>,
|
||||||
/// Current animation is transitioning from having horizontal scrollbars
|
/// Current animation is transitioning from having horizontal scrollbars
|
||||||
/// to not having them or vice versa.
|
/// to not having them or vice versa.
|
||||||
pub zoom_hscrollbar_transition: Cell<bool>,
|
pub(super) zoom_hscrollbar_transition: Cell<bool>,
|
||||||
/// Same but for vertical
|
/// Same but for vertical
|
||||||
pub zoom_vscrollbar_transition: Cell<bool>,
|
pub(super) zoom_vscrollbar_transition: Cell<bool>,
|
||||||
|
|
||||||
/// Always fit image into window, causes `zoom` to change automatically
|
/// Always fit image into window, causes `zoom` to change automatically
|
||||||
pub best_fit: Cell<bool>,
|
pub(super) best_fit: Cell<bool>,
|
||||||
/// Max zoom level is reached, stored to only send signals on change
|
/// Max zoom level is reached, stored to only send signals on change
|
||||||
pub max_zoom: Cell<bool>,
|
pub(super) max_zoom: Cell<bool>,
|
||||||
|
|
||||||
/// Horizontal scrolling
|
/// Horizontal scrolling
|
||||||
pub hadjustment: RefCell<Option<gtk::Adjustment>>,
|
pub(super) hadjustment: RefCell<Option<gtk::Adjustment>>,
|
||||||
/// Vertical scrolling
|
/// Vertical scrolling
|
||||||
pub vadjustment: RefCell<Option<gtk::Adjustment>>,
|
pub(super) vadjustment: RefCell<Option<gtk::Adjustment>>,
|
||||||
|
|
||||||
/// Currently EXIF data
|
/// Currently EXIF data
|
||||||
pub image_metadata: RefCell<LpImageMetadata>,
|
pub(super) image_metadata: RefCell<LpImageMetadata>,
|
||||||
/// Image dimension details for SVGs
|
/// Image dimension details for SVGs
|
||||||
pub dimension_details: RefCell<decoder::ImageDimensionDetails>,
|
pub(super) dimension_details: RefCell<decoder::ImageDimensionDetails>,
|
||||||
|
|
||||||
/// Current pointer position
|
/// Current pointer position
|
||||||
pub pointer_position: Cell<Option<(f64, f64)>>,
|
pub(super) pointer_position: Cell<Option<(f64, f64)>>,
|
||||||
|
|
||||||
/// Position of fingers during zoom gesture
|
/// Position of fingers during zoom gesture
|
||||||
///
|
///
|
||||||
/// Required for calculating delta when moving window on touchscreen.
|
/// Required for calculating delta when moving window on touchscreen.
|
||||||
/// On touchpad this is only the initial value used as the zoom target.
|
/// On touchpad this is only the initial value used as the zoom target.
|
||||||
pub zoom_gesture_center: Cell<Option<(f64, f64)>>,
|
pub(super) zoom_gesture_center: Cell<Option<(f64, f64)>>,
|
||||||
/// Required for calculating delta while moving window around
|
/// Required for calculating delta while moving window around
|
||||||
pub last_drag_value: Cell<Option<(f64, f64)>>,
|
pub(super) last_drag_value: Cell<Option<(f64, f64)>>,
|
||||||
|
|
||||||
widget_dimensions: Cell<(i32, i32)>,
|
widget_dimensions: Cell<(i32, i32)>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,20 +60,20 @@ mod imp {
|
||||||
pub struct LpImageView {
|
pub struct LpImageView {
|
||||||
/// Direct child of this Adw::Bin
|
/// Direct child of this Adw::Bin
|
||||||
#[template_child]
|
#[template_child]
|
||||||
pub bin_child: TemplateChild<gtk::Widget>,
|
pub(super) bin_child: TemplateChild<gtk::Widget>,
|
||||||
/// overlayed controls
|
/// overlayed controls
|
||||||
#[template_child]
|
#[template_child]
|
||||||
pub controls_box_start: TemplateChild<gtk::Widget>,
|
pub(super) controls_box_start: TemplateChild<gtk::Widget>,
|
||||||
/// overlayed controls
|
/// overlayed controls
|
||||||
#[template_child]
|
#[template_child]
|
||||||
pub controls_box_end: TemplateChild<gtk::Widget>,
|
pub(super) controls_box_end: TemplateChild<gtk::Widget>,
|
||||||
#[template_child]
|
#[template_child]
|
||||||
pub sliding_view: TemplateChild<LpSlidingView>,
|
pub sliding_view: TemplateChild<LpSlidingView>,
|
||||||
|
|
||||||
pub model: RefCell<LpFileModel>,
|
pub(super) model: RefCell<LpFileModel>,
|
||||||
pub preserve_content: Cell<bool>,
|
pub(super) preserve_content: Cell<bool>,
|
||||||
|
|
||||||
pub current_image_signals: OnceCell<glib::SignalGroup>,
|
pub(super) current_image_signals: OnceCell<glib::SignalGroup>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[glib::object_subclass]
|
#[glib::object_subclass]
|
||||||
|
|
|
||||||
|
|
@ -43,13 +43,13 @@ mod imp {
|
||||||
#[derive(Debug, Default, CompositeTemplate)]
|
#[derive(Debug, Default, CompositeTemplate)]
|
||||||
#[template(file = "../../data/gtk/properties_view.ui")]
|
#[template(file = "../../data/gtk/properties_view.ui")]
|
||||||
pub struct LpPropertiesView {
|
pub struct LpPropertiesView {
|
||||||
pub file: RefCell<Option<glib::WeakRef<gio::File>>>,
|
pub(super) file: RefCell<Option<glib::WeakRef<gio::File>>>,
|
||||||
pub image: RefCell<Option<glib::WeakRef<LpImage>>>,
|
pub(super) image: RefCell<Option<glib::WeakRef<LpImage>>>,
|
||||||
|
|
||||||
pub metadata: RefCell<LpImageMetadata>,
|
pub(super) metadata: RefCell<LpImageMetadata>,
|
||||||
|
|
||||||
pub file_info: RefCell<Option<gio::FileInfo>>,
|
pub(super) file_info: RefCell<Option<gio::FileInfo>>,
|
||||||
pub info_handle: RefCell<Option<AbortHandle>>,
|
pub(super) info_handle: RefCell<Option<AbortHandle>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[glib::object_subclass]
|
#[glib::object_subclass]
|
||||||
|
|
|
||||||
|
|
@ -56,25 +56,25 @@ mod imp {
|
||||||
// TemplateChild<T> wrapper, where T is the
|
// TemplateChild<T> wrapper, where T is the
|
||||||
// object type of the template child.
|
// object type of the template child.
|
||||||
#[template_child]
|
#[template_child]
|
||||||
pub flap: TemplateChild<adw::Flap>,
|
pub(super) flap: TemplateChild<adw::Flap>,
|
||||||
#[template_child]
|
#[template_child]
|
||||||
pub headerbar: TemplateChild<gtk::HeaderBar>,
|
pub(super) headerbar: TemplateChild<gtk::HeaderBar>,
|
||||||
#[template_child]
|
#[template_child]
|
||||||
pub properties_button: TemplateChild<gtk::ToggleButton>,
|
pub(super) properties_button: TemplateChild<gtk::ToggleButton>,
|
||||||
#[template_child]
|
#[template_child]
|
||||||
pub menu_button: TemplateChild<gtk::MenuButton>,
|
pub(super) menu_button: TemplateChild<gtk::MenuButton>,
|
||||||
#[template_child]
|
#[template_child]
|
||||||
pub toast_overlay: TemplateChild<adw::ToastOverlay>,
|
pub(super) toast_overlay: TemplateChild<adw::ToastOverlay>,
|
||||||
#[template_child]
|
#[template_child]
|
||||||
pub stack: TemplateChild<gtk::Stack>,
|
pub(super) stack: TemplateChild<gtk::Stack>,
|
||||||
#[template_child]
|
#[template_child]
|
||||||
pub status_page: TemplateChild<adw::StatusPage>,
|
pub(super) status_page: TemplateChild<adw::StatusPage>,
|
||||||
#[template_child]
|
#[template_child]
|
||||||
pub image_view: TemplateChild<LpImageView>,
|
pub(super) image_view: TemplateChild<LpImageView>,
|
||||||
#[template_child]
|
#[template_child]
|
||||||
pub properties_view: TemplateChild<LpPropertiesView>,
|
pub(super) properties_view: TemplateChild<LpPropertiesView>,
|
||||||
#[template_child]
|
#[template_child]
|
||||||
pub drop_target: TemplateChild<gtk::DropTarget>,
|
pub(super) drop_target: TemplateChild<gtk::DropTarget>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[glib::object_subclass]
|
#[glib::object_subclass]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue