46 lines
1.2 KiB
Rust
46 lines
1.2 KiB
Rust
// This file was generated by gir (89daf8f) from gir-files (1f01de0)
|
|
// DO NOT EDIT
|
|
|
|
use ffi;
|
|
use glib::translate::*;
|
|
use std;
|
|
|
|
/// The urgency level of the notification.
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
|
pub enum Urgency {
|
|
/// Low urgency. Used for unimportant notifications.
|
|
Low,
|
|
/// Normal urgency. Used for most standard notifications.
|
|
Normal,
|
|
/// Critical urgency. Used for very important notifications.
|
|
Critical,
|
|
#[doc(hidden)]
|
|
__Unknown(i32),
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl ToGlib for Urgency {
|
|
type GlibType = ffi::NotifyUrgency;
|
|
|
|
fn to_glib(&self) -> ffi::NotifyUrgency {
|
|
match *self {
|
|
Urgency::Low => ffi::NOTIFY_URGENCY_LOW,
|
|
Urgency::Normal => ffi::NOTIFY_URGENCY_NORMAL,
|
|
Urgency::Critical => ffi::NOTIFY_URGENCY_CRITICAL,
|
|
Urgency::__Unknown(value) => unsafe { std::mem::transmute(value) },
|
|
}
|
|
}
|
|
}
|
|
|
|
#[doc(hidden)]
|
|
impl FromGlib<ffi::NotifyUrgency> for Urgency {
|
|
fn from_glib(value: ffi::NotifyUrgency) -> Self {
|
|
match value as i32 {
|
|
0 => Urgency::Low,
|
|
1 => Urgency::Normal,
|
|
2 => Urgency::Critical,
|
|
value => Urgency::__Unknown(value),
|
|
}
|
|
}
|
|
}
|