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
#![feature(int_abs_diff)]
#![feature(thread_is_running)]
#![feature(generic_associated_types)]

use clashctl_interactive::clashctl::{self, mod_use, model};

pub mod components;
pub mod pages;

mod_use![utils, action, app, event, servo, state, error, tui_opt];

#[macro_export]
macro_rules! define_widget {
    ($name:ident) => {
        #[derive(Clone, Debug)]
        pub struct $name<'a> {
            state: &'a $crate::TuiStates<'a>,
            _life: ::std::marker::PhantomData<&'a ()>,
        }

        impl<'a> $name<'a> {
            pub fn new(state: &'a $crate::TuiStates<'a>) -> Self {
                Self {
                    _life: ::std::marker::PhantomData,
                    state,
                }
            }
        }
    };
}