Skip to content

Commit

Permalink
Merge pull request #1551 from felinira/wip/interface-bounds
Browse files Browse the repository at this point in the history
gio: Add interface bounds to ApplicationImpl
  • Loading branch information
sdroege authored Oct 23, 2024
2 parents 260d747 + bdb6de1 commit 865f49a
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 865f49a

Please sign in to comment.