libappindicator-zbus 0.1.1

zbus implement for libappindicator
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
//! # D-Bus interface proxy for: `com.canonical.dbusmenu`
//!
//! This code was generated by `zbus-xmlgen` `5.1.0` from D-Bus introspection data.
//! Source: `Interface '/MenuBar' from service ':1.9087' on system bus`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
//!
//! More information can be found in the [Writing a client proxy] section of the zbus
//! documentation.
//!
//! This type implements the [D-Bus standard interfaces], (`org.freedesktop.DBus.*`) for which the
//! following zbus API can be used:
//!
//! * [`zbus::fdo::PropertiesProxy`]
//! * [`zbus::fdo::IntrospectableProxy`]
//! * [`zbus::fdo::PeerProxy`]
//!
//! Consequently `zbus-xmlgen` did not generate code for the above interfaces.
//!
//! [Writing a client proxy]: https://dbus2.github.io/zbus/client.html
//! [D-Bus standard interfaces]: https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces,
use std::ops::Deref;
use std::sync::atomic::{self, AtomicI32};

use serde::{Deserialize, Serialize};
use zbus::zvariant::{self, OwnedValue, Type, Value, as_value::optional};

use zbus::{interface, object_server::SignalEmitter};

pub mod event_types;

pub use event_types::*;

#[derive(Type, Debug, Serialize, Deserialize, Default, OwnedValue, Value, Clone)]
/// Specified options for a [`Screencast::create_session`] request.
#[zvariant(signature = "dict")]
pub struct MenuProperty {
    #[serde(with = "optional", skip_serializing_if = "Option::is_none", default)]
    pub label: Option<String>,
    #[serde(with = "optional", skip_serializing_if = "Option::is_none", default)]
    #[zvariant(rename = "icon-name")]
    pub icon_name: Option<String>,
    #[serde(with = "optional", skip_serializing_if = "Option::is_none", default)]
    pub enabled: Option<bool>,
    #[serde(with = "optional", skip_serializing_if = "Option::is_none", default)]
    #[zvariant(rename = "toggle-type")]
    pub toggle_type: Option<ToggleType>,
    #[serde(with = "optional", skip_serializing_if = "Option::is_none", default)]
    #[zvariant(rename = "toggle-state")]
    pub toggle_state: Option<ToggleState>,
    #[serde(with = "optional", skip_serializing_if = "Option::is_none", default)]
    #[zvariant(rename = "children-display")]
    pub children_display: Option<String>,
}

impl MenuProperty {
    /// Key name
    pub const LABEL: &str = "label";
    pub const ICON_NAME: &str = "icon-name";
    pub const ENABLED: &str = "enabled";
    pub const TOGGLE_TYPE: &str = "toggle-type";
    pub const TOGGLE_STATE: &str = "toggle-state";
    pub const CHILDREN_DISPLAY: &str = "children-display";
}

impl MenuProperty {
    pub fn root() -> Self {
        MenuProperty {
            label: Some("root".to_owned()),
            children_display: Some("submenu".to_owned()),
            ..Default::default()
        }
    }
    pub fn submenu(label: String) -> Self {
        MenuProperty {
            label: Some(label),
            children_display: Some("submenu".to_owned()),
            ..Default::default()
        }
    }
}

#[derive(Type, Debug, Serialize, Deserialize, OwnedValue, Value, Clone)]
pub struct Id(i32);

static COUNT: AtomicI32 = AtomicI32::new(1);

impl Id {
    const MAIN: Self = Id(0);
    /// Creates a new unique window [`Id`].
    pub fn unique() -> Id {
        Id(COUNT.fetch_add(1, atomic::Ordering::Relaxed))
    }
}

impl Deref for Id {
    type Target = i32;
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}

#[allow(unused)]
#[derive(Debug, Clone)]
enum MenuType {
    Root,
    SubMenu,
    Button,
}

#[derive(Debug, Clone)]
pub struct MenuUnit<Message: Clone> {
    id: Id,
    tp: MenuType,
    pub property: MenuProperty,
    pub sub_menus: Vec<MenuUnit<Message>>,
    pub message: Option<Message>,
}

#[derive(Debug, Clone, Default)]
pub struct ButtonOptions {
    pub label: String,
    pub enabled: bool,
    pub icon_name: String,
}

impl<Message: Clone> From<MenuUnit<Message>> for MenuItem {
    fn from(value: MenuUnit<Message>) -> Self {
        let mut output = MenuItem {
            id: value.id,
            property: value.property,
            sub_menus: vec![],
        };
        for sub_menu in value.sub_menus {
            output = output.push_sub_menu(sub_menu.into());
        }
        output
    }
}

impl<Message: Clone> MenuUnit<Message> {
    pub fn button(
        ButtonOptions {
            label,
            enabled,
            icon_name,
        }: ButtonOptions,
        message: Message,
    ) -> Self {
        Self {
            tp: MenuType::Button,
            id: Id::unique(),
            property: MenuProperty {
                label: Some(label),
                enabled: Some(enabled),
                icon_name: Some(icon_name),
                ..Default::default()
            },
            sub_menus: vec![],
            message: Some(message),
        }
    }
    pub fn root() -> Self {
        Self {
            id: Id::MAIN,
            tp: MenuType::Root,
            property: MenuProperty::root(),
            sub_menus: vec![],
            message: None,
        }
    }
    pub fn sub_menu(label: String) -> Self {
        Self {
            id: Id::unique(),
            tp: MenuType::SubMenu,
            property: MenuProperty::submenu(label),
            sub_menus: vec![],
            message: None,
        }
    }
    pub fn push_sub_menu(mut self, menu: Self) -> Self {
        self.sub_menus.push(menu);
        self
    }

    pub fn find_menu_by_id(&self, id: i32) -> Option<&Self> {
        if *self.id == id {
            return Some(self);
        }
        for menu in &self.sub_menus {
            if let Some(menu) = menu.find_menu_by_id(id) {
                return Some(menu);
            }
        }
        None
    }
}

#[derive(Type, Debug, Serialize, Deserialize, OwnedValue, Value, Clone)]
#[zvariant(signature = "(ia{sv}av)")]
pub struct MenuItem {
    pub id: Id,
    pub property: MenuProperty,
    pub sub_menus: Vec<zvariant::OwnedValue>,
}

#[derive(Clone, PartialEq, Type, Serialize, Deserialize, OwnedValue, Value, Debug, Default)]
#[zvariant(signature = "s", rename_all = "lowercase")]
pub enum MenuStatus {
    #[default]
    Normal,
    Notice,
    Disabled,
}

impl Default for MenuItem {
    fn default() -> Self {
        MenuItem {
            id: Id::unique(),
            property: MenuProperty::root(),
            sub_menus: vec![],
        }
    }
}

impl MenuItem {
    pub fn new(property: MenuProperty) -> Self {
        MenuItem {
            id: Id::unique(),
            property,
            sub_menus: vec![],
        }
    }

    #[allow(unused)]
    #[allow(clippy::only_used_in_recursion)]
    pub fn get_filiter(
        &self,
        parent_id: i32,
        recursion_depth: i32,
        property_names: &[&str],
    ) -> Option<MenuItem> {
        if *self.id == parent_id {
            let mut new_menu = MenuItem {
                id: self.id.clone(),
                property: self.property.clone(),
                sub_menus: vec![],
            };

            let next_reversion_depth = recursion_depth - 1;
            if next_reversion_depth != 0 {
                for menu in self.sub_menus.as_slice() {
                    let menu: MenuItem = menu.clone().try_into().unwrap();
                    let next_menu = menu.filiter(next_reversion_depth, property_names);
                    new_menu = new_menu.push_sub_menu(next_menu);
                }
            }
            return Some(new_menu);
        }
        None
    }

    #[allow(unused)]
    #[allow(clippy::only_used_in_recursion)]
    fn filiter(&self, recursion_depth: i32, property_names: &[&str]) -> MenuItem {
        let mut new_menu = MenuItem {
            id: self.id.clone(),
            property: self.property.clone(),
            sub_menus: vec![],
        };

        let next_reversion_depth = recursion_depth - 1;
        for menu in self.sub_menus.as_slice() {
            let menu: MenuItem = menu.clone().try_into().unwrap();
            let next_menu = menu.filiter(next_reversion_depth, property_names);
            new_menu = new_menu.push_sub_menu(next_menu);
        }

        new_menu
    }

    pub fn push_sub_menu(mut self, menu: MenuItem) -> Self {
        self.sub_menus.push(OwnedValue::try_from(menu).unwrap());
        self
    }

    pub fn get_property(&self, id: i32, name: String) -> Option<PropertyItem> {
        if *self.id == id {
            return Some(PropertyItem {
                id,
                item: self.property.clone(),
            });
        }
        let sub_menus: Vec<MenuItem> = self
            .sub_menus
            .iter()
            .map(|submenu| submenu.clone().try_into().unwrap())
            .collect();

        for sub_menu in sub_menus {
            let property = sub_menu.get_property(id, name.clone());
            if property.is_some() {
                return property;
            }
        }

        None
    }

    pub fn get_property_groups(
        &self,
        ids: Vec<i32>,
        _property_names: Vec<String>,
    ) -> Vec<PropertyItem> {
        let mut output = vec![];
        for id in ids {
            if let Some(property) = self.get_property(id, "".to_string()) {
                output.push(property);
            }
        }

        output
    }
}

#[derive(Type, Debug, Default, Serialize, Deserialize)]
pub struct PropertyItem {
    pub id: i32,
    pub item: MenuProperty,
}

pub trait DBusMenuItem {
    type State;
    type Message: Clone;

    fn boot(&self) -> Self::State;

    fn menu(&self, state: &Self::State) -> MenuUnit<Self::Message>;

    fn revision(&self, state: &Self::State) -> u32;

    #[allow(unused)]
    fn about_to_show(&self, state: &mut Self::State, id: i32) -> zbus::fdo::Result<bool> {
        Err(zbus::fdo::Error::Failed("Unimplemented".to_string()))
    }

    /// AboutToShowGroup method
    #[allow(unused)]
    fn about_to_show_group(
        &self,
        state: &mut Self::State,
        ids: Vec<i32>,
    ) -> zbus::fdo::Result<(Vec<i32>, Vec<i32>)> {
        Err(zbus::fdo::Error::Failed("Unimplemented".to_string()))
    }

    fn status(&self, _state: &Self::State) -> zbus::fdo::Result<MenuStatus> {
        Ok(MenuStatus::Normal)
    }

    #[allow(unused)]
    fn on_clicked(
        &self,
        state: &mut Self::State,
        message: Self::Message,
        timestamp: u32,
    ) -> EventUpdate {
        EventUpdate::None
    }

    #[allow(unused)]
    fn text_direction(&self, state: &Self::State) -> TextDirection {
        TextDirection::Inherit
    }

    #[allow(unused)]
    fn icon_theme_path(&self, state: &Self::State) -> Vec<String> {
        vec![]
    }
}

pub struct DBusMenuInstance<Menu: DBusMenuItem> {
    pub(crate) program: Menu,
    pub(crate) state: Menu::State,
}

pub trait DBusMenuBootFn<State> {
    fn boot(&self) -> State;
}

impl<T, State> DBusMenuBootFn<State> for T
where
    T: Fn() -> State,
{
    fn boot(&self) -> State {
        self()
    }
}

pub trait MenuStatusFn<State> {
    fn status(&self, state: &State) -> MenuStatus;
}

impl<T, State> MenuStatusFn<State> for T
where
    T: Fn(&State) -> MenuStatus,
{
    fn status(&self, state: &State) -> MenuStatus {
        self(state)
    }
}
pub trait AboutToShowFn<State> {
    fn about_to_show(&self, state: &mut State, id: i32) -> bool;
}

impl<T, State> AboutToShowFn<State> for T
where
    T: Fn(&mut State, i32) -> bool,
{
    fn about_to_show(&self, state: &mut State, id: i32) -> bool {
        self(state, id)
    }
}

#[derive(Debug)]
pub enum EventUpdate {
    None,
    UpdateCurrent,
    UpdateAll,
}

pub trait RevisionFn<State> {
    fn revision(&self, state: &State) -> u32;
}

impl<State, F> RevisionFn<State> for F
where
    F: Fn(&State) -> u32,
{
    fn revision(&self, state: &State) -> u32 {
        self(state)
    }
}

impl<State> RevisionFn<State> for u32 {
    fn revision(&self, _state: &State) -> u32 {
        *self
    }
}

pub trait MenuFn<State, Message: Clone> {
    fn menu(&self, state: &State) -> MenuUnit<Message>;
}

impl<State, Message: Clone, F> MenuFn<State, Message> for F
where
    F: Fn(&State) -> MenuUnit<Message>,
{
    fn menu(&self, state: &State) -> MenuUnit<Message> {
        self(state)
    }
}

pub trait OnClickedFn<State, Message> {
    fn on_clicked(&self, state: &mut State, message: Message, timestamp: u32) -> EventUpdate;
}

impl<T, State, Message> OnClickedFn<State, Message> for T
where
    T: Fn(&mut State, Message, u32) -> EventUpdate,
{
    fn on_clicked(&self, state: &mut State, message: Message, timestamp: u32) -> EventUpdate {
        self(state, message, timestamp)
    }
}

pub trait TextDirectionFn<State> {
    fn text_direction(&self, state: &State) -> TextDirection;
}

impl<State> TextDirectionFn<State> for TextDirection {
    fn text_direction(&self, _state: &State) -> TextDirection {
        *self
    }
}

impl<T, State> TextDirectionFn<State> for T
where
    T: Fn(&State) -> TextDirection,
{
    fn text_direction(&self, state: &State) -> TextDirection {
        self(state)
    }
}

pub trait IconThemePathFn<State> {
    fn icon_theme_path(&self, state: &State) -> Vec<String>;
}

impl<State> IconThemePathFn<State> for Vec<String> {
    fn icon_theme_path(&self, _state: &State) -> Vec<String> {
        self.clone()
    }
}

impl<T, State> IconThemePathFn<State> for T
where
    T: Fn(&State) -> Vec<String>,
{
    fn icon_theme_path(&self, state: &State) -> Vec<String> {
        self(state)
    }
}

pub trait AboutToShowGroupFn<State> {
    fn about_to_show_group(
        &self,
        state: &mut State,
        ids: Vec<i32>,
    ) -> zbus::fdo::Result<(Vec<i32>, Vec<i32>)>;
}

impl<T, State> AboutToShowGroupFn<State> for T
where
    T: Fn(&mut State, Vec<i32>) -> zbus::fdo::Result<(Vec<i32>, Vec<i32>)>,
{
    fn about_to_show_group(
        &self,
        state: &mut State,
        ids: Vec<i32>,
    ) -> zbus::fdo::Result<(Vec<i32>, Vec<i32>)> {
        self(state, ids)
    }
}

#[interface(name = "com.canonical.dbusmenu")]
impl<Menu: DBusMenuItem> DBusMenuInstance<Menu>
where
    Menu: Send + Sync + 'static,
    Menu::State: 'static + Send + Sync,
    Menu::Message: 'static + Send + Sync + Clone,
{
    fn about_to_show(&mut self, id: i32) -> zbus::fdo::Result<bool> {
        self.program.about_to_show(&mut self.state, id)
    }

    /// AboutToShowGroup method
    fn about_to_show_group(&mut self, ids: Vec<i32>) -> zbus::fdo::Result<(Vec<i32>, Vec<i32>)> {
        self.program.about_to_show_group(&mut self.state, ids)
    }

    // NOTE: this should not implemented by user
    /// GetLayout method
    fn get_layout(
        &mut self,
        parent_id: i32,
        recursion_depth: i32,
        property_names: Vec<String>,
    ) -> zbus::fdo::Result<(u32, MenuItem)> {
        let property_names: Vec<&str> = property_names.iter().map(|name| name.as_str()).collect();
        let menuitem: MenuItem = self.program.menu(&self.state).into();
        Ok((
            self.program.revision(&self.state),
            menuitem
                .get_filiter(parent_id, recursion_depth, &property_names)
                .ok_or(zbus::fdo::Error::Failed("UnFounded".to_string()))?,
        ))
    }

    // NOTE: this should not implemented by user
    /// GetGroupProperties method
    fn get_group_properties(
        &mut self,
        ids: Vec<i32>,
        property_names: Vec<String>,
    ) -> zbus::fdo::Result<Vec<PropertyItem>> {
        let menuitem: MenuItem = self.program.menu(&self.state).into();
        Ok(menuitem.get_property_groups(ids, property_names))
    }

    // NOTE: this should not implemented by user
    /// GetProperty method
    fn get_property(&mut self, id: i32, name: String) -> zbus::fdo::Result<PropertyItem> {
        let menuitem: MenuItem = self.program.menu(&self.state).into();
        menuitem
            .get_property(id, name)
            .ok_or(zbus::fdo::Error::Failed("Unfounded".to_string()))
    }

    /// Version property
    #[zbus(property)]
    fn version(&self) -> u32 {
        2
    }

    /// Status property
    #[zbus(property)]
    fn status(&self) -> zbus::fdo::Result<MenuStatus> {
        self.program.status(&self.state)
    }

    /// Event method
    async fn event(
        &mut self,
        id: i32,
        event_id: String,
        _data: zbus::zvariant::OwnedValue,
        timestamp: u32,
        #[zbus(object_server)] server: &zbus::ObjectServer,
    ) -> zbus::fdo::Result<()> {
        let menu = self.program.menu(&self.state);
        let Some(button) = menu.find_menu_by_id(id) else {
            return Ok(());
        };
        let need_update = match event_id.as_str() {
            "clicked" => {
                if !matches!(button.tp, MenuType::Button) {
                    return Ok(());
                }
                self.program
                    .on_clicked(&mut self.state, button.message.clone().unwrap(), timestamp)
            }
            _ => EventUpdate::None,
        };
        let revision = self.program.revision(&self.state);
        match need_update {
            EventUpdate::UpdateCurrent => {
                let iface_rf = server
                    .interface::<_, DBusMenuInstance<Menu>>("/MenuBar")
                    .await?;
                let _ = DBusMenuInstance::<Menu>::layout_updated(
                    iface_rf.signal_emitter(),
                    revision,
                    id,
                )
                .await;
            }
            EventUpdate::UpdateAll => {
                let iface_rf = server
                    .interface::<_, DBusMenuInstance<Menu>>("/MenuBar")
                    .await?;
                let _ = DBusMenuInstance::<Menu>::layout_updated(
                    iface_rf.signal_emitter(),
                    revision,
                    *Id::MAIN,
                )
                .await;
            }
            _ => {}
        }

        Ok(())
    }

    /// EventGroup method
    async fn event_group(
        &mut self,
        events: Vec<(i32, String, zbus::zvariant::OwnedValue, u32)>,
        #[zbus(object_server)] server: &zbus::ObjectServer,
    ) -> zbus::fdo::Result<Vec<i32>> {
        let mut output = vec![];
        let mut update_all = false;
        let mut update_parents: Vec<i32> = vec![];
        for (id, event_id, _data, timestamp) in events {
            let menu = self.program.menu(&self.state);
            let Some(button) = menu.find_menu_by_id(id) else {
                continue;
            };

            let need_update = match event_id.as_str() {
                "clicked" => {
                    if !matches!(button.tp, MenuType::Button) {
                        continue;
                    }
                    self.program.on_clicked(
                        &mut self.state,
                        button.message.clone().unwrap(),
                        timestamp,
                    )
                }
                _ => {
                    continue;
                }
            };
            match need_update {
                EventUpdate::None => {
                    continue;
                }
                EventUpdate::UpdateAll => {
                    update_all = true;
                }
                EventUpdate::UpdateCurrent => {
                    update_parents.push(*menu.id);
                }
            };
            output.push(id);
        }
        let revision = self.program.revision(&self.state);
        if update_all {
            let iface_rf = server
                .interface::<_, DBusMenuInstance<Menu>>("/MenuBar")
                .await?;
            let _ = DBusMenuInstance::<Menu>::layout_updated(
                iface_rf.signal_emitter(),
                revision,
                *Id::MAIN,
            )
            .await;
        } else {
            for id in update_parents {
                let iface_rf = server
                    .interface::<_, DBusMenuInstance<Menu>>("/MenuBar")
                    .await?;
                let _ = DBusMenuInstance::<Menu>::layout_updated(
                    iface_rf.signal_emitter(),
                    revision,
                    id,
                )
                .await;
            }
        }
        Ok(output)
    }

    /// TextDirection property
    #[zbus(property)]
    fn text_direction(&self) -> TextDirection {
        self.program.text_direction(&self.state)
    }

    #[zbus(property)]
    fn icon_theme_path(&self) -> Vec<String> {
        self.program.icon_theme_path(&self.state)
    }

    /// ItemActivationRequested signal
    #[zbus(signal)]
    pub async fn item_activation_requested(
        ctxt: &SignalEmitter<'_>,
        id: i32,
        timestamp: u32,
    ) -> zbus::Result<()>;

    /// ItemsPropertiesUpdated signal
    #[zbus(signal)]
    pub async fn items_properties_updated(
        ctxt: &SignalEmitter<'_>,
        updated_props: Vec<(i32, MenuProperty)>,
        removed_props: Vec<(i32, Vec<&str>)>,
    ) -> zbus::Result<()>;

    /// LayoutUpdated signal
    #[zbus(signal)]
    pub async fn layout_updated(
        ctxt: &SignalEmitter<'_>,
        revision: u32,
        parent: i32,
    ) -> zbus::Result<()>;
}