wasma-sys 1.3.0-beta-stable2

WASMA Windows Assignment System Monitoring Architecture — client and protocol layer
Documentation
// WASMA - Windows Assignment System Monitoring Architecture
// lib.rs — Crate Root
// Tüm modülleri birleştiren ve public API'yi dışa açan ana giriş noktası.
// Ocak–Şubat 2026

#![doc = include_str!("../README.md")]
#![warn(missing_docs)]
#![warn(rust_2018_idioms)]
#![allow(unused)]
#![allow(warnings)]
#![cfg_attr(not(unix), allow(unused_imports))]

// ============================================================================
// EXTERNAL CRATE IMPORTS
// ============================================================================

#[cfg(feature = "async")]
extern crate tokio;

#[cfg(feature = "serde")]
extern crate serde;

#[cfg(feature = "config-toml")]
extern crate toml;

#[cfg(feature = "anyhow")]
extern crate anyhow;

#[cfg(feature = "x11")]
extern crate xcb;

#[cfg(feature = "wayland")]
extern crate wayland_client;

#[cfg(feature = "wgpu")]
extern crate wgpu;

#[cfg(feature = "toolkit-iced")]
extern crate iced;

#[cfg(feature = "toolkit-gtk4")]
extern crate gtk4;

#[cfg(feature = "opencl")]
extern crate ocl;

// ============================================================================
// CORE MODULES
// ============================================================================

/// Yapılandırma dosyası ayrıştırıcısı ve WasmaConfig tanımı.
/// `wasma.in.conf` formatını okur, varsayılan config üretir.
pub use wasma_client::parser;

/// UClient (Universal Client) — temel veri akışı ve SectionMemory yönetimi.
/// Tüm istemci motorlarının ortak bellek altyapısını sağlar.
pub use wasma_client::uclient;

/// WindowClient — rendering ve viewport yönetimi.
/// RawWindowClient ile PosixWindowLauncher tarafından kullanılır.
pub use wasma_client::window_client;

/// Pencere yönetimi tipleri ve yapıları.
/// WindowGeometry, WindowState, WindowType, ResourceLimits, PermissionScope.
pub use wasma_client::window_handling;

// ============================================================================
// POSIX RAW CLIENT MODULES
// ============================================================================

/// Raw POSIX Uygulama Veri Erişim İstemcisi.
///
/// POSIX fd (`read()`) tabanlı veri akışı motoru.  
/// [`UClientEngine`] trait'ini implement eder.  
/// Ping-pong çift tampon, NULL_EXCEPTION (scope_level=0) ve
/// bölümlenmiş mod desteklenir.
///
/// Ana tipler:
/// - [`wasma_client_unix_posix_raw_app::RawAppClient`]
/// - [`wasma_client_unix_posix_raw_app::RawAppDescriptor`]
/// - [`wasma_client_unix_posix_raw_app::RawAppSource`]
/// - [`wasma_client_unix_posix_raw_app::UClientEngine`] (trait)
/// - [`wasma_client_unix_posix_raw_app::posix`] (alt modül)
#[cfg(unix)]
pub mod wasma_client_unix_posix_raw_app;

/// Raw POSIX Applet Letting İstemcisi.
///
/// Applet ↔ Host iletişimi için reaktif letting protokolü.
/// Sabit 20 byte başlık + değişken payload (LETL/LRSP magic).  
/// [`UClientEngine`]'den bağımsızdır — sadece letting protokolü.
///
/// Ana tipler:
/// - [`wasma_client_unix_posix_raw_applettel::ApplettelClient`]
/// - [`wasma_client_unix_posix_raw_applettel::AppletDescriptor`]
/// - [`wasma_client_unix_posix_raw_applettel::AppletKind`]
/// - [`wasma_client_unix_posix_raw_applettel::FieldKey`]
/// - [`wasma_client_unix_posix_raw_applettel::LettingEvent`]
#[cfg(unix)]
pub mod wasma_client_unix_posix_raw_applettel;

/// Raw POSIX Pencere Yönetim İstemcisi.
///
/// Pencere yönetimini POSIX fd üzerinden ham olarak yürütür.
/// Rendering [`window_client::WindowClient`]'a delege edilir.
/// [`UClientEngine`] trait'ini implement eder.
/// 16 byte WAWM/WRSP protokolü.
///
/// Ana tipler:
/// - [`wasma_client_unix_posix_raw_window::RawWindowClient`]
/// - [`wasma_client_unix_posix_raw_window::RawWindowRecord`]
/// - [`wasma_client_unix_posix_raw_window::RawWindowFd`]
/// - [`wasma_client_unix_posix_raw_window::geometry_codec`]
/// - [`wasma_client_unix_posix_raw_window::state_codec`]
#[cfg(unix)]
pub mod wasma_client_unix_posix_raw_window;

// ============================================================================
// UNIVERSAL PROTOCOL MODULES
// ============================================================================

/// Evrensel POSIX Pencere İstemcisi — Platform-agnostik.
///
/// Compile-time mimari dispatch (`#[cfg(target_arch)]`) ile
/// x86_64, AArch64, RISC-V 64, OpenRISC, PowerPC 64, SPARC 64
/// ve SISD (kısmi) desteklenir.
///
/// Ana tipler:
/// - [`wasma_protocol_universal_client_unix_posix_window::UniversalClient`]
/// - [`wasma_protocol_universal_client_unix_posix_window::ArchKind`]
/// - [`wasma_protocol_universal_client_unix_posix_window::ArchBackend`]
/// - [`wasma_protocol_universal_client_unix_posix_window::UniversalWindowOps`]
/// - [`wasma_protocol_universal_client_unix_posix_window::UniversalTransport`]
/// - [`wasma_protocol_universal_client_unix_posix_window::CURRENT_ARCH`] (sabit)
#[cfg(unix)]
pub mod wasma_protocol_universal_client_unix_posix_window;

/// POSIX Pencere Çizim Dönüşüm Yöneticisi.
///
/// Koordinat sistemi dönüşümleri: mantıksal piksel, fiziksel piksel,
/// DPI normalize, noktalar (pt), milimetre.  
/// Pipeline (A→B→C) ve doğrudan tek adım dönüşüm desteklenir.  
/// Soft (CPU) ve donanım hızlandırmalı (mimari dispatch) motorlar.
///
/// Ana tipler:
/// - [`wasma_protocol_unix_posix_conversion::ConversionManager`]
/// - [`wasma_protocol_unix_posix_conversion::ConversionEngine`]
/// - [`wasma_protocol_unix_posix_conversion::ConversionPipeline`]
/// - [`wasma_protocol_unix_posix_conversion::DirectConverter`]
/// - [`wasma_protocol_unix_posix_conversion::DpiProfile`]
/// - [`wasma_protocol_unix_posix_conversion::CoordSpace`]
pub mod wasma_protocol_unix_posix_conversion;

/// POSIX Optionalty Yapılandırması.
///
/// Tüm isteğe bağlı WASMA pencere çizim ve render ayarları.
/// Gruplar: [`DrawOpt`], [`PixelOpt`], [`XlinxOpt`], [`BackendOpt`].  
/// Builder pattern + thread-safe runtime override ([`RuntimeOptStore`]).
///
/// [`DrawOpt`]: wasma_protocol_unix_posix_opt::DrawOpt
/// [`PixelOpt`]: wasma_protocol_unix_posix_opt::PixelOpt
/// [`XlinxOpt`]: wasma_protocol_unix_posix_opt::XlinxOpt
/// [`BackendOpt`]: wasma_protocol_unix_posix_opt::BackendOpt
/// [`RuntimeOptStore`]: wasma_protocol_unix_posix_opt::RuntimeOptStore
///
/// Ana tipler:
/// - [`wasma_protocol_unix_posix_opt::PosixOpt`]
/// - [`wasma_protocol_unix_posix_opt::PosixOptBuilder`]
/// - [`wasma_protocol_unix_posix_opt::RuntimeOptStore`]
/// - [`wasma_protocol_unix_posix_opt::DisplayBackend`]
/// - [`wasma_protocol_unix_posix_opt::XlinxArch`]
/// - [`wasma_protocol_unix_posix_opt::RasterMode`]
pub mod wasma_protocol_unix_posix_opt;

/// Normal (ham olmayan) POSIX Pencere Başlatma Protokolü.
///
/// Manifest/config tabanlı ve runtime API başlatmayı destekler.  
/// Pencere modu: Singularity (tekli) veya Multitary (çoklu).  
/// [`UClientEngine`] implement eder.  
/// [`PosixOpt`] her başlatmada otomatik uygulanır.
///
/// [`PosixOpt`]: wasma_protocol_unix_posix_opt::PosixOpt
///
/// Ana tipler:
/// - [`wasma_protocol_unix_posix_window::PosixWindowLauncher`]
/// - [`wasma_protocol_unix_posix_window::PosixWindowLauncherBuilder`]
/// - [`wasma_protocol_unix_posix_window::WindowSpec`]
/// - [`wasma_protocol_unix_posix_window::WindowSpecBuilder`]
/// - [`wasma_protocol_unix_posix_window::PosixWindow`]
/// - [`wasma_protocol_unix_posix_window::WindowMode`]
#[cfg(unix)]
pub mod wasma_protocol_unix_posix_window;

// ============================================================================
// WINDOW ESCAPE / SHIFTMASKING MODULES
// ============================================================================

/// POSIX Pencere Escape — ShiftMasking Protokolü.
///
/// Yalnızca UNIX/POSIX uyumlu cihazlar için.  
/// **64-bit:** tam destek (XOR + BitRotation + PolynomialHash + LFSR).  
/// **32-bit:** yarı kısıtlı (LFSR devre dışı, 32-bit rotation).
///
/// Ana tipler:
/// - [`wasma_protocol_unix_posix_windowesc::PosixWindowEsc`]
/// - [`wasma_protocol_unix_posix_windowesc::ShiftMaskEngine`]
/// - [`wasma_protocol_unix_posix_windowesc::ShiftMaskKey`]
/// - [`wasma_protocol_unix_posix_windowesc::ShiftMaskAlgo`]
/// - [`wasma_protocol_unix_posix_windowesc::WindowIdEscaper`]
/// - [`wasma_protocol_unix_posix_windowesc::StreamEscaper`]
/// - [`wasma_protocol_unix_posix_windowesc::PlatformWidth`]
#[cfg(unix)]
pub mod wasma_protocol_unix_posix_windowesc;

/// Unixverse Pencere Escape — AVAX ShiftMasking Protokolü.
///
/// Tüm platformlar için, POSIX olmayan cihazlar dahil.  
/// **32-bit:** TAM destek (kısıtlama yok).  
/// **64-bit:** TAM destek.  
/// AVAX (Adaptive Vectorized Accumulative XOR-shift) — unixverse'e özel algoritma.  
/// `wasma_protocol_unix_posix_windowesc`'den tamamen bağımsızdır.
///
/// Ana tipler:
/// - [`wasma_protocol_unixverse_windowesc::UniverseWindowEsc`]
/// - [`wasma_protocol_unixverse_windowesc::UniverseEngine`]
/// - [`wasma_protocol_unixverse_windowesc::UniverseKey`]
/// - [`wasma_protocol_unixverse_windowesc::UniverseAlgo`]
/// - [`wasma_protocol_unixverse_windowesc::AvaxEngine`]
/// - [`wasma_protocol_unixverse_windowesc::UniverseWindowIdEscaper`]
/// - [`wasma_protocol_unixverse_windowesc::UniverseStreamEscaper`]
/// - [`wasma_protocol_unixverse_windowesc::UniverseWidth`]
pub mod wasma_protocol_unixverse_windowesc;

// ============================================================================
// PUBLIC API RE-EXPORTS — En sık kullanılan tipler doğrudan erişilebilir
// ============================================================================

// --- Config ---
pub use parser::{ConfigParser, WasmaConfig};

// --- UClient Engine trait (tüm istemcilerin ortak arayüzü) ---
#[cfg(unix)]
pub use wasma_client_unix_posix_raw_app::UClientEngine;

// --- Pencere tipleri ---
pub use window_handling::{WindowGeometry, WindowState, WindowType};

// --- Mimari bilgisi ---
#[cfg(unix)]
pub use wasma_protocol_universal_client_unix_posix_window::{ArchKind, CURRENT_ARCH};

// --- Dönüşüm yöneticisi ---
pub use wasma_protocol_unix_posix_conversion::{ConversionManager, CoordSpace, DpiProfile};

// --- Optionalty ---
pub use wasma_protocol_unix_posix_opt::{
    DisplayBackend, PosixOpt, PosixOptBuilder, RuntimeOptStore,
};

// --- Pencere başlatıcı ---
#[cfg(unix)]
pub use wasma_protocol_unix_posix_window::{
    PosixWindowLauncher, PosixWindowLauncherBuilder, WindowMode, WindowSpec,
};

// --- ShiftMask (POSIX) ---
#[cfg(unix)]
pub use wasma_protocol_unix_posix_windowesc::{PosixWindowEsc, ShiftMaskAlgo, ShiftMaskKey};

// --- ShiftMask (Unixverse/AVAX) ---
pub use wasma_protocol_unixverse_windowesc::{UniverseAlgo, UniverseKey, UniverseWindowEsc};

// ============================================================================
// PRELUDE — Tek import ile temel API
// ============================================================================

/// WASMA prelude — en yaygın kullanılan tipleri tek seferde import eder.
///
/// ```rust
/// use wasma_sys::prelude::*;
/// ```
pub mod prelude {
    // Config
    pub use crate::parser::{ConfigParser, WasmaConfig};

    // Window tipleri
    pub use crate::window_handling::{WindowGeometry, WindowState, WindowType};

    // Dönüşüm
    pub use crate::wasma_protocol_unix_posix_conversion::{
        ConversionManager, ConversionPipeline, CoordSpace, DirectConverter, DpiProfile,
    };

    // Opt
    pub use crate::wasma_protocol_unix_posix_opt::{
        DisplayBackend, PosixOpt, PosixOptBuilder, RasterMode, RuntimeOptStore, ToolkitTheme,
        XlinxArch,
    };

    // Unixverse ShiftMask (tüm platformlarda mevcut)
    pub use crate::wasma_protocol_unixverse_windowesc::{
        AvaxEngine, UniverseAlgo, UniverseKey, UniverseWindowEsc,
    };

    // POSIX'e özgü
    #[cfg(unix)]
    pub use crate::wasma_client_unix_posix_raw_app::{
        RawAppClient, RawAppClientBuilder, RawAppSource, UClientEngine,
    };

    #[cfg(unix)]
    pub use crate::wasma_client_unix_posix_raw_applettel::{
        AppletDescriptor, AppletKind, ApplettelClient, ApplettelClientBuilder, EmbeddedAppletRole,
        FieldKey, FieldValue, LettingEvent, SystemAppletRole,
    };

    #[cfg(unix)]
    pub use crate::wasma_client_unix_posix_raw_window::{RawWindowClient, RawWindowClientBuilder};

    #[cfg(unix)]
    pub use crate::wasma_protocol_universal_client_unix_posix_window::{
        ArchKind, UniversalClient, UniversalClientBuilder, CURRENT_ARCH,
    };

    #[cfg(unix)]
    pub use crate::wasma_protocol_unix_posix_window::{
        PosixWindowLauncher, PosixWindowLauncherBuilder, WindowMode, WindowSpec, WindowSpecBuilder,
    };

    #[cfg(unix)]
    pub use crate::wasma_protocol_unix_posix_windowesc::{
        PlatformWidth, PosixWindowEsc, ShiftMaskAlgo, ShiftMaskKey,
    };
}

// ============================================================================
// CRATE META
// ============================================================================

/// WASMA kütüphane sürümü.
pub const VERSION: &str = env!("CARGO_PKG_VERSION");

/// WASMA mimari adı (compile-time).
#[cfg(unix)]
pub const ARCH_NAME: &str = "unix";