2021-04-09 12:38:02 +00:00
|
|
|
//
|
|
|
|
// 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
|
|
|
|
|
2021-10-17 17:23:43 +00:00
|
|
|
use crate::sink::frame::Frame;
|
2021-04-09 12:38:02 +00:00
|
|
|
|
|
|
|
use gtk::subclass::prelude::*;
|
|
|
|
use gtk::{gdk, glib};
|
|
|
|
|
|
|
|
mod imp;
|
|
|
|
|
|
|
|
glib::wrapper! {
|
2022-10-27 17:50:40 +00:00
|
|
|
pub struct Paintable(ObjectSubclass<imp::Paintable>)
|
2021-04-09 12:38:02 +00:00
|
|
|
@implements gdk::Paintable;
|
|
|
|
}
|
|
|
|
|
2022-10-27 17:50:40 +00:00
|
|
|
impl Paintable {
|
2021-04-09 12:38:02 +00:00
|
|
|
pub fn new() -> Self {
|
2022-10-07 18:07:48 +00:00
|
|
|
glib::Object::new(&[])
|
2021-04-09 12:38:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-27 17:50:40 +00:00
|
|
|
impl Default for Paintable {
|
2021-04-09 12:38:02 +00:00
|
|
|
fn default() -> Self {
|
|
|
|
Self::new()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-27 17:50:40 +00:00
|
|
|
impl Paintable {
|
2021-04-09 12:38:02 +00:00
|
|
|
pub(crate) fn handle_frame_changed(&self, frame: Option<Frame>) {
|
2022-01-17 18:09:18 +00:00
|
|
|
let imp = self.imp();
|
2022-10-09 13:06:59 +00:00
|
|
|
imp.handle_frame_changed(frame);
|
2021-04-09 12:38:02 +00:00
|
|
|
}
|
|
|
|
}
|