-
Notifications
You must be signed in to change notification settings - Fork 511
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
Showing
15 changed files
with
158 additions
and
3 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
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
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
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,15 @@ | ||
// Copyright © SixtyFPS GmbH <info@slint.dev> | ||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial | ||
|
||
fn main() { | ||
#[cfg(feature = "system-testing")] | ||
{ | ||
let out_dir = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap()); | ||
let proto_file = std::path::PathBuf::from(::std::env::var("CARGO_MANIFEST_DIR").unwrap()) | ||
.join("slint_systest.proto"); | ||
let config_builder = pb_rs::ConfigBuilder::new(&[proto_file], None, Some(&out_dir), &[]) | ||
.unwrap() | ||
.headers(false); | ||
pb_rs::types::FileDescriptor::run(&config_builder.build()).unwrap(); | ||
} | ||
} |
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 @@ | ||
// Copyright © SixtyFPS GmbH <info@slint.dev> | ||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial | ||
|
||
syntax = "proto3"; | ||
|
||
message RequestWindowListMessage { | ||
} | ||
|
||
message RequestToAUT { | ||
oneof msg { | ||
RequestWindowListMessage request_window_list = 1; | ||
} | ||
} | ||
|
||
message WindowDetails { | ||
// Can add information such as size | ||
} | ||
|
||
message WindowListResponse { | ||
map<uint64, WindowDetails> windows = 1; | ||
} | ||
|
||
message AUTResponse { | ||
oneof msg { | ||
WindowListResponse window_list = 1; | ||
} | ||
} |
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,62 @@ | ||
// Copyright © SixtyFPS GmbH <info@slint.dev> | ||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial | ||
|
||
use i_slint_core::api::invoke_from_event_loop; | ||
use i_slint_core::api::EventLoopError; | ||
use i_slint_core::platform::PlatformError; | ||
use i_slint_core::platform::WindowAdapter; | ||
use std::cell::OnceCell; | ||
use std::cell::RefCell; | ||
use std::rc::Rc; | ||
|
||
mod proto { | ||
include!(concat!(env!("OUT_DIR"), "/slint_systest.rs")); | ||
} | ||
|
||
struct TestingClient { | ||
windows: RefCell<slab::Slab<Rc<dyn WindowAdapter>>>, | ||
} | ||
|
||
impl TestingClient { | ||
fn new() -> Self { | ||
todo!() | ||
} | ||
|
||
fn window_shown(self: Rc<Self>, adapter: Rc<dyn WindowAdapter>) { | ||
let id = self.windows.borrow_mut().insert(adapter); | ||
|
||
let _ = invoke_from_event_loop(move || eprintln!("{id}")); | ||
} | ||
} | ||
|
||
pub fn init() -> Result<(), EventLoopError> { | ||
let Ok(server_addr) = std::env::var("SLINT_TEST_SERVER") else { | ||
return Ok(()); | ||
}; | ||
eprintln!("Attempting to connect to testing server at {server_addr}"); | ||
|
||
i_slint_core::future::spawn_local(async move { | ||
let stream = match smol::net::TcpStream::connect(server_addr.clone()).await { | ||
Ok(stream) => stream, | ||
Err(err) => { | ||
eprintln!("Error connecting to Slint test server at {server_addr}: {}", err); | ||
return; | ||
} | ||
}; | ||
eprintln!("Connected to test server"); | ||
|
||
//loop { | ||
|
||
//} | ||
})?; | ||
/* | ||
let Some(client) = TestingClient::connect() else { | ||
return Ok(()); | ||
}; | ||
i_slint_core::context::set_window_shown_hook(Some(Box::new(move |adapter| { | ||
client.window_shown(adapter); | ||
})))?; | ||
*/ | ||
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
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
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