feat(rename): renamed iirhai --> rhai_impl
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
**General things to keep in mind:**
|
||||
|
||||
- Run `cargo fmt` for formatting your code.
|
||||
- Always do PR (Pull Request) to iidev branch (especially if its a doc change).
|
||||
- Always do PR (Pull Request) to iidev branch if it is a new feature.
|
||||
|
||||
## Codebase
|
||||
|
||||
- `crates/ewwii`: Core of ewwii (ipc, daemon, options, rt engine, gtk, etc.)
|
||||
- `crates/iirhai`: Rhai implementation (parsing, modules, poll/listen handlers)
|
||||
- `crates/rhai_impl`: Rhai implementation (parsing, modules, poll/listen handlers)
|
||||
- `crates/shared_utils`: Utility functions shared between rhai and ewwii (spans, helpers)
|
||||
|
||||
44
Cargo.lock
generated
44
Cargo.lock
generated
@@ -590,7 +590,6 @@ dependencies = [
|
||||
"grass",
|
||||
"gtk",
|
||||
"gtk-layer-shell",
|
||||
"iirhai",
|
||||
"itertools",
|
||||
"log",
|
||||
"nix",
|
||||
@@ -600,6 +599,7 @@ dependencies = [
|
||||
"pretty_env_logger",
|
||||
"regex",
|
||||
"rhai",
|
||||
"rhai_impl",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"shared_utils",
|
||||
@@ -839,9 +839,9 @@ dependencies = [
|
||||
name = "generate-rhai-docs"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"iirhai",
|
||||
"rhai",
|
||||
"rhai-autodocs",
|
||||
"rhai_impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1175,26 +1175,6 @@ version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
|
||||
|
||||
[[package]]
|
||||
name = "iirhai"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"anyhow",
|
||||
"colored",
|
||||
"gtk",
|
||||
"libc",
|
||||
"log",
|
||||
"nix",
|
||||
"once_cell",
|
||||
"rhai",
|
||||
"serde",
|
||||
"shared_utils",
|
||||
"termsize",
|
||||
"textwrap",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "2.5.0"
|
||||
@@ -1860,6 +1840,26 @@ dependencies = [
|
||||
"syn 2.0.87",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rhai_impl"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"anyhow",
|
||||
"colored",
|
||||
"gtk",
|
||||
"libc",
|
||||
"log",
|
||||
"nix",
|
||||
"once_cell",
|
||||
"rhai",
|
||||
"serde",
|
||||
"shared_utils",
|
||||
"termsize",
|
||||
"textwrap",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-demangle"
|
||||
version = "0.1.24"
|
||||
|
||||
@@ -5,7 +5,7 @@ resolver = "2"
|
||||
[workspace.dependencies]
|
||||
|
||||
shared_utils = { version = "0.1.0", path = "crates/shared_utils" }
|
||||
iirhai = { version = "0.1.0", path = "crates/iirhai" }
|
||||
rhai_impl = { version = "0.1.0", path = "crates/rhai_impl" }
|
||||
|
||||
anyhow = "1.0.86"
|
||||
ahash = "0.8.12"
|
||||
|
||||
@@ -16,7 +16,7 @@ wayland = ["gtk-layer-shell"]
|
||||
|
||||
[dependencies]
|
||||
shared_utils.workspace = true
|
||||
iirhai.workspace = true
|
||||
rhai_impl.workspace = true
|
||||
|
||||
gtk-layer-shell = { version = "0.8.1", optional = true, features=["v0_6"] }
|
||||
gdkx11 = { version = "0.18", optional = true }
|
||||
|
||||
@@ -27,7 +27,7 @@ use codespan_reporting::files::Files;
|
||||
use gdk::Monitor;
|
||||
use glib::ObjectExt;
|
||||
use gtk::{gdk, glib};
|
||||
use iirhai::ast::WidgetNode;
|
||||
use rhai_impl::ast::WidgetNode;
|
||||
use itertools::Itertools;
|
||||
use once_cell::sync::Lazy;
|
||||
use rhai::Dynamic;
|
||||
@@ -316,7 +316,7 @@ impl<B: DisplayBackend> App<B> {
|
||||
/// Fully stop ewwii:
|
||||
/// close all windows, stop the script_var_handler, quit the gtk appliaction and send the exit instruction to the lifecycle manager
|
||||
fn stop_application(&mut self) {
|
||||
iirhai::updates::kill_state_change_handler();
|
||||
rhai_impl::updates::kill_state_change_handler();
|
||||
for (_, window) in self.open_windows.drain() {
|
||||
window.close();
|
||||
}
|
||||
@@ -350,7 +350,7 @@ impl<B: DisplayBackend> App<B> {
|
||||
|
||||
// stop poll/listen handlers if no windows are open
|
||||
if self.open_windows.is_empty() {
|
||||
iirhai::updates::kill_state_change_handler();
|
||||
rhai_impl::updates::kill_state_change_handler();
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@@ -403,7 +403,7 @@ impl<B: DisplayBackend> App<B> {
|
||||
let (tx, mut rx) = tokio::sync::mpsc::unbounded_channel::<String>();
|
||||
let config_path = self.paths.get_rhai_path();
|
||||
let compiled_ast = self.ewwii_config.get_owned_compiled_ast();
|
||||
let mut stored_parser = iirhai::parser::ParseConfig::new();
|
||||
let mut stored_parser = rhai_impl::parser::ParseConfig::new();
|
||||
|
||||
let widget_reg_store = widget_reg_store.clone();
|
||||
|
||||
@@ -417,7 +417,7 @@ impl<B: DisplayBackend> App<B> {
|
||||
// I just cant find the perfect place where it can live
|
||||
// so I guess that I will just let it stay right here.
|
||||
if self.open_windows.is_empty() {
|
||||
let store = iirhai::updates::handle_state_changes(
|
||||
let store = rhai_impl::updates::handle_state_changes(
|
||||
self.ewwii_config.get_root_node()?.as_ref(),
|
||||
tx,
|
||||
);
|
||||
@@ -745,7 +745,7 @@ fn initialize_window<B: DisplayBackend>(
|
||||
})
|
||||
}
|
||||
|
||||
use iirhai::parser::ParseConfig;
|
||||
use rhai_impl::parser::ParseConfig;
|
||||
|
||||
async fn generate_new_widgetnode(
|
||||
all_vars: &HashMap<String, String>,
|
||||
|
||||
@@ -8,7 +8,7 @@ use crate::{
|
||||
window::backend_window_options::BackendWindowOptionsDef,
|
||||
};
|
||||
|
||||
use iirhai::{parser::ParseConfig, ast::WidgetNode};
|
||||
use rhai_impl::{parser::ParseConfig, ast::WidgetNode};
|
||||
use rhai::{Map, AST};
|
||||
|
||||
// use tokio::{net::UnixStream, runtime::Runtime, sync::mpsc};
|
||||
|
||||
@@ -3,7 +3,7 @@ use gtk::gdk::prelude::Cast;
|
||||
|
||||
use crate::{config::WindowDefinition, widgets::widget_definitions::*};
|
||||
|
||||
use iirhai::ast::WidgetNode;
|
||||
use rhai_impl::ast::WidgetNode;
|
||||
|
||||
/// Widget input allows us to pass either a widgetnode or a window_def
|
||||
/// this is important to make build_gtk_widget standalone without having to
|
||||
|
||||
@@ -8,7 +8,7 @@ use gtk::glib::translate::FromGlib;
|
||||
use gtk::prelude::LabelExt;
|
||||
use gtk::{self, prelude::*, DestDefaults, TargetEntry, TargetList};
|
||||
use gtk::{gdk, glib, pango};
|
||||
use iirhai::ast::{get_id_to_widget_info, hash_props_and_type, WidgetNode};
|
||||
use rhai_impl::ast::{get_id_to_widget_info, hash_props_and_type, WidgetNode};
|
||||
use rhai::Map;
|
||||
|
||||
use super::widget_definitions_helper::*;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
[package]
|
||||
name = "iirhai"
|
||||
name = "rhai_impl"
|
||||
version = "0.1.0"
|
||||
authors = ["byson94 <byson94wastaken@gmail.com>"]
|
||||
edition = "2021"
|
||||
license = "GPL-3.0-or-later"
|
||||
description = "A simple rhai based expression language, used as a part of ewwii"
|
||||
description = "The rhai embedded language implementation of ewwii"
|
||||
repository = "https://github.com/byson94/ewwii"
|
||||
homepage = "https://github.com/byson94/ewwii"
|
||||
|
||||
@@ -4,6 +4,6 @@ version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
iirhai.workspace = true
|
||||
rhai_impl.workspace = true
|
||||
rhai = "1.22.2"
|
||||
rhai-autodocs = "0.9.0"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use iirhai::providers;
|
||||
use rhai_impl::providers;
|
||||
use rhai::{Engine, module_resolvers::StaticModuleResolver};
|
||||
use rhai_autodocs::{export::options, generate::mdbook};
|
||||
use std::{env, fs, path::Path};
|
||||
|
||||
Reference in New Issue
Block a user