gst-plugins-rs/video/gtk4/src/sink/paintable/mod.rs
Jordan Petridis ea6c59e5e9 video/gtk4: Rename Object types and struct to something simpler
Avoid the confusion caused by SinkPaintable and PaintableSink,
and instead refer to the objects as Paintable for the GdkPaintable
subclass or PaintalbeSink for the gst element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/588>
2022-11-29 21:06:12 +02:00

42 lines
991 B
Rust

//
// Copyright (C) 2021 Bilal Elmoussaoui <bil.elmoussaoui@gmail.com>
// Copyright (C) 2021 Jordan Petridis <jordan@centricular.com>
// Copyright (C) 2021 Sebastian Dröge <sebastian@centricular.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License, v2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at
// <https://mozilla.org/MPL/2.0/>.
//
// SPDX-License-Identifier: MPL-2.0
use crate::sink::frame::Frame;
use gtk::subclass::prelude::*;
use gtk::{gdk, glib};
mod imp;
glib::wrapper! {
pub struct Paintable(ObjectSubclass<imp::Paintable>)
@implements gdk::Paintable;
}
impl Paintable {
pub fn new() -> Self {
glib::Object::new(&[])
}
}
impl Default for Paintable {
fn default() -> Self {
Self::new()
}
}
impl Paintable {
pub(crate) fn handle_frame_changed(&self, frame: Option<Frame>) {
let imp = self.imp();
imp.handle_frame_changed(frame);
}
}