mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-06-10 02:09:22 +00:00
ea6c59e5e9
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>
42 lines
991 B
Rust
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);
|
|
}
|
|
}
|