#![allow(non_snake_case)]
#![allow(dead_code)]
use core::any::Any;
use std::os::raw::c_void;
use crate::ported::machine::Machine;
use crate::ported::object::{Object, ObjectClass};
use crate::ported::process::{
Process, ProcessClass, Process_compareByKey_Base, Process_init, Process_writeField,
};
use crate::ported::richstring::RichString;
use crate::ported::row::{Row, RowClass};
use crate::ported::settings::RowField;
#[repr(C)]
pub struct UnsupportedProcess {
pub super_: Process,
}
impl Object for UnsupportedProcess {
fn klass(&self) -> &'static ObjectClass {
self.super_.klass()
}
fn display(&self, out: &mut RichString) {
self.super_.display(out)
}
fn compare(&self, other: &dyn Object) -> i32 {
self.super_.compare(other)
}
fn row_class(&self) -> Option<&'static RowClass> {
self.super_.row_class()
}
fn process_class(&self) -> Option<&'static ProcessClass> {
self.super_.process_class()
}
fn as_row(&self) -> Option<&Row> {
Some(&self.super_.super_)
}
fn as_row_mut(&mut self) -> Option<&mut Row> {
Some(&mut self.super_.super_)
}
fn as_process(&self) -> Option<&Process> {
Some(&self.super_)
}
fn as_process_mut(&mut self) -> Option<&mut Process> {
Some(&mut self.super_)
}
}
pub fn UnsupportedProcess_new(host: *const Machine) -> Box<UnsupportedProcess> {
let mut this = Box::new(UnsupportedProcess {
super_: Process::default(),
});
Process_init(&mut this.super_, host as *const c_void);
this
}
pub fn Process_delete() {
todo!("port of UnsupportedProcess.c:54 — pure free() teardown; Rust Drop handles it")
}
pub fn UnsupportedProcess_rowWriteField(super_: &dyn Object, str: &mut RichString, field: RowField) {
let up = (super_ as &dyn Any)
.downcast_ref::<UnsupportedProcess>()
.expect("UnsupportedProcess_rowWriteField: row is not an UnsupportedProcess");
match field {
_ => {
Process_writeField(&up.super_, str, field);
}
}
}
pub fn UnsupportedProcess_compareByKey(v1: &dyn Object, v2: &dyn Object, key: RowField) -> i32 {
let p1 = (v1 as &dyn Any)
.downcast_ref::<UnsupportedProcess>()
.expect("UnsupportedProcess_compareByKey: v1 is not an UnsupportedProcess");
let p2 = (v2 as &dyn Any)
.downcast_ref::<UnsupportedProcess>()
.expect("UnsupportedProcess_compareByKey: v2 is not an UnsupportedProcess");
match key {
_ => Process_compareByKey_Base(&p1.super_, &p2.super_, key),
}
}