Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
induce base workflows
  • Loading branch information
Decodetalkers committed Jun 19, 2024
1 parent 4b28cc3 commit cffa581
Show file tree
Hide file tree
Showing 25 changed files with 195 additions and 142 deletions.
33 changes: 33 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

# docs
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
# We release on Tuesdays and open dependabot PRs will rebase after the
# version bump and thus consume unnecessary workers during release, thus
# let's open new ones on Wednesday
day: "wednesday"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
groups:
# Only update polars as a whole as there are many subcrates that need to
# be updated at once. We explicitly depend on some of them, so batch their
# updates to not take up dependabot PR slots with dysfunctional PRs
polars:
patterns:
- "polars"
- "polars-*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "wednesday"
19 changes: 19 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# yamllint disable rule:line-length
name: check_typos

on: # yamllint disable-line rule:truthy
push:
pull_request:
branches:
- '**'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: typos-action
uses: crate-ci/[email protected]
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

Take winit as reference a lot, to make easilier program on layershell and ext-session-lock.

This project bind `ext-session-lock` and `layershell` with the simillar way of winit, which storing message and handle it in callback
This project bind `ext-session-lock` and `layershell` with the similar way of winit, which storing message and handle it in callback
4 changes: 2 additions & 2 deletions iced_examples/counter_lock/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use iced::{event, Alignment, Command, Element, Event, Length, Theme};

use iced_sessionlock::actions::UnLockAction;
use iced_sessionlock::settings::Settings;
use iced_sessionlock::MutiApplication;
use iced_sessionlock::MultiApplication;

pub fn main() -> Result<(), iced_sessionlock::Error> {
Counter::run(Settings::default())
Expand All @@ -23,7 +23,7 @@ enum Message {
Lock,
}

impl MutiApplication for Counter {
impl MultiApplication for Counter {
type Message = Message;
type Flags = ();
type Theme = Theme;
Expand Down
2 changes: 1 addition & 1 deletion iced_examples/counter_muti/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "counter_muti"
name = "counter_multi"
authors.workspace = true
edition.workspace = true
version.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions iced_examples/counter_muti/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use iced::{event, Alignment, Command, Element, Event, Length, Theme};
use iced_layershell::actions::{LayershellCustomActions, LayershellCustomActionsWithId};
use iced_layershell::reexport::Anchor;
use iced_layershell::settings::{LayerShellSettings, Settings};
use iced_layershell::MutiApplication;
use iced_layershell::MultiApplication;
pub fn main() -> Result<(), iced_layershell::Error> {
Counter::run(Settings {
layer_settings: LayerShellSettings {
Expand Down Expand Up @@ -39,7 +39,7 @@ enum Message {
IcedEvent(Event),
}

impl MutiApplication for Counter {
impl MultiApplication for Counter {
type Message = Message;
type Flags = ();
type Theme = Theme;
Expand Down
2 changes: 1 addition & 1 deletion iced_layershell/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ async fn run_instance<A, E, C>(
custom_actions.push(LayerShellActions::Mouse(new_mouse_interaction));
mouse_interaction = new_mouse_interaction;
}
// TODO: check mosue_interaction
// TODO: check mouse_interaction

debug.render_started();

Expand Down
6 changes: 3 additions & 3 deletions iced_layershell/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ pub enum IcedLayerEvent<Message: 'static> {

#[allow(unused)]
#[derive(Debug)]
pub struct MutiWindowIcedLayerEvent<Message: 'static>(pub Option<Id>, pub IcedLayerEvent<Message>);
pub struct MultiWindowIcedLayerEvent<Message: 'static>(pub Option<Id>, pub IcedLayerEvent<Message>);

impl<Message: 'static> From<(Option<Id>, IcedLayerEvent<Message>)>
for MutiWindowIcedLayerEvent<Message>
for MultiWindowIcedLayerEvent<Message>
{
fn from((id, message): (Option<Id>, IcedLayerEvent<Message>)) -> Self {
MutiWindowIcedLayerEvent(id, message)
MultiWindowIcedLayerEvent(id, message)
}
}

Expand Down
16 changes: 8 additions & 8 deletions iced_layershell/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ where
}
}

pub trait MutiApplication: Sized {
pub trait MultiApplication: Sized {
/// The [`Executor`] that will run commands and subscriptions.
///
/// The [default executor] can be a good starting point!
Expand Down Expand Up @@ -320,18 +320,18 @@ pub trait MutiApplication: Sized {
..iced_renderer::Settings::default()
};

multi_window::run::<MutiInstance<Self>, Self::Executor, iced_renderer::Compositor>(
multi_window::run::<MultiInstance<Self>, Self::Executor, iced_renderer::Compositor>(
settings,
renderer_settings,
)
}
}

struct MutiInstance<A: MutiApplication>(A);
struct MultiInstance<A: MultiApplication>(A);

impl<A> iced_runtime::multi_window::Program for MutiInstance<A>
impl<A> iced_runtime::multi_window::Program for MultiInstance<A>
where
A: MutiApplication,
A: MultiApplication,
{
type Message = A::Message;
type Theme = A::Theme;
Expand All @@ -349,16 +349,16 @@ where
}
}

impl<A> multi_window::Application for MutiInstance<A>
impl<A> multi_window::Application for MultiInstance<A>
where
A: MutiApplication,
A: MultiApplication,
{
type Flags = A::Flags;

fn new(flags: Self::Flags) -> (Self, Command<A::Message>) {
let (app, command) = A::new(flags);

(MutiInstance(app), command)
(MultiInstance(app), command)
}

fn namespace(&self) -> String {
Expand Down
26 changes: 13 additions & 13 deletions iced_layershell/src/multi_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use layershellev::{
use futures::{channel::mpsc, SinkExt, StreamExt};

use crate::{
event::{IcedLayerEvent, MutiWindowIcedLayerEvent},
event::{IcedLayerEvent, MultiWindowIcedLayerEvent},
proxy::IcedProxy,
settings::Settings,
};
Expand Down Expand Up @@ -179,7 +179,7 @@ where
);

let (mut event_sender, event_receiver) =
mpsc::unbounded::<MutiWindowIcedLayerEvent<A::Message>>();
mpsc::unbounded::<MultiWindowIcedLayerEvent<A::Message>>();
let (control_sender, mut control_receiver) = mpsc::unbounded::<Vec<LayerShellActions>>();

let mut instance = Box::pin(run_instance::<A, E, C>(
Expand Down Expand Up @@ -212,7 +212,7 @@ where
match message {
DispatchMessage::RequestRefresh { width, height } => {
event_sender
.start_send(MutiWindowIcedLayerEvent(
.start_send(MultiWindowIcedLayerEvent(
id,
IcedLayerEvent::RequestRefreshWithWrapper {
width: *width,
Expand All @@ -238,7 +238,7 @@ where
}

event_sender
.start_send(MutiWindowIcedLayerEvent(id, message.into()))
.start_send(MultiWindowIcedLayerEvent(id, message.into()))
.expect("Cannot send");
}
LayerEvent::NormalDispatch => match &key_event {
Expand All @@ -247,12 +247,12 @@ where
let event = IcedLayerEvent::Window(*windowevent);
if key_ping_count > 70 && key_ping_count < 74 {
event_sender
.start_send(MutiWindowIcedLayerEvent(id, event))
.start_send(MultiWindowIcedLayerEvent(id, event))
.expect("Cannot send");
key_ping_count = 0;
} else {
event_sender
.start_send(MutiWindowIcedLayerEvent(
.start_send(MultiWindowIcedLayerEvent(
id,
IcedLayerEvent::NormalUpdate,
))
Expand All @@ -267,13 +267,13 @@ where
}
None => {
event_sender
.start_send(MutiWindowIcedLayerEvent(id, IcedLayerEvent::NormalUpdate))
.start_send(MultiWindowIcedLayerEvent(id, IcedLayerEvent::NormalUpdate))
.expect("Cannot send");
}
},
LayerEvent::UserEvent(event) => {
event_sender
.start_send(MutiWindowIcedLayerEvent(
.start_send(MultiWindowIcedLayerEvent(
id,
IcedLayerEvent::UserEvent(event),
))
Expand Down Expand Up @@ -342,7 +342,7 @@ async fn run_instance<A, E, C>(
mut runtime: Runtime<E, IcedProxy<A::Message>, A::Message>,
mut proxy: IcedProxy<A::Message>,
mut debug: Debug,
mut event_receiver: mpsc::UnboundedReceiver<MutiWindowIcedLayerEvent<A::Message>>,
mut event_receiver: mpsc::UnboundedReceiver<MultiWindowIcedLayerEvent<A::Message>>,
mut control_sender: mpsc::UnboundedSender<Vec<LayerShellActions>>,
mut window_manager: WindowManager<A, C>,
init_command: Command<A::Message>,
Expand Down Expand Up @@ -403,7 +403,7 @@ async fn run_instance<A, E, C>(
runtime.track(application.subscription().into_recipes());
while let Some(event) = event_receiver.next().await {
match event {
MutiWindowIcedLayerEvent(
MultiWindowIcedLayerEvent(
_id,
IcedLayerEvent::RequestRefreshWithWrapper {
width,
Expand Down Expand Up @@ -523,7 +523,7 @@ async fn run_instance<A, E, C>(

debug.render_finished();
}
MutiWindowIcedLayerEvent(Some(id), IcedLayerEvent::Window(event)) => {
MultiWindowIcedLayerEvent(Some(id), IcedLayerEvent::Window(event)) => {
let Some((id, window)) = window_manager.get_mut_alias(id) else {
continue;
};
Expand All @@ -532,10 +532,10 @@ async fn run_instance<A, E, C>(
events.push((Some(id), event));
}
}
MutiWindowIcedLayerEvent(_, IcedLayerEvent::UserEvent(event)) => {
MultiWindowIcedLayerEvent(_, IcedLayerEvent::UserEvent(event)) => {
messages.push(event);
}
MutiWindowIcedLayerEvent(_, IcedLayerEvent::NormalUpdate) => {
MultiWindowIcedLayerEvent(_, IcedLayerEvent::NormalUpdate) => {
if events.is_empty() && messages.is_empty() {
continue;
}
Expand Down
7 changes: 4 additions & 3 deletions iced_sessionlock/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pub enum IcedSessionLockEvent<Message: 'static> {
height: u32,
wrapper: WindowWrapper,
},
#[allow(unused)]
RequestRefresh {
width: u32,
height: u32,
Expand All @@ -67,16 +68,16 @@ pub enum IcedSessionLockEvent<Message: 'static> {
}

#[derive(Debug)]
pub struct MutiWindowIcedSessionLockEvent<Message: 'static>(
pub struct MultiWindowIcedSessionLockEvent<Message: 'static>(
pub Option<Id>,
pub IcedSessionLockEvent<Message>,
);

impl<Message: 'static> From<(Option<Id>, IcedSessionLockEvent<Message>)>
for MutiWindowIcedSessionLockEvent<Message>
for MultiWindowIcedSessionLockEvent<Message>
{
fn from((id, message): (Option<Id>, IcedSessionLockEvent<Message>)) -> Self {
MutiWindowIcedSessionLockEvent(id, message)
MultiWindowIcedSessionLockEvent(id, message)
}
}

Expand Down
16 changes: 8 additions & 8 deletions iced_sessionlock/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use iced_futures::Subscription;
use iced_runtime::Command;
use iced_style::application::StyleSheet;

pub trait MutiApplication: Sized {
pub trait MultiApplication: Sized {
/// The [`Executor`] that will run commands and subscriptions.
///
/// The [default executor] can be a good starting point!
Expand Down Expand Up @@ -135,18 +135,18 @@ pub trait MutiApplication: Sized {
..iced_renderer::Settings::default()
};

multi_window::run::<MutiInstance<Self>, Self::Executor, iced_renderer::Compositor>(
multi_window::run::<MultiInstance<Self>, Self::Executor, iced_renderer::Compositor>(
settings,
renderer_settings,
)
}
}

struct MutiInstance<A: MutiApplication>(A);
struct MultiInstance<A: MultiApplication>(A);

impl<A> iced_runtime::multi_window::Program for MutiInstance<A>
impl<A> iced_runtime::multi_window::Program for MultiInstance<A>
where
A: MutiApplication,
A: MultiApplication,
{
type Message = A::Message;
type Theme = A::Theme;
Expand All @@ -164,16 +164,16 @@ where
}
}

impl<A> multi_window::Application for MutiInstance<A>
impl<A> multi_window::Application for MultiInstance<A>
where
A: MutiApplication,
A: MultiApplication,
{
type Flags = A::Flags;

fn new(flags: Self::Flags) -> (Self, Command<A::Message>) {
let (app, command) = A::new(flags);

(MutiInstance(app), command)
(MultiInstance(app), command)
}

fn namespace(&self) -> String {
Expand Down
Loading

0 comments on commit cffa581

Please sign in to comment.