Skip to content

Commit

Permalink
gio: Add interface bounds to ApplicationImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
felinira committed Oct 22, 2024
1 parent 260d747 commit bdb6de1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gio/src/subclass/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{ffi::OsString, fmt, ops::Deref, ptr};
use glib::{prelude::*, subclass::prelude::*, translate::*, ExitCode, VariantDict};
use libc::{c_char, c_int, c_void};

use crate::{ffi, Application};
use crate::{ffi, ActionGroup, ActionMap, Application};

pub struct ArgumentList {
pub(crate) ptr: *mut *mut *mut c_char,
Expand Down Expand Up @@ -64,7 +64,9 @@ impl From<ArgumentList> for Vec<OsString> {
}
}

pub trait ApplicationImpl: ObjectImpl + ObjectSubclass<Type: IsA<Application>> {
pub trait ApplicationImpl:
ObjectImpl + ObjectSubclass<Type: IsA<Application> + IsA<ActionGroup> + IsA<ActionMap>>
{
fn activate(&self) {
self.parent_activate()
}
Expand Down Expand Up @@ -449,7 +451,7 @@ mod tests {

glib::wrapper! {
pub struct SimpleApplication(ObjectSubclass<imp::SimpleApplication>)
@implements crate::Application;
@implements Application, ActionMap, ActionGroup;
}

#[test]
Expand Down

0 comments on commit bdb6de1

Please sign in to comment.