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
// #![doc(html_favicon_url = "https://github.com/VimYoung/Spell/blob/bb01ae94a365d237ebb0db1df1b6eb37aea25367/spell-framework/assets/Spell.png")]
/// It contains related enums and struct which are used to manage,
/// define and update various properties of a widget(viz a viz layer). You can import necessary
/// types from this module to implement relevant features. See docs of related objects for
/// their overview.
/// Components of this module are not be used by end user directly. This module contains
/// certain reexports used by public facing macros like [cast_spell] and [generate_widgets]
/// internally.
use Error;
use ;
/// This trait is implemented upon slint generated windows to enable IPC handling
/// This is an internal trait implemented by objects generated from [`generate_widgets`].
/// It helps in running every SpellWidget (like [SpellWin](`wayland_adapter::SpellWin`),
/// [SpellLock](`wayland_adapter::SpellLock`)) through the same event_loop function.
/// event loop function internally used by [`cast_spell`] for single widget setups.
/// Not to be used by end user,
/// event loop function internally used by [`cast_spell`] for multiple widget setups.
/// Not to be used by end user.
// TODO Update docs of spellock and spellwin to justify their use being purely internal.
// TODO update the blog with latest API changes in spell-framework.
// TODO update the constant vals so that the new APIs are used.
// TODO and configuration file to ensure that a single widget is open for a single layer name.
// TODO IMPORTANT LOGGING SUBSCRIBER LOGIC NEEDS TO BE UNIFIED AND NOT WINDOW SPECIFIC.
// Code to launch a Zbus service
// <BS>
// pub async fn deploy_zbus_service(
// state: State,
// state_updater: Sender<InternalHandle>,
// layer_name: String,
// ) -> zbus::Result<()> {
// let connection = BusConn::session().await.unwrap();
// connection
// .object_server()
// .at(
// "/org/VimYoung/VarHandler",
// VarHandler {
// state: state.clone(),
// state_updater: state_updater.clone(),
// layer_name: layer_name.clone(),
// },
// )
// .await?;
// trace!("Object server set up");
// // connection.request_name("org.VimYoung.Spell").await?;
// // open_sec_service(state, state_updater, layer_name).await?;
// if let Err(err) = connection
// .request_name_with_flags("org.VimYoung.Spell", RequestNameFlags::DoNotQueue.into())
// .await
// {
// open_sec_service(state, state_updater, layer_name).await?;
// info!("Successfully created secondary service, Error: {}", err);
// } else {
// info!("Successfully created main service");
// }
// std::future::pending::<()>().await;
// Ok(())
// }
// Macro on top of VarHandler impl.
// #[interface(name = "org.VimYoung.Spell1", proxy(gen_blocking = false,))]
// TODO it is necessary to call join unwrap on spawned threads to ensure
// that they are closed when main thread closes.
// TODO linux's DNF Buffers needs to be used to improve rendering and avoid conversions
// from CPU to GPU and vice versa.
// TO REMEMBER I removed dirty region from spellskiawinadapter but it can be added
// if I want to make use of the dirty region information to strengthen my rendering.
// TODO lock screen behaviour in a multi-monitor setup needs to be tested.
// TODO implement logging for SpellLock.
// Provide a method in the macro to disable tracing_subsriber completely for some project
// which want's to do it themselves.
// cast spell macro should be having following values.
// 1. Disable log: should disable setting subscriber, generally for the project to use or for
// someone to set their own.
// 2. forge: provide a forge instance to run independently.
// 3. exclusive_zone: true or false or with specified value.
// 4. it should have the option to take a window_conf or directly the window configurations
// into the macro, removing the need to define it previously.
// 5. monitor: Specify the monitor to show the widget in.
// Also, a procedural macro to mimic the functionalities of ForeignController.
// Build a consistent error type to deal with CLI, dbus and window creation errors
// (including window conf) more gracefully.