-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3082e78
commit b19a5f2
Showing
8 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use std::collections::HashMap; | ||
|
||
use zbus::dbus_interface; | ||
use zvariant::{OwnedValue, Value}; | ||
|
||
use crate::{ | ||
desktop::{request::Response, HandleToken, ResponseError}, | ||
WindowIdentifierType, | ||
}; | ||
|
||
pub struct Access {} | ||
|
||
#[dbus_interface(name = "org.freedesktop.impl.portal.Access")] | ||
impl Access { | ||
fn access_dialog( | ||
&self, | ||
_handle: HandleToken, | ||
_app_id: &str, | ||
_window_identifier: WindowIdentifierType, | ||
_title: &str, | ||
_subtitle: &str, | ||
_body: &str, | ||
_options: HashMap<&str, Value<'_>>, | ||
) -> Response<HashMap<String, OwnedValue>> { | ||
Response::Err(ResponseError::Cancelled) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use zbus::dbus_interface; | ||
use zvariant::DeserializeDict; | ||
|
||
use crate::{ | ||
desktop::{ | ||
account::UserInfo, | ||
request::{Response, ResponseError}, | ||
HandleToken, | ||
}, | ||
WindowIdentifierType, | ||
}; | ||
|
||
#[derive(Debug, DeserializeDict, zvariant::Type)] | ||
#[zvariant(signature = "dict")] | ||
pub struct UserInfoOptions { | ||
reason: Option<String>, | ||
} | ||
|
||
pub struct Account {} | ||
|
||
#[dbus_interface(name = "org.freedesktop.impl.portal.Account")] | ||
impl Account { | ||
async fn get_user_information( | ||
&self, | ||
handle: HandleToken, | ||
app_id: &str, | ||
window_identifier: WindowIdentifierType, | ||
options: UserInfoOptions, | ||
) -> Response<UserInfo> { | ||
Response::Err(ResponseError::Cancelled) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
mod access; | ||
mod account; | ||
mod request; | ||
mod session; | ||
mod wallpaper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use zbus::dbus_interface; | ||
|
||
pub struct Request {} | ||
|
||
#[dbus_interface(name = "org.freedesktop.impl.portal.Request")] | ||
impl Request { | ||
async fn close(&self) -> zbus::fdo::Result<()> { | ||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use zbus::{dbus_interface, SignalContext}; | ||
|
||
pub struct Session {} | ||
|
||
#[dbus_interface(name = "org.freedesktop.impl.portal.Session")] | ||
impl Session { | ||
async fn close(&self) -> zbus::fdo::Result<()> { | ||
Ok(()) | ||
} | ||
|
||
#[dbus_interface(property)] | ||
fn version(&self) -> u32 { | ||
2 | ||
} | ||
|
||
#[dbus_interface(signal)] | ||
async fn closed(signal_ctxt: &SignalContext<'_>, message: &str) -> zbus::Result<()>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use zbus::dbus_interface; | ||
use zvariant::{DeserializeDict, Type}; | ||
|
||
use crate::{ | ||
desktop::{ | ||
request::{BasicResponse, Response}, | ||
wallpaper::SetOn, | ||
HandleToken, | ||
}, | ||
WindowIdentifierType, | ||
}; | ||
|
||
#[derive(DeserializeDict, Type, Debug, Default)] | ||
#[zvariant(signature = "dict")] | ||
pub struct WallpaperOptions { | ||
#[zvariant(rename = "show-preview")] | ||
show_preview: Option<bool>, | ||
#[zvariant(rename = "set-on")] | ||
set_on: Option<SetOn>, | ||
} | ||
|
||
pub struct Wallpaper {} | ||
|
||
#[dbus_interface(name = "org.freedesktop.impl.portal.Wallpaper")] | ||
impl Wallpaper { | ||
async fn set_wallpaper_uri( | ||
&self, | ||
handle: HandleToken, | ||
app_id: &str, | ||
window_identifier: WindowIdentifierType, | ||
uri: url::Url, | ||
options: WallpaperOptions, | ||
) -> Response<BasicResponse> { | ||
todo!() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters