This repository has been archived on 2025-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
2024-08-02 00:09:26 +03:00
|
|
|
use std::cell::Cell;
|
|
|
|
|
|
|
|
use crate::gtk;
|
|
|
|
|
|
|
|
use glib::Properties;
|
|
|
|
use gtk::glib;
|
|
|
|
use gtk::prelude::*;
|
|
|
|
use gtk::subclass::prelude::*;
|
|
|
|
|
2024-07-19 22:05:55 +03:00
|
|
|
#[repr(usize)]
|
|
|
|
#[derive(Clone)]
|
|
|
|
pub enum HammingMode {
|
|
|
|
Encrypt = 4,
|
|
|
|
Decrypt = 7,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct EventHandler<F, C> {
|
|
|
|
pub(crate) component: C,
|
|
|
|
pub(crate) callback: F,
|
|
|
|
}
|
|
|
|
|
2024-08-02 22:59:31 +03:00
|
|
|
#[derive(Default, Copy, Clone)]
|
|
|
|
pub struct SignalReduce(pub f64, pub f64, pub f64, pub f64, pub f64, pub f64);
|
|
|
|
|
|
|
|
impl SignalReduce {
|
|
|
|
pub fn new() -> Self {
|
|
|
|
Self(0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
|
|
|
|
}
|
|
|
|
}
|
2024-08-02 00:09:26 +03:00
|
|
|
|
|
|
|
#[derive(Properties, Default)]
|
|
|
|
#[properties(wrapper_type = super::ResultValue)]
|
|
|
|
pub struct ResultValue {
|
|
|
|
#[property(get, set)]
|
|
|
|
value: Cell<f64>,
|
|
|
|
}
|
|
|
|
|
|
|
|
// The central trait for subclassing a GObject
|
|
|
|
#[glib::object_subclass]
|
|
|
|
impl ObjectSubclass for ResultValue {
|
|
|
|
const NAME: &'static str = "MyGtkAppCustomButton";
|
|
|
|
type Type = super::ResultValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[glib::derived_properties]
|
|
|
|
impl ObjectImpl for ResultValue {}
|