text
stringlengths
8
4.13M
// https://leetcode.com/problems/to-lower-case/submissions/ impl Solution { pub fn to_lower_case(s: String) -> String { s.to_lowercase() } }
extern crate ansi_term; extern crate rusqlite; extern crate serde; #[macro_use] extern crate serde_derive; use rusqlite::NO_PARAMS; use rusqlite::{Connection, Result}; use ansi_term::Colour; use text_io::read; #[derive(Serialize, Deserialize, Debug)] struct Card { question: String, answer: String, } fn enter_new_card(conn: &mut Connection) -> Result<()> { // Connect to our DB let tx = conn.transaction()?; // Ask user for input println!("{}", Colour::Blue.paint("Enter a question: ")); let input_question: String = read!("{}\n"); println!("{}", Colour::Blue.paint("Enter the answer: ")); let input_answer: String = read!("{}\n"); // add it to our database tx.execute( "INSERT INTO edu_cards (question, answer, score) values(?1, ?2, 0.0);", &[input_question, input_answer], )?; tx.commit() } fn display_cards(conn: &mut Connection) -> Result<()> { let mut stmt = conn.prepare("SELECT * FROM edu_cards;")?; let cards = stmt.query_map(NO_PARAMS, |row| { Ok(Card { question: row.get(1)?, answer: row.get(2)?, }) })?; for card in cards { println!("{:?}", card); } Ok(()) } fn study_cards(conn: &mut Connection) -> Result<()> { let mut stmt = conn.prepare("SELECT * FROM edu_cards;")?; let cards = stmt.query_map(NO_PARAMS, |row| { Ok(Card { question: row.get(1)?, answer: row.get(2)?, }) })?; for card in cards { let result = card.unwrap(); println!("{}", result.question); println!("[hit any key] - Reveal the answer"); let user_input: String = read!("{}\n"); println!("{}", result.answer); } Ok(()) } fn main() -> Result<()> { println!( "{}", Colour::Green .bold() .paint("================= Welcome to Edulingo! ===================") ); let mut conn = Connection::open("edulingo.db")?; conn.execute( "create table if not exists edu_cards ( id integer primary key, question text not null unique, answer text not null, score real not null );", NO_PARAMS, )?; loop { println!( "{}", Colour::Yellow.bold().paint("Please select an option!") ); println!("{}", Colour::Green.paint("[!c] - Create a card")); println!("{}", Colour::Red.paint("[!s] - Study")); println!("{}", Colour::Green.paint("[!v] - View cards")); println!("{}", Colour::Red.paint("[!q] - Quit")); let input_control: String = read!("{}\n"); if input_control == "!c" { enter_new_card(&mut conn); } else if input_control == "!s" { study_cards(&mut conn); } else if input_control == "!v" { display_cards(&mut conn); } else if input_control == "!q" { break; } } Ok(()) }
mod data; mod languages; mod templates; mod utils; use actix_web::{get, web, App, HttpRequest, HttpResponse, HttpServer}; use dotenv::dotenv; use std::env; #[get("/")] async fn home(page_url: web::Data<String>, req: HttpRequest) -> actix_web::Result<HttpResponse> { templates::render("home", page_url, req) } #[get("/projects")] async fn projects( page_url: web::Data<String>, req: HttpRequest, ) -> actix_web::Result<HttpResponse> { templates::render("projects", page_url, req) } #[get("/project/{name}")] async fn project(page_url: web::Data<String>, req: HttpRequest) -> actix_web::Result<HttpResponse> { templates::render("project", page_url, req) } #[get("/blog")] async fn blog(page_url: web::Data<String>, req: HttpRequest) -> actix_web::Result<HttpResponse> { templates::render("blog", page_url, req) } #[get("/blog/{name:.*}")] async fn blog_post(page_url: web::Data<String>, req: HttpRequest) -> actix_web::Result<HttpResponse> { templates::render("blog_post", page_url, req) } #[get("*")] async fn error404( page_url: web::Data<String>, req: HttpRequest, ) -> actix_web::Result<HttpResponse> { templates::render("error404", page_url, req) } #[actix_web::main] async fn main() -> std::io::Result<()> { // Read .env file. dotenv().ok(); // Get `API_HOST` from the environment variables. let host: String = env::var("API_HOST").unwrap_or(String::from("127.0.0.1")); // Get `API_PORT` from the environment variables. let port: u16 = env::var("API_PORT") .unwrap_or(String::from("5000")) .parse() .expect("The `API_PORT` is not a valid port number."); // Get `API_URL` from the environment variables. let page_url: String = env::var("API_URL").unwrap_or(format!("http://{}:{}/", host, port)); // Initialize the HTTP Server HttpServer::new(move || { App::new() .data(page_url.clone()) .service(actix_files::Files::new("/assets/", "assets/public/").show_files_listing()) .service(home) .service(projects) .service(project) .service(blog) .service(blog_post) .service(error404) }) .bind((host, port))? .run() .await }
use super::Context; use crate::projects::mutations::MutationProjects; use crate::stories::mutations::MutationStories; use crate::users::mutations::MutationUsers; pub struct MutationRoot; #[juniper::graphql_object(Context = Context)] impl MutationRoot { fn users(&self) -> MutationUsers { MutationUsers } fn projects(&self) -> MutationProjects { MutationProjects } fn stories(&self) -> MutationStories { MutationStories } }
use embedded_hal::digital::v2::InputPin; use core::convert::Infallible; pub struct Encoder<CHA: InputPin, CHB: InputPin> { channel_a: CHA, channel_b: CHB, position: i32, } pub enum Channel { A, B } impl<CHA, CHB> Encoder<CHA, CHB> where CHA: InputPin<Error = Infallible>, CHB: InputPin<Error = Infallible>, { pub fn new(ch_a: CHA, ch_b: CHB) -> Self { Self { channel_a: ch_a, channel_b: ch_b, position: 0, } } pub fn update(&mut self, ch: Channel) -> (i32, i32) { let a: bool = self.channel_a.is_high().unwrap(); let b: bool = self.channel_b.is_high().unwrap(); let mut step = 1; match ch { Channel::A => { if a == b { step = -1; } }, Channel::B => { if a != b { step = -1; } } } self.position += step; (self.position, step) } }
use rendering::camera::Camera; use rendering::colors::Color; #[derive(Debug, Clone)] pub enum RenderMode { WIREFRAME, DEFAULT, } struct Renderer { camera: &'static Camera, clear_color: Color, // passes: Vec<RenderPass>, mode: RenderMode, }
use crate::attributes::*; use glam::{vec2, vec3, Vec3, Mat3}; use image::{RgbaImage, Rgba}; pub struct Program { pub vertex_shader: Box<dyn FnMut(VertexAttributes, UniformAttributes) -> VertexAttributes>, pub fragment_shader: Box<dyn FnMut(VertexAttributes, UniformAttributes) -> FragmentAttributes>, pub blending_shader: Box<dyn FnMut(FragmentAttributes, Rgba<u8>) -> Rgba<u8>>, } pub fn rasterize_triangle(program: &mut Program, uniform: UniformAttributes, v1: VertexAttributes, v2: VertexAttributes, v3: VertexAttributes, frame_buffer: &mut RgbaImage) { let mut p = vec![]; p.push(v1.position / v1.position.w()); p.push(v2.position / v2.position.w()); p.push(v3.position / v3.position.w()); p.iter_mut().for_each(|point| { point[0] = ((point[0] + 1.0) / 2.0) * frame_buffer.height() as f32; point[1] = ((point[1] + 1.0) / 2.0) * frame_buffer.width() as f32; }); let f32_cmp = |a: &f32, b: &f32| a.partial_cmp(b).unwrap(); let x: Vec<f32> = p.iter().map(|point| point[0]).collect(); let y: Vec<f32> = p.iter().map(|point| point[1]).collect(); let lx = x.clone().into_iter().min_by(f32_cmp).unwrap().max(0.0) as u32; let ly = y.clone().into_iter().min_by(f32_cmp).unwrap().max(0.0) as u32; let ux = x.into_iter().max_by(f32_cmp).unwrap().min(frame_buffer.height() as f32 - 1.0) as u32; let uy = y.into_iter().max_by(f32_cmp).unwrap().min(frame_buffer.width() as f32 - 1.0) as u32; let mut a = Mat3::zero(); a.set_x_axis(p[0].truncate().into()); a.set_y_axis(p[1].truncate().into()); a.set_z_axis(p[2].truncate().into()); a = a.transpose(); a.set_z_axis(Vec3::one()); a = a.transpose(); let ai = a.inverse(); for i in lx..=ux { for j in ly..=uy { let pixel = vec3(i as f32 + 0.5, j as f32 + 0.5, 1.0); let b = ai * pixel; if b.min_element() >= 0.0 { let va = VertexAttributes::interpolate(v1, v2, v3, b.x(), b.y(), b.z()); if va.position[2] >= -1.0 && va.position[2] <= 1.0 { let frag = (program.fragment_shader)(va, uniform); let h = frame_buffer.height() - 1; *frame_buffer.get_pixel_mut(i, h - j) = (program.blending_shader)(frag, *frame_buffer.get_pixel_mut(i, h - j)); } } } } } pub fn rasterize_triangles(program: &mut Program, uniform: UniformAttributes, vertices: Vec<VertexAttributes>, frame_buffer: &mut RgbaImage) { let mut v: Vec<VertexAttributes> = vec![]; vertices.clone().into_iter().for_each(|vertex| v.push((program.vertex_shader)(vertex, uniform))); for i in 0..vertices.len() / 3 { rasterize_triangle(program, uniform, v[i * 3 + 0], v[i * 3 + 1], v[i * 3 + 2], frame_buffer); } } pub fn rasterize_line(program: &mut Program, uniform: UniformAttributes, v1: VertexAttributes, v2: VertexAttributes, line_thickness: f32, frame_buffer: &mut RgbaImage) { let mut p = vec![]; p.push(v1.position / v1.position.w()); p.push(v2.position / v2.position.w()); p.iter_mut().for_each(|point| { point[0] = ((point[0] + 1.0) / 2.0) * frame_buffer.height() as f32; point[1] = ((point[1] + 1.0) / 2.0) * frame_buffer.width() as f32; }); let f32_cmp = |a: &f32, b: &f32| a.partial_cmp(b).unwrap(); let x: Vec<f32> = p.iter().map(|point| point[0]).collect(); let y: Vec<f32> = p.iter().map(|point| point[1]).collect(); let lx = (x.clone().into_iter().min_by(f32_cmp).unwrap() - line_thickness).max(0.0) as u32; let ly = (y.clone().into_iter().min_by(f32_cmp).unwrap() - line_thickness).max(0.0) as u32; let ux = (x.into_iter().max_by(f32_cmp).unwrap() + line_thickness).min(frame_buffer.height() as f32 - 1.0) as u32; let uy = (y.into_iter().max_by(f32_cmp).unwrap() + line_thickness).min(frame_buffer.width() as f32 - 1.0) as u32; let l1 = vec2(p[0][0], p[0][1]); let l2 = vec2(p[1][0], p[1][1]); let mut t = -1.0; let ll = (l1 - l2).length_squared(); for i in lx..=ux { for j in ly..=uy { let pixel = vec2(i as f32 + 0.5, j as f32 + 0.5); if ll == 0.0 { t = 0.0; } else { t = ((pixel - l1).dot(l2 - l1) / ll).min(1.0).max(0.0); } let pixel_p = l1 + t * (l2 - l1); if (pixel - pixel_p).length_squared() < line_thickness * line_thickness { let va = VertexAttributes::interpolate(v1, v2, v1, 1.0 - t, t, 0.0); let frag = (program.fragment_shader)(va, uniform); let h = frame_buffer.height() - 1; *frame_buffer.get_pixel_mut(i, h - j) = (program.blending_shader)(frag, *frame_buffer.get_pixel_mut(i, h - j)); } } } } pub fn rasterize_lines(program: &mut Program, uniform: UniformAttributes, vertices: Vec<VertexAttributes>, line_thickness: f32, frame_buffer: &mut RgbaImage) { let mut v: Vec<VertexAttributes> = vec![]; vertices.clone().into_iter().for_each(|vertex| v.push((program.vertex_shader)(vertex, uniform))); for i in 0..vertices.len() / 2 { rasterize_line(program, uniform, v[i * 2 + 0], v[i * 2 + 1], line_thickness, frame_buffer); } }
use sdl2::rect::{Point, Rect}; pub fn update_pos_x(r1: &mut Rect, r2: &Rect, x: i32) { if x != 0 && r1.has_intersection(*r2) { if x > 0 { r1.set_right(r2.x); } else { r1.set_x(r2.right()); } } } pub fn update_pos_y(r1: &mut Rect, r2: &Rect, y: i32) { if y != 0 && r1.has_intersection(*r2) { if y > 0 { r1.set_bottom(r2.top()); } else { r1.set_y(r2.bottom()); } } } fn line_intersect(a: Point, b: Point, c: Point, d: Point) -> Option<Point> { let r = b - a; let s = d - c; let e = r.x * s.y - r.y * s.x; let u = ((c.x - a.x) * r.y - (c.y - a.y) * r.x) / e; let t = ((c.x - a.x) * s.y - (c.y - a.y) * s.x) / e; if 0 <= u && u <= 1 && 0 <= t && t <= 1 { return Some(a + (r * t)); } None } pub fn raycast(to: Point, from: Point, query: &Rect) -> Option<Point> { match query.intersect_line(to, from) { Some(hit) => Some(hit.0), None => None } }
// auto generated, do not modify. // created: Mon Feb 22 23:57:02 2016 // src-file: /QtWidgets/qgraphicsitem.h // dst-file: /src/widgets/qgraphicsitem.rs // // header block begin => #![feature(libc)] #![feature(core)] #![feature(collections)] extern crate libc; use self::libc::*; // <= header block end // main block begin => // <= main block end // use block begin => // use super::qgraphicsitem::QGraphicsObject; // 773 use std::ops::Deref; use super::super::gui::qtextcursor::*; // 771 use super::super::gui::qfont::*; // 771 use super::super::core::qstring::*; // 771 // use super::qgraphicsitem::QGraphicsItem; // 773 use super::super::core::qobjectdefs::*; // 771 use super::super::gui::qtextdocument::*; // 771 use super::super::gui::qpainter::*; // 771 use super::qstyleoption::*; // 773 use super::qwidget::*; // 773 use super::super::gui::qcolor::*; // 771 use super::super::gui::qpainterpath::*; // 771 use super::super::core::qrect::*; // 771 use super::super::core::qpoint::*; // 771 use super::super::gui::qpixmap::*; // 771 // use super::qgraphicsitem::QAbstractGraphicsShapeItem; // 773 use super::super::gui::qpolygon::*; // 771 use super::super::gui::qpen::*; // 771 use super::super::core::qline::*; // 771 use super::super::gui::qbrush::*; // 771 use super::qgraphicswidget::*; // 773 use super::super::gui::qtransform::*; // 771 use super::super::gui::qregion::*; // 771 use super::qgraphicseffect::*; // 773 use super::qgraphicsscene::*; // 773 // use super::qlist::*; // 775 use super::super::gui::qmatrix::*; // 771 use super::super::core::qsize::*; // 771 // use super::qgraphicsitem::QGraphicsItemGroup; // 773 use super::super::core::qvariant::*; // 771 use super::super::gui::qcursor::*; // 771 use super::super::core::qobject::*; // 771 // <= use block end // ext block begin => // #[link(name = "Qt5Core")] // #[link(name = "Qt5Gui")] // #[link(name = "Qt5Widgets")] // #[link(name = "QtInline")] extern { fn QGraphicsTextItem_Class_Size() -> c_int; // proto: bool QGraphicsTextItem::openExternalLinks(); fn C_ZNK17QGraphicsTextItem17openExternalLinksEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: qreal QGraphicsTextItem::textWidth(); fn C_ZNK17QGraphicsTextItem9textWidthEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: void QGraphicsTextItem::setTextWidth(qreal width); fn C_ZN17QGraphicsTextItem12setTextWidthEd(qthis: u64 /* *mut c_void*/, arg0: c_double); // proto: void QGraphicsTextItem::setTextCursor(const QTextCursor & cursor); fn C_ZN17QGraphicsTextItem13setTextCursorERK11QTextCursor(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: int QGraphicsTextItem::type(); fn C_ZNK17QGraphicsTextItem4typeEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: QFont QGraphicsTextItem::font(); fn C_ZNK17QGraphicsTextItem4fontEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsTextItem::QGraphicsTextItem(const QString & text, QGraphicsItem * parent); fn C_ZN17QGraphicsTextItemC2ERK7QStringP13QGraphicsItem(arg0: *mut c_void, arg1: *mut c_void) -> u64; // proto: const QMetaObject * QGraphicsTextItem::metaObject(); fn C_ZNK17QGraphicsTextItem10metaObjectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsTextItem::setOpenExternalLinks(bool open); fn C_ZN17QGraphicsTextItem20setOpenExternalLinksEb(qthis: u64 /* *mut c_void*/, arg0: c_char); // proto: void QGraphicsTextItem::setTabChangesFocus(bool b); fn C_ZN17QGraphicsTextItem18setTabChangesFocusEb(qthis: u64 /* *mut c_void*/, arg0: c_char); // proto: QString QGraphicsTextItem::toHtml(); fn C_ZNK17QGraphicsTextItem6toHtmlEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsTextItem::setDocument(QTextDocument * document); fn C_ZN17QGraphicsTextItem11setDocumentEP13QTextDocument(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: void QGraphicsTextItem::setPlainText(const QString & text); fn C_ZN17QGraphicsTextItem12setPlainTextERK7QString(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: void QGraphicsTextItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); fn C_ZN17QGraphicsTextItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void, arg2: *mut c_void); // proto: void QGraphicsTextItem::setFont(const QFont & font); fn C_ZN17QGraphicsTextItem7setFontERK5QFont(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: void QGraphicsTextItem::setDefaultTextColor(const QColor & c); fn C_ZN17QGraphicsTextItem19setDefaultTextColorERK6QColor(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: QColor QGraphicsTextItem::defaultTextColor(); fn C_ZNK17QGraphicsTextItem16defaultTextColorEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsTextItem::~QGraphicsTextItem(); fn C_ZN17QGraphicsTextItemD2Ev(qthis: u64 /* *mut c_void*/); // proto: QPainterPath QGraphicsTextItem::shape(); fn C_ZNK17QGraphicsTextItem5shapeEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QTextCursor QGraphicsTextItem::textCursor(); fn C_ZNK17QGraphicsTextItem10textCursorEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QRectF QGraphicsTextItem::boundingRect(); fn C_ZNK17QGraphicsTextItem12boundingRectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QString QGraphicsTextItem::toPlainText(); fn C_ZNK17QGraphicsTextItem11toPlainTextEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsTextItem::setHtml(const QString & html); fn C_ZN17QGraphicsTextItem7setHtmlERK7QString(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: bool QGraphicsTextItem::tabChangesFocus(); fn C_ZNK17QGraphicsTextItem15tabChangesFocusEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: void QGraphicsTextItem::QGraphicsTextItem(QGraphicsItem * parent); fn C_ZN17QGraphicsTextItemC2EP13QGraphicsItem(arg0: *mut c_void) -> u64; // proto: QTextDocument * QGraphicsTextItem::document(); fn C_ZNK17QGraphicsTextItem8documentEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: bool QGraphicsTextItem::isObscuredBy(const QGraphicsItem * item); fn C_ZNK17QGraphicsTextItem12isObscuredByEPK13QGraphicsItem(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: QPainterPath QGraphicsTextItem::opaqueArea(); fn C_ZNK17QGraphicsTextItem10opaqueAreaEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: bool QGraphicsTextItem::contains(const QPointF & point); fn C_ZNK17QGraphicsTextItem8containsERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: void QGraphicsTextItem::adjustSize(); fn C_ZN17QGraphicsTextItem10adjustSizeEv(qthis: u64 /* *mut c_void*/); fn QGraphicsPixmapItem_Class_Size() -> c_int; // proto: void QGraphicsPixmapItem::QGraphicsPixmapItem(QGraphicsItem * parent); fn C_ZN19QGraphicsPixmapItemC2EP13QGraphicsItem(arg0: *mut c_void) -> u64; // proto: void QGraphicsPixmapItem::QGraphicsPixmapItem(const QPixmap & pixmap, QGraphicsItem * parent); fn C_ZN19QGraphicsPixmapItemC2ERK7QPixmapP13QGraphicsItem(arg0: *mut c_void, arg1: *mut c_void) -> u64; // proto: void QGraphicsPixmapItem::~QGraphicsPixmapItem(); fn C_ZN19QGraphicsPixmapItemD2Ev(qthis: u64 /* *mut c_void*/); // proto: QPainterPath QGraphicsPixmapItem::opaqueArea(); fn C_ZNK19QGraphicsPixmapItem10opaqueAreaEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: bool QGraphicsPixmapItem::isObscuredBy(const QGraphicsItem * item); fn C_ZNK19QGraphicsPixmapItem12isObscuredByEPK13QGraphicsItem(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: int QGraphicsPixmapItem::type(); fn C_ZNK19QGraphicsPixmapItem4typeEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: QPainterPath QGraphicsPixmapItem::shape(); fn C_ZNK19QGraphicsPixmapItem5shapeEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QPixmap QGraphicsPixmapItem::pixmap(); fn C_ZNK19QGraphicsPixmapItem6pixmapEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsPixmapItem::setOffset(qreal x, qreal y); fn C_ZN19QGraphicsPixmapItem9setOffsetEdd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double); // proto: void QGraphicsPixmapItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); fn C_ZN19QGraphicsPixmapItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void, arg2: *mut c_void); // proto: QPointF QGraphicsPixmapItem::offset(); fn C_ZNK19QGraphicsPixmapItem6offsetEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QRectF QGraphicsPixmapItem::boundingRect(); fn C_ZNK19QGraphicsPixmapItem12boundingRectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: bool QGraphicsPixmapItem::contains(const QPointF & point); fn C_ZNK19QGraphicsPixmapItem8containsERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: void QGraphicsPixmapItem::setPixmap(const QPixmap & pixmap); fn C_ZN19QGraphicsPixmapItem9setPixmapERK7QPixmap(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: void QGraphicsPixmapItem::setOffset(const QPointF & offset); fn C_ZN19QGraphicsPixmapItem9setOffsetERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); fn QGraphicsRectItem_Class_Size() -> c_int; // proto: bool QGraphicsRectItem::isObscuredBy(const QGraphicsItem * item); fn C_ZNK17QGraphicsRectItem12isObscuredByEPK13QGraphicsItem(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: QRectF QGraphicsRectItem::boundingRect(); fn C_ZNK17QGraphicsRectItem12boundingRectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: int QGraphicsRectItem::type(); fn C_ZNK17QGraphicsRectItem4typeEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: QRectF QGraphicsRectItem::rect(); fn C_ZNK17QGraphicsRectItem4rectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QPainterPath QGraphicsRectItem::shape(); fn C_ZNK17QGraphicsRectItem5shapeEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsRectItem::~QGraphicsRectItem(); fn C_ZN17QGraphicsRectItemD2Ev(qthis: u64 /* *mut c_void*/); // proto: void QGraphicsRectItem::QGraphicsRectItem(const QRectF & rect, QGraphicsItem * parent); fn C_ZN17QGraphicsRectItemC2ERK6QRectFP13QGraphicsItem(arg0: *mut c_void, arg1: *mut c_void) -> u64; // proto: QPainterPath QGraphicsRectItem::opaqueArea(); fn C_ZNK17QGraphicsRectItem10opaqueAreaEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsRectItem::setRect(const QRectF & rect); fn C_ZN17QGraphicsRectItem7setRectERK6QRectF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: void QGraphicsRectItem::setRect(qreal x, qreal y, qreal w, qreal h); fn C_ZN17QGraphicsRectItem7setRectEdddd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double); // proto: void QGraphicsRectItem::QGraphicsRectItem(QGraphicsItem * parent); fn C_ZN17QGraphicsRectItemC2EP13QGraphicsItem(arg0: *mut c_void) -> u64; // proto: bool QGraphicsRectItem::contains(const QPointF & point); fn C_ZNK17QGraphicsRectItem8containsERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: void QGraphicsRectItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); fn C_ZN17QGraphicsRectItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void, arg2: *mut c_void); // proto: void QGraphicsRectItem::QGraphicsRectItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem * parent); fn C_ZN17QGraphicsRectItemC2EddddP13QGraphicsItem(arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double, arg4: *mut c_void) -> u64; fn QGraphicsEllipseItem_Class_Size() -> c_int; // proto: void QGraphicsEllipseItem::setStartAngle(int angle); fn C_ZN20QGraphicsEllipseItem13setStartAngleEi(qthis: u64 /* *mut c_void*/, arg0: c_int); // proto: bool QGraphicsEllipseItem::contains(const QPointF & point); fn C_ZNK20QGraphicsEllipseItem8containsERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: void QGraphicsEllipseItem::QGraphicsEllipseItem(const QRectF & rect, QGraphicsItem * parent); fn C_ZN20QGraphicsEllipseItemC2ERK6QRectFP13QGraphicsItem(arg0: *mut c_void, arg1: *mut c_void) -> u64; // proto: void QGraphicsEllipseItem::setRect(const QRectF & rect); fn C_ZN20QGraphicsEllipseItem7setRectERK6QRectF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: void QGraphicsEllipseItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); fn C_ZN20QGraphicsEllipseItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void, arg2: *mut c_void); // proto: bool QGraphicsEllipseItem::isObscuredBy(const QGraphicsItem * item); fn C_ZNK20QGraphicsEllipseItem12isObscuredByEPK13QGraphicsItem(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: QRectF QGraphicsEllipseItem::rect(); fn C_ZNK20QGraphicsEllipseItem4rectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: int QGraphicsEllipseItem::spanAngle(); fn C_ZNK20QGraphicsEllipseItem9spanAngleEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: int QGraphicsEllipseItem::startAngle(); fn C_ZNK20QGraphicsEllipseItem10startAngleEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: void QGraphicsEllipseItem::QGraphicsEllipseItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem * parent); fn C_ZN20QGraphicsEllipseItemC2EddddP13QGraphicsItem(arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double, arg4: *mut c_void) -> u64; // proto: void QGraphicsEllipseItem::setRect(qreal x, qreal y, qreal w, qreal h); fn C_ZN20QGraphicsEllipseItem7setRectEdddd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double); // proto: void QGraphicsEllipseItem::setSpanAngle(int angle); fn C_ZN20QGraphicsEllipseItem12setSpanAngleEi(qthis: u64 /* *mut c_void*/, arg0: c_int); // proto: int QGraphicsEllipseItem::type(); fn C_ZNK20QGraphicsEllipseItem4typeEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: QRectF QGraphicsEllipseItem::boundingRect(); fn C_ZNK20QGraphicsEllipseItem12boundingRectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QPainterPath QGraphicsEllipseItem::shape(); fn C_ZNK20QGraphicsEllipseItem5shapeEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsEllipseItem::~QGraphicsEllipseItem(); fn C_ZN20QGraphicsEllipseItemD2Ev(qthis: u64 /* *mut c_void*/); // proto: void QGraphicsEllipseItem::QGraphicsEllipseItem(QGraphicsItem * parent); fn C_ZN20QGraphicsEllipseItemC2EP13QGraphicsItem(arg0: *mut c_void) -> u64; // proto: QPainterPath QGraphicsEllipseItem::opaqueArea(); fn C_ZNK20QGraphicsEllipseItem10opaqueAreaEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; fn QGraphicsPolygonItem_Class_Size() -> c_int; // proto: QPainterPath QGraphicsPolygonItem::shape(); fn C_ZNK20QGraphicsPolygonItem5shapeEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: bool QGraphicsPolygonItem::isObscuredBy(const QGraphicsItem * item); fn C_ZNK20QGraphicsPolygonItem12isObscuredByEPK13QGraphicsItem(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: void QGraphicsPolygonItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); fn C_ZN20QGraphicsPolygonItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void, arg2: *mut c_void); // proto: void QGraphicsPolygonItem::QGraphicsPolygonItem(QGraphicsItem * parent); fn C_ZN20QGraphicsPolygonItemC2EP13QGraphicsItem(arg0: *mut c_void) -> u64; // proto: QRectF QGraphicsPolygonItem::boundingRect(); fn C_ZNK20QGraphicsPolygonItem12boundingRectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: int QGraphicsPolygonItem::type(); fn C_ZNK20QGraphicsPolygonItem4typeEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: void QGraphicsPolygonItem::~QGraphicsPolygonItem(); fn C_ZN20QGraphicsPolygonItemD2Ev(qthis: u64 /* *mut c_void*/); // proto: QPolygonF QGraphicsPolygonItem::polygon(); fn C_ZNK20QGraphicsPolygonItem7polygonEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QPainterPath QGraphicsPolygonItem::opaqueArea(); fn C_ZNK20QGraphicsPolygonItem10opaqueAreaEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsPolygonItem::QGraphicsPolygonItem(const QPolygonF & polygon, QGraphicsItem * parent); fn C_ZN20QGraphicsPolygonItemC2ERK9QPolygonFP13QGraphicsItem(arg0: *mut c_void, arg1: *mut c_void) -> u64; // proto: bool QGraphicsPolygonItem::contains(const QPointF & point); fn C_ZNK20QGraphicsPolygonItem8containsERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: void QGraphicsPolygonItem::setPolygon(const QPolygonF & polygon); fn C_ZN20QGraphicsPolygonItem10setPolygonERK9QPolygonF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); fn QGraphicsPathItem_Class_Size() -> c_int; // proto: void QGraphicsPathItem::setPath(const QPainterPath & path); fn C_ZN17QGraphicsPathItem7setPathERK12QPainterPath(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: void QGraphicsPathItem::QGraphicsPathItem(const QPainterPath & path, QGraphicsItem * parent); fn C_ZN17QGraphicsPathItemC2ERK12QPainterPathP13QGraphicsItem(arg0: *mut c_void, arg1: *mut c_void) -> u64; // proto: bool QGraphicsPathItem::contains(const QPointF & point); fn C_ZNK17QGraphicsPathItem8containsERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: QRectF QGraphicsPathItem::boundingRect(); fn C_ZNK17QGraphicsPathItem12boundingRectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: int QGraphicsPathItem::type(); fn C_ZNK17QGraphicsPathItem4typeEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: QPainterPath QGraphicsPathItem::opaqueArea(); fn C_ZNK17QGraphicsPathItem10opaqueAreaEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QPainterPath QGraphicsPathItem::path(); fn C_ZNK17QGraphicsPathItem4pathEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsPathItem::~QGraphicsPathItem(); fn C_ZN17QGraphicsPathItemD2Ev(qthis: u64 /* *mut c_void*/); // proto: QPainterPath QGraphicsPathItem::shape(); fn C_ZNK17QGraphicsPathItem5shapeEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: bool QGraphicsPathItem::isObscuredBy(const QGraphicsItem * item); fn C_ZNK17QGraphicsPathItem12isObscuredByEPK13QGraphicsItem(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: void QGraphicsPathItem::QGraphicsPathItem(QGraphicsItem * parent); fn C_ZN17QGraphicsPathItemC2EP13QGraphicsItem(arg0: *mut c_void) -> u64; // proto: void QGraphicsPathItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); fn C_ZN17QGraphicsPathItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void, arg2: *mut c_void); fn QGraphicsLineItem_Class_Size() -> c_int; // proto: void QGraphicsLineItem::setPen(const QPen & pen); fn C_ZN17QGraphicsLineItem6setPenERK4QPen(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: void QGraphicsLineItem::QGraphicsLineItem(QGraphicsItem * parent); fn C_ZN17QGraphicsLineItemC2EP13QGraphicsItem(arg0: *mut c_void) -> u64; // proto: bool QGraphicsLineItem::isObscuredBy(const QGraphicsItem * item); fn C_ZNK17QGraphicsLineItem12isObscuredByEPK13QGraphicsItem(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: void QGraphicsLineItem::QGraphicsLineItem(const QLineF & line, QGraphicsItem * parent); fn C_ZN17QGraphicsLineItemC2ERK6QLineFP13QGraphicsItem(arg0: *mut c_void, arg1: *mut c_void) -> u64; // proto: QLineF QGraphicsLineItem::line(); fn C_ZNK17QGraphicsLineItem4lineEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QPainterPath QGraphicsLineItem::opaqueArea(); fn C_ZNK17QGraphicsLineItem10opaqueAreaEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsLineItem::setLine(qreal x1, qreal y1, qreal x2, qreal y2); fn C_ZN17QGraphicsLineItem7setLineEdddd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double); // proto: QRectF QGraphicsLineItem::boundingRect(); fn C_ZNK17QGraphicsLineItem12boundingRectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QPen QGraphicsLineItem::pen(); fn C_ZNK17QGraphicsLineItem3penEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsLineItem::setLine(const QLineF & line); fn C_ZN17QGraphicsLineItem7setLineERK6QLineF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: QPainterPath QGraphicsLineItem::shape(); fn C_ZNK17QGraphicsLineItem5shapeEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsLineItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); fn C_ZN17QGraphicsLineItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void, arg2: *mut c_void); // proto: int QGraphicsLineItem::type(); fn C_ZNK17QGraphicsLineItem4typeEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: void QGraphicsLineItem::QGraphicsLineItem(qreal x1, qreal y1, qreal x2, qreal y2, QGraphicsItem * parent); fn C_ZN17QGraphicsLineItemC2EddddP13QGraphicsItem(arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double, arg4: *mut c_void) -> u64; // proto: bool QGraphicsLineItem::contains(const QPointF & point); fn C_ZNK17QGraphicsLineItem8containsERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: void QGraphicsLineItem::~QGraphicsLineItem(); fn C_ZN17QGraphicsLineItemD2Ev(qthis: u64 /* *mut c_void*/); fn QGraphicsItemGroup_Class_Size() -> c_int; // proto: bool QGraphicsItemGroup::isObscuredBy(const QGraphicsItem * item); fn C_ZNK18QGraphicsItemGroup12isObscuredByEPK13QGraphicsItem(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: void QGraphicsItemGroup::~QGraphicsItemGroup(); fn C_ZN18QGraphicsItemGroupD2Ev(qthis: u64 /* *mut c_void*/); // proto: void QGraphicsItemGroup::QGraphicsItemGroup(QGraphicsItem * parent); fn C_ZN18QGraphicsItemGroupC2EP13QGraphicsItem(arg0: *mut c_void) -> u64; // proto: int QGraphicsItemGroup::type(); fn C_ZNK18QGraphicsItemGroup4typeEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: QRectF QGraphicsItemGroup::boundingRect(); fn C_ZNK18QGraphicsItemGroup12boundingRectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsItemGroup::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); fn C_ZN18QGraphicsItemGroup5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void, arg2: *mut c_void); // proto: void QGraphicsItemGroup::removeFromGroup(QGraphicsItem * item); fn C_ZN18QGraphicsItemGroup15removeFromGroupEP13QGraphicsItem(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: void QGraphicsItemGroup::addToGroup(QGraphicsItem * item); fn C_ZN18QGraphicsItemGroup10addToGroupEP13QGraphicsItem(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: QPainterPath QGraphicsItemGroup::opaqueArea(); fn C_ZNK18QGraphicsItemGroup10opaqueAreaEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; fn QAbstractGraphicsShapeItem_Class_Size() -> c_int; // proto: bool QAbstractGraphicsShapeItem::isObscuredBy(const QGraphicsItem * item); fn C_ZNK26QAbstractGraphicsShapeItem12isObscuredByEPK13QGraphicsItem(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: QBrush QAbstractGraphicsShapeItem::brush(); fn C_ZNK26QAbstractGraphicsShapeItem5brushEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QAbstractGraphicsShapeItem::QAbstractGraphicsShapeItem(QGraphicsItem * parent); fn C_ZN26QAbstractGraphicsShapeItemC2EP13QGraphicsItem(arg0: *mut c_void) -> u64; // proto: QPainterPath QAbstractGraphicsShapeItem::opaqueArea(); fn C_ZNK26QAbstractGraphicsShapeItem10opaqueAreaEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QAbstractGraphicsShapeItem::setBrush(const QBrush & brush); fn C_ZN26QAbstractGraphicsShapeItem8setBrushERK6QBrush(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: void QAbstractGraphicsShapeItem::setPen(const QPen & pen); fn C_ZN26QAbstractGraphicsShapeItem6setPenERK4QPen(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: QPen QAbstractGraphicsShapeItem::pen(); fn C_ZNK26QAbstractGraphicsShapeItem3penEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QAbstractGraphicsShapeItem::~QAbstractGraphicsShapeItem(); fn C_ZN26QAbstractGraphicsShapeItemD2Ev(qthis: u64 /* *mut c_void*/); fn QGraphicsItem_Class_Size() -> c_int; // proto: QPainterPath QGraphicsItem::mapFromParent(const QPainterPath & path); fn C_ZNK13QGraphicsItem13mapFromParentERK12QPainterPath(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: QPointF QGraphicsItem::mapFromItem(const QGraphicsItem * item, const QPointF & point); fn C_ZNK13QGraphicsItem11mapFromItemEPKS_RK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void) -> *mut c_void; // proto: QGraphicsItem * QGraphicsItem::focusItem(); fn C_ZNK13QGraphicsItem9focusItemEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QGraphicsObject * QGraphicsItem::parentObject(); fn C_ZNK13QGraphicsItem12parentObjectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsItem::setTransformOriginPoint(const QPointF & origin); fn C_ZN13QGraphicsItem23setTransformOriginPointERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: void QGraphicsItem::ungrabMouse(); fn C_ZN13QGraphicsItem11ungrabMouseEv(qthis: u64 /* *mut c_void*/); // proto: int QGraphicsItem::type(); fn C_ZNK13QGraphicsItem4typeEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: bool QGraphicsItem::isSelected(); fn C_ZNK13QGraphicsItem10isSelectedEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: QPolygonF QGraphicsItem::mapFromItem(const QGraphicsItem * item, qreal x, qreal y, qreal w, qreal h); fn C_ZNK13QGraphicsItem11mapFromItemEPKS_dddd(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: c_double, arg2: c_double, arg3: c_double, arg4: c_double) -> *mut c_void; // proto: QGraphicsWidget * QGraphicsItem::parentWidget(); fn C_ZNK13QGraphicsItem12parentWidgetEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsItem::resetTransform(); fn C_ZN13QGraphicsItem14resetTransformEv(qthis: u64 /* *mut c_void*/); // proto: QRegion QGraphicsItem::boundingRegion(const QTransform & itemToDeviceTransform); fn C_ZNK13QGraphicsItem14boundingRegionERK10QTransform(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: void QGraphicsItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); fn C_ZN13QGraphicsItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void, arg2: *mut c_void); // proto: bool QGraphicsItem::isActive(); fn C_ZNK13QGraphicsItem8isActiveEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: void QGraphicsItem::QGraphicsItem(QGraphicsItem * parent); fn C_ZN13QGraphicsItemC2EPS_(arg0: *mut c_void) -> u64; // proto: QPolygonF QGraphicsItem::mapToParent(const QPolygonF & polygon); fn C_ZNK13QGraphicsItem11mapToParentERK9QPolygonF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: bool QGraphicsItem::isWidget(); fn C_ZNK13QGraphicsItem8isWidgetEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: void QGraphicsItem::setParentItem(QGraphicsItem * parent); fn C_ZN13QGraphicsItem13setParentItemEPS_(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: QPolygonF QGraphicsItem::mapToItem(const QGraphicsItem * item, const QRectF & rect); fn C_ZNK13QGraphicsItem9mapToItemEPKS_RK6QRectF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void) -> *mut c_void; // proto: QGraphicsWidget * QGraphicsItem::window(); fn C_ZNK13QGraphicsItem6windowEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QPointF QGraphicsItem::scenePos(); fn C_ZNK13QGraphicsItem8scenePosEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: bool QGraphicsItem::handlesChildEvents(); fn C_ZNK13QGraphicsItem18handlesChildEventsEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: void QGraphicsItem::setOpacity(qreal opacity); fn C_ZN13QGraphicsItem10setOpacityEd(qthis: u64 /* *mut c_void*/, arg0: c_double); // proto: QTransform QGraphicsItem::sceneTransform(); fn C_ZNK13QGraphicsItem14sceneTransformEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsItem::setZValue(qreal z); fn C_ZN13QGraphicsItem9setZValueEd(qthis: u64 /* *mut c_void*/, arg0: c_double); // proto: QPolygonF QGraphicsItem::mapFromParent(const QRectF & rect); fn C_ZNK13QGraphicsItem13mapFromParentERK6QRectF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: QPolygonF QGraphicsItem::mapFromParent(qreal x, qreal y, qreal w, qreal h); fn C_ZNK13QGraphicsItem13mapFromParentEdddd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double) -> *mut c_void; // proto: bool QGraphicsItem::isObscured(qreal x, qreal y, qreal w, qreal h); fn C_ZNK13QGraphicsItem10isObscuredEdddd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double) -> c_char; // proto: void QGraphicsItem::installSceneEventFilter(QGraphicsItem * filterItem); fn C_ZN13QGraphicsItem23installSceneEventFilterEPS_(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: void QGraphicsItem::setY(qreal y); fn C_ZN13QGraphicsItem4setYEd(qthis: u64 /* *mut c_void*/, arg0: c_double); // proto: QRectF QGraphicsItem::mapRectToItem(const QGraphicsItem * item, qreal x, qreal y, qreal w, qreal h); fn C_ZNK13QGraphicsItem13mapRectToItemEPKS_dddd(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: c_double, arg2: c_double, arg3: c_double, arg4: c_double) -> *mut c_void; // proto: QGraphicsItem * QGraphicsItem::parentItem(); fn C_ZNK13QGraphicsItem10parentItemEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsItem::clearFocus(); fn C_ZN13QGraphicsItem10clearFocusEv(qthis: u64 /* *mut c_void*/); // proto: bool QGraphicsItem::isWindow(); fn C_ZNK13QGraphicsItem8isWindowEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: QPointF QGraphicsItem::transformOriginPoint(); fn C_ZNK13QGraphicsItem20transformOriginPointEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QRectF QGraphicsItem::boundingRect(); fn C_ZNK13QGraphicsItem12boundingRectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QRectF QGraphicsItem::childrenBoundingRect(); fn C_ZNK13QGraphicsItem20childrenBoundingRectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: bool QGraphicsItem::isObscured(const QRectF & rect); fn C_ZNK13QGraphicsItem10isObscuredERK6QRectF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: QPolygonF QGraphicsItem::mapFromScene(const QRectF & rect); fn C_ZNK13QGraphicsItem12mapFromSceneERK6QRectF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: bool QGraphicsItem::hasCursor(); fn C_ZNK13QGraphicsItem9hasCursorEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: void QGraphicsItem::setGraphicsEffect(QGraphicsEffect * effect); fn C_ZN13QGraphicsItem17setGraphicsEffectEP15QGraphicsEffect(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: QPainterPath QGraphicsItem::mapToParent(const QPainterPath & path); fn C_ZNK13QGraphicsItem11mapToParentERK12QPainterPath(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: void QGraphicsItem::ensureVisible(qreal x, qreal y, qreal w, qreal h, int xmargin, int ymargin); fn C_ZN13QGraphicsItem13ensureVisibleEddddii(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double, arg4: c_int, arg5: c_int); // proto: QPolygonF QGraphicsItem::mapToItem(const QGraphicsItem * item, qreal x, qreal y, qreal w, qreal h); fn C_ZNK13QGraphicsItem9mapToItemEPKS_dddd(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: c_double, arg2: c_double, arg3: c_double, arg4: c_double) -> *mut c_void; // proto: QPointF QGraphicsItem::mapToItem(const QGraphicsItem * item, qreal x, qreal y); fn C_ZNK13QGraphicsItem9mapToItemEPKS_dd(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: c_double, arg2: c_double) -> *mut c_void; // proto: QRectF QGraphicsItem::mapRectToParent(const QRectF & rect); fn C_ZNK13QGraphicsItem15mapRectToParentERK6QRectF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: void QGraphicsItem::setToolTip(const QString & toolTip); fn C_ZN13QGraphicsItem10setToolTipERK7QString(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: qreal QGraphicsItem::rotation(); fn C_ZNK13QGraphicsItem8rotationEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: QGraphicsScene * QGraphicsItem::scene(); fn C_ZNK13QGraphicsItem5sceneEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QPainterPath QGraphicsItem::mapToItem(const QGraphicsItem * item, const QPainterPath & path); fn C_ZNK13QGraphicsItem9mapToItemEPKS_RK12QPainterPath(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void) -> *mut c_void; // proto: QRectF QGraphicsItem::mapRectToParent(qreal x, qreal y, qreal w, qreal h); fn C_ZNK13QGraphicsItem15mapRectToParentEdddd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double) -> *mut c_void; // proto: QPolygonF QGraphicsItem::mapFromItem(const QGraphicsItem * item, const QRectF & rect); fn C_ZNK13QGraphicsItem11mapFromItemEPKS_RK6QRectF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void) -> *mut c_void; // proto: QRectF QGraphicsItem::mapRectFromParent(const QRectF & rect); fn C_ZNK13QGraphicsItem17mapRectFromParentERK6QRectF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: void QGraphicsItem::setFocusProxy(QGraphicsItem * item); fn C_ZN13QGraphicsItem13setFocusProxyEPS_(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: bool QGraphicsItem::acceptDrops(); fn C_ZNK13QGraphicsItem11acceptDropsEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: QPointF QGraphicsItem::mapToParent(const QPointF & point); fn C_ZNK13QGraphicsItem11mapToParentERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: QRectF QGraphicsItem::mapRectFromScene(const QRectF & rect); fn C_ZNK13QGraphicsItem16mapRectFromSceneERK6QRectF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: QGraphicsItem * QGraphicsItem::focusScopeItem(); fn C_ZNK13QGraphicsItem14focusScopeItemEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsItem::removeSceneEventFilter(QGraphicsItem * filterItem); fn C_ZN13QGraphicsItem22removeSceneEventFilterEPS_(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: QGraphicsItem * QGraphicsItem::focusProxy(); fn C_ZNK13QGraphicsItem10focusProxyEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QPointF QGraphicsItem::mapToItem(const QGraphicsItem * item, const QPointF & point); fn C_ZNK13QGraphicsItem9mapToItemEPKS_RK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void) -> *mut c_void; // proto: QRectF QGraphicsItem::sceneBoundingRect(); fn C_ZNK13QGraphicsItem17sceneBoundingRectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsItem::~QGraphicsItem(); fn C_ZN13QGraphicsItemD2Ev(qthis: u64 /* *mut c_void*/); // proto: void QGraphicsItem::setX(qreal x); fn C_ZN13QGraphicsItem4setXEd(qthis: u64 /* *mut c_void*/, arg0: c_double); // proto: void QGraphicsItem::update(qreal x, qreal y, qreal width, qreal height); fn C_ZN13QGraphicsItem6updateEdddd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double); // proto: void QGraphicsItem::setSelected(bool selected); fn C_ZN13QGraphicsItem11setSelectedEb(qthis: u64 /* *mut c_void*/, arg0: c_char); // proto: QRectF QGraphicsItem::mapRectToItem(const QGraphicsItem * item, const QRectF & rect); fn C_ZNK13QGraphicsItem13mapRectToItemEPKS_RK6QRectF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void) -> *mut c_void; // proto: void QGraphicsItem::stackBefore(const QGraphicsItem * sibling); fn C_ZN13QGraphicsItem11stackBeforeEPKS_(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: QPointF QGraphicsItem::mapFromItem(const QGraphicsItem * item, qreal x, qreal y); fn C_ZNK13QGraphicsItem11mapFromItemEPKS_dd(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: c_double, arg2: c_double) -> *mut c_void; // proto: void QGraphicsItem::resetMatrix(); fn C_ZN13QGraphicsItem11resetMatrixEv(qthis: u64 /* *mut c_void*/); // proto: QPainterPath QGraphicsItem::opaqueArea(); fn C_ZNK13QGraphicsItem10opaqueAreaEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsItem::unsetCursor(); fn C_ZN13QGraphicsItem11unsetCursorEv(qthis: u64 /* *mut c_void*/); // proto: QPointF QGraphicsItem::mapFromParent(qreal x, qreal y); fn C_ZNK13QGraphicsItem13mapFromParentEdd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double) -> *mut c_void; // proto: QRectF QGraphicsItem::mapRectToScene(const QRectF & rect); fn C_ZNK13QGraphicsItem14mapRectToSceneERK6QRectF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: QRectF QGraphicsItem::mapRectFromItem(const QGraphicsItem * item, qreal x, qreal y, qreal w, qreal h); fn C_ZNK13QGraphicsItem15mapRectFromItemEPKS_dddd(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: c_double, arg2: c_double, arg3: c_double, arg4: c_double) -> *mut c_void; // proto: qreal QGraphicsItem::scale(); fn C_ZNK13QGraphicsItem5scaleEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: void QGraphicsItem::setBoundingRegionGranularity(qreal granularity); fn C_ZN13QGraphicsItem28setBoundingRegionGranularityEd(qthis: u64 /* *mut c_void*/, arg0: c_double); // proto: void QGraphicsItem::setAcceptDrops(bool on); fn C_ZN13QGraphicsItem14setAcceptDropsEb(qthis: u64 /* *mut c_void*/, arg0: c_char); // proto: QPolygonF QGraphicsItem::mapFromScene(qreal x, qreal y, qreal w, qreal h); fn C_ZNK13QGraphicsItem12mapFromSceneEdddd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double) -> *mut c_void; // proto: void QGraphicsItem::ungrabKeyboard(); fn C_ZN13QGraphicsItem14ungrabKeyboardEv(qthis: u64 /* *mut c_void*/); // proto: void QGraphicsItem::setEnabled(bool enabled); fn C_ZN13QGraphicsItem10setEnabledEb(qthis: u64 /* *mut c_void*/, arg0: c_char); // proto: QGraphicsEffect * QGraphicsItem::graphicsEffect(); fn C_ZNK13QGraphicsItem14graphicsEffectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: bool QGraphicsItem::acceptHoverEvents(); fn C_ZNK13QGraphicsItem17acceptHoverEventsEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: QGraphicsWidget * QGraphicsItem::topLevelWidget(); fn C_ZNK13QGraphicsItem14topLevelWidgetEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QList<QGraphicsTransform *> QGraphicsItem::transformations(); fn C_ZNK13QGraphicsItem15transformationsEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QPolygonF QGraphicsItem::mapToScene(qreal x, qreal y, qreal w, qreal h); fn C_ZNK13QGraphicsItem10mapToSceneEdddd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double) -> *mut c_void; // proto: QPointF QGraphicsItem::mapToScene(qreal x, qreal y); fn C_ZNK13QGraphicsItem10mapToSceneEdd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double) -> *mut c_void; // proto: QRectF QGraphicsItem::mapRectFromScene(qreal x, qreal y, qreal w, qreal h); fn C_ZNK13QGraphicsItem16mapRectFromSceneEdddd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double) -> *mut c_void; // proto: void QGraphicsItem::advance(int phase); fn C_ZN13QGraphicsItem7advanceEi(qthis: u64 /* *mut c_void*/, arg0: c_int); // proto: QMatrix QGraphicsItem::sceneMatrix(); fn C_ZNK13QGraphicsItem11sceneMatrixEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsItem::setFiltersChildEvents(bool enabled); fn C_ZN13QGraphicsItem21setFiltersChildEventsEb(qthis: u64 /* *mut c_void*/, arg0: c_char); // proto: QPolygonF QGraphicsItem::mapToScene(const QPolygonF & polygon); fn C_ZNK13QGraphicsItem10mapToSceneERK9QPolygonF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: QTransform QGraphicsItem::itemTransform(const QGraphicsItem * other, bool * ok); fn C_ZNK13QGraphicsItem13itemTransformEPKS_Pb(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_char) -> *mut c_void; // proto: void QGraphicsItem::setTransformOriginPoint(qreal ax, qreal ay); fn C_ZN13QGraphicsItem23setTransformOriginPointEdd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double); // proto: void QGraphicsItem::moveBy(qreal dx, qreal dy); fn C_ZN13QGraphicsItem6moveByEdd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double); // proto: QPolygonF QGraphicsItem::mapFromScene(const QPolygonF & polygon); fn C_ZNK13QGraphicsItem12mapFromSceneERK9QPolygonF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: QGraphicsItemGroup * QGraphicsItem::group(); fn C_ZNK13QGraphicsItem5groupEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QPainterPath QGraphicsItem::shape(); fn C_ZNK13QGraphicsItem5shapeEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QPointF QGraphicsItem::mapFromScene(qreal x, qreal y); fn C_ZNK13QGraphicsItem12mapFromSceneEdd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double) -> *mut c_void; // proto: void QGraphicsItem::scroll(qreal dx, qreal dy, const QRectF & rect); fn C_ZN13QGraphicsItem6scrollEddRK6QRectF(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double, arg2: *mut c_void); // proto: bool QGraphicsItem::isObscuredBy(const QGraphicsItem * item); fn C_ZNK13QGraphicsItem12isObscuredByEPKS_(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: QPointF QGraphicsItem::mapFromParent(const QPointF & point); fn C_ZNK13QGraphicsItem13mapFromParentERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: void QGraphicsItem::setData(int key, const QVariant & value); fn C_ZN13QGraphicsItem7setDataEiRK8QVariant(qthis: u64 /* *mut c_void*/, arg0: c_int, arg1: *mut c_void); // proto: QGraphicsItem * QGraphicsItem::commonAncestorItem(const QGraphicsItem * other); fn C_ZNK13QGraphicsItem18commonAncestorItemEPKS_(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: QPainterPath QGraphicsItem::mapFromScene(const QPainterPath & path); fn C_ZNK13QGraphicsItem12mapFromSceneERK12QPainterPath(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: QPainterPath QGraphicsItem::mapToScene(const QPainterPath & path); fn C_ZNK13QGraphicsItem10mapToSceneERK12QPainterPath(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: QPolygonF QGraphicsItem::mapToParent(qreal x, qreal y, qreal w, qreal h); fn C_ZNK13QGraphicsItem11mapToParentEdddd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double) -> *mut c_void; // proto: void QGraphicsItem::setGroup(QGraphicsItemGroup * group); fn C_ZN13QGraphicsItem8setGroupEP18QGraphicsItemGroup(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: QRectF QGraphicsItem::mapRectFromParent(qreal x, qreal y, qreal w, qreal h); fn C_ZNK13QGraphicsItem17mapRectFromParentEdddd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double) -> *mut c_void; // proto: void QGraphicsItem::show(); fn C_ZN13QGraphicsItem4showEv(qthis: u64 /* *mut c_void*/); // proto: QRectF QGraphicsItem::mapRectFromItem(const QGraphicsItem * item, const QRectF & rect); fn C_ZNK13QGraphicsItem15mapRectFromItemEPKS_RK6QRectF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void) -> *mut c_void; // proto: qreal QGraphicsItem::y(); fn C_ZNK13QGraphicsItem1yEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: QPointF QGraphicsItem::mapFromScene(const QPointF & point); fn C_ZNK13QGraphicsItem12mapFromSceneERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: bool QGraphicsItem::hasFocus(); fn C_ZNK13QGraphicsItem8hasFocusEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: QPainterPath QGraphicsItem::clipPath(); fn C_ZNK13QGraphicsItem8clipPathEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsItem::setPos(qreal x, qreal y); fn C_ZN13QGraphicsItem6setPosEdd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double); // proto: bool QGraphicsItem::isEnabled(); fn C_ZNK13QGraphicsItem9isEnabledEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: bool QGraphicsItem::contains(const QPointF & point); fn C_ZNK13QGraphicsItem8containsERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: bool QGraphicsItem::isPanel(); fn C_ZNK13QGraphicsItem7isPanelEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: bool QGraphicsItem::filtersChildEvents(); fn C_ZNK13QGraphicsItem18filtersChildEventsEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: void QGraphicsItem::grabKeyboard(); fn C_ZN13QGraphicsItem12grabKeyboardEv(qthis: u64 /* *mut c_void*/); // proto: QPainterPath QGraphicsItem::mapFromItem(const QGraphicsItem * item, const QPainterPath & path); fn C_ZNK13QGraphicsItem11mapFromItemEPKS_RK12QPainterPath(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void) -> *mut c_void; // proto: void QGraphicsItem::setActive(bool active); fn C_ZN13QGraphicsItem9setActiveEb(qthis: u64 /* *mut c_void*/, arg0: c_char); // proto: QGraphicsObject * QGraphicsItem::toGraphicsObject(); fn C_ZN13QGraphicsItem16toGraphicsObjectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QPolygonF QGraphicsItem::mapFromItem(const QGraphicsItem * item, const QPolygonF & polygon); fn C_ZNK13QGraphicsItem11mapFromItemEPKS_RK9QPolygonF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void) -> *mut c_void; // proto: void QGraphicsItem::setHandlesChildEvents(bool enabled); fn C_ZN13QGraphicsItem21setHandlesChildEventsEb(qthis: u64 /* *mut c_void*/, arg0: c_char); // proto: QPolygonF QGraphicsItem::mapFromParent(const QPolygonF & polygon); fn C_ZNK13QGraphicsItem13mapFromParentERK9QPolygonF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: QPointF QGraphicsItem::mapToParent(qreal x, qreal y); fn C_ZNK13QGraphicsItem11mapToParentEdd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double) -> *mut c_void; // proto: void QGraphicsItem::setMatrix(const QMatrix & matrix, bool combine); fn C_ZN13QGraphicsItem9setMatrixERK7QMatrixb(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: c_char); // proto: void QGraphicsItem::update(const QRectF & rect); fn C_ZN13QGraphicsItem6updateERK6QRectF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: QPolygonF QGraphicsItem::mapToItem(const QGraphicsItem * item, const QPolygonF & polygon); fn C_ZNK13QGraphicsItem9mapToItemEPKS_RK9QPolygonF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void) -> *mut c_void; // proto: QTransform QGraphicsItem::transform(); fn C_ZNK13QGraphicsItem9transformEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QVariant QGraphicsItem::data(int key); fn C_ZNK13QGraphicsItem4dataEi(qthis: u64 /* *mut c_void*/, arg0: c_int) -> *mut c_void; // proto: void QGraphicsItem::hide(); fn C_ZN13QGraphicsItem4hideEv(qthis: u64 /* *mut c_void*/); // proto: bool QGraphicsItem::isUnderMouse(); fn C_ZNK13QGraphicsItem12isUnderMouseEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: void QGraphicsItem::setAcceptTouchEvents(bool enabled); fn C_ZN13QGraphicsItem20setAcceptTouchEventsEb(qthis: u64 /* *mut c_void*/, arg0: c_char); // proto: void QGraphicsItem::setAcceptHoverEvents(bool enabled); fn C_ZN13QGraphicsItem20setAcceptHoverEventsEb(qthis: u64 /* *mut c_void*/, arg0: c_char); // proto: QList<QGraphicsItem *> QGraphicsItem::childItems(); fn C_ZNK13QGraphicsItem10childItemsEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: bool QGraphicsItem::isAncestorOf(const QGraphicsItem * child); fn C_ZNK13QGraphicsItem12isAncestorOfEPKS_(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: qreal QGraphicsItem::opacity(); fn C_ZNK13QGraphicsItem7opacityEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: bool QGraphicsItem::isVisibleTo(const QGraphicsItem * parent); fn C_ZNK13QGraphicsItem11isVisibleToEPKS_(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: QString QGraphicsItem::toolTip(); fn C_ZNK13QGraphicsItem7toolTipEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QCursor QGraphicsItem::cursor(); fn C_ZNK13QGraphicsItem6cursorEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QPointF QGraphicsItem::mapToScene(const QPointF & point); fn C_ZNK13QGraphicsItem10mapToSceneERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: qreal QGraphicsItem::zValue(); fn C_ZNK13QGraphicsItem6zValueEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: QMatrix QGraphicsItem::matrix(); fn C_ZNK13QGraphicsItem6matrixEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QRectF QGraphicsItem::mapRectToScene(qreal x, qreal y, qreal w, qreal h); fn C_ZNK13QGraphicsItem14mapRectToSceneEdddd(qthis: u64 /* *mut c_void*/, arg0: c_double, arg1: c_double, arg2: c_double, arg3: c_double) -> *mut c_void; // proto: void QGraphicsItem::setPos(const QPointF & pos); fn C_ZN13QGraphicsItem6setPosERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: QGraphicsItem * QGraphicsItem::panel(); fn C_ZNK13QGraphicsItem5panelEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: bool QGraphicsItem::isClipped(); fn C_ZNK13QGraphicsItem9isClippedEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: QGraphicsItem * QGraphicsItem::topLevelItem(); fn C_ZNK13QGraphicsItem12topLevelItemEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QPolygonF QGraphicsItem::mapToScene(const QRectF & rect); fn C_ZNK13QGraphicsItem10mapToSceneERK6QRectF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: void QGraphicsItem::setScale(qreal scale); fn C_ZN13QGraphicsItem8setScaleEd(qthis: u64 /* *mut c_void*/, arg0: c_double); // proto: void QGraphicsItem::setCursor(const QCursor & cursor); fn C_ZN13QGraphicsItem9setCursorERK7QCursor(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: bool QGraphicsItem::isVisible(); fn C_ZNK13QGraphicsItem9isVisibleEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: QPointF QGraphicsItem::pos(); fn C_ZNK13QGraphicsItem3posEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: bool QGraphicsItem::isBlockedByModalPanel(QGraphicsItem ** blockingPanel); fn C_ZNK13QGraphicsItem21isBlockedByModalPanelEPPS_(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: qreal QGraphicsItem::effectiveOpacity(); fn C_ZNK13QGraphicsItem16effectiveOpacityEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: void QGraphicsItem::ensureVisible(const QRectF & rect, int xmargin, int ymargin); fn C_ZN13QGraphicsItem13ensureVisibleERK6QRectFii(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: c_int, arg2: c_int); // proto: qreal QGraphicsItem::boundingRegionGranularity(); fn C_ZNK13QGraphicsItem25boundingRegionGranularityEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: qreal QGraphicsItem::x(); fn C_ZNK13QGraphicsItem1xEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: void QGraphicsItem::grabMouse(); fn C_ZN13QGraphicsItem9grabMouseEv(qthis: u64 /* *mut c_void*/); // proto: void QGraphicsItem::setVisible(bool visible); fn C_ZN13QGraphicsItem10setVisibleEb(qthis: u64 /* *mut c_void*/, arg0: c_char); // proto: void QGraphicsItem::setRotation(qreal angle); fn C_ZN13QGraphicsItem11setRotationEd(qthis: u64 /* *mut c_void*/, arg0: c_double); // proto: QTransform QGraphicsItem::deviceTransform(const QTransform & viewportTransform); fn C_ZNK13QGraphicsItem15deviceTransformERK10QTransform(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: bool QGraphicsItem::acceptTouchEvents(); fn C_ZNK13QGraphicsItem17acceptTouchEventsEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: void QGraphicsItem::setTransform(const QTransform & matrix, bool combine); fn C_ZN13QGraphicsItem12setTransformERK10QTransformb(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: c_char); // proto: QPolygonF QGraphicsItem::mapToParent(const QRectF & rect); fn C_ZNK13QGraphicsItem11mapToParentERK6QRectF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; fn QGraphicsObject_Class_Size() -> c_int; // proto: void QGraphicsObject::QGraphicsObject(QGraphicsItem * parent); fn C_ZN15QGraphicsObjectC2EP13QGraphicsItem(arg0: *mut c_void) -> u64; // proto: void QGraphicsObject::~QGraphicsObject(); fn C_ZN15QGraphicsObjectD2Ev(qthis: u64 /* *mut c_void*/); // proto: const QMetaObject * QGraphicsObject::metaObject(); fn C_ZNK15QGraphicsObject10metaObjectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; fn QGraphicsSimpleTextItem_Class_Size() -> c_int; // proto: int QGraphicsSimpleTextItem::type(); fn C_ZNK23QGraphicsSimpleTextItem4typeEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: QFont QGraphicsSimpleTextItem::font(); fn C_ZNK23QGraphicsSimpleTextItem4fontEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsSimpleTextItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); fn C_ZN23QGraphicsSimpleTextItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void, arg2: *mut c_void); // proto: void QGraphicsSimpleTextItem::~QGraphicsSimpleTextItem(); fn C_ZN23QGraphicsSimpleTextItemD2Ev(qthis: u64 /* *mut c_void*/); // proto: void QGraphicsSimpleTextItem::setText(const QString & text); fn C_ZN23QGraphicsSimpleTextItem7setTextERK7QString(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: QString QGraphicsSimpleTextItem::text(); fn C_ZNK23QGraphicsSimpleTextItem4textEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsSimpleTextItem::QGraphicsSimpleTextItem(const QString & text, QGraphicsItem * parent); fn C_ZN23QGraphicsSimpleTextItemC2ERK7QStringP13QGraphicsItem(arg0: *mut c_void, arg1: *mut c_void) -> u64; // proto: bool QGraphicsSimpleTextItem::isObscuredBy(const QGraphicsItem * item); fn C_ZNK23QGraphicsSimpleTextItem12isObscuredByEPK13QGraphicsItem(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: QPainterPath QGraphicsSimpleTextItem::shape(); fn C_ZNK23QGraphicsSimpleTextItem5shapeEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QGraphicsSimpleTextItem::QGraphicsSimpleTextItem(QGraphicsItem * parent); fn C_ZN23QGraphicsSimpleTextItemC2EP13QGraphicsItem(arg0: *mut c_void) -> u64; // proto: void QGraphicsSimpleTextItem::setFont(const QFont & font); fn C_ZN23QGraphicsSimpleTextItem7setFontERK5QFont(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: QPainterPath QGraphicsSimpleTextItem::opaqueArea(); fn C_ZNK23QGraphicsSimpleTextItem10opaqueAreaEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QRectF QGraphicsSimpleTextItem::boundingRect(); fn C_ZNK23QGraphicsSimpleTextItem12boundingRectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: bool QGraphicsSimpleTextItem::contains(const QPointF & point); fn C_ZNK23QGraphicsSimpleTextItem8containsERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; fn QGraphicsTextItem_SlotProxy_connect__ZN17QGraphicsTextItem11linkHoveredERK7QString(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void); fn QGraphicsTextItem_SlotProxy_connect__ZN17QGraphicsTextItem13linkActivatedERK7QString(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void); fn QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject8yChangedEv(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void); fn QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject14opacityChangedEv(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void); fn QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject14visibleChangedEv(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void); fn QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject15childrenChangedEv(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void); fn QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject8zChangedEv(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void); fn QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject12widthChangedEv(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void); fn QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject15rotationChangedEv(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void); fn QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject14enabledChangedEv(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void); fn QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject12scaleChangedEv(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void); fn QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject13heightChangedEv(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void); fn QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject13parentChangedEv(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void); fn QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject8xChangedEv(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void); } // <= ext block end // body block begin => // class sizeof(QGraphicsTextItem)=1 #[derive(Default)] pub struct QGraphicsTextItem { qbase: QGraphicsObject, pub qclsinst: u64 /* *mut c_void*/, pub _linkActivated: QGraphicsTextItem_linkActivated_signal, pub _linkHovered: QGraphicsTextItem_linkHovered_signal, } // class sizeof(QGraphicsPixmapItem)=1 #[derive(Default)] pub struct QGraphicsPixmapItem { qbase: QGraphicsItem, pub qclsinst: u64 /* *mut c_void*/, } // class sizeof(QGraphicsRectItem)=1 #[derive(Default)] pub struct QGraphicsRectItem { qbase: QAbstractGraphicsShapeItem, pub qclsinst: u64 /* *mut c_void*/, } // class sizeof(QGraphicsEllipseItem)=1 #[derive(Default)] pub struct QGraphicsEllipseItem { qbase: QAbstractGraphicsShapeItem, pub qclsinst: u64 /* *mut c_void*/, } // class sizeof(QGraphicsPolygonItem)=1 #[derive(Default)] pub struct QGraphicsPolygonItem { qbase: QAbstractGraphicsShapeItem, pub qclsinst: u64 /* *mut c_void*/, } // class sizeof(QGraphicsPathItem)=1 #[derive(Default)] pub struct QGraphicsPathItem { qbase: QAbstractGraphicsShapeItem, pub qclsinst: u64 /* *mut c_void*/, } // class sizeof(QGraphicsLineItem)=1 #[derive(Default)] pub struct QGraphicsLineItem { qbase: QGraphicsItem, pub qclsinst: u64 /* *mut c_void*/, } // class sizeof(QGraphicsItemGroup)=1 #[derive(Default)] pub struct QGraphicsItemGroup { qbase: QGraphicsItem, pub qclsinst: u64 /* *mut c_void*/, } // class sizeof(QAbstractGraphicsShapeItem)=1 #[derive(Default)] pub struct QAbstractGraphicsShapeItem { qbase: QGraphicsItem, pub qclsinst: u64 /* *mut c_void*/, } // class sizeof(QGraphicsItem)=1 #[derive(Default)] pub struct QGraphicsItem { // qbase: None, pub qclsinst: u64 /* *mut c_void*/, } // class sizeof(QGraphicsObject)=1 #[derive(Default)] pub struct QGraphicsObject { qbase: QObject, pub qclsinst: u64 /* *mut c_void*/, pub _childrenChanged: QGraphicsObject_childrenChanged_signal, pub _parentChanged: QGraphicsObject_parentChanged_signal, pub _heightChanged: QGraphicsObject_heightChanged_signal, pub _zChanged: QGraphicsObject_zChanged_signal, pub _visibleChanged: QGraphicsObject_visibleChanged_signal, pub _yChanged: QGraphicsObject_yChanged_signal, pub _widthChanged: QGraphicsObject_widthChanged_signal, pub _opacityChanged: QGraphicsObject_opacityChanged_signal, pub _rotationChanged: QGraphicsObject_rotationChanged_signal, pub _enabledChanged: QGraphicsObject_enabledChanged_signal, pub _xChanged: QGraphicsObject_xChanged_signal, pub _scaleChanged: QGraphicsObject_scaleChanged_signal, } // class sizeof(QGraphicsSimpleTextItem)=1 #[derive(Default)] pub struct QGraphicsSimpleTextItem { qbase: QAbstractGraphicsShapeItem, pub qclsinst: u64 /* *mut c_void*/, } impl /*struct*/ QGraphicsTextItem { pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QGraphicsTextItem { return QGraphicsTextItem{qbase: QGraphicsObject::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; } } impl Deref for QGraphicsTextItem { type Target = QGraphicsObject; fn deref(&self) -> &QGraphicsObject { return & self.qbase; } } impl AsRef<QGraphicsObject> for QGraphicsTextItem { fn as_ref(& self) -> & QGraphicsObject { return & self.qbase; } } // proto: bool QGraphicsTextItem::openExternalLinks(); impl /*struct*/ QGraphicsTextItem { pub fn openExternalLinks<RetType, T: QGraphicsTextItem_openExternalLinks<RetType>>(& self, overload_args: T) -> RetType { return overload_args.openExternalLinks(self); // return 1; } } pub trait QGraphicsTextItem_openExternalLinks<RetType> { fn openExternalLinks(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: bool QGraphicsTextItem::openExternalLinks(); impl<'a> /*trait*/ QGraphicsTextItem_openExternalLinks<i8> for () { fn openExternalLinks(self , rsthis: & QGraphicsTextItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsTextItem17openExternalLinksEv()}; let mut ret = unsafe {C_ZNK17QGraphicsTextItem17openExternalLinksEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: qreal QGraphicsTextItem::textWidth(); impl /*struct*/ QGraphicsTextItem { pub fn textWidth<RetType, T: QGraphicsTextItem_textWidth<RetType>>(& self, overload_args: T) -> RetType { return overload_args.textWidth(self); // return 1; } } pub trait QGraphicsTextItem_textWidth<RetType> { fn textWidth(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: qreal QGraphicsTextItem::textWidth(); impl<'a> /*trait*/ QGraphicsTextItem_textWidth<f64> for () { fn textWidth(self , rsthis: & QGraphicsTextItem) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsTextItem9textWidthEv()}; let mut ret = unsafe {C_ZNK17QGraphicsTextItem9textWidthEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: void QGraphicsTextItem::setTextWidth(qreal width); impl /*struct*/ QGraphicsTextItem { pub fn setTextWidth<RetType, T: QGraphicsTextItem_setTextWidth<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setTextWidth(self); // return 1; } } pub trait QGraphicsTextItem_setTextWidth<RetType> { fn setTextWidth(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: void QGraphicsTextItem::setTextWidth(qreal width); impl<'a> /*trait*/ QGraphicsTextItem_setTextWidth<()> for (f64) { fn setTextWidth(self , rsthis: & QGraphicsTextItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsTextItem12setTextWidthEd()}; let arg0 = self as c_double; unsafe {C_ZN17QGraphicsTextItem12setTextWidthEd(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsTextItem::setTextCursor(const QTextCursor & cursor); impl /*struct*/ QGraphicsTextItem { pub fn setTextCursor<RetType, T: QGraphicsTextItem_setTextCursor<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setTextCursor(self); // return 1; } } pub trait QGraphicsTextItem_setTextCursor<RetType> { fn setTextCursor(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: void QGraphicsTextItem::setTextCursor(const QTextCursor & cursor); impl<'a> /*trait*/ QGraphicsTextItem_setTextCursor<()> for (&'a QTextCursor) { fn setTextCursor(self , rsthis: & QGraphicsTextItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsTextItem13setTextCursorERK11QTextCursor()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN17QGraphicsTextItem13setTextCursorERK11QTextCursor(rsthis.qclsinst, arg0)}; // return 1; } } // proto: int QGraphicsTextItem::type(); impl /*struct*/ QGraphicsTextItem { pub fn type_<RetType, T: QGraphicsTextItem_type_<RetType>>(& self, overload_args: T) -> RetType { return overload_args.type_(self); // return 1; } } pub trait QGraphicsTextItem_type_<RetType> { fn type_(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: int QGraphicsTextItem::type(); impl<'a> /*trait*/ QGraphicsTextItem_type_<i32> for () { fn type_(self , rsthis: & QGraphicsTextItem) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsTextItem4typeEv()}; let mut ret = unsafe {C_ZNK17QGraphicsTextItem4typeEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: QFont QGraphicsTextItem::font(); impl /*struct*/ QGraphicsTextItem { pub fn font<RetType, T: QGraphicsTextItem_font<RetType>>(& self, overload_args: T) -> RetType { return overload_args.font(self); // return 1; } } pub trait QGraphicsTextItem_font<RetType> { fn font(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: QFont QGraphicsTextItem::font(); impl<'a> /*trait*/ QGraphicsTextItem_font<QFont> for () { fn font(self , rsthis: & QGraphicsTextItem) -> QFont { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsTextItem4fontEv()}; let mut ret = unsafe {C_ZNK17QGraphicsTextItem4fontEv(rsthis.qclsinst)}; let mut ret1 = QFont::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsTextItem::QGraphicsTextItem(const QString & text, QGraphicsItem * parent); impl /*struct*/ QGraphicsTextItem { pub fn new<T: QGraphicsTextItem_new>(value: T) -> QGraphicsTextItem { let rsthis = value.new(); return rsthis; // return 1; } } pub trait QGraphicsTextItem_new { fn new(self) -> QGraphicsTextItem; } // proto: void QGraphicsTextItem::QGraphicsTextItem(const QString & text, QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsTextItem_new for (&'a QString, Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsTextItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsTextItemC2ERK7QStringP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsTextItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {0} else {self.1.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN17QGraphicsTextItemC2ERK7QStringP13QGraphicsItem(arg0, arg1)}; let rsthis = QGraphicsTextItem{qbase: QGraphicsObject::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: const QMetaObject * QGraphicsTextItem::metaObject(); impl /*struct*/ QGraphicsTextItem { pub fn metaObject<RetType, T: QGraphicsTextItem_metaObject<RetType>>(& self, overload_args: T) -> RetType { return overload_args.metaObject(self); // return 1; } } pub trait QGraphicsTextItem_metaObject<RetType> { fn metaObject(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: const QMetaObject * QGraphicsTextItem::metaObject(); impl<'a> /*trait*/ QGraphicsTextItem_metaObject<QMetaObject> for () { fn metaObject(self , rsthis: & QGraphicsTextItem) -> QMetaObject { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsTextItem10metaObjectEv()}; let mut ret = unsafe {C_ZNK17QGraphicsTextItem10metaObjectEv(rsthis.qclsinst)}; let mut ret1 = QMetaObject::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsTextItem::setOpenExternalLinks(bool open); impl /*struct*/ QGraphicsTextItem { pub fn setOpenExternalLinks<RetType, T: QGraphicsTextItem_setOpenExternalLinks<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setOpenExternalLinks(self); // return 1; } } pub trait QGraphicsTextItem_setOpenExternalLinks<RetType> { fn setOpenExternalLinks(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: void QGraphicsTextItem::setOpenExternalLinks(bool open); impl<'a> /*trait*/ QGraphicsTextItem_setOpenExternalLinks<()> for (i8) { fn setOpenExternalLinks(self , rsthis: & QGraphicsTextItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsTextItem20setOpenExternalLinksEb()}; let arg0 = self as c_char; unsafe {C_ZN17QGraphicsTextItem20setOpenExternalLinksEb(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsTextItem::setTabChangesFocus(bool b); impl /*struct*/ QGraphicsTextItem { pub fn setTabChangesFocus<RetType, T: QGraphicsTextItem_setTabChangesFocus<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setTabChangesFocus(self); // return 1; } } pub trait QGraphicsTextItem_setTabChangesFocus<RetType> { fn setTabChangesFocus(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: void QGraphicsTextItem::setTabChangesFocus(bool b); impl<'a> /*trait*/ QGraphicsTextItem_setTabChangesFocus<()> for (i8) { fn setTabChangesFocus(self , rsthis: & QGraphicsTextItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsTextItem18setTabChangesFocusEb()}; let arg0 = self as c_char; unsafe {C_ZN17QGraphicsTextItem18setTabChangesFocusEb(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QString QGraphicsTextItem::toHtml(); impl /*struct*/ QGraphicsTextItem { pub fn toHtml<RetType, T: QGraphicsTextItem_toHtml<RetType>>(& self, overload_args: T) -> RetType { return overload_args.toHtml(self); // return 1; } } pub trait QGraphicsTextItem_toHtml<RetType> { fn toHtml(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: QString QGraphicsTextItem::toHtml(); impl<'a> /*trait*/ QGraphicsTextItem_toHtml<QString> for () { fn toHtml(self , rsthis: & QGraphicsTextItem) -> QString { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsTextItem6toHtmlEv()}; let mut ret = unsafe {C_ZNK17QGraphicsTextItem6toHtmlEv(rsthis.qclsinst)}; let mut ret1 = QString::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsTextItem::setDocument(QTextDocument * document); impl /*struct*/ QGraphicsTextItem { pub fn setDocument<RetType, T: QGraphicsTextItem_setDocument<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setDocument(self); // return 1; } } pub trait QGraphicsTextItem_setDocument<RetType> { fn setDocument(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: void QGraphicsTextItem::setDocument(QTextDocument * document); impl<'a> /*trait*/ QGraphicsTextItem_setDocument<()> for (&'a QTextDocument) { fn setDocument(self , rsthis: & QGraphicsTextItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsTextItem11setDocumentEP13QTextDocument()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN17QGraphicsTextItem11setDocumentEP13QTextDocument(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsTextItem::setPlainText(const QString & text); impl /*struct*/ QGraphicsTextItem { pub fn setPlainText<RetType, T: QGraphicsTextItem_setPlainText<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setPlainText(self); // return 1; } } pub trait QGraphicsTextItem_setPlainText<RetType> { fn setPlainText(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: void QGraphicsTextItem::setPlainText(const QString & text); impl<'a> /*trait*/ QGraphicsTextItem_setPlainText<()> for (&'a QString) { fn setPlainText(self , rsthis: & QGraphicsTextItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsTextItem12setPlainTextERK7QString()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN17QGraphicsTextItem12setPlainTextERK7QString(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsTextItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl /*struct*/ QGraphicsTextItem { pub fn paint<RetType, T: QGraphicsTextItem_paint<RetType>>(& self, overload_args: T) -> RetType { return overload_args.paint(self); // return 1; } } pub trait QGraphicsTextItem_paint<RetType> { fn paint(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: void QGraphicsTextItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl<'a> /*trait*/ QGraphicsTextItem_paint<()> for (&'a QPainter, &'a QStyleOptionGraphicsItem, &'a QWidget) { fn paint(self , rsthis: & QGraphicsTextItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsTextItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let arg2 = self.2.qclsinst as *mut c_void; unsafe {C_ZN17QGraphicsTextItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(rsthis.qclsinst, arg0, arg1, arg2)}; // return 1; } } // proto: void QGraphicsTextItem::setFont(const QFont & font); impl /*struct*/ QGraphicsTextItem { pub fn setFont<RetType, T: QGraphicsTextItem_setFont<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setFont(self); // return 1; } } pub trait QGraphicsTextItem_setFont<RetType> { fn setFont(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: void QGraphicsTextItem::setFont(const QFont & font); impl<'a> /*trait*/ QGraphicsTextItem_setFont<()> for (&'a QFont) { fn setFont(self , rsthis: & QGraphicsTextItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsTextItem7setFontERK5QFont()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN17QGraphicsTextItem7setFontERK5QFont(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsTextItem::setDefaultTextColor(const QColor & c); impl /*struct*/ QGraphicsTextItem { pub fn setDefaultTextColor<RetType, T: QGraphicsTextItem_setDefaultTextColor<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setDefaultTextColor(self); // return 1; } } pub trait QGraphicsTextItem_setDefaultTextColor<RetType> { fn setDefaultTextColor(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: void QGraphicsTextItem::setDefaultTextColor(const QColor & c); impl<'a> /*trait*/ QGraphicsTextItem_setDefaultTextColor<()> for (&'a QColor) { fn setDefaultTextColor(self , rsthis: & QGraphicsTextItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsTextItem19setDefaultTextColorERK6QColor()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN17QGraphicsTextItem19setDefaultTextColorERK6QColor(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QColor QGraphicsTextItem::defaultTextColor(); impl /*struct*/ QGraphicsTextItem { pub fn defaultTextColor<RetType, T: QGraphicsTextItem_defaultTextColor<RetType>>(& self, overload_args: T) -> RetType { return overload_args.defaultTextColor(self); // return 1; } } pub trait QGraphicsTextItem_defaultTextColor<RetType> { fn defaultTextColor(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: QColor QGraphicsTextItem::defaultTextColor(); impl<'a> /*trait*/ QGraphicsTextItem_defaultTextColor<QColor> for () { fn defaultTextColor(self , rsthis: & QGraphicsTextItem) -> QColor { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsTextItem16defaultTextColorEv()}; let mut ret = unsafe {C_ZNK17QGraphicsTextItem16defaultTextColorEv(rsthis.qclsinst)}; let mut ret1 = QColor::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsTextItem::~QGraphicsTextItem(); impl /*struct*/ QGraphicsTextItem { pub fn free<RetType, T: QGraphicsTextItem_free<RetType>>(& self, overload_args: T) -> RetType { return overload_args.free(self); // return 1; } } pub trait QGraphicsTextItem_free<RetType> { fn free(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: void QGraphicsTextItem::~QGraphicsTextItem(); impl<'a> /*trait*/ QGraphicsTextItem_free<()> for () { fn free(self , rsthis: & QGraphicsTextItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsTextItemD2Ev()}; unsafe {C_ZN17QGraphicsTextItemD2Ev(rsthis.qclsinst)}; // return 1; } } // proto: QPainterPath QGraphicsTextItem::shape(); impl /*struct*/ QGraphicsTextItem { pub fn shape<RetType, T: QGraphicsTextItem_shape<RetType>>(& self, overload_args: T) -> RetType { return overload_args.shape(self); // return 1; } } pub trait QGraphicsTextItem_shape<RetType> { fn shape(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: QPainterPath QGraphicsTextItem::shape(); impl<'a> /*trait*/ QGraphicsTextItem_shape<QPainterPath> for () { fn shape(self , rsthis: & QGraphicsTextItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsTextItem5shapeEv()}; let mut ret = unsafe {C_ZNK17QGraphicsTextItem5shapeEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QTextCursor QGraphicsTextItem::textCursor(); impl /*struct*/ QGraphicsTextItem { pub fn textCursor<RetType, T: QGraphicsTextItem_textCursor<RetType>>(& self, overload_args: T) -> RetType { return overload_args.textCursor(self); // return 1; } } pub trait QGraphicsTextItem_textCursor<RetType> { fn textCursor(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: QTextCursor QGraphicsTextItem::textCursor(); impl<'a> /*trait*/ QGraphicsTextItem_textCursor<QTextCursor> for () { fn textCursor(self , rsthis: & QGraphicsTextItem) -> QTextCursor { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsTextItem10textCursorEv()}; let mut ret = unsafe {C_ZNK17QGraphicsTextItem10textCursorEv(rsthis.qclsinst)}; let mut ret1 = QTextCursor::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QRectF QGraphicsTextItem::boundingRect(); impl /*struct*/ QGraphicsTextItem { pub fn boundingRect<RetType, T: QGraphicsTextItem_boundingRect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.boundingRect(self); // return 1; } } pub trait QGraphicsTextItem_boundingRect<RetType> { fn boundingRect(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: QRectF QGraphicsTextItem::boundingRect(); impl<'a> /*trait*/ QGraphicsTextItem_boundingRect<QRectF> for () { fn boundingRect(self , rsthis: & QGraphicsTextItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsTextItem12boundingRectEv()}; let mut ret = unsafe {C_ZNK17QGraphicsTextItem12boundingRectEv(rsthis.qclsinst)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QString QGraphicsTextItem::toPlainText(); impl /*struct*/ QGraphicsTextItem { pub fn toPlainText<RetType, T: QGraphicsTextItem_toPlainText<RetType>>(& self, overload_args: T) -> RetType { return overload_args.toPlainText(self); // return 1; } } pub trait QGraphicsTextItem_toPlainText<RetType> { fn toPlainText(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: QString QGraphicsTextItem::toPlainText(); impl<'a> /*trait*/ QGraphicsTextItem_toPlainText<QString> for () { fn toPlainText(self , rsthis: & QGraphicsTextItem) -> QString { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsTextItem11toPlainTextEv()}; let mut ret = unsafe {C_ZNK17QGraphicsTextItem11toPlainTextEv(rsthis.qclsinst)}; let mut ret1 = QString::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsTextItem::setHtml(const QString & html); impl /*struct*/ QGraphicsTextItem { pub fn setHtml<RetType, T: QGraphicsTextItem_setHtml<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setHtml(self); // return 1; } } pub trait QGraphicsTextItem_setHtml<RetType> { fn setHtml(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: void QGraphicsTextItem::setHtml(const QString & html); impl<'a> /*trait*/ QGraphicsTextItem_setHtml<()> for (&'a QString) { fn setHtml(self , rsthis: & QGraphicsTextItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsTextItem7setHtmlERK7QString()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN17QGraphicsTextItem7setHtmlERK7QString(rsthis.qclsinst, arg0)}; // return 1; } } // proto: bool QGraphicsTextItem::tabChangesFocus(); impl /*struct*/ QGraphicsTextItem { pub fn tabChangesFocus<RetType, T: QGraphicsTextItem_tabChangesFocus<RetType>>(& self, overload_args: T) -> RetType { return overload_args.tabChangesFocus(self); // return 1; } } pub trait QGraphicsTextItem_tabChangesFocus<RetType> { fn tabChangesFocus(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: bool QGraphicsTextItem::tabChangesFocus(); impl<'a> /*trait*/ QGraphicsTextItem_tabChangesFocus<i8> for () { fn tabChangesFocus(self , rsthis: & QGraphicsTextItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsTextItem15tabChangesFocusEv()}; let mut ret = unsafe {C_ZNK17QGraphicsTextItem15tabChangesFocusEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsTextItem::QGraphicsTextItem(QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsTextItem_new for (Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsTextItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsTextItemC2EP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsTextItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN17QGraphicsTextItemC2EP13QGraphicsItem(arg0)}; let rsthis = QGraphicsTextItem{qbase: QGraphicsObject::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: QTextDocument * QGraphicsTextItem::document(); impl /*struct*/ QGraphicsTextItem { pub fn document<RetType, T: QGraphicsTextItem_document<RetType>>(& self, overload_args: T) -> RetType { return overload_args.document(self); // return 1; } } pub trait QGraphicsTextItem_document<RetType> { fn document(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: QTextDocument * QGraphicsTextItem::document(); impl<'a> /*trait*/ QGraphicsTextItem_document<QTextDocument> for () { fn document(self , rsthis: & QGraphicsTextItem) -> QTextDocument { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsTextItem8documentEv()}; let mut ret = unsafe {C_ZNK17QGraphicsTextItem8documentEv(rsthis.qclsinst)}; let mut ret1 = QTextDocument::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsTextItem::isObscuredBy(const QGraphicsItem * item); impl /*struct*/ QGraphicsTextItem { pub fn isObscuredBy<RetType, T: QGraphicsTextItem_isObscuredBy<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isObscuredBy(self); // return 1; } } pub trait QGraphicsTextItem_isObscuredBy<RetType> { fn isObscuredBy(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: bool QGraphicsTextItem::isObscuredBy(const QGraphicsItem * item); impl<'a> /*trait*/ QGraphicsTextItem_isObscuredBy<i8> for (&'a QGraphicsItem) { fn isObscuredBy(self , rsthis: & QGraphicsTextItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsTextItem12isObscuredByEPK13QGraphicsItem()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK17QGraphicsTextItem12isObscuredByEPK13QGraphicsItem(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: QPainterPath QGraphicsTextItem::opaqueArea(); impl /*struct*/ QGraphicsTextItem { pub fn opaqueArea<RetType, T: QGraphicsTextItem_opaqueArea<RetType>>(& self, overload_args: T) -> RetType { return overload_args.opaqueArea(self); // return 1; } } pub trait QGraphicsTextItem_opaqueArea<RetType> { fn opaqueArea(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: QPainterPath QGraphicsTextItem::opaqueArea(); impl<'a> /*trait*/ QGraphicsTextItem_opaqueArea<QPainterPath> for () { fn opaqueArea(self , rsthis: & QGraphicsTextItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsTextItem10opaqueAreaEv()}; let mut ret = unsafe {C_ZNK17QGraphicsTextItem10opaqueAreaEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsTextItem::contains(const QPointF & point); impl /*struct*/ QGraphicsTextItem { pub fn contains<RetType, T: QGraphicsTextItem_contains<RetType>>(& self, overload_args: T) -> RetType { return overload_args.contains(self); // return 1; } } pub trait QGraphicsTextItem_contains<RetType> { fn contains(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: bool QGraphicsTextItem::contains(const QPointF & point); impl<'a> /*trait*/ QGraphicsTextItem_contains<i8> for (&'a QPointF) { fn contains(self , rsthis: & QGraphicsTextItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsTextItem8containsERK7QPointF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK17QGraphicsTextItem8containsERK7QPointF(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsTextItem::adjustSize(); impl /*struct*/ QGraphicsTextItem { pub fn adjustSize<RetType, T: QGraphicsTextItem_adjustSize<RetType>>(& self, overload_args: T) -> RetType { return overload_args.adjustSize(self); // return 1; } } pub trait QGraphicsTextItem_adjustSize<RetType> { fn adjustSize(self , rsthis: & QGraphicsTextItem) -> RetType; } // proto: void QGraphicsTextItem::adjustSize(); impl<'a> /*trait*/ QGraphicsTextItem_adjustSize<()> for () { fn adjustSize(self , rsthis: & QGraphicsTextItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsTextItem10adjustSizeEv()}; unsafe {C_ZN17QGraphicsTextItem10adjustSizeEv(rsthis.qclsinst)}; // return 1; } } impl /*struct*/ QGraphicsPixmapItem { pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QGraphicsPixmapItem { return QGraphicsPixmapItem{qbase: QGraphicsItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; } } impl Deref for QGraphicsPixmapItem { type Target = QGraphicsItem; fn deref(&self) -> &QGraphicsItem { return & self.qbase; } } impl AsRef<QGraphicsItem> for QGraphicsPixmapItem { fn as_ref(& self) -> & QGraphicsItem { return & self.qbase; } } // proto: void QGraphicsPixmapItem::QGraphicsPixmapItem(QGraphicsItem * parent); impl /*struct*/ QGraphicsPixmapItem { pub fn new<T: QGraphicsPixmapItem_new>(value: T) -> QGraphicsPixmapItem { let rsthis = value.new(); return rsthis; // return 1; } } pub trait QGraphicsPixmapItem_new { fn new(self) -> QGraphicsPixmapItem; } // proto: void QGraphicsPixmapItem::QGraphicsPixmapItem(QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsPixmapItem_new for (Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsPixmapItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN19QGraphicsPixmapItemC2EP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsPixmapItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN19QGraphicsPixmapItemC2EP13QGraphicsItem(arg0)}; let rsthis = QGraphicsPixmapItem{qbase: QGraphicsItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: void QGraphicsPixmapItem::QGraphicsPixmapItem(const QPixmap & pixmap, QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsPixmapItem_new for (&'a QPixmap, Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsPixmapItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN19QGraphicsPixmapItemC2ERK7QPixmapP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsPixmapItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {0} else {self.1.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN19QGraphicsPixmapItemC2ERK7QPixmapP13QGraphicsItem(arg0, arg1)}; let rsthis = QGraphicsPixmapItem{qbase: QGraphicsItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: void QGraphicsPixmapItem::~QGraphicsPixmapItem(); impl /*struct*/ QGraphicsPixmapItem { pub fn free<RetType, T: QGraphicsPixmapItem_free<RetType>>(& self, overload_args: T) -> RetType { return overload_args.free(self); // return 1; } } pub trait QGraphicsPixmapItem_free<RetType> { fn free(self , rsthis: & QGraphicsPixmapItem) -> RetType; } // proto: void QGraphicsPixmapItem::~QGraphicsPixmapItem(); impl<'a> /*trait*/ QGraphicsPixmapItem_free<()> for () { fn free(self , rsthis: & QGraphicsPixmapItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN19QGraphicsPixmapItemD2Ev()}; unsafe {C_ZN19QGraphicsPixmapItemD2Ev(rsthis.qclsinst)}; // return 1; } } // proto: QPainterPath QGraphicsPixmapItem::opaqueArea(); impl /*struct*/ QGraphicsPixmapItem { pub fn opaqueArea<RetType, T: QGraphicsPixmapItem_opaqueArea<RetType>>(& self, overload_args: T) -> RetType { return overload_args.opaqueArea(self); // return 1; } } pub trait QGraphicsPixmapItem_opaqueArea<RetType> { fn opaqueArea(self , rsthis: & QGraphicsPixmapItem) -> RetType; } // proto: QPainterPath QGraphicsPixmapItem::opaqueArea(); impl<'a> /*trait*/ QGraphicsPixmapItem_opaqueArea<QPainterPath> for () { fn opaqueArea(self , rsthis: & QGraphicsPixmapItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK19QGraphicsPixmapItem10opaqueAreaEv()}; let mut ret = unsafe {C_ZNK19QGraphicsPixmapItem10opaqueAreaEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsPixmapItem::isObscuredBy(const QGraphicsItem * item); impl /*struct*/ QGraphicsPixmapItem { pub fn isObscuredBy<RetType, T: QGraphicsPixmapItem_isObscuredBy<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isObscuredBy(self); // return 1; } } pub trait QGraphicsPixmapItem_isObscuredBy<RetType> { fn isObscuredBy(self , rsthis: & QGraphicsPixmapItem) -> RetType; } // proto: bool QGraphicsPixmapItem::isObscuredBy(const QGraphicsItem * item); impl<'a> /*trait*/ QGraphicsPixmapItem_isObscuredBy<i8> for (&'a QGraphicsItem) { fn isObscuredBy(self , rsthis: & QGraphicsPixmapItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK19QGraphicsPixmapItem12isObscuredByEPK13QGraphicsItem()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK19QGraphicsPixmapItem12isObscuredByEPK13QGraphicsItem(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: int QGraphicsPixmapItem::type(); impl /*struct*/ QGraphicsPixmapItem { pub fn type_<RetType, T: QGraphicsPixmapItem_type_<RetType>>(& self, overload_args: T) -> RetType { return overload_args.type_(self); // return 1; } } pub trait QGraphicsPixmapItem_type_<RetType> { fn type_(self , rsthis: & QGraphicsPixmapItem) -> RetType; } // proto: int QGraphicsPixmapItem::type(); impl<'a> /*trait*/ QGraphicsPixmapItem_type_<i32> for () { fn type_(self , rsthis: & QGraphicsPixmapItem) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK19QGraphicsPixmapItem4typeEv()}; let mut ret = unsafe {C_ZNK19QGraphicsPixmapItem4typeEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: QPainterPath QGraphicsPixmapItem::shape(); impl /*struct*/ QGraphicsPixmapItem { pub fn shape<RetType, T: QGraphicsPixmapItem_shape<RetType>>(& self, overload_args: T) -> RetType { return overload_args.shape(self); // return 1; } } pub trait QGraphicsPixmapItem_shape<RetType> { fn shape(self , rsthis: & QGraphicsPixmapItem) -> RetType; } // proto: QPainterPath QGraphicsPixmapItem::shape(); impl<'a> /*trait*/ QGraphicsPixmapItem_shape<QPainterPath> for () { fn shape(self , rsthis: & QGraphicsPixmapItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK19QGraphicsPixmapItem5shapeEv()}; let mut ret = unsafe {C_ZNK19QGraphicsPixmapItem5shapeEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPixmap QGraphicsPixmapItem::pixmap(); impl /*struct*/ QGraphicsPixmapItem { pub fn pixmap<RetType, T: QGraphicsPixmapItem_pixmap<RetType>>(& self, overload_args: T) -> RetType { return overload_args.pixmap(self); // return 1; } } pub trait QGraphicsPixmapItem_pixmap<RetType> { fn pixmap(self , rsthis: & QGraphicsPixmapItem) -> RetType; } // proto: QPixmap QGraphicsPixmapItem::pixmap(); impl<'a> /*trait*/ QGraphicsPixmapItem_pixmap<QPixmap> for () { fn pixmap(self , rsthis: & QGraphicsPixmapItem) -> QPixmap { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK19QGraphicsPixmapItem6pixmapEv()}; let mut ret = unsafe {C_ZNK19QGraphicsPixmapItem6pixmapEv(rsthis.qclsinst)}; let mut ret1 = QPixmap::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsPixmapItem::setOffset(qreal x, qreal y); impl /*struct*/ QGraphicsPixmapItem { pub fn setOffset<RetType, T: QGraphicsPixmapItem_setOffset<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setOffset(self); // return 1; } } pub trait QGraphicsPixmapItem_setOffset<RetType> { fn setOffset(self , rsthis: & QGraphicsPixmapItem) -> RetType; } // proto: void QGraphicsPixmapItem::setOffset(qreal x, qreal y); impl<'a> /*trait*/ QGraphicsPixmapItem_setOffset<()> for (f64, f64) { fn setOffset(self , rsthis: & QGraphicsPixmapItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN19QGraphicsPixmapItem9setOffsetEdd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; unsafe {C_ZN19QGraphicsPixmapItem9setOffsetEdd(rsthis.qclsinst, arg0, arg1)}; // return 1; } } // proto: void QGraphicsPixmapItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl /*struct*/ QGraphicsPixmapItem { pub fn paint<RetType, T: QGraphicsPixmapItem_paint<RetType>>(& self, overload_args: T) -> RetType { return overload_args.paint(self); // return 1; } } pub trait QGraphicsPixmapItem_paint<RetType> { fn paint(self , rsthis: & QGraphicsPixmapItem) -> RetType; } // proto: void QGraphicsPixmapItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl<'a> /*trait*/ QGraphicsPixmapItem_paint<()> for (&'a QPainter, &'a QStyleOptionGraphicsItem, &'a QWidget) { fn paint(self , rsthis: & QGraphicsPixmapItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN19QGraphicsPixmapItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let arg2 = self.2.qclsinst as *mut c_void; unsafe {C_ZN19QGraphicsPixmapItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(rsthis.qclsinst, arg0, arg1, arg2)}; // return 1; } } // proto: QPointF QGraphicsPixmapItem::offset(); impl /*struct*/ QGraphicsPixmapItem { pub fn offset<RetType, T: QGraphicsPixmapItem_offset<RetType>>(& self, overload_args: T) -> RetType { return overload_args.offset(self); // return 1; } } pub trait QGraphicsPixmapItem_offset<RetType> { fn offset(self , rsthis: & QGraphicsPixmapItem) -> RetType; } // proto: QPointF QGraphicsPixmapItem::offset(); impl<'a> /*trait*/ QGraphicsPixmapItem_offset<QPointF> for () { fn offset(self , rsthis: & QGraphicsPixmapItem) -> QPointF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK19QGraphicsPixmapItem6offsetEv()}; let mut ret = unsafe {C_ZNK19QGraphicsPixmapItem6offsetEv(rsthis.qclsinst)}; let mut ret1 = QPointF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QRectF QGraphicsPixmapItem::boundingRect(); impl /*struct*/ QGraphicsPixmapItem { pub fn boundingRect<RetType, T: QGraphicsPixmapItem_boundingRect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.boundingRect(self); // return 1; } } pub trait QGraphicsPixmapItem_boundingRect<RetType> { fn boundingRect(self , rsthis: & QGraphicsPixmapItem) -> RetType; } // proto: QRectF QGraphicsPixmapItem::boundingRect(); impl<'a> /*trait*/ QGraphicsPixmapItem_boundingRect<QRectF> for () { fn boundingRect(self , rsthis: & QGraphicsPixmapItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK19QGraphicsPixmapItem12boundingRectEv()}; let mut ret = unsafe {C_ZNK19QGraphicsPixmapItem12boundingRectEv(rsthis.qclsinst)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsPixmapItem::contains(const QPointF & point); impl /*struct*/ QGraphicsPixmapItem { pub fn contains<RetType, T: QGraphicsPixmapItem_contains<RetType>>(& self, overload_args: T) -> RetType { return overload_args.contains(self); // return 1; } } pub trait QGraphicsPixmapItem_contains<RetType> { fn contains(self , rsthis: & QGraphicsPixmapItem) -> RetType; } // proto: bool QGraphicsPixmapItem::contains(const QPointF & point); impl<'a> /*trait*/ QGraphicsPixmapItem_contains<i8> for (&'a QPointF) { fn contains(self , rsthis: & QGraphicsPixmapItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK19QGraphicsPixmapItem8containsERK7QPointF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK19QGraphicsPixmapItem8containsERK7QPointF(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsPixmapItem::setPixmap(const QPixmap & pixmap); impl /*struct*/ QGraphicsPixmapItem { pub fn setPixmap<RetType, T: QGraphicsPixmapItem_setPixmap<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setPixmap(self); // return 1; } } pub trait QGraphicsPixmapItem_setPixmap<RetType> { fn setPixmap(self , rsthis: & QGraphicsPixmapItem) -> RetType; } // proto: void QGraphicsPixmapItem::setPixmap(const QPixmap & pixmap); impl<'a> /*trait*/ QGraphicsPixmapItem_setPixmap<()> for (&'a QPixmap) { fn setPixmap(self , rsthis: & QGraphicsPixmapItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN19QGraphicsPixmapItem9setPixmapERK7QPixmap()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN19QGraphicsPixmapItem9setPixmapERK7QPixmap(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsPixmapItem::setOffset(const QPointF & offset); impl<'a> /*trait*/ QGraphicsPixmapItem_setOffset<()> for (&'a QPointF) { fn setOffset(self , rsthis: & QGraphicsPixmapItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN19QGraphicsPixmapItem9setOffsetERK7QPointF()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN19QGraphicsPixmapItem9setOffsetERK7QPointF(rsthis.qclsinst, arg0)}; // return 1; } } impl /*struct*/ QGraphicsRectItem { pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QGraphicsRectItem { return QGraphicsRectItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; } } impl Deref for QGraphicsRectItem { type Target = QAbstractGraphicsShapeItem; fn deref(&self) -> &QAbstractGraphicsShapeItem { return & self.qbase; } } impl AsRef<QAbstractGraphicsShapeItem> for QGraphicsRectItem { fn as_ref(& self) -> & QAbstractGraphicsShapeItem { return & self.qbase; } } // proto: bool QGraphicsRectItem::isObscuredBy(const QGraphicsItem * item); impl /*struct*/ QGraphicsRectItem { pub fn isObscuredBy<RetType, T: QGraphicsRectItem_isObscuredBy<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isObscuredBy(self); // return 1; } } pub trait QGraphicsRectItem_isObscuredBy<RetType> { fn isObscuredBy(self , rsthis: & QGraphicsRectItem) -> RetType; } // proto: bool QGraphicsRectItem::isObscuredBy(const QGraphicsItem * item); impl<'a> /*trait*/ QGraphicsRectItem_isObscuredBy<i8> for (&'a QGraphicsItem) { fn isObscuredBy(self , rsthis: & QGraphicsRectItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsRectItem12isObscuredByEPK13QGraphicsItem()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK17QGraphicsRectItem12isObscuredByEPK13QGraphicsItem(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: QRectF QGraphicsRectItem::boundingRect(); impl /*struct*/ QGraphicsRectItem { pub fn boundingRect<RetType, T: QGraphicsRectItem_boundingRect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.boundingRect(self); // return 1; } } pub trait QGraphicsRectItem_boundingRect<RetType> { fn boundingRect(self , rsthis: & QGraphicsRectItem) -> RetType; } // proto: QRectF QGraphicsRectItem::boundingRect(); impl<'a> /*trait*/ QGraphicsRectItem_boundingRect<QRectF> for () { fn boundingRect(self , rsthis: & QGraphicsRectItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsRectItem12boundingRectEv()}; let mut ret = unsafe {C_ZNK17QGraphicsRectItem12boundingRectEv(rsthis.qclsinst)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: int QGraphicsRectItem::type(); impl /*struct*/ QGraphicsRectItem { pub fn type_<RetType, T: QGraphicsRectItem_type_<RetType>>(& self, overload_args: T) -> RetType { return overload_args.type_(self); // return 1; } } pub trait QGraphicsRectItem_type_<RetType> { fn type_(self , rsthis: & QGraphicsRectItem) -> RetType; } // proto: int QGraphicsRectItem::type(); impl<'a> /*trait*/ QGraphicsRectItem_type_<i32> for () { fn type_(self , rsthis: & QGraphicsRectItem) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsRectItem4typeEv()}; let mut ret = unsafe {C_ZNK17QGraphicsRectItem4typeEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: QRectF QGraphicsRectItem::rect(); impl /*struct*/ QGraphicsRectItem { pub fn rect<RetType, T: QGraphicsRectItem_rect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.rect(self); // return 1; } } pub trait QGraphicsRectItem_rect<RetType> { fn rect(self , rsthis: & QGraphicsRectItem) -> RetType; } // proto: QRectF QGraphicsRectItem::rect(); impl<'a> /*trait*/ QGraphicsRectItem_rect<QRectF> for () { fn rect(self , rsthis: & QGraphicsRectItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsRectItem4rectEv()}; let mut ret = unsafe {C_ZNK17QGraphicsRectItem4rectEv(rsthis.qclsinst)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPainterPath QGraphicsRectItem::shape(); impl /*struct*/ QGraphicsRectItem { pub fn shape<RetType, T: QGraphicsRectItem_shape<RetType>>(& self, overload_args: T) -> RetType { return overload_args.shape(self); // return 1; } } pub trait QGraphicsRectItem_shape<RetType> { fn shape(self , rsthis: & QGraphicsRectItem) -> RetType; } // proto: QPainterPath QGraphicsRectItem::shape(); impl<'a> /*trait*/ QGraphicsRectItem_shape<QPainterPath> for () { fn shape(self , rsthis: & QGraphicsRectItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsRectItem5shapeEv()}; let mut ret = unsafe {C_ZNK17QGraphicsRectItem5shapeEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsRectItem::~QGraphicsRectItem(); impl /*struct*/ QGraphicsRectItem { pub fn free<RetType, T: QGraphicsRectItem_free<RetType>>(& self, overload_args: T) -> RetType { return overload_args.free(self); // return 1; } } pub trait QGraphicsRectItem_free<RetType> { fn free(self , rsthis: & QGraphicsRectItem) -> RetType; } // proto: void QGraphicsRectItem::~QGraphicsRectItem(); impl<'a> /*trait*/ QGraphicsRectItem_free<()> for () { fn free(self , rsthis: & QGraphicsRectItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsRectItemD2Ev()}; unsafe {C_ZN17QGraphicsRectItemD2Ev(rsthis.qclsinst)}; // return 1; } } // proto: void QGraphicsRectItem::QGraphicsRectItem(const QRectF & rect, QGraphicsItem * parent); impl /*struct*/ QGraphicsRectItem { pub fn new<T: QGraphicsRectItem_new>(value: T) -> QGraphicsRectItem { let rsthis = value.new(); return rsthis; // return 1; } } pub trait QGraphicsRectItem_new { fn new(self) -> QGraphicsRectItem; } // proto: void QGraphicsRectItem::QGraphicsRectItem(const QRectF & rect, QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsRectItem_new for (&'a QRectF, Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsRectItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsRectItemC2ERK6QRectFP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsRectItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {0} else {self.1.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN17QGraphicsRectItemC2ERK6QRectFP13QGraphicsItem(arg0, arg1)}; let rsthis = QGraphicsRectItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: QPainterPath QGraphicsRectItem::opaqueArea(); impl /*struct*/ QGraphicsRectItem { pub fn opaqueArea<RetType, T: QGraphicsRectItem_opaqueArea<RetType>>(& self, overload_args: T) -> RetType { return overload_args.opaqueArea(self); // return 1; } } pub trait QGraphicsRectItem_opaqueArea<RetType> { fn opaqueArea(self , rsthis: & QGraphicsRectItem) -> RetType; } // proto: QPainterPath QGraphicsRectItem::opaqueArea(); impl<'a> /*trait*/ QGraphicsRectItem_opaqueArea<QPainterPath> for () { fn opaqueArea(self , rsthis: & QGraphicsRectItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsRectItem10opaqueAreaEv()}; let mut ret = unsafe {C_ZNK17QGraphicsRectItem10opaqueAreaEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsRectItem::setRect(const QRectF & rect); impl /*struct*/ QGraphicsRectItem { pub fn setRect<RetType, T: QGraphicsRectItem_setRect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setRect(self); // return 1; } } pub trait QGraphicsRectItem_setRect<RetType> { fn setRect(self , rsthis: & QGraphicsRectItem) -> RetType; } // proto: void QGraphicsRectItem::setRect(const QRectF & rect); impl<'a> /*trait*/ QGraphicsRectItem_setRect<()> for (&'a QRectF) { fn setRect(self , rsthis: & QGraphicsRectItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsRectItem7setRectERK6QRectF()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN17QGraphicsRectItem7setRectERK6QRectF(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsRectItem::setRect(qreal x, qreal y, qreal w, qreal h); impl<'a> /*trait*/ QGraphicsRectItem_setRect<()> for (f64, f64, f64, f64) { fn setRect(self , rsthis: & QGraphicsRectItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsRectItem7setRectEdddd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; unsafe {C_ZN17QGraphicsRectItem7setRectEdddd(rsthis.qclsinst, arg0, arg1, arg2, arg3)}; // return 1; } } // proto: void QGraphicsRectItem::QGraphicsRectItem(QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsRectItem_new for (Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsRectItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsRectItemC2EP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsRectItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN17QGraphicsRectItemC2EP13QGraphicsItem(arg0)}; let rsthis = QGraphicsRectItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: bool QGraphicsRectItem::contains(const QPointF & point); impl /*struct*/ QGraphicsRectItem { pub fn contains<RetType, T: QGraphicsRectItem_contains<RetType>>(& self, overload_args: T) -> RetType { return overload_args.contains(self); // return 1; } } pub trait QGraphicsRectItem_contains<RetType> { fn contains(self , rsthis: & QGraphicsRectItem) -> RetType; } // proto: bool QGraphicsRectItem::contains(const QPointF & point); impl<'a> /*trait*/ QGraphicsRectItem_contains<i8> for (&'a QPointF) { fn contains(self , rsthis: & QGraphicsRectItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsRectItem8containsERK7QPointF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK17QGraphicsRectItem8containsERK7QPointF(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsRectItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl /*struct*/ QGraphicsRectItem { pub fn paint<RetType, T: QGraphicsRectItem_paint<RetType>>(& self, overload_args: T) -> RetType { return overload_args.paint(self); // return 1; } } pub trait QGraphicsRectItem_paint<RetType> { fn paint(self , rsthis: & QGraphicsRectItem) -> RetType; } // proto: void QGraphicsRectItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl<'a> /*trait*/ QGraphicsRectItem_paint<()> for (&'a QPainter, &'a QStyleOptionGraphicsItem, Option<&'a QWidget>) { fn paint(self , rsthis: & QGraphicsRectItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsRectItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let arg2 = (if self.2.is_none() {0} else {self.2.unwrap().qclsinst}) as *mut c_void; unsafe {C_ZN17QGraphicsRectItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(rsthis.qclsinst, arg0, arg1, arg2)}; // return 1; } } // proto: void QGraphicsRectItem::QGraphicsRectItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsRectItem_new for (f64, f64, f64, f64, Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsRectItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsRectItemC2EddddP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsRectItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let arg4 = (if self.4.is_none() {0} else {self.4.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN17QGraphicsRectItemC2EddddP13QGraphicsItem(arg0, arg1, arg2, arg3, arg4)}; let rsthis = QGraphicsRectItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } impl /*struct*/ QGraphicsEllipseItem { pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QGraphicsEllipseItem { return QGraphicsEllipseItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; } } impl Deref for QGraphicsEllipseItem { type Target = QAbstractGraphicsShapeItem; fn deref(&self) -> &QAbstractGraphicsShapeItem { return & self.qbase; } } impl AsRef<QAbstractGraphicsShapeItem> for QGraphicsEllipseItem { fn as_ref(& self) -> & QAbstractGraphicsShapeItem { return & self.qbase; } } // proto: void QGraphicsEllipseItem::setStartAngle(int angle); impl /*struct*/ QGraphicsEllipseItem { pub fn setStartAngle<RetType, T: QGraphicsEllipseItem_setStartAngle<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setStartAngle(self); // return 1; } } pub trait QGraphicsEllipseItem_setStartAngle<RetType> { fn setStartAngle(self , rsthis: & QGraphicsEllipseItem) -> RetType; } // proto: void QGraphicsEllipseItem::setStartAngle(int angle); impl<'a> /*trait*/ QGraphicsEllipseItem_setStartAngle<()> for (i32) { fn setStartAngle(self , rsthis: & QGraphicsEllipseItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN20QGraphicsEllipseItem13setStartAngleEi()}; let arg0 = self as c_int; unsafe {C_ZN20QGraphicsEllipseItem13setStartAngleEi(rsthis.qclsinst, arg0)}; // return 1; } } // proto: bool QGraphicsEllipseItem::contains(const QPointF & point); impl /*struct*/ QGraphicsEllipseItem { pub fn contains<RetType, T: QGraphicsEllipseItem_contains<RetType>>(& self, overload_args: T) -> RetType { return overload_args.contains(self); // return 1; } } pub trait QGraphicsEllipseItem_contains<RetType> { fn contains(self , rsthis: & QGraphicsEllipseItem) -> RetType; } // proto: bool QGraphicsEllipseItem::contains(const QPointF & point); impl<'a> /*trait*/ QGraphicsEllipseItem_contains<i8> for (&'a QPointF) { fn contains(self , rsthis: & QGraphicsEllipseItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK20QGraphicsEllipseItem8containsERK7QPointF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK20QGraphicsEllipseItem8containsERK7QPointF(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsEllipseItem::QGraphicsEllipseItem(const QRectF & rect, QGraphicsItem * parent); impl /*struct*/ QGraphicsEllipseItem { pub fn new<T: QGraphicsEllipseItem_new>(value: T) -> QGraphicsEllipseItem { let rsthis = value.new(); return rsthis; // return 1; } } pub trait QGraphicsEllipseItem_new { fn new(self) -> QGraphicsEllipseItem; } // proto: void QGraphicsEllipseItem::QGraphicsEllipseItem(const QRectF & rect, QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsEllipseItem_new for (&'a QRectF, Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsEllipseItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN20QGraphicsEllipseItemC2ERK6QRectFP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsEllipseItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {0} else {self.1.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN20QGraphicsEllipseItemC2ERK6QRectFP13QGraphicsItem(arg0, arg1)}; let rsthis = QGraphicsEllipseItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: void QGraphicsEllipseItem::setRect(const QRectF & rect); impl /*struct*/ QGraphicsEllipseItem { pub fn setRect<RetType, T: QGraphicsEllipseItem_setRect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setRect(self); // return 1; } } pub trait QGraphicsEllipseItem_setRect<RetType> { fn setRect(self , rsthis: & QGraphicsEllipseItem) -> RetType; } // proto: void QGraphicsEllipseItem::setRect(const QRectF & rect); impl<'a> /*trait*/ QGraphicsEllipseItem_setRect<()> for (&'a QRectF) { fn setRect(self , rsthis: & QGraphicsEllipseItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN20QGraphicsEllipseItem7setRectERK6QRectF()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN20QGraphicsEllipseItem7setRectERK6QRectF(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsEllipseItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl /*struct*/ QGraphicsEllipseItem { pub fn paint<RetType, T: QGraphicsEllipseItem_paint<RetType>>(& self, overload_args: T) -> RetType { return overload_args.paint(self); // return 1; } } pub trait QGraphicsEllipseItem_paint<RetType> { fn paint(self , rsthis: & QGraphicsEllipseItem) -> RetType; } // proto: void QGraphicsEllipseItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl<'a> /*trait*/ QGraphicsEllipseItem_paint<()> for (&'a QPainter, &'a QStyleOptionGraphicsItem, Option<&'a QWidget>) { fn paint(self , rsthis: & QGraphicsEllipseItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN20QGraphicsEllipseItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let arg2 = (if self.2.is_none() {0} else {self.2.unwrap().qclsinst}) as *mut c_void; unsafe {C_ZN20QGraphicsEllipseItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(rsthis.qclsinst, arg0, arg1, arg2)}; // return 1; } } // proto: bool QGraphicsEllipseItem::isObscuredBy(const QGraphicsItem * item); impl /*struct*/ QGraphicsEllipseItem { pub fn isObscuredBy<RetType, T: QGraphicsEllipseItem_isObscuredBy<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isObscuredBy(self); // return 1; } } pub trait QGraphicsEllipseItem_isObscuredBy<RetType> { fn isObscuredBy(self , rsthis: & QGraphicsEllipseItem) -> RetType; } // proto: bool QGraphicsEllipseItem::isObscuredBy(const QGraphicsItem * item); impl<'a> /*trait*/ QGraphicsEllipseItem_isObscuredBy<i8> for (&'a QGraphicsItem) { fn isObscuredBy(self , rsthis: & QGraphicsEllipseItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK20QGraphicsEllipseItem12isObscuredByEPK13QGraphicsItem()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK20QGraphicsEllipseItem12isObscuredByEPK13QGraphicsItem(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: QRectF QGraphicsEllipseItem::rect(); impl /*struct*/ QGraphicsEllipseItem { pub fn rect<RetType, T: QGraphicsEllipseItem_rect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.rect(self); // return 1; } } pub trait QGraphicsEllipseItem_rect<RetType> { fn rect(self , rsthis: & QGraphicsEllipseItem) -> RetType; } // proto: QRectF QGraphicsEllipseItem::rect(); impl<'a> /*trait*/ QGraphicsEllipseItem_rect<QRectF> for () { fn rect(self , rsthis: & QGraphicsEllipseItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK20QGraphicsEllipseItem4rectEv()}; let mut ret = unsafe {C_ZNK20QGraphicsEllipseItem4rectEv(rsthis.qclsinst)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: int QGraphicsEllipseItem::spanAngle(); impl /*struct*/ QGraphicsEllipseItem { pub fn spanAngle<RetType, T: QGraphicsEllipseItem_spanAngle<RetType>>(& self, overload_args: T) -> RetType { return overload_args.spanAngle(self); // return 1; } } pub trait QGraphicsEllipseItem_spanAngle<RetType> { fn spanAngle(self , rsthis: & QGraphicsEllipseItem) -> RetType; } // proto: int QGraphicsEllipseItem::spanAngle(); impl<'a> /*trait*/ QGraphicsEllipseItem_spanAngle<i32> for () { fn spanAngle(self , rsthis: & QGraphicsEllipseItem) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK20QGraphicsEllipseItem9spanAngleEv()}; let mut ret = unsafe {C_ZNK20QGraphicsEllipseItem9spanAngleEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: int QGraphicsEllipseItem::startAngle(); impl /*struct*/ QGraphicsEllipseItem { pub fn startAngle<RetType, T: QGraphicsEllipseItem_startAngle<RetType>>(& self, overload_args: T) -> RetType { return overload_args.startAngle(self); // return 1; } } pub trait QGraphicsEllipseItem_startAngle<RetType> { fn startAngle(self , rsthis: & QGraphicsEllipseItem) -> RetType; } // proto: int QGraphicsEllipseItem::startAngle(); impl<'a> /*trait*/ QGraphicsEllipseItem_startAngle<i32> for () { fn startAngle(self , rsthis: & QGraphicsEllipseItem) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK20QGraphicsEllipseItem10startAngleEv()}; let mut ret = unsafe {C_ZNK20QGraphicsEllipseItem10startAngleEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: void QGraphicsEllipseItem::QGraphicsEllipseItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsEllipseItem_new for (f64, f64, f64, f64, Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsEllipseItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN20QGraphicsEllipseItemC2EddddP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsEllipseItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let arg4 = (if self.4.is_none() {0} else {self.4.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN20QGraphicsEllipseItemC2EddddP13QGraphicsItem(arg0, arg1, arg2, arg3, arg4)}; let rsthis = QGraphicsEllipseItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: void QGraphicsEllipseItem::setRect(qreal x, qreal y, qreal w, qreal h); impl<'a> /*trait*/ QGraphicsEllipseItem_setRect<()> for (f64, f64, f64, f64) { fn setRect(self , rsthis: & QGraphicsEllipseItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN20QGraphicsEllipseItem7setRectEdddd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; unsafe {C_ZN20QGraphicsEllipseItem7setRectEdddd(rsthis.qclsinst, arg0, arg1, arg2, arg3)}; // return 1; } } // proto: void QGraphicsEllipseItem::setSpanAngle(int angle); impl /*struct*/ QGraphicsEllipseItem { pub fn setSpanAngle<RetType, T: QGraphicsEllipseItem_setSpanAngle<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setSpanAngle(self); // return 1; } } pub trait QGraphicsEllipseItem_setSpanAngle<RetType> { fn setSpanAngle(self , rsthis: & QGraphicsEllipseItem) -> RetType; } // proto: void QGraphicsEllipseItem::setSpanAngle(int angle); impl<'a> /*trait*/ QGraphicsEllipseItem_setSpanAngle<()> for (i32) { fn setSpanAngle(self , rsthis: & QGraphicsEllipseItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN20QGraphicsEllipseItem12setSpanAngleEi()}; let arg0 = self as c_int; unsafe {C_ZN20QGraphicsEllipseItem12setSpanAngleEi(rsthis.qclsinst, arg0)}; // return 1; } } // proto: int QGraphicsEllipseItem::type(); impl /*struct*/ QGraphicsEllipseItem { pub fn type_<RetType, T: QGraphicsEllipseItem_type_<RetType>>(& self, overload_args: T) -> RetType { return overload_args.type_(self); // return 1; } } pub trait QGraphicsEllipseItem_type_<RetType> { fn type_(self , rsthis: & QGraphicsEllipseItem) -> RetType; } // proto: int QGraphicsEllipseItem::type(); impl<'a> /*trait*/ QGraphicsEllipseItem_type_<i32> for () { fn type_(self , rsthis: & QGraphicsEllipseItem) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK20QGraphicsEllipseItem4typeEv()}; let mut ret = unsafe {C_ZNK20QGraphicsEllipseItem4typeEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: QRectF QGraphicsEllipseItem::boundingRect(); impl /*struct*/ QGraphicsEllipseItem { pub fn boundingRect<RetType, T: QGraphicsEllipseItem_boundingRect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.boundingRect(self); // return 1; } } pub trait QGraphicsEllipseItem_boundingRect<RetType> { fn boundingRect(self , rsthis: & QGraphicsEllipseItem) -> RetType; } // proto: QRectF QGraphicsEllipseItem::boundingRect(); impl<'a> /*trait*/ QGraphicsEllipseItem_boundingRect<QRectF> for () { fn boundingRect(self , rsthis: & QGraphicsEllipseItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK20QGraphicsEllipseItem12boundingRectEv()}; let mut ret = unsafe {C_ZNK20QGraphicsEllipseItem12boundingRectEv(rsthis.qclsinst)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPainterPath QGraphicsEllipseItem::shape(); impl /*struct*/ QGraphicsEllipseItem { pub fn shape<RetType, T: QGraphicsEllipseItem_shape<RetType>>(& self, overload_args: T) -> RetType { return overload_args.shape(self); // return 1; } } pub trait QGraphicsEllipseItem_shape<RetType> { fn shape(self , rsthis: & QGraphicsEllipseItem) -> RetType; } // proto: QPainterPath QGraphicsEllipseItem::shape(); impl<'a> /*trait*/ QGraphicsEllipseItem_shape<QPainterPath> for () { fn shape(self , rsthis: & QGraphicsEllipseItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK20QGraphicsEllipseItem5shapeEv()}; let mut ret = unsafe {C_ZNK20QGraphicsEllipseItem5shapeEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsEllipseItem::~QGraphicsEllipseItem(); impl /*struct*/ QGraphicsEllipseItem { pub fn free<RetType, T: QGraphicsEllipseItem_free<RetType>>(& self, overload_args: T) -> RetType { return overload_args.free(self); // return 1; } } pub trait QGraphicsEllipseItem_free<RetType> { fn free(self , rsthis: & QGraphicsEllipseItem) -> RetType; } // proto: void QGraphicsEllipseItem::~QGraphicsEllipseItem(); impl<'a> /*trait*/ QGraphicsEllipseItem_free<()> for () { fn free(self , rsthis: & QGraphicsEllipseItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN20QGraphicsEllipseItemD2Ev()}; unsafe {C_ZN20QGraphicsEllipseItemD2Ev(rsthis.qclsinst)}; // return 1; } } // proto: void QGraphicsEllipseItem::QGraphicsEllipseItem(QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsEllipseItem_new for (Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsEllipseItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN20QGraphicsEllipseItemC2EP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsEllipseItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN20QGraphicsEllipseItemC2EP13QGraphicsItem(arg0)}; let rsthis = QGraphicsEllipseItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: QPainterPath QGraphicsEllipseItem::opaqueArea(); impl /*struct*/ QGraphicsEllipseItem { pub fn opaqueArea<RetType, T: QGraphicsEllipseItem_opaqueArea<RetType>>(& self, overload_args: T) -> RetType { return overload_args.opaqueArea(self); // return 1; } } pub trait QGraphicsEllipseItem_opaqueArea<RetType> { fn opaqueArea(self , rsthis: & QGraphicsEllipseItem) -> RetType; } // proto: QPainterPath QGraphicsEllipseItem::opaqueArea(); impl<'a> /*trait*/ QGraphicsEllipseItem_opaqueArea<QPainterPath> for () { fn opaqueArea(self , rsthis: & QGraphicsEllipseItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK20QGraphicsEllipseItem10opaqueAreaEv()}; let mut ret = unsafe {C_ZNK20QGraphicsEllipseItem10opaqueAreaEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } impl /*struct*/ QGraphicsPolygonItem { pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QGraphicsPolygonItem { return QGraphicsPolygonItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; } } impl Deref for QGraphicsPolygonItem { type Target = QAbstractGraphicsShapeItem; fn deref(&self) -> &QAbstractGraphicsShapeItem { return & self.qbase; } } impl AsRef<QAbstractGraphicsShapeItem> for QGraphicsPolygonItem { fn as_ref(& self) -> & QAbstractGraphicsShapeItem { return & self.qbase; } } // proto: QPainterPath QGraphicsPolygonItem::shape(); impl /*struct*/ QGraphicsPolygonItem { pub fn shape<RetType, T: QGraphicsPolygonItem_shape<RetType>>(& self, overload_args: T) -> RetType { return overload_args.shape(self); // return 1; } } pub trait QGraphicsPolygonItem_shape<RetType> { fn shape(self , rsthis: & QGraphicsPolygonItem) -> RetType; } // proto: QPainterPath QGraphicsPolygonItem::shape(); impl<'a> /*trait*/ QGraphicsPolygonItem_shape<QPainterPath> for () { fn shape(self , rsthis: & QGraphicsPolygonItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK20QGraphicsPolygonItem5shapeEv()}; let mut ret = unsafe {C_ZNK20QGraphicsPolygonItem5shapeEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsPolygonItem::isObscuredBy(const QGraphicsItem * item); impl /*struct*/ QGraphicsPolygonItem { pub fn isObscuredBy<RetType, T: QGraphicsPolygonItem_isObscuredBy<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isObscuredBy(self); // return 1; } } pub trait QGraphicsPolygonItem_isObscuredBy<RetType> { fn isObscuredBy(self , rsthis: & QGraphicsPolygonItem) -> RetType; } // proto: bool QGraphicsPolygonItem::isObscuredBy(const QGraphicsItem * item); impl<'a> /*trait*/ QGraphicsPolygonItem_isObscuredBy<i8> for (&'a QGraphicsItem) { fn isObscuredBy(self , rsthis: & QGraphicsPolygonItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK20QGraphicsPolygonItem12isObscuredByEPK13QGraphicsItem()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK20QGraphicsPolygonItem12isObscuredByEPK13QGraphicsItem(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsPolygonItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl /*struct*/ QGraphicsPolygonItem { pub fn paint<RetType, T: QGraphicsPolygonItem_paint<RetType>>(& self, overload_args: T) -> RetType { return overload_args.paint(self); // return 1; } } pub trait QGraphicsPolygonItem_paint<RetType> { fn paint(self , rsthis: & QGraphicsPolygonItem) -> RetType; } // proto: void QGraphicsPolygonItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl<'a> /*trait*/ QGraphicsPolygonItem_paint<()> for (&'a QPainter, &'a QStyleOptionGraphicsItem, Option<&'a QWidget>) { fn paint(self , rsthis: & QGraphicsPolygonItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN20QGraphicsPolygonItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let arg2 = (if self.2.is_none() {0} else {self.2.unwrap().qclsinst}) as *mut c_void; unsafe {C_ZN20QGraphicsPolygonItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(rsthis.qclsinst, arg0, arg1, arg2)}; // return 1; } } // proto: void QGraphicsPolygonItem::QGraphicsPolygonItem(QGraphicsItem * parent); impl /*struct*/ QGraphicsPolygonItem { pub fn new<T: QGraphicsPolygonItem_new>(value: T) -> QGraphicsPolygonItem { let rsthis = value.new(); return rsthis; // return 1; } } pub trait QGraphicsPolygonItem_new { fn new(self) -> QGraphicsPolygonItem; } // proto: void QGraphicsPolygonItem::QGraphicsPolygonItem(QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsPolygonItem_new for (Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsPolygonItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN20QGraphicsPolygonItemC2EP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsPolygonItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN20QGraphicsPolygonItemC2EP13QGraphicsItem(arg0)}; let rsthis = QGraphicsPolygonItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: QRectF QGraphicsPolygonItem::boundingRect(); impl /*struct*/ QGraphicsPolygonItem { pub fn boundingRect<RetType, T: QGraphicsPolygonItem_boundingRect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.boundingRect(self); // return 1; } } pub trait QGraphicsPolygonItem_boundingRect<RetType> { fn boundingRect(self , rsthis: & QGraphicsPolygonItem) -> RetType; } // proto: QRectF QGraphicsPolygonItem::boundingRect(); impl<'a> /*trait*/ QGraphicsPolygonItem_boundingRect<QRectF> for () { fn boundingRect(self , rsthis: & QGraphicsPolygonItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK20QGraphicsPolygonItem12boundingRectEv()}; let mut ret = unsafe {C_ZNK20QGraphicsPolygonItem12boundingRectEv(rsthis.qclsinst)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: int QGraphicsPolygonItem::type(); impl /*struct*/ QGraphicsPolygonItem { pub fn type_<RetType, T: QGraphicsPolygonItem_type_<RetType>>(& self, overload_args: T) -> RetType { return overload_args.type_(self); // return 1; } } pub trait QGraphicsPolygonItem_type_<RetType> { fn type_(self , rsthis: & QGraphicsPolygonItem) -> RetType; } // proto: int QGraphicsPolygonItem::type(); impl<'a> /*trait*/ QGraphicsPolygonItem_type_<i32> for () { fn type_(self , rsthis: & QGraphicsPolygonItem) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK20QGraphicsPolygonItem4typeEv()}; let mut ret = unsafe {C_ZNK20QGraphicsPolygonItem4typeEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: void QGraphicsPolygonItem::~QGraphicsPolygonItem(); impl /*struct*/ QGraphicsPolygonItem { pub fn free<RetType, T: QGraphicsPolygonItem_free<RetType>>(& self, overload_args: T) -> RetType { return overload_args.free(self); // return 1; } } pub trait QGraphicsPolygonItem_free<RetType> { fn free(self , rsthis: & QGraphicsPolygonItem) -> RetType; } // proto: void QGraphicsPolygonItem::~QGraphicsPolygonItem(); impl<'a> /*trait*/ QGraphicsPolygonItem_free<()> for () { fn free(self , rsthis: & QGraphicsPolygonItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN20QGraphicsPolygonItemD2Ev()}; unsafe {C_ZN20QGraphicsPolygonItemD2Ev(rsthis.qclsinst)}; // return 1; } } // proto: QPolygonF QGraphicsPolygonItem::polygon(); impl /*struct*/ QGraphicsPolygonItem { pub fn polygon<RetType, T: QGraphicsPolygonItem_polygon<RetType>>(& self, overload_args: T) -> RetType { return overload_args.polygon(self); // return 1; } } pub trait QGraphicsPolygonItem_polygon<RetType> { fn polygon(self , rsthis: & QGraphicsPolygonItem) -> RetType; } // proto: QPolygonF QGraphicsPolygonItem::polygon(); impl<'a> /*trait*/ QGraphicsPolygonItem_polygon<QPolygonF> for () { fn polygon(self , rsthis: & QGraphicsPolygonItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK20QGraphicsPolygonItem7polygonEv()}; let mut ret = unsafe {C_ZNK20QGraphicsPolygonItem7polygonEv(rsthis.qclsinst)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPainterPath QGraphicsPolygonItem::opaqueArea(); impl /*struct*/ QGraphicsPolygonItem { pub fn opaqueArea<RetType, T: QGraphicsPolygonItem_opaqueArea<RetType>>(& self, overload_args: T) -> RetType { return overload_args.opaqueArea(self); // return 1; } } pub trait QGraphicsPolygonItem_opaqueArea<RetType> { fn opaqueArea(self , rsthis: & QGraphicsPolygonItem) -> RetType; } // proto: QPainterPath QGraphicsPolygonItem::opaqueArea(); impl<'a> /*trait*/ QGraphicsPolygonItem_opaqueArea<QPainterPath> for () { fn opaqueArea(self , rsthis: & QGraphicsPolygonItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK20QGraphicsPolygonItem10opaqueAreaEv()}; let mut ret = unsafe {C_ZNK20QGraphicsPolygonItem10opaqueAreaEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsPolygonItem::QGraphicsPolygonItem(const QPolygonF & polygon, QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsPolygonItem_new for (&'a QPolygonF, Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsPolygonItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN20QGraphicsPolygonItemC2ERK9QPolygonFP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsPolygonItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {0} else {self.1.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN20QGraphicsPolygonItemC2ERK9QPolygonFP13QGraphicsItem(arg0, arg1)}; let rsthis = QGraphicsPolygonItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: bool QGraphicsPolygonItem::contains(const QPointF & point); impl /*struct*/ QGraphicsPolygonItem { pub fn contains<RetType, T: QGraphicsPolygonItem_contains<RetType>>(& self, overload_args: T) -> RetType { return overload_args.contains(self); // return 1; } } pub trait QGraphicsPolygonItem_contains<RetType> { fn contains(self , rsthis: & QGraphicsPolygonItem) -> RetType; } // proto: bool QGraphicsPolygonItem::contains(const QPointF & point); impl<'a> /*trait*/ QGraphicsPolygonItem_contains<i8> for (&'a QPointF) { fn contains(self , rsthis: & QGraphicsPolygonItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK20QGraphicsPolygonItem8containsERK7QPointF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK20QGraphicsPolygonItem8containsERK7QPointF(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsPolygonItem::setPolygon(const QPolygonF & polygon); impl /*struct*/ QGraphicsPolygonItem { pub fn setPolygon<RetType, T: QGraphicsPolygonItem_setPolygon<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setPolygon(self); // return 1; } } pub trait QGraphicsPolygonItem_setPolygon<RetType> { fn setPolygon(self , rsthis: & QGraphicsPolygonItem) -> RetType; } // proto: void QGraphicsPolygonItem::setPolygon(const QPolygonF & polygon); impl<'a> /*trait*/ QGraphicsPolygonItem_setPolygon<()> for (&'a QPolygonF) { fn setPolygon(self , rsthis: & QGraphicsPolygonItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN20QGraphicsPolygonItem10setPolygonERK9QPolygonF()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN20QGraphicsPolygonItem10setPolygonERK9QPolygonF(rsthis.qclsinst, arg0)}; // return 1; } } impl /*struct*/ QGraphicsPathItem { pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QGraphicsPathItem { return QGraphicsPathItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; } } impl Deref for QGraphicsPathItem { type Target = QAbstractGraphicsShapeItem; fn deref(&self) -> &QAbstractGraphicsShapeItem { return & self.qbase; } } impl AsRef<QAbstractGraphicsShapeItem> for QGraphicsPathItem { fn as_ref(& self) -> & QAbstractGraphicsShapeItem { return & self.qbase; } } // proto: void QGraphicsPathItem::setPath(const QPainterPath & path); impl /*struct*/ QGraphicsPathItem { pub fn setPath<RetType, T: QGraphicsPathItem_setPath<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setPath(self); // return 1; } } pub trait QGraphicsPathItem_setPath<RetType> { fn setPath(self , rsthis: & QGraphicsPathItem) -> RetType; } // proto: void QGraphicsPathItem::setPath(const QPainterPath & path); impl<'a> /*trait*/ QGraphicsPathItem_setPath<()> for (&'a QPainterPath) { fn setPath(self , rsthis: & QGraphicsPathItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsPathItem7setPathERK12QPainterPath()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN17QGraphicsPathItem7setPathERK12QPainterPath(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsPathItem::QGraphicsPathItem(const QPainterPath & path, QGraphicsItem * parent); impl /*struct*/ QGraphicsPathItem { pub fn new<T: QGraphicsPathItem_new>(value: T) -> QGraphicsPathItem { let rsthis = value.new(); return rsthis; // return 1; } } pub trait QGraphicsPathItem_new { fn new(self) -> QGraphicsPathItem; } // proto: void QGraphicsPathItem::QGraphicsPathItem(const QPainterPath & path, QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsPathItem_new for (&'a QPainterPath, Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsPathItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsPathItemC2ERK12QPainterPathP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsPathItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {0} else {self.1.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN17QGraphicsPathItemC2ERK12QPainterPathP13QGraphicsItem(arg0, arg1)}; let rsthis = QGraphicsPathItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: bool QGraphicsPathItem::contains(const QPointF & point); impl /*struct*/ QGraphicsPathItem { pub fn contains<RetType, T: QGraphicsPathItem_contains<RetType>>(& self, overload_args: T) -> RetType { return overload_args.contains(self); // return 1; } } pub trait QGraphicsPathItem_contains<RetType> { fn contains(self , rsthis: & QGraphicsPathItem) -> RetType; } // proto: bool QGraphicsPathItem::contains(const QPointF & point); impl<'a> /*trait*/ QGraphicsPathItem_contains<i8> for (&'a QPointF) { fn contains(self , rsthis: & QGraphicsPathItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsPathItem8containsERK7QPointF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK17QGraphicsPathItem8containsERK7QPointF(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: QRectF QGraphicsPathItem::boundingRect(); impl /*struct*/ QGraphicsPathItem { pub fn boundingRect<RetType, T: QGraphicsPathItem_boundingRect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.boundingRect(self); // return 1; } } pub trait QGraphicsPathItem_boundingRect<RetType> { fn boundingRect(self , rsthis: & QGraphicsPathItem) -> RetType; } // proto: QRectF QGraphicsPathItem::boundingRect(); impl<'a> /*trait*/ QGraphicsPathItem_boundingRect<QRectF> for () { fn boundingRect(self , rsthis: & QGraphicsPathItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsPathItem12boundingRectEv()}; let mut ret = unsafe {C_ZNK17QGraphicsPathItem12boundingRectEv(rsthis.qclsinst)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: int QGraphicsPathItem::type(); impl /*struct*/ QGraphicsPathItem { pub fn type_<RetType, T: QGraphicsPathItem_type_<RetType>>(& self, overload_args: T) -> RetType { return overload_args.type_(self); // return 1; } } pub trait QGraphicsPathItem_type_<RetType> { fn type_(self , rsthis: & QGraphicsPathItem) -> RetType; } // proto: int QGraphicsPathItem::type(); impl<'a> /*trait*/ QGraphicsPathItem_type_<i32> for () { fn type_(self , rsthis: & QGraphicsPathItem) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsPathItem4typeEv()}; let mut ret = unsafe {C_ZNK17QGraphicsPathItem4typeEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: QPainterPath QGraphicsPathItem::opaqueArea(); impl /*struct*/ QGraphicsPathItem { pub fn opaqueArea<RetType, T: QGraphicsPathItem_opaqueArea<RetType>>(& self, overload_args: T) -> RetType { return overload_args.opaqueArea(self); // return 1; } } pub trait QGraphicsPathItem_opaqueArea<RetType> { fn opaqueArea(self , rsthis: & QGraphicsPathItem) -> RetType; } // proto: QPainterPath QGraphicsPathItem::opaqueArea(); impl<'a> /*trait*/ QGraphicsPathItem_opaqueArea<QPainterPath> for () { fn opaqueArea(self , rsthis: & QGraphicsPathItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsPathItem10opaqueAreaEv()}; let mut ret = unsafe {C_ZNK17QGraphicsPathItem10opaqueAreaEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPainterPath QGraphicsPathItem::path(); impl /*struct*/ QGraphicsPathItem { pub fn path<RetType, T: QGraphicsPathItem_path<RetType>>(& self, overload_args: T) -> RetType { return overload_args.path(self); // return 1; } } pub trait QGraphicsPathItem_path<RetType> { fn path(self , rsthis: & QGraphicsPathItem) -> RetType; } // proto: QPainterPath QGraphicsPathItem::path(); impl<'a> /*trait*/ QGraphicsPathItem_path<QPainterPath> for () { fn path(self , rsthis: & QGraphicsPathItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsPathItem4pathEv()}; let mut ret = unsafe {C_ZNK17QGraphicsPathItem4pathEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsPathItem::~QGraphicsPathItem(); impl /*struct*/ QGraphicsPathItem { pub fn free<RetType, T: QGraphicsPathItem_free<RetType>>(& self, overload_args: T) -> RetType { return overload_args.free(self); // return 1; } } pub trait QGraphicsPathItem_free<RetType> { fn free(self , rsthis: & QGraphicsPathItem) -> RetType; } // proto: void QGraphicsPathItem::~QGraphicsPathItem(); impl<'a> /*trait*/ QGraphicsPathItem_free<()> for () { fn free(self , rsthis: & QGraphicsPathItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsPathItemD2Ev()}; unsafe {C_ZN17QGraphicsPathItemD2Ev(rsthis.qclsinst)}; // return 1; } } // proto: QPainterPath QGraphicsPathItem::shape(); impl /*struct*/ QGraphicsPathItem { pub fn shape<RetType, T: QGraphicsPathItem_shape<RetType>>(& self, overload_args: T) -> RetType { return overload_args.shape(self); // return 1; } } pub trait QGraphicsPathItem_shape<RetType> { fn shape(self , rsthis: & QGraphicsPathItem) -> RetType; } // proto: QPainterPath QGraphicsPathItem::shape(); impl<'a> /*trait*/ QGraphicsPathItem_shape<QPainterPath> for () { fn shape(self , rsthis: & QGraphicsPathItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsPathItem5shapeEv()}; let mut ret = unsafe {C_ZNK17QGraphicsPathItem5shapeEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsPathItem::isObscuredBy(const QGraphicsItem * item); impl /*struct*/ QGraphicsPathItem { pub fn isObscuredBy<RetType, T: QGraphicsPathItem_isObscuredBy<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isObscuredBy(self); // return 1; } } pub trait QGraphicsPathItem_isObscuredBy<RetType> { fn isObscuredBy(self , rsthis: & QGraphicsPathItem) -> RetType; } // proto: bool QGraphicsPathItem::isObscuredBy(const QGraphicsItem * item); impl<'a> /*trait*/ QGraphicsPathItem_isObscuredBy<i8> for (&'a QGraphicsItem) { fn isObscuredBy(self , rsthis: & QGraphicsPathItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsPathItem12isObscuredByEPK13QGraphicsItem()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK17QGraphicsPathItem12isObscuredByEPK13QGraphicsItem(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsPathItem::QGraphicsPathItem(QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsPathItem_new for (Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsPathItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsPathItemC2EP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsPathItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN17QGraphicsPathItemC2EP13QGraphicsItem(arg0)}; let rsthis = QGraphicsPathItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: void QGraphicsPathItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl /*struct*/ QGraphicsPathItem { pub fn paint<RetType, T: QGraphicsPathItem_paint<RetType>>(& self, overload_args: T) -> RetType { return overload_args.paint(self); // return 1; } } pub trait QGraphicsPathItem_paint<RetType> { fn paint(self , rsthis: & QGraphicsPathItem) -> RetType; } // proto: void QGraphicsPathItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl<'a> /*trait*/ QGraphicsPathItem_paint<()> for (&'a QPainter, &'a QStyleOptionGraphicsItem, Option<&'a QWidget>) { fn paint(self , rsthis: & QGraphicsPathItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsPathItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let arg2 = (if self.2.is_none() {0} else {self.2.unwrap().qclsinst}) as *mut c_void; unsafe {C_ZN17QGraphicsPathItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(rsthis.qclsinst, arg0, arg1, arg2)}; // return 1; } } impl /*struct*/ QGraphicsLineItem { pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QGraphicsLineItem { return QGraphicsLineItem{qbase: QGraphicsItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; } } impl Deref for QGraphicsLineItem { type Target = QGraphicsItem; fn deref(&self) -> &QGraphicsItem { return & self.qbase; } } impl AsRef<QGraphicsItem> for QGraphicsLineItem { fn as_ref(& self) -> & QGraphicsItem { return & self.qbase; } } // proto: void QGraphicsLineItem::setPen(const QPen & pen); impl /*struct*/ QGraphicsLineItem { pub fn setPen<RetType, T: QGraphicsLineItem_setPen<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setPen(self); // return 1; } } pub trait QGraphicsLineItem_setPen<RetType> { fn setPen(self , rsthis: & QGraphicsLineItem) -> RetType; } // proto: void QGraphicsLineItem::setPen(const QPen & pen); impl<'a> /*trait*/ QGraphicsLineItem_setPen<()> for (&'a QPen) { fn setPen(self , rsthis: & QGraphicsLineItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsLineItem6setPenERK4QPen()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN17QGraphicsLineItem6setPenERK4QPen(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsLineItem::QGraphicsLineItem(QGraphicsItem * parent); impl /*struct*/ QGraphicsLineItem { pub fn new<T: QGraphicsLineItem_new>(value: T) -> QGraphicsLineItem { let rsthis = value.new(); return rsthis; // return 1; } } pub trait QGraphicsLineItem_new { fn new(self) -> QGraphicsLineItem; } // proto: void QGraphicsLineItem::QGraphicsLineItem(QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsLineItem_new for (Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsLineItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsLineItemC2EP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsLineItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN17QGraphicsLineItemC2EP13QGraphicsItem(arg0)}; let rsthis = QGraphicsLineItem{qbase: QGraphicsItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: bool QGraphicsLineItem::isObscuredBy(const QGraphicsItem * item); impl /*struct*/ QGraphicsLineItem { pub fn isObscuredBy<RetType, T: QGraphicsLineItem_isObscuredBy<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isObscuredBy(self); // return 1; } } pub trait QGraphicsLineItem_isObscuredBy<RetType> { fn isObscuredBy(self , rsthis: & QGraphicsLineItem) -> RetType; } // proto: bool QGraphicsLineItem::isObscuredBy(const QGraphicsItem * item); impl<'a> /*trait*/ QGraphicsLineItem_isObscuredBy<i8> for (&'a QGraphicsItem) { fn isObscuredBy(self , rsthis: & QGraphicsLineItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsLineItem12isObscuredByEPK13QGraphicsItem()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK17QGraphicsLineItem12isObscuredByEPK13QGraphicsItem(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsLineItem::QGraphicsLineItem(const QLineF & line, QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsLineItem_new for (&'a QLineF, Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsLineItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsLineItemC2ERK6QLineFP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsLineItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {0} else {self.1.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN17QGraphicsLineItemC2ERK6QLineFP13QGraphicsItem(arg0, arg1)}; let rsthis = QGraphicsLineItem{qbase: QGraphicsItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: QLineF QGraphicsLineItem::line(); impl /*struct*/ QGraphicsLineItem { pub fn line<RetType, T: QGraphicsLineItem_line<RetType>>(& self, overload_args: T) -> RetType { return overload_args.line(self); // return 1; } } pub trait QGraphicsLineItem_line<RetType> { fn line(self , rsthis: & QGraphicsLineItem) -> RetType; } // proto: QLineF QGraphicsLineItem::line(); impl<'a> /*trait*/ QGraphicsLineItem_line<QLineF> for () { fn line(self , rsthis: & QGraphicsLineItem) -> QLineF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsLineItem4lineEv()}; let mut ret = unsafe {C_ZNK17QGraphicsLineItem4lineEv(rsthis.qclsinst)}; let mut ret1 = QLineF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPainterPath QGraphicsLineItem::opaqueArea(); impl /*struct*/ QGraphicsLineItem { pub fn opaqueArea<RetType, T: QGraphicsLineItem_opaqueArea<RetType>>(& self, overload_args: T) -> RetType { return overload_args.opaqueArea(self); // return 1; } } pub trait QGraphicsLineItem_opaqueArea<RetType> { fn opaqueArea(self , rsthis: & QGraphicsLineItem) -> RetType; } // proto: QPainterPath QGraphicsLineItem::opaqueArea(); impl<'a> /*trait*/ QGraphicsLineItem_opaqueArea<QPainterPath> for () { fn opaqueArea(self , rsthis: & QGraphicsLineItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsLineItem10opaqueAreaEv()}; let mut ret = unsafe {C_ZNK17QGraphicsLineItem10opaqueAreaEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsLineItem::setLine(qreal x1, qreal y1, qreal x2, qreal y2); impl /*struct*/ QGraphicsLineItem { pub fn setLine<RetType, T: QGraphicsLineItem_setLine<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setLine(self); // return 1; } } pub trait QGraphicsLineItem_setLine<RetType> { fn setLine(self , rsthis: & QGraphicsLineItem) -> RetType; } // proto: void QGraphicsLineItem::setLine(qreal x1, qreal y1, qreal x2, qreal y2); impl<'a> /*trait*/ QGraphicsLineItem_setLine<()> for (f64, f64, f64, f64) { fn setLine(self , rsthis: & QGraphicsLineItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsLineItem7setLineEdddd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; unsafe {C_ZN17QGraphicsLineItem7setLineEdddd(rsthis.qclsinst, arg0, arg1, arg2, arg3)}; // return 1; } } // proto: QRectF QGraphicsLineItem::boundingRect(); impl /*struct*/ QGraphicsLineItem { pub fn boundingRect<RetType, T: QGraphicsLineItem_boundingRect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.boundingRect(self); // return 1; } } pub trait QGraphicsLineItem_boundingRect<RetType> { fn boundingRect(self , rsthis: & QGraphicsLineItem) -> RetType; } // proto: QRectF QGraphicsLineItem::boundingRect(); impl<'a> /*trait*/ QGraphicsLineItem_boundingRect<QRectF> for () { fn boundingRect(self , rsthis: & QGraphicsLineItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsLineItem12boundingRectEv()}; let mut ret = unsafe {C_ZNK17QGraphicsLineItem12boundingRectEv(rsthis.qclsinst)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPen QGraphicsLineItem::pen(); impl /*struct*/ QGraphicsLineItem { pub fn pen<RetType, T: QGraphicsLineItem_pen<RetType>>(& self, overload_args: T) -> RetType { return overload_args.pen(self); // return 1; } } pub trait QGraphicsLineItem_pen<RetType> { fn pen(self , rsthis: & QGraphicsLineItem) -> RetType; } // proto: QPen QGraphicsLineItem::pen(); impl<'a> /*trait*/ QGraphicsLineItem_pen<QPen> for () { fn pen(self , rsthis: & QGraphicsLineItem) -> QPen { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsLineItem3penEv()}; let mut ret = unsafe {C_ZNK17QGraphicsLineItem3penEv(rsthis.qclsinst)}; let mut ret1 = QPen::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsLineItem::setLine(const QLineF & line); impl<'a> /*trait*/ QGraphicsLineItem_setLine<()> for (&'a QLineF) { fn setLine(self , rsthis: & QGraphicsLineItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsLineItem7setLineERK6QLineF()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN17QGraphicsLineItem7setLineERK6QLineF(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QPainterPath QGraphicsLineItem::shape(); impl /*struct*/ QGraphicsLineItem { pub fn shape<RetType, T: QGraphicsLineItem_shape<RetType>>(& self, overload_args: T) -> RetType { return overload_args.shape(self); // return 1; } } pub trait QGraphicsLineItem_shape<RetType> { fn shape(self , rsthis: & QGraphicsLineItem) -> RetType; } // proto: QPainterPath QGraphicsLineItem::shape(); impl<'a> /*trait*/ QGraphicsLineItem_shape<QPainterPath> for () { fn shape(self , rsthis: & QGraphicsLineItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsLineItem5shapeEv()}; let mut ret = unsafe {C_ZNK17QGraphicsLineItem5shapeEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsLineItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl /*struct*/ QGraphicsLineItem { pub fn paint<RetType, T: QGraphicsLineItem_paint<RetType>>(& self, overload_args: T) -> RetType { return overload_args.paint(self); // return 1; } } pub trait QGraphicsLineItem_paint<RetType> { fn paint(self , rsthis: & QGraphicsLineItem) -> RetType; } // proto: void QGraphicsLineItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl<'a> /*trait*/ QGraphicsLineItem_paint<()> for (&'a QPainter, &'a QStyleOptionGraphicsItem, Option<&'a QWidget>) { fn paint(self , rsthis: & QGraphicsLineItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsLineItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let arg2 = (if self.2.is_none() {0} else {self.2.unwrap().qclsinst}) as *mut c_void; unsafe {C_ZN17QGraphicsLineItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(rsthis.qclsinst, arg0, arg1, arg2)}; // return 1; } } // proto: int QGraphicsLineItem::type(); impl /*struct*/ QGraphicsLineItem { pub fn type_<RetType, T: QGraphicsLineItem_type_<RetType>>(& self, overload_args: T) -> RetType { return overload_args.type_(self); // return 1; } } pub trait QGraphicsLineItem_type_<RetType> { fn type_(self , rsthis: & QGraphicsLineItem) -> RetType; } // proto: int QGraphicsLineItem::type(); impl<'a> /*trait*/ QGraphicsLineItem_type_<i32> for () { fn type_(self , rsthis: & QGraphicsLineItem) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsLineItem4typeEv()}; let mut ret = unsafe {C_ZNK17QGraphicsLineItem4typeEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: void QGraphicsLineItem::QGraphicsLineItem(qreal x1, qreal y1, qreal x2, qreal y2, QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsLineItem_new for (f64, f64, f64, f64, Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsLineItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsLineItemC2EddddP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsLineItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let arg4 = (if self.4.is_none() {0} else {self.4.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN17QGraphicsLineItemC2EddddP13QGraphicsItem(arg0, arg1, arg2, arg3, arg4)}; let rsthis = QGraphicsLineItem{qbase: QGraphicsItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: bool QGraphicsLineItem::contains(const QPointF & point); impl /*struct*/ QGraphicsLineItem { pub fn contains<RetType, T: QGraphicsLineItem_contains<RetType>>(& self, overload_args: T) -> RetType { return overload_args.contains(self); // return 1; } } pub trait QGraphicsLineItem_contains<RetType> { fn contains(self , rsthis: & QGraphicsLineItem) -> RetType; } // proto: bool QGraphicsLineItem::contains(const QPointF & point); impl<'a> /*trait*/ QGraphicsLineItem_contains<i8> for (&'a QPointF) { fn contains(self , rsthis: & QGraphicsLineItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK17QGraphicsLineItem8containsERK7QPointF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK17QGraphicsLineItem8containsERK7QPointF(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsLineItem::~QGraphicsLineItem(); impl /*struct*/ QGraphicsLineItem { pub fn free<RetType, T: QGraphicsLineItem_free<RetType>>(& self, overload_args: T) -> RetType { return overload_args.free(self); // return 1; } } pub trait QGraphicsLineItem_free<RetType> { fn free(self , rsthis: & QGraphicsLineItem) -> RetType; } // proto: void QGraphicsLineItem::~QGraphicsLineItem(); impl<'a> /*trait*/ QGraphicsLineItem_free<()> for () { fn free(self , rsthis: & QGraphicsLineItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN17QGraphicsLineItemD2Ev()}; unsafe {C_ZN17QGraphicsLineItemD2Ev(rsthis.qclsinst)}; // return 1; } } impl /*struct*/ QGraphicsItemGroup { pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QGraphicsItemGroup { return QGraphicsItemGroup{qbase: QGraphicsItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; } } impl Deref for QGraphicsItemGroup { type Target = QGraphicsItem; fn deref(&self) -> &QGraphicsItem { return & self.qbase; } } impl AsRef<QGraphicsItem> for QGraphicsItemGroup { fn as_ref(& self) -> & QGraphicsItem { return & self.qbase; } } // proto: bool QGraphicsItemGroup::isObscuredBy(const QGraphicsItem * item); impl /*struct*/ QGraphicsItemGroup { pub fn isObscuredBy<RetType, T: QGraphicsItemGroup_isObscuredBy<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isObscuredBy(self); // return 1; } } pub trait QGraphicsItemGroup_isObscuredBy<RetType> { fn isObscuredBy(self , rsthis: & QGraphicsItemGroup) -> RetType; } // proto: bool QGraphicsItemGroup::isObscuredBy(const QGraphicsItem * item); impl<'a> /*trait*/ QGraphicsItemGroup_isObscuredBy<i8> for (&'a QGraphicsItem) { fn isObscuredBy(self , rsthis: & QGraphicsItemGroup) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK18QGraphicsItemGroup12isObscuredByEPK13QGraphicsItem()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK18QGraphicsItemGroup12isObscuredByEPK13QGraphicsItem(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsItemGroup::~QGraphicsItemGroup(); impl /*struct*/ QGraphicsItemGroup { pub fn free<RetType, T: QGraphicsItemGroup_free<RetType>>(& self, overload_args: T) -> RetType { return overload_args.free(self); // return 1; } } pub trait QGraphicsItemGroup_free<RetType> { fn free(self , rsthis: & QGraphicsItemGroup) -> RetType; } // proto: void QGraphicsItemGroup::~QGraphicsItemGroup(); impl<'a> /*trait*/ QGraphicsItemGroup_free<()> for () { fn free(self , rsthis: & QGraphicsItemGroup) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN18QGraphicsItemGroupD2Ev()}; unsafe {C_ZN18QGraphicsItemGroupD2Ev(rsthis.qclsinst)}; // return 1; } } // proto: void QGraphicsItemGroup::QGraphicsItemGroup(QGraphicsItem * parent); impl /*struct*/ QGraphicsItemGroup { pub fn new<T: QGraphicsItemGroup_new>(value: T) -> QGraphicsItemGroup { let rsthis = value.new(); return rsthis; // return 1; } } pub trait QGraphicsItemGroup_new { fn new(self) -> QGraphicsItemGroup; } // proto: void QGraphicsItemGroup::QGraphicsItemGroup(QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsItemGroup_new for (Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsItemGroup { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN18QGraphicsItemGroupC2EP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsItemGroup_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN18QGraphicsItemGroupC2EP13QGraphicsItem(arg0)}; let rsthis = QGraphicsItemGroup{qbase: QGraphicsItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: int QGraphicsItemGroup::type(); impl /*struct*/ QGraphicsItemGroup { pub fn type_<RetType, T: QGraphicsItemGroup_type_<RetType>>(& self, overload_args: T) -> RetType { return overload_args.type_(self); // return 1; } } pub trait QGraphicsItemGroup_type_<RetType> { fn type_(self , rsthis: & QGraphicsItemGroup) -> RetType; } // proto: int QGraphicsItemGroup::type(); impl<'a> /*trait*/ QGraphicsItemGroup_type_<i32> for () { fn type_(self , rsthis: & QGraphicsItemGroup) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK18QGraphicsItemGroup4typeEv()}; let mut ret = unsafe {C_ZNK18QGraphicsItemGroup4typeEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: QRectF QGraphicsItemGroup::boundingRect(); impl /*struct*/ QGraphicsItemGroup { pub fn boundingRect<RetType, T: QGraphicsItemGroup_boundingRect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.boundingRect(self); // return 1; } } pub trait QGraphicsItemGroup_boundingRect<RetType> { fn boundingRect(self , rsthis: & QGraphicsItemGroup) -> RetType; } // proto: QRectF QGraphicsItemGroup::boundingRect(); impl<'a> /*trait*/ QGraphicsItemGroup_boundingRect<QRectF> for () { fn boundingRect(self , rsthis: & QGraphicsItemGroup) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK18QGraphicsItemGroup12boundingRectEv()}; let mut ret = unsafe {C_ZNK18QGraphicsItemGroup12boundingRectEv(rsthis.qclsinst)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItemGroup::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl /*struct*/ QGraphicsItemGroup { pub fn paint<RetType, T: QGraphicsItemGroup_paint<RetType>>(& self, overload_args: T) -> RetType { return overload_args.paint(self); // return 1; } } pub trait QGraphicsItemGroup_paint<RetType> { fn paint(self , rsthis: & QGraphicsItemGroup) -> RetType; } // proto: void QGraphicsItemGroup::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl<'a> /*trait*/ QGraphicsItemGroup_paint<()> for (&'a QPainter, &'a QStyleOptionGraphicsItem, Option<&'a QWidget>) { fn paint(self , rsthis: & QGraphicsItemGroup) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN18QGraphicsItemGroup5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let arg2 = (if self.2.is_none() {0} else {self.2.unwrap().qclsinst}) as *mut c_void; unsafe {C_ZN18QGraphicsItemGroup5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(rsthis.qclsinst, arg0, arg1, arg2)}; // return 1; } } // proto: void QGraphicsItemGroup::removeFromGroup(QGraphicsItem * item); impl /*struct*/ QGraphicsItemGroup { pub fn removeFromGroup<RetType, T: QGraphicsItemGroup_removeFromGroup<RetType>>(& self, overload_args: T) -> RetType { return overload_args.removeFromGroup(self); // return 1; } } pub trait QGraphicsItemGroup_removeFromGroup<RetType> { fn removeFromGroup(self , rsthis: & QGraphicsItemGroup) -> RetType; } // proto: void QGraphicsItemGroup::removeFromGroup(QGraphicsItem * item); impl<'a> /*trait*/ QGraphicsItemGroup_removeFromGroup<()> for (&'a QGraphicsItem) { fn removeFromGroup(self , rsthis: & QGraphicsItemGroup) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN18QGraphicsItemGroup15removeFromGroupEP13QGraphicsItem()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN18QGraphicsItemGroup15removeFromGroupEP13QGraphicsItem(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsItemGroup::addToGroup(QGraphicsItem * item); impl /*struct*/ QGraphicsItemGroup { pub fn addToGroup<RetType, T: QGraphicsItemGroup_addToGroup<RetType>>(& self, overload_args: T) -> RetType { return overload_args.addToGroup(self); // return 1; } } pub trait QGraphicsItemGroup_addToGroup<RetType> { fn addToGroup(self , rsthis: & QGraphicsItemGroup) -> RetType; } // proto: void QGraphicsItemGroup::addToGroup(QGraphicsItem * item); impl<'a> /*trait*/ QGraphicsItemGroup_addToGroup<()> for (&'a QGraphicsItem) { fn addToGroup(self , rsthis: & QGraphicsItemGroup) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN18QGraphicsItemGroup10addToGroupEP13QGraphicsItem()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN18QGraphicsItemGroup10addToGroupEP13QGraphicsItem(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QPainterPath QGraphicsItemGroup::opaqueArea(); impl /*struct*/ QGraphicsItemGroup { pub fn opaqueArea<RetType, T: QGraphicsItemGroup_opaqueArea<RetType>>(& self, overload_args: T) -> RetType { return overload_args.opaqueArea(self); // return 1; } } pub trait QGraphicsItemGroup_opaqueArea<RetType> { fn opaqueArea(self , rsthis: & QGraphicsItemGroup) -> RetType; } // proto: QPainterPath QGraphicsItemGroup::opaqueArea(); impl<'a> /*trait*/ QGraphicsItemGroup_opaqueArea<QPainterPath> for () { fn opaqueArea(self , rsthis: & QGraphicsItemGroup) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK18QGraphicsItemGroup10opaqueAreaEv()}; let mut ret = unsafe {C_ZNK18QGraphicsItemGroup10opaqueAreaEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } impl /*struct*/ QAbstractGraphicsShapeItem { pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QAbstractGraphicsShapeItem { return QAbstractGraphicsShapeItem{qbase: QGraphicsItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; } } impl Deref for QAbstractGraphicsShapeItem { type Target = QGraphicsItem; fn deref(&self) -> &QGraphicsItem { return & self.qbase; } } impl AsRef<QGraphicsItem> for QAbstractGraphicsShapeItem { fn as_ref(& self) -> & QGraphicsItem { return & self.qbase; } } // proto: bool QAbstractGraphicsShapeItem::isObscuredBy(const QGraphicsItem * item); impl /*struct*/ QAbstractGraphicsShapeItem { pub fn isObscuredBy<RetType, T: QAbstractGraphicsShapeItem_isObscuredBy<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isObscuredBy(self); // return 1; } } pub trait QAbstractGraphicsShapeItem_isObscuredBy<RetType> { fn isObscuredBy(self , rsthis: & QAbstractGraphicsShapeItem) -> RetType; } // proto: bool QAbstractGraphicsShapeItem::isObscuredBy(const QGraphicsItem * item); impl<'a> /*trait*/ QAbstractGraphicsShapeItem_isObscuredBy<i8> for (&'a QGraphicsItem) { fn isObscuredBy(self , rsthis: & QAbstractGraphicsShapeItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK26QAbstractGraphicsShapeItem12isObscuredByEPK13QGraphicsItem()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK26QAbstractGraphicsShapeItem12isObscuredByEPK13QGraphicsItem(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: QBrush QAbstractGraphicsShapeItem::brush(); impl /*struct*/ QAbstractGraphicsShapeItem { pub fn brush<RetType, T: QAbstractGraphicsShapeItem_brush<RetType>>(& self, overload_args: T) -> RetType { return overload_args.brush(self); // return 1; } } pub trait QAbstractGraphicsShapeItem_brush<RetType> { fn brush(self , rsthis: & QAbstractGraphicsShapeItem) -> RetType; } // proto: QBrush QAbstractGraphicsShapeItem::brush(); impl<'a> /*trait*/ QAbstractGraphicsShapeItem_brush<QBrush> for () { fn brush(self , rsthis: & QAbstractGraphicsShapeItem) -> QBrush { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK26QAbstractGraphicsShapeItem5brushEv()}; let mut ret = unsafe {C_ZNK26QAbstractGraphicsShapeItem5brushEv(rsthis.qclsinst)}; let mut ret1 = QBrush::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QAbstractGraphicsShapeItem::QAbstractGraphicsShapeItem(QGraphicsItem * parent); impl /*struct*/ QAbstractGraphicsShapeItem { pub fn new<T: QAbstractGraphicsShapeItem_new>(value: T) -> QAbstractGraphicsShapeItem { let rsthis = value.new(); return rsthis; // return 1; } } pub trait QAbstractGraphicsShapeItem_new { fn new(self) -> QAbstractGraphicsShapeItem; } // proto: void QAbstractGraphicsShapeItem::QAbstractGraphicsShapeItem(QGraphicsItem * parent); impl<'a> /*trait*/ QAbstractGraphicsShapeItem_new for (Option<&'a QGraphicsItem>) { fn new(self) -> QAbstractGraphicsShapeItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN26QAbstractGraphicsShapeItemC2EP13QGraphicsItem()}; let ctysz: c_int = unsafe{QAbstractGraphicsShapeItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN26QAbstractGraphicsShapeItemC2EP13QGraphicsItem(arg0)}; let rsthis = QAbstractGraphicsShapeItem{qbase: QGraphicsItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: QPainterPath QAbstractGraphicsShapeItem::opaqueArea(); impl /*struct*/ QAbstractGraphicsShapeItem { pub fn opaqueArea<RetType, T: QAbstractGraphicsShapeItem_opaqueArea<RetType>>(& self, overload_args: T) -> RetType { return overload_args.opaqueArea(self); // return 1; } } pub trait QAbstractGraphicsShapeItem_opaqueArea<RetType> { fn opaqueArea(self , rsthis: & QAbstractGraphicsShapeItem) -> RetType; } // proto: QPainterPath QAbstractGraphicsShapeItem::opaqueArea(); impl<'a> /*trait*/ QAbstractGraphicsShapeItem_opaqueArea<QPainterPath> for () { fn opaqueArea(self , rsthis: & QAbstractGraphicsShapeItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK26QAbstractGraphicsShapeItem10opaqueAreaEv()}; let mut ret = unsafe {C_ZNK26QAbstractGraphicsShapeItem10opaqueAreaEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QAbstractGraphicsShapeItem::setBrush(const QBrush & brush); impl /*struct*/ QAbstractGraphicsShapeItem { pub fn setBrush<RetType, T: QAbstractGraphicsShapeItem_setBrush<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setBrush(self); // return 1; } } pub trait QAbstractGraphicsShapeItem_setBrush<RetType> { fn setBrush(self , rsthis: & QAbstractGraphicsShapeItem) -> RetType; } // proto: void QAbstractGraphicsShapeItem::setBrush(const QBrush & brush); impl<'a> /*trait*/ QAbstractGraphicsShapeItem_setBrush<()> for (&'a QBrush) { fn setBrush(self , rsthis: & QAbstractGraphicsShapeItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN26QAbstractGraphicsShapeItem8setBrushERK6QBrush()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN26QAbstractGraphicsShapeItem8setBrushERK6QBrush(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QAbstractGraphicsShapeItem::setPen(const QPen & pen); impl /*struct*/ QAbstractGraphicsShapeItem { pub fn setPen<RetType, T: QAbstractGraphicsShapeItem_setPen<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setPen(self); // return 1; } } pub trait QAbstractGraphicsShapeItem_setPen<RetType> { fn setPen(self , rsthis: & QAbstractGraphicsShapeItem) -> RetType; } // proto: void QAbstractGraphicsShapeItem::setPen(const QPen & pen); impl<'a> /*trait*/ QAbstractGraphicsShapeItem_setPen<()> for (&'a QPen) { fn setPen(self , rsthis: & QAbstractGraphicsShapeItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN26QAbstractGraphicsShapeItem6setPenERK4QPen()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN26QAbstractGraphicsShapeItem6setPenERK4QPen(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QPen QAbstractGraphicsShapeItem::pen(); impl /*struct*/ QAbstractGraphicsShapeItem { pub fn pen<RetType, T: QAbstractGraphicsShapeItem_pen<RetType>>(& self, overload_args: T) -> RetType { return overload_args.pen(self); // return 1; } } pub trait QAbstractGraphicsShapeItem_pen<RetType> { fn pen(self , rsthis: & QAbstractGraphicsShapeItem) -> RetType; } // proto: QPen QAbstractGraphicsShapeItem::pen(); impl<'a> /*trait*/ QAbstractGraphicsShapeItem_pen<QPen> for () { fn pen(self , rsthis: & QAbstractGraphicsShapeItem) -> QPen { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK26QAbstractGraphicsShapeItem3penEv()}; let mut ret = unsafe {C_ZNK26QAbstractGraphicsShapeItem3penEv(rsthis.qclsinst)}; let mut ret1 = QPen::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QAbstractGraphicsShapeItem::~QAbstractGraphicsShapeItem(); impl /*struct*/ QAbstractGraphicsShapeItem { pub fn free<RetType, T: QAbstractGraphicsShapeItem_free<RetType>>(& self, overload_args: T) -> RetType { return overload_args.free(self); // return 1; } } pub trait QAbstractGraphicsShapeItem_free<RetType> { fn free(self , rsthis: & QAbstractGraphicsShapeItem) -> RetType; } // proto: void QAbstractGraphicsShapeItem::~QAbstractGraphicsShapeItem(); impl<'a> /*trait*/ QAbstractGraphicsShapeItem_free<()> for () { fn free(self , rsthis: & QAbstractGraphicsShapeItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN26QAbstractGraphicsShapeItemD2Ev()}; unsafe {C_ZN26QAbstractGraphicsShapeItemD2Ev(rsthis.qclsinst)}; // return 1; } } impl /*struct*/ QGraphicsItem { pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QGraphicsItem { return QGraphicsItem{qclsinst: qthis, ..Default::default()}; } } // proto: QPainterPath QGraphicsItem::mapFromParent(const QPainterPath & path); impl /*struct*/ QGraphicsItem { pub fn mapFromParent<RetType, T: QGraphicsItem_mapFromParent<RetType>>(& self, overload_args: T) -> RetType { return overload_args.mapFromParent(self); // return 1; } } pub trait QGraphicsItem_mapFromParent<RetType> { fn mapFromParent(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QPainterPath QGraphicsItem::mapFromParent(const QPainterPath & path); impl<'a> /*trait*/ QGraphicsItem_mapFromParent<QPainterPath> for (&'a QPainterPath) { fn mapFromParent(self , rsthis: & QGraphicsItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem13mapFromParentERK12QPainterPath()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem13mapFromParentERK12QPainterPath(rsthis.qclsinst, arg0)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPointF QGraphicsItem::mapFromItem(const QGraphicsItem * item, const QPointF & point); impl /*struct*/ QGraphicsItem { pub fn mapFromItem<RetType, T: QGraphicsItem_mapFromItem<RetType>>(& self, overload_args: T) -> RetType { return overload_args.mapFromItem(self); // return 1; } } pub trait QGraphicsItem_mapFromItem<RetType> { fn mapFromItem(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QPointF QGraphicsItem::mapFromItem(const QGraphicsItem * item, const QPointF & point); impl<'a> /*trait*/ QGraphicsItem_mapFromItem<QPointF> for (&'a QGraphicsItem, &'a QPointF) { fn mapFromItem(self , rsthis: & QGraphicsItem) -> QPointF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem11mapFromItemEPKS_RK7QPointF()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem11mapFromItemEPKS_RK7QPointF(rsthis.qclsinst, arg0, arg1)}; let mut ret1 = QPointF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QGraphicsItem * QGraphicsItem::focusItem(); impl /*struct*/ QGraphicsItem { pub fn focusItem<RetType, T: QGraphicsItem_focusItem<RetType>>(& self, overload_args: T) -> RetType { return overload_args.focusItem(self); // return 1; } } pub trait QGraphicsItem_focusItem<RetType> { fn focusItem(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QGraphicsItem * QGraphicsItem::focusItem(); impl<'a> /*trait*/ QGraphicsItem_focusItem<QGraphicsItem> for () { fn focusItem(self , rsthis: & QGraphicsItem) -> QGraphicsItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem9focusItemEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem9focusItemEv(rsthis.qclsinst)}; let mut ret1 = QGraphicsItem::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QGraphicsObject * QGraphicsItem::parentObject(); impl /*struct*/ QGraphicsItem { pub fn parentObject<RetType, T: QGraphicsItem_parentObject<RetType>>(& self, overload_args: T) -> RetType { return overload_args.parentObject(self); // return 1; } } pub trait QGraphicsItem_parentObject<RetType> { fn parentObject(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QGraphicsObject * QGraphicsItem::parentObject(); impl<'a> /*trait*/ QGraphicsItem_parentObject<QGraphicsObject> for () { fn parentObject(self , rsthis: & QGraphicsItem) -> QGraphicsObject { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem12parentObjectEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem12parentObjectEv(rsthis.qclsinst)}; let mut ret1 = QGraphicsObject::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::setTransformOriginPoint(const QPointF & origin); impl /*struct*/ QGraphicsItem { pub fn setTransformOriginPoint<RetType, T: QGraphicsItem_setTransformOriginPoint<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setTransformOriginPoint(self); // return 1; } } pub trait QGraphicsItem_setTransformOriginPoint<RetType> { fn setTransformOriginPoint(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setTransformOriginPoint(const QPointF & origin); impl<'a> /*trait*/ QGraphicsItem_setTransformOriginPoint<()> for (&'a QPointF) { fn setTransformOriginPoint(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem23setTransformOriginPointERK7QPointF()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN13QGraphicsItem23setTransformOriginPointERK7QPointF(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsItem::ungrabMouse(); impl /*struct*/ QGraphicsItem { pub fn ungrabMouse<RetType, T: QGraphicsItem_ungrabMouse<RetType>>(& self, overload_args: T) -> RetType { return overload_args.ungrabMouse(self); // return 1; } } pub trait QGraphicsItem_ungrabMouse<RetType> { fn ungrabMouse(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::ungrabMouse(); impl<'a> /*trait*/ QGraphicsItem_ungrabMouse<()> for () { fn ungrabMouse(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem11ungrabMouseEv()}; unsafe {C_ZN13QGraphicsItem11ungrabMouseEv(rsthis.qclsinst)}; // return 1; } } // proto: int QGraphicsItem::type(); impl /*struct*/ QGraphicsItem { pub fn type_<RetType, T: QGraphicsItem_type_<RetType>>(& self, overload_args: T) -> RetType { return overload_args.type_(self); // return 1; } } pub trait QGraphicsItem_type_<RetType> { fn type_(self , rsthis: & QGraphicsItem) -> RetType; } // proto: int QGraphicsItem::type(); impl<'a> /*trait*/ QGraphicsItem_type_<i32> for () { fn type_(self , rsthis: & QGraphicsItem) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem4typeEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem4typeEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: bool QGraphicsItem::isSelected(); impl /*struct*/ QGraphicsItem { pub fn isSelected<RetType, T: QGraphicsItem_isSelected<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isSelected(self); // return 1; } } pub trait QGraphicsItem_isSelected<RetType> { fn isSelected(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::isSelected(); impl<'a> /*trait*/ QGraphicsItem_isSelected<i8> for () { fn isSelected(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem10isSelectedEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem10isSelectedEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: QPolygonF QGraphicsItem::mapFromItem(const QGraphicsItem * item, qreal x, qreal y, qreal w, qreal h); impl<'a> /*trait*/ QGraphicsItem_mapFromItem<QPolygonF> for (&'a QGraphicsItem, f64, f64, f64, f64) { fn mapFromItem(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem11mapFromItemEPKS_dddd()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let arg4 = self.4 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem11mapFromItemEPKS_dddd(rsthis.qclsinst, arg0, arg1, arg2, arg3, arg4)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QGraphicsWidget * QGraphicsItem::parentWidget(); impl /*struct*/ QGraphicsItem { pub fn parentWidget<RetType, T: QGraphicsItem_parentWidget<RetType>>(& self, overload_args: T) -> RetType { return overload_args.parentWidget(self); // return 1; } } pub trait QGraphicsItem_parentWidget<RetType> { fn parentWidget(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QGraphicsWidget * QGraphicsItem::parentWidget(); impl<'a> /*trait*/ QGraphicsItem_parentWidget<QGraphicsWidget> for () { fn parentWidget(self , rsthis: & QGraphicsItem) -> QGraphicsWidget { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem12parentWidgetEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem12parentWidgetEv(rsthis.qclsinst)}; let mut ret1 = QGraphicsWidget::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::resetTransform(); impl /*struct*/ QGraphicsItem { pub fn resetTransform<RetType, T: QGraphicsItem_resetTransform<RetType>>(& self, overload_args: T) -> RetType { return overload_args.resetTransform(self); // return 1; } } pub trait QGraphicsItem_resetTransform<RetType> { fn resetTransform(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::resetTransform(); impl<'a> /*trait*/ QGraphicsItem_resetTransform<()> for () { fn resetTransform(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem14resetTransformEv()}; unsafe {C_ZN13QGraphicsItem14resetTransformEv(rsthis.qclsinst)}; // return 1; } } // proto: QRegion QGraphicsItem::boundingRegion(const QTransform & itemToDeviceTransform); impl /*struct*/ QGraphicsItem { pub fn boundingRegion<RetType, T: QGraphicsItem_boundingRegion<RetType>>(& self, overload_args: T) -> RetType { return overload_args.boundingRegion(self); // return 1; } } pub trait QGraphicsItem_boundingRegion<RetType> { fn boundingRegion(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QRegion QGraphicsItem::boundingRegion(const QTransform & itemToDeviceTransform); impl<'a> /*trait*/ QGraphicsItem_boundingRegion<QRegion> for (&'a QTransform) { fn boundingRegion(self , rsthis: & QGraphicsItem) -> QRegion { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem14boundingRegionERK10QTransform()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem14boundingRegionERK10QTransform(rsthis.qclsinst, arg0)}; let mut ret1 = QRegion::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl /*struct*/ QGraphicsItem { pub fn paint<RetType, T: QGraphicsItem_paint<RetType>>(& self, overload_args: T) -> RetType { return overload_args.paint(self); // return 1; } } pub trait QGraphicsItem_paint<RetType> { fn paint(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl<'a> /*trait*/ QGraphicsItem_paint<()> for (&'a QPainter, &'a QStyleOptionGraphicsItem, Option<&'a QWidget>) { fn paint(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let arg2 = (if self.2.is_none() {0} else {self.2.unwrap().qclsinst}) as *mut c_void; unsafe {C_ZN13QGraphicsItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(rsthis.qclsinst, arg0, arg1, arg2)}; // return 1; } } // proto: bool QGraphicsItem::isActive(); impl /*struct*/ QGraphicsItem { pub fn isActive<RetType, T: QGraphicsItem_isActive<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isActive(self); // return 1; } } pub trait QGraphicsItem_isActive<RetType> { fn isActive(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::isActive(); impl<'a> /*trait*/ QGraphicsItem_isActive<i8> for () { fn isActive(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem8isActiveEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem8isActiveEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsItem::QGraphicsItem(QGraphicsItem * parent); impl /*struct*/ QGraphicsItem { pub fn new<T: QGraphicsItem_new>(value: T) -> QGraphicsItem { let rsthis = value.new(); return rsthis; // return 1; } } pub trait QGraphicsItem_new { fn new(self) -> QGraphicsItem; } // proto: void QGraphicsItem::QGraphicsItem(QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsItem_new for (Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItemC2EPS_()}; let ctysz: c_int = unsafe{QGraphicsItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN13QGraphicsItemC2EPS_(arg0)}; let rsthis = QGraphicsItem{qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: QPolygonF QGraphicsItem::mapToParent(const QPolygonF & polygon); impl /*struct*/ QGraphicsItem { pub fn mapToParent<RetType, T: QGraphicsItem_mapToParent<RetType>>(& self, overload_args: T) -> RetType { return overload_args.mapToParent(self); // return 1; } } pub trait QGraphicsItem_mapToParent<RetType> { fn mapToParent(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QPolygonF QGraphicsItem::mapToParent(const QPolygonF & polygon); impl<'a> /*trait*/ QGraphicsItem_mapToParent<QPolygonF> for (&'a QPolygonF) { fn mapToParent(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem11mapToParentERK9QPolygonF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem11mapToParentERK9QPolygonF(rsthis.qclsinst, arg0)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsItem::isWidget(); impl /*struct*/ QGraphicsItem { pub fn isWidget<RetType, T: QGraphicsItem_isWidget<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isWidget(self); // return 1; } } pub trait QGraphicsItem_isWidget<RetType> { fn isWidget(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::isWidget(); impl<'a> /*trait*/ QGraphicsItem_isWidget<i8> for () { fn isWidget(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem8isWidgetEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem8isWidgetEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsItem::setParentItem(QGraphicsItem * parent); impl /*struct*/ QGraphicsItem { pub fn setParentItem<RetType, T: QGraphicsItem_setParentItem<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setParentItem(self); // return 1; } } pub trait QGraphicsItem_setParentItem<RetType> { fn setParentItem(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setParentItem(QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsItem_setParentItem<()> for (&'a QGraphicsItem) { fn setParentItem(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem13setParentItemEPS_()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN13QGraphicsItem13setParentItemEPS_(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QPolygonF QGraphicsItem::mapToItem(const QGraphicsItem * item, const QRectF & rect); impl /*struct*/ QGraphicsItem { pub fn mapToItem<RetType, T: QGraphicsItem_mapToItem<RetType>>(& self, overload_args: T) -> RetType { return overload_args.mapToItem(self); // return 1; } } pub trait QGraphicsItem_mapToItem<RetType> { fn mapToItem(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QPolygonF QGraphicsItem::mapToItem(const QGraphicsItem * item, const QRectF & rect); impl<'a> /*trait*/ QGraphicsItem_mapToItem<QPolygonF> for (&'a QGraphicsItem, &'a QRectF) { fn mapToItem(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem9mapToItemEPKS_RK6QRectF()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem9mapToItemEPKS_RK6QRectF(rsthis.qclsinst, arg0, arg1)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QGraphicsWidget * QGraphicsItem::window(); impl /*struct*/ QGraphicsItem { pub fn window<RetType, T: QGraphicsItem_window<RetType>>(& self, overload_args: T) -> RetType { return overload_args.window(self); // return 1; } } pub trait QGraphicsItem_window<RetType> { fn window(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QGraphicsWidget * QGraphicsItem::window(); impl<'a> /*trait*/ QGraphicsItem_window<QGraphicsWidget> for () { fn window(self , rsthis: & QGraphicsItem) -> QGraphicsWidget { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem6windowEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem6windowEv(rsthis.qclsinst)}; let mut ret1 = QGraphicsWidget::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPointF QGraphicsItem::scenePos(); impl /*struct*/ QGraphicsItem { pub fn scenePos<RetType, T: QGraphicsItem_scenePos<RetType>>(& self, overload_args: T) -> RetType { return overload_args.scenePos(self); // return 1; } } pub trait QGraphicsItem_scenePos<RetType> { fn scenePos(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QPointF QGraphicsItem::scenePos(); impl<'a> /*trait*/ QGraphicsItem_scenePos<QPointF> for () { fn scenePos(self , rsthis: & QGraphicsItem) -> QPointF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem8scenePosEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem8scenePosEv(rsthis.qclsinst)}; let mut ret1 = QPointF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsItem::handlesChildEvents(); impl /*struct*/ QGraphicsItem { pub fn handlesChildEvents<RetType, T: QGraphicsItem_handlesChildEvents<RetType>>(& self, overload_args: T) -> RetType { return overload_args.handlesChildEvents(self); // return 1; } } pub trait QGraphicsItem_handlesChildEvents<RetType> { fn handlesChildEvents(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::handlesChildEvents(); impl<'a> /*trait*/ QGraphicsItem_handlesChildEvents<i8> for () { fn handlesChildEvents(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem18handlesChildEventsEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem18handlesChildEventsEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsItem::setOpacity(qreal opacity); impl /*struct*/ QGraphicsItem { pub fn setOpacity<RetType, T: QGraphicsItem_setOpacity<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setOpacity(self); // return 1; } } pub trait QGraphicsItem_setOpacity<RetType> { fn setOpacity(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setOpacity(qreal opacity); impl<'a> /*trait*/ QGraphicsItem_setOpacity<()> for (f64) { fn setOpacity(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem10setOpacityEd()}; let arg0 = self as c_double; unsafe {C_ZN13QGraphicsItem10setOpacityEd(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QTransform QGraphicsItem::sceneTransform(); impl /*struct*/ QGraphicsItem { pub fn sceneTransform<RetType, T: QGraphicsItem_sceneTransform<RetType>>(& self, overload_args: T) -> RetType { return overload_args.sceneTransform(self); // return 1; } } pub trait QGraphicsItem_sceneTransform<RetType> { fn sceneTransform(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QTransform QGraphicsItem::sceneTransform(); impl<'a> /*trait*/ QGraphicsItem_sceneTransform<QTransform> for () { fn sceneTransform(self , rsthis: & QGraphicsItem) -> QTransform { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem14sceneTransformEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem14sceneTransformEv(rsthis.qclsinst)}; let mut ret1 = QTransform::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::setZValue(qreal z); impl /*struct*/ QGraphicsItem { pub fn setZValue<RetType, T: QGraphicsItem_setZValue<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setZValue(self); // return 1; } } pub trait QGraphicsItem_setZValue<RetType> { fn setZValue(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setZValue(qreal z); impl<'a> /*trait*/ QGraphicsItem_setZValue<()> for (f64) { fn setZValue(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem9setZValueEd()}; let arg0 = self as c_double; unsafe {C_ZN13QGraphicsItem9setZValueEd(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QPolygonF QGraphicsItem::mapFromParent(const QRectF & rect); impl<'a> /*trait*/ QGraphicsItem_mapFromParent<QPolygonF> for (&'a QRectF) { fn mapFromParent(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem13mapFromParentERK6QRectF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem13mapFromParentERK6QRectF(rsthis.qclsinst, arg0)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPolygonF QGraphicsItem::mapFromParent(qreal x, qreal y, qreal w, qreal h); impl<'a> /*trait*/ QGraphicsItem_mapFromParent<QPolygonF> for (f64, f64, f64, f64) { fn mapFromParent(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem13mapFromParentEdddd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem13mapFromParentEdddd(rsthis.qclsinst, arg0, arg1, arg2, arg3)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsItem::isObscured(qreal x, qreal y, qreal w, qreal h); impl /*struct*/ QGraphicsItem { pub fn isObscured<RetType, T: QGraphicsItem_isObscured<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isObscured(self); // return 1; } } pub trait QGraphicsItem_isObscured<RetType> { fn isObscured(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::isObscured(qreal x, qreal y, qreal w, qreal h); impl<'a> /*trait*/ QGraphicsItem_isObscured<i8> for (f64, f64, f64, f64) { fn isObscured(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem10isObscuredEdddd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem10isObscuredEdddd(rsthis.qclsinst, arg0, arg1, arg2, arg3)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsItem::installSceneEventFilter(QGraphicsItem * filterItem); impl /*struct*/ QGraphicsItem { pub fn installSceneEventFilter<RetType, T: QGraphicsItem_installSceneEventFilter<RetType>>(& self, overload_args: T) -> RetType { return overload_args.installSceneEventFilter(self); // return 1; } } pub trait QGraphicsItem_installSceneEventFilter<RetType> { fn installSceneEventFilter(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::installSceneEventFilter(QGraphicsItem * filterItem); impl<'a> /*trait*/ QGraphicsItem_installSceneEventFilter<()> for (&'a QGraphicsItem) { fn installSceneEventFilter(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem23installSceneEventFilterEPS_()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN13QGraphicsItem23installSceneEventFilterEPS_(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsItem::setY(qreal y); impl /*struct*/ QGraphicsItem { pub fn setY<RetType, T: QGraphicsItem_setY<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setY(self); // return 1; } } pub trait QGraphicsItem_setY<RetType> { fn setY(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setY(qreal y); impl<'a> /*trait*/ QGraphicsItem_setY<()> for (f64) { fn setY(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem4setYEd()}; let arg0 = self as c_double; unsafe {C_ZN13QGraphicsItem4setYEd(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QRectF QGraphicsItem::mapRectToItem(const QGraphicsItem * item, qreal x, qreal y, qreal w, qreal h); impl /*struct*/ QGraphicsItem { pub fn mapRectToItem<RetType, T: QGraphicsItem_mapRectToItem<RetType>>(& self, overload_args: T) -> RetType { return overload_args.mapRectToItem(self); // return 1; } } pub trait QGraphicsItem_mapRectToItem<RetType> { fn mapRectToItem(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QRectF QGraphicsItem::mapRectToItem(const QGraphicsItem * item, qreal x, qreal y, qreal w, qreal h); impl<'a> /*trait*/ QGraphicsItem_mapRectToItem<QRectF> for (&'a QGraphicsItem, f64, f64, f64, f64) { fn mapRectToItem(self , rsthis: & QGraphicsItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem13mapRectToItemEPKS_dddd()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let arg4 = self.4 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem13mapRectToItemEPKS_dddd(rsthis.qclsinst, arg0, arg1, arg2, arg3, arg4)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QGraphicsItem * QGraphicsItem::parentItem(); impl /*struct*/ QGraphicsItem { pub fn parentItem<RetType, T: QGraphicsItem_parentItem<RetType>>(& self, overload_args: T) -> RetType { return overload_args.parentItem(self); // return 1; } } pub trait QGraphicsItem_parentItem<RetType> { fn parentItem(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QGraphicsItem * QGraphicsItem::parentItem(); impl<'a> /*trait*/ QGraphicsItem_parentItem<QGraphicsItem> for () { fn parentItem(self , rsthis: & QGraphicsItem) -> QGraphicsItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem10parentItemEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem10parentItemEv(rsthis.qclsinst)}; let mut ret1 = QGraphicsItem::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::clearFocus(); impl /*struct*/ QGraphicsItem { pub fn clearFocus<RetType, T: QGraphicsItem_clearFocus<RetType>>(& self, overload_args: T) -> RetType { return overload_args.clearFocus(self); // return 1; } } pub trait QGraphicsItem_clearFocus<RetType> { fn clearFocus(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::clearFocus(); impl<'a> /*trait*/ QGraphicsItem_clearFocus<()> for () { fn clearFocus(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem10clearFocusEv()}; unsafe {C_ZN13QGraphicsItem10clearFocusEv(rsthis.qclsinst)}; // return 1; } } // proto: bool QGraphicsItem::isWindow(); impl /*struct*/ QGraphicsItem { pub fn isWindow<RetType, T: QGraphicsItem_isWindow<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isWindow(self); // return 1; } } pub trait QGraphicsItem_isWindow<RetType> { fn isWindow(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::isWindow(); impl<'a> /*trait*/ QGraphicsItem_isWindow<i8> for () { fn isWindow(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem8isWindowEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem8isWindowEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: QPointF QGraphicsItem::transformOriginPoint(); impl /*struct*/ QGraphicsItem { pub fn transformOriginPoint<RetType, T: QGraphicsItem_transformOriginPoint<RetType>>(& self, overload_args: T) -> RetType { return overload_args.transformOriginPoint(self); // return 1; } } pub trait QGraphicsItem_transformOriginPoint<RetType> { fn transformOriginPoint(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QPointF QGraphicsItem::transformOriginPoint(); impl<'a> /*trait*/ QGraphicsItem_transformOriginPoint<QPointF> for () { fn transformOriginPoint(self , rsthis: & QGraphicsItem) -> QPointF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem20transformOriginPointEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem20transformOriginPointEv(rsthis.qclsinst)}; let mut ret1 = QPointF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QRectF QGraphicsItem::boundingRect(); impl /*struct*/ QGraphicsItem { pub fn boundingRect<RetType, T: QGraphicsItem_boundingRect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.boundingRect(self); // return 1; } } pub trait QGraphicsItem_boundingRect<RetType> { fn boundingRect(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QRectF QGraphicsItem::boundingRect(); impl<'a> /*trait*/ QGraphicsItem_boundingRect<QRectF> for () { fn boundingRect(self , rsthis: & QGraphicsItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem12boundingRectEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem12boundingRectEv(rsthis.qclsinst)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QRectF QGraphicsItem::childrenBoundingRect(); impl /*struct*/ QGraphicsItem { pub fn childrenBoundingRect<RetType, T: QGraphicsItem_childrenBoundingRect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.childrenBoundingRect(self); // return 1; } } pub trait QGraphicsItem_childrenBoundingRect<RetType> { fn childrenBoundingRect(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QRectF QGraphicsItem::childrenBoundingRect(); impl<'a> /*trait*/ QGraphicsItem_childrenBoundingRect<QRectF> for () { fn childrenBoundingRect(self , rsthis: & QGraphicsItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem20childrenBoundingRectEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem20childrenBoundingRectEv(rsthis.qclsinst)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsItem::isObscured(const QRectF & rect); impl<'a> /*trait*/ QGraphicsItem_isObscured<i8> for (Option<&'a QRectF>) { fn isObscured(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem10isObscuredERK6QRectF()}; let arg0 = (if self.is_none() {QRectF::new(()).qclsinst} else {self.unwrap().qclsinst}) as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem10isObscuredERK6QRectF(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: QPolygonF QGraphicsItem::mapFromScene(const QRectF & rect); impl /*struct*/ QGraphicsItem { pub fn mapFromScene<RetType, T: QGraphicsItem_mapFromScene<RetType>>(& self, overload_args: T) -> RetType { return overload_args.mapFromScene(self); // return 1; } } pub trait QGraphicsItem_mapFromScene<RetType> { fn mapFromScene(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QPolygonF QGraphicsItem::mapFromScene(const QRectF & rect); impl<'a> /*trait*/ QGraphicsItem_mapFromScene<QPolygonF> for (&'a QRectF) { fn mapFromScene(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem12mapFromSceneERK6QRectF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem12mapFromSceneERK6QRectF(rsthis.qclsinst, arg0)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsItem::hasCursor(); impl /*struct*/ QGraphicsItem { pub fn hasCursor<RetType, T: QGraphicsItem_hasCursor<RetType>>(& self, overload_args: T) -> RetType { return overload_args.hasCursor(self); // return 1; } } pub trait QGraphicsItem_hasCursor<RetType> { fn hasCursor(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::hasCursor(); impl<'a> /*trait*/ QGraphicsItem_hasCursor<i8> for () { fn hasCursor(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem9hasCursorEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem9hasCursorEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsItem::setGraphicsEffect(QGraphicsEffect * effect); impl /*struct*/ QGraphicsItem { pub fn setGraphicsEffect<RetType, T: QGraphicsItem_setGraphicsEffect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setGraphicsEffect(self); // return 1; } } pub trait QGraphicsItem_setGraphicsEffect<RetType> { fn setGraphicsEffect(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setGraphicsEffect(QGraphicsEffect * effect); impl<'a> /*trait*/ QGraphicsItem_setGraphicsEffect<()> for (&'a QGraphicsEffect) { fn setGraphicsEffect(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem17setGraphicsEffectEP15QGraphicsEffect()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN13QGraphicsItem17setGraphicsEffectEP15QGraphicsEffect(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QPainterPath QGraphicsItem::mapToParent(const QPainterPath & path); impl<'a> /*trait*/ QGraphicsItem_mapToParent<QPainterPath> for (&'a QPainterPath) { fn mapToParent(self , rsthis: & QGraphicsItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem11mapToParentERK12QPainterPath()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem11mapToParentERK12QPainterPath(rsthis.qclsinst, arg0)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::ensureVisible(qreal x, qreal y, qreal w, qreal h, int xmargin, int ymargin); impl /*struct*/ QGraphicsItem { pub fn ensureVisible<RetType, T: QGraphicsItem_ensureVisible<RetType>>(& self, overload_args: T) -> RetType { return overload_args.ensureVisible(self); // return 1; } } pub trait QGraphicsItem_ensureVisible<RetType> { fn ensureVisible(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::ensureVisible(qreal x, qreal y, qreal w, qreal h, int xmargin, int ymargin); impl<'a> /*trait*/ QGraphicsItem_ensureVisible<()> for (f64, f64, f64, f64, Option<i32>, Option<i32>) { fn ensureVisible(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem13ensureVisibleEddddii()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let arg4 = (if self.4.is_none() {50} else {self.4.unwrap()}) as c_int; let arg5 = (if self.5.is_none() {50} else {self.5.unwrap()}) as c_int; unsafe {C_ZN13QGraphicsItem13ensureVisibleEddddii(rsthis.qclsinst, arg0, arg1, arg2, arg3, arg4, arg5)}; // return 1; } } // proto: QPolygonF QGraphicsItem::mapToItem(const QGraphicsItem * item, qreal x, qreal y, qreal w, qreal h); impl<'a> /*trait*/ QGraphicsItem_mapToItem<QPolygonF> for (&'a QGraphicsItem, f64, f64, f64, f64) { fn mapToItem(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem9mapToItemEPKS_dddd()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let arg4 = self.4 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem9mapToItemEPKS_dddd(rsthis.qclsinst, arg0, arg1, arg2, arg3, arg4)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPointF QGraphicsItem::mapToItem(const QGraphicsItem * item, qreal x, qreal y); impl<'a> /*trait*/ QGraphicsItem_mapToItem<QPointF> for (&'a QGraphicsItem, f64, f64) { fn mapToItem(self , rsthis: & QGraphicsItem) -> QPointF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem9mapToItemEPKS_dd()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem9mapToItemEPKS_dd(rsthis.qclsinst, arg0, arg1, arg2)}; let mut ret1 = QPointF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QRectF QGraphicsItem::mapRectToParent(const QRectF & rect); impl /*struct*/ QGraphicsItem { pub fn mapRectToParent<RetType, T: QGraphicsItem_mapRectToParent<RetType>>(& self, overload_args: T) -> RetType { return overload_args.mapRectToParent(self); // return 1; } } pub trait QGraphicsItem_mapRectToParent<RetType> { fn mapRectToParent(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QRectF QGraphicsItem::mapRectToParent(const QRectF & rect); impl<'a> /*trait*/ QGraphicsItem_mapRectToParent<QRectF> for (&'a QRectF) { fn mapRectToParent(self , rsthis: & QGraphicsItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem15mapRectToParentERK6QRectF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem15mapRectToParentERK6QRectF(rsthis.qclsinst, arg0)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::setToolTip(const QString & toolTip); impl /*struct*/ QGraphicsItem { pub fn setToolTip<RetType, T: QGraphicsItem_setToolTip<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setToolTip(self); // return 1; } } pub trait QGraphicsItem_setToolTip<RetType> { fn setToolTip(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setToolTip(const QString & toolTip); impl<'a> /*trait*/ QGraphicsItem_setToolTip<()> for (&'a QString) { fn setToolTip(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem10setToolTipERK7QString()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN13QGraphicsItem10setToolTipERK7QString(rsthis.qclsinst, arg0)}; // return 1; } } // proto: qreal QGraphicsItem::rotation(); impl /*struct*/ QGraphicsItem { pub fn rotation<RetType, T: QGraphicsItem_rotation<RetType>>(& self, overload_args: T) -> RetType { return overload_args.rotation(self); // return 1; } } pub trait QGraphicsItem_rotation<RetType> { fn rotation(self , rsthis: & QGraphicsItem) -> RetType; } // proto: qreal QGraphicsItem::rotation(); impl<'a> /*trait*/ QGraphicsItem_rotation<f64> for () { fn rotation(self , rsthis: & QGraphicsItem) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem8rotationEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem8rotationEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: QGraphicsScene * QGraphicsItem::scene(); impl /*struct*/ QGraphicsItem { pub fn scene<RetType, T: QGraphicsItem_scene<RetType>>(& self, overload_args: T) -> RetType { return overload_args.scene(self); // return 1; } } pub trait QGraphicsItem_scene<RetType> { fn scene(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QGraphicsScene * QGraphicsItem::scene(); impl<'a> /*trait*/ QGraphicsItem_scene<QGraphicsScene> for () { fn scene(self , rsthis: & QGraphicsItem) -> QGraphicsScene { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem5sceneEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem5sceneEv(rsthis.qclsinst)}; let mut ret1 = QGraphicsScene::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPainterPath QGraphicsItem::mapToItem(const QGraphicsItem * item, const QPainterPath & path); impl<'a> /*trait*/ QGraphicsItem_mapToItem<QPainterPath> for (&'a QGraphicsItem, &'a QPainterPath) { fn mapToItem(self , rsthis: & QGraphicsItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem9mapToItemEPKS_RK12QPainterPath()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem9mapToItemEPKS_RK12QPainterPath(rsthis.qclsinst, arg0, arg1)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QRectF QGraphicsItem::mapRectToParent(qreal x, qreal y, qreal w, qreal h); impl<'a> /*trait*/ QGraphicsItem_mapRectToParent<QRectF> for (f64, f64, f64, f64) { fn mapRectToParent(self , rsthis: & QGraphicsItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem15mapRectToParentEdddd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem15mapRectToParentEdddd(rsthis.qclsinst, arg0, arg1, arg2, arg3)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPolygonF QGraphicsItem::mapFromItem(const QGraphicsItem * item, const QRectF & rect); impl<'a> /*trait*/ QGraphicsItem_mapFromItem<QPolygonF> for (&'a QGraphicsItem, &'a QRectF) { fn mapFromItem(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem11mapFromItemEPKS_RK6QRectF()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem11mapFromItemEPKS_RK6QRectF(rsthis.qclsinst, arg0, arg1)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QRectF QGraphicsItem::mapRectFromParent(const QRectF & rect); impl /*struct*/ QGraphicsItem { pub fn mapRectFromParent<RetType, T: QGraphicsItem_mapRectFromParent<RetType>>(& self, overload_args: T) -> RetType { return overload_args.mapRectFromParent(self); // return 1; } } pub trait QGraphicsItem_mapRectFromParent<RetType> { fn mapRectFromParent(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QRectF QGraphicsItem::mapRectFromParent(const QRectF & rect); impl<'a> /*trait*/ QGraphicsItem_mapRectFromParent<QRectF> for (&'a QRectF) { fn mapRectFromParent(self , rsthis: & QGraphicsItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem17mapRectFromParentERK6QRectF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem17mapRectFromParentERK6QRectF(rsthis.qclsinst, arg0)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::setFocusProxy(QGraphicsItem * item); impl /*struct*/ QGraphicsItem { pub fn setFocusProxy<RetType, T: QGraphicsItem_setFocusProxy<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setFocusProxy(self); // return 1; } } pub trait QGraphicsItem_setFocusProxy<RetType> { fn setFocusProxy(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setFocusProxy(QGraphicsItem * item); impl<'a> /*trait*/ QGraphicsItem_setFocusProxy<()> for (&'a QGraphicsItem) { fn setFocusProxy(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem13setFocusProxyEPS_()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN13QGraphicsItem13setFocusProxyEPS_(rsthis.qclsinst, arg0)}; // return 1; } } // proto: bool QGraphicsItem::acceptDrops(); impl /*struct*/ QGraphicsItem { pub fn acceptDrops<RetType, T: QGraphicsItem_acceptDrops<RetType>>(& self, overload_args: T) -> RetType { return overload_args.acceptDrops(self); // return 1; } } pub trait QGraphicsItem_acceptDrops<RetType> { fn acceptDrops(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::acceptDrops(); impl<'a> /*trait*/ QGraphicsItem_acceptDrops<i8> for () { fn acceptDrops(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem11acceptDropsEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem11acceptDropsEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: QPointF QGraphicsItem::mapToParent(const QPointF & point); impl<'a> /*trait*/ QGraphicsItem_mapToParent<QPointF> for (&'a QPointF) { fn mapToParent(self , rsthis: & QGraphicsItem) -> QPointF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem11mapToParentERK7QPointF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem11mapToParentERK7QPointF(rsthis.qclsinst, arg0)}; let mut ret1 = QPointF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QRectF QGraphicsItem::mapRectFromScene(const QRectF & rect); impl /*struct*/ QGraphicsItem { pub fn mapRectFromScene<RetType, T: QGraphicsItem_mapRectFromScene<RetType>>(& self, overload_args: T) -> RetType { return overload_args.mapRectFromScene(self); // return 1; } } pub trait QGraphicsItem_mapRectFromScene<RetType> { fn mapRectFromScene(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QRectF QGraphicsItem::mapRectFromScene(const QRectF & rect); impl<'a> /*trait*/ QGraphicsItem_mapRectFromScene<QRectF> for (&'a QRectF) { fn mapRectFromScene(self , rsthis: & QGraphicsItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem16mapRectFromSceneERK6QRectF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem16mapRectFromSceneERK6QRectF(rsthis.qclsinst, arg0)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QGraphicsItem * QGraphicsItem::focusScopeItem(); impl /*struct*/ QGraphicsItem { pub fn focusScopeItem<RetType, T: QGraphicsItem_focusScopeItem<RetType>>(& self, overload_args: T) -> RetType { return overload_args.focusScopeItem(self); // return 1; } } pub trait QGraphicsItem_focusScopeItem<RetType> { fn focusScopeItem(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QGraphicsItem * QGraphicsItem::focusScopeItem(); impl<'a> /*trait*/ QGraphicsItem_focusScopeItem<QGraphicsItem> for () { fn focusScopeItem(self , rsthis: & QGraphicsItem) -> QGraphicsItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem14focusScopeItemEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem14focusScopeItemEv(rsthis.qclsinst)}; let mut ret1 = QGraphicsItem::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::removeSceneEventFilter(QGraphicsItem * filterItem); impl /*struct*/ QGraphicsItem { pub fn removeSceneEventFilter<RetType, T: QGraphicsItem_removeSceneEventFilter<RetType>>(& self, overload_args: T) -> RetType { return overload_args.removeSceneEventFilter(self); // return 1; } } pub trait QGraphicsItem_removeSceneEventFilter<RetType> { fn removeSceneEventFilter(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::removeSceneEventFilter(QGraphicsItem * filterItem); impl<'a> /*trait*/ QGraphicsItem_removeSceneEventFilter<()> for (&'a QGraphicsItem) { fn removeSceneEventFilter(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem22removeSceneEventFilterEPS_()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN13QGraphicsItem22removeSceneEventFilterEPS_(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QGraphicsItem * QGraphicsItem::focusProxy(); impl /*struct*/ QGraphicsItem { pub fn focusProxy<RetType, T: QGraphicsItem_focusProxy<RetType>>(& self, overload_args: T) -> RetType { return overload_args.focusProxy(self); // return 1; } } pub trait QGraphicsItem_focusProxy<RetType> { fn focusProxy(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QGraphicsItem * QGraphicsItem::focusProxy(); impl<'a> /*trait*/ QGraphicsItem_focusProxy<QGraphicsItem> for () { fn focusProxy(self , rsthis: & QGraphicsItem) -> QGraphicsItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem10focusProxyEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem10focusProxyEv(rsthis.qclsinst)}; let mut ret1 = QGraphicsItem::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPointF QGraphicsItem::mapToItem(const QGraphicsItem * item, const QPointF & point); impl<'a> /*trait*/ QGraphicsItem_mapToItem<QPointF> for (&'a QGraphicsItem, &'a QPointF) { fn mapToItem(self , rsthis: & QGraphicsItem) -> QPointF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem9mapToItemEPKS_RK7QPointF()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem9mapToItemEPKS_RK7QPointF(rsthis.qclsinst, arg0, arg1)}; let mut ret1 = QPointF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QRectF QGraphicsItem::sceneBoundingRect(); impl /*struct*/ QGraphicsItem { pub fn sceneBoundingRect<RetType, T: QGraphicsItem_sceneBoundingRect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.sceneBoundingRect(self); // return 1; } } pub trait QGraphicsItem_sceneBoundingRect<RetType> { fn sceneBoundingRect(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QRectF QGraphicsItem::sceneBoundingRect(); impl<'a> /*trait*/ QGraphicsItem_sceneBoundingRect<QRectF> for () { fn sceneBoundingRect(self , rsthis: & QGraphicsItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem17sceneBoundingRectEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem17sceneBoundingRectEv(rsthis.qclsinst)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::~QGraphicsItem(); impl /*struct*/ QGraphicsItem { pub fn free<RetType, T: QGraphicsItem_free<RetType>>(& self, overload_args: T) -> RetType { return overload_args.free(self); // return 1; } } pub trait QGraphicsItem_free<RetType> { fn free(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::~QGraphicsItem(); impl<'a> /*trait*/ QGraphicsItem_free<()> for () { fn free(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItemD2Ev()}; unsafe {C_ZN13QGraphicsItemD2Ev(rsthis.qclsinst)}; // return 1; } } // proto: void QGraphicsItem::setX(qreal x); impl /*struct*/ QGraphicsItem { pub fn setX<RetType, T: QGraphicsItem_setX<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setX(self); // return 1; } } pub trait QGraphicsItem_setX<RetType> { fn setX(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setX(qreal x); impl<'a> /*trait*/ QGraphicsItem_setX<()> for (f64) { fn setX(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem4setXEd()}; let arg0 = self as c_double; unsafe {C_ZN13QGraphicsItem4setXEd(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsItem::update(qreal x, qreal y, qreal width, qreal height); impl /*struct*/ QGraphicsItem { pub fn update<RetType, T: QGraphicsItem_update<RetType>>(& self, overload_args: T) -> RetType { return overload_args.update(self); // return 1; } } pub trait QGraphicsItem_update<RetType> { fn update(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::update(qreal x, qreal y, qreal width, qreal height); impl<'a> /*trait*/ QGraphicsItem_update<()> for (f64, f64, f64, f64) { fn update(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem6updateEdddd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; unsafe {C_ZN13QGraphicsItem6updateEdddd(rsthis.qclsinst, arg0, arg1, arg2, arg3)}; // return 1; } } // proto: void QGraphicsItem::setSelected(bool selected); impl /*struct*/ QGraphicsItem { pub fn setSelected<RetType, T: QGraphicsItem_setSelected<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setSelected(self); // return 1; } } pub trait QGraphicsItem_setSelected<RetType> { fn setSelected(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setSelected(bool selected); impl<'a> /*trait*/ QGraphicsItem_setSelected<()> for (i8) { fn setSelected(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem11setSelectedEb()}; let arg0 = self as c_char; unsafe {C_ZN13QGraphicsItem11setSelectedEb(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QRectF QGraphicsItem::mapRectToItem(const QGraphicsItem * item, const QRectF & rect); impl<'a> /*trait*/ QGraphicsItem_mapRectToItem<QRectF> for (&'a QGraphicsItem, &'a QRectF) { fn mapRectToItem(self , rsthis: & QGraphicsItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem13mapRectToItemEPKS_RK6QRectF()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem13mapRectToItemEPKS_RK6QRectF(rsthis.qclsinst, arg0, arg1)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::stackBefore(const QGraphicsItem * sibling); impl /*struct*/ QGraphicsItem { pub fn stackBefore<RetType, T: QGraphicsItem_stackBefore<RetType>>(& self, overload_args: T) -> RetType { return overload_args.stackBefore(self); // return 1; } } pub trait QGraphicsItem_stackBefore<RetType> { fn stackBefore(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::stackBefore(const QGraphicsItem * sibling); impl<'a> /*trait*/ QGraphicsItem_stackBefore<()> for (&'a QGraphicsItem) { fn stackBefore(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem11stackBeforeEPKS_()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN13QGraphicsItem11stackBeforeEPKS_(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QPointF QGraphicsItem::mapFromItem(const QGraphicsItem * item, qreal x, qreal y); impl<'a> /*trait*/ QGraphicsItem_mapFromItem<QPointF> for (&'a QGraphicsItem, f64, f64) { fn mapFromItem(self , rsthis: & QGraphicsItem) -> QPointF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem11mapFromItemEPKS_dd()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem11mapFromItemEPKS_dd(rsthis.qclsinst, arg0, arg1, arg2)}; let mut ret1 = QPointF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::resetMatrix(); impl /*struct*/ QGraphicsItem { pub fn resetMatrix<RetType, T: QGraphicsItem_resetMatrix<RetType>>(& self, overload_args: T) -> RetType { return overload_args.resetMatrix(self); // return 1; } } pub trait QGraphicsItem_resetMatrix<RetType> { fn resetMatrix(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::resetMatrix(); impl<'a> /*trait*/ QGraphicsItem_resetMatrix<()> for () { fn resetMatrix(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem11resetMatrixEv()}; unsafe {C_ZN13QGraphicsItem11resetMatrixEv(rsthis.qclsinst)}; // return 1; } } // proto: QPainterPath QGraphicsItem::opaqueArea(); impl /*struct*/ QGraphicsItem { pub fn opaqueArea<RetType, T: QGraphicsItem_opaqueArea<RetType>>(& self, overload_args: T) -> RetType { return overload_args.opaqueArea(self); // return 1; } } pub trait QGraphicsItem_opaqueArea<RetType> { fn opaqueArea(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QPainterPath QGraphicsItem::opaqueArea(); impl<'a> /*trait*/ QGraphicsItem_opaqueArea<QPainterPath> for () { fn opaqueArea(self , rsthis: & QGraphicsItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem10opaqueAreaEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem10opaqueAreaEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::unsetCursor(); impl /*struct*/ QGraphicsItem { pub fn unsetCursor<RetType, T: QGraphicsItem_unsetCursor<RetType>>(& self, overload_args: T) -> RetType { return overload_args.unsetCursor(self); // return 1; } } pub trait QGraphicsItem_unsetCursor<RetType> { fn unsetCursor(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::unsetCursor(); impl<'a> /*trait*/ QGraphicsItem_unsetCursor<()> for () { fn unsetCursor(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem11unsetCursorEv()}; unsafe {C_ZN13QGraphicsItem11unsetCursorEv(rsthis.qclsinst)}; // return 1; } } // proto: QPointF QGraphicsItem::mapFromParent(qreal x, qreal y); impl<'a> /*trait*/ QGraphicsItem_mapFromParent<QPointF> for (f64, f64) { fn mapFromParent(self , rsthis: & QGraphicsItem) -> QPointF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem13mapFromParentEdd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem13mapFromParentEdd(rsthis.qclsinst, arg0, arg1)}; let mut ret1 = QPointF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QRectF QGraphicsItem::mapRectToScene(const QRectF & rect); impl /*struct*/ QGraphicsItem { pub fn mapRectToScene<RetType, T: QGraphicsItem_mapRectToScene<RetType>>(& self, overload_args: T) -> RetType { return overload_args.mapRectToScene(self); // return 1; } } pub trait QGraphicsItem_mapRectToScene<RetType> { fn mapRectToScene(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QRectF QGraphicsItem::mapRectToScene(const QRectF & rect); impl<'a> /*trait*/ QGraphicsItem_mapRectToScene<QRectF> for (&'a QRectF) { fn mapRectToScene(self , rsthis: & QGraphicsItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem14mapRectToSceneERK6QRectF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem14mapRectToSceneERK6QRectF(rsthis.qclsinst, arg0)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QRectF QGraphicsItem::mapRectFromItem(const QGraphicsItem * item, qreal x, qreal y, qreal w, qreal h); impl /*struct*/ QGraphicsItem { pub fn mapRectFromItem<RetType, T: QGraphicsItem_mapRectFromItem<RetType>>(& self, overload_args: T) -> RetType { return overload_args.mapRectFromItem(self); // return 1; } } pub trait QGraphicsItem_mapRectFromItem<RetType> { fn mapRectFromItem(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QRectF QGraphicsItem::mapRectFromItem(const QGraphicsItem * item, qreal x, qreal y, qreal w, qreal h); impl<'a> /*trait*/ QGraphicsItem_mapRectFromItem<QRectF> for (&'a QGraphicsItem, f64, f64, f64, f64) { fn mapRectFromItem(self , rsthis: & QGraphicsItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem15mapRectFromItemEPKS_dddd()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let arg4 = self.4 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem15mapRectFromItemEPKS_dddd(rsthis.qclsinst, arg0, arg1, arg2, arg3, arg4)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: qreal QGraphicsItem::scale(); impl /*struct*/ QGraphicsItem { pub fn scale<RetType, T: QGraphicsItem_scale<RetType>>(& self, overload_args: T) -> RetType { return overload_args.scale(self); // return 1; } } pub trait QGraphicsItem_scale<RetType> { fn scale(self , rsthis: & QGraphicsItem) -> RetType; } // proto: qreal QGraphicsItem::scale(); impl<'a> /*trait*/ QGraphicsItem_scale<f64> for () { fn scale(self , rsthis: & QGraphicsItem) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem5scaleEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem5scaleEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: void QGraphicsItem::setBoundingRegionGranularity(qreal granularity); impl /*struct*/ QGraphicsItem { pub fn setBoundingRegionGranularity<RetType, T: QGraphicsItem_setBoundingRegionGranularity<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setBoundingRegionGranularity(self); // return 1; } } pub trait QGraphicsItem_setBoundingRegionGranularity<RetType> { fn setBoundingRegionGranularity(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setBoundingRegionGranularity(qreal granularity); impl<'a> /*trait*/ QGraphicsItem_setBoundingRegionGranularity<()> for (f64) { fn setBoundingRegionGranularity(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem28setBoundingRegionGranularityEd()}; let arg0 = self as c_double; unsafe {C_ZN13QGraphicsItem28setBoundingRegionGranularityEd(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsItem::setAcceptDrops(bool on); impl /*struct*/ QGraphicsItem { pub fn setAcceptDrops<RetType, T: QGraphicsItem_setAcceptDrops<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setAcceptDrops(self); // return 1; } } pub trait QGraphicsItem_setAcceptDrops<RetType> { fn setAcceptDrops(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setAcceptDrops(bool on); impl<'a> /*trait*/ QGraphicsItem_setAcceptDrops<()> for (i8) { fn setAcceptDrops(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem14setAcceptDropsEb()}; let arg0 = self as c_char; unsafe {C_ZN13QGraphicsItem14setAcceptDropsEb(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QPolygonF QGraphicsItem::mapFromScene(qreal x, qreal y, qreal w, qreal h); impl<'a> /*trait*/ QGraphicsItem_mapFromScene<QPolygonF> for (f64, f64, f64, f64) { fn mapFromScene(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem12mapFromSceneEdddd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem12mapFromSceneEdddd(rsthis.qclsinst, arg0, arg1, arg2, arg3)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::ungrabKeyboard(); impl /*struct*/ QGraphicsItem { pub fn ungrabKeyboard<RetType, T: QGraphicsItem_ungrabKeyboard<RetType>>(& self, overload_args: T) -> RetType { return overload_args.ungrabKeyboard(self); // return 1; } } pub trait QGraphicsItem_ungrabKeyboard<RetType> { fn ungrabKeyboard(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::ungrabKeyboard(); impl<'a> /*trait*/ QGraphicsItem_ungrabKeyboard<()> for () { fn ungrabKeyboard(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem14ungrabKeyboardEv()}; unsafe {C_ZN13QGraphicsItem14ungrabKeyboardEv(rsthis.qclsinst)}; // return 1; } } // proto: void QGraphicsItem::setEnabled(bool enabled); impl /*struct*/ QGraphicsItem { pub fn setEnabled<RetType, T: QGraphicsItem_setEnabled<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setEnabled(self); // return 1; } } pub trait QGraphicsItem_setEnabled<RetType> { fn setEnabled(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setEnabled(bool enabled); impl<'a> /*trait*/ QGraphicsItem_setEnabled<()> for (i8) { fn setEnabled(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem10setEnabledEb()}; let arg0 = self as c_char; unsafe {C_ZN13QGraphicsItem10setEnabledEb(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QGraphicsEffect * QGraphicsItem::graphicsEffect(); impl /*struct*/ QGraphicsItem { pub fn graphicsEffect<RetType, T: QGraphicsItem_graphicsEffect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.graphicsEffect(self); // return 1; } } pub trait QGraphicsItem_graphicsEffect<RetType> { fn graphicsEffect(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QGraphicsEffect * QGraphicsItem::graphicsEffect(); impl<'a> /*trait*/ QGraphicsItem_graphicsEffect<QGraphicsEffect> for () { fn graphicsEffect(self , rsthis: & QGraphicsItem) -> QGraphicsEffect { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem14graphicsEffectEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem14graphicsEffectEv(rsthis.qclsinst)}; let mut ret1 = QGraphicsEffect::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsItem::acceptHoverEvents(); impl /*struct*/ QGraphicsItem { pub fn acceptHoverEvents<RetType, T: QGraphicsItem_acceptHoverEvents<RetType>>(& self, overload_args: T) -> RetType { return overload_args.acceptHoverEvents(self); // return 1; } } pub trait QGraphicsItem_acceptHoverEvents<RetType> { fn acceptHoverEvents(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::acceptHoverEvents(); impl<'a> /*trait*/ QGraphicsItem_acceptHoverEvents<i8> for () { fn acceptHoverEvents(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem17acceptHoverEventsEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem17acceptHoverEventsEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: QGraphicsWidget * QGraphicsItem::topLevelWidget(); impl /*struct*/ QGraphicsItem { pub fn topLevelWidget<RetType, T: QGraphicsItem_topLevelWidget<RetType>>(& self, overload_args: T) -> RetType { return overload_args.topLevelWidget(self); // return 1; } } pub trait QGraphicsItem_topLevelWidget<RetType> { fn topLevelWidget(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QGraphicsWidget * QGraphicsItem::topLevelWidget(); impl<'a> /*trait*/ QGraphicsItem_topLevelWidget<QGraphicsWidget> for () { fn topLevelWidget(self , rsthis: & QGraphicsItem) -> QGraphicsWidget { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem14topLevelWidgetEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem14topLevelWidgetEv(rsthis.qclsinst)}; let mut ret1 = QGraphicsWidget::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QList<QGraphicsTransform *> QGraphicsItem::transformations(); impl /*struct*/ QGraphicsItem { pub fn transformations<RetType, T: QGraphicsItem_transformations<RetType>>(& self, overload_args: T) -> RetType { return overload_args.transformations(self); // return 1; } } pub trait QGraphicsItem_transformations<RetType> { fn transformations(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QList<QGraphicsTransform *> QGraphicsItem::transformations(); impl<'a> /*trait*/ QGraphicsItem_transformations<u64> for () { fn transformations(self , rsthis: & QGraphicsItem) -> u64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem15transformationsEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem15transformationsEv(rsthis.qclsinst)}; return ret as u64; // 5 // return 1; } } // proto: QPolygonF QGraphicsItem::mapToScene(qreal x, qreal y, qreal w, qreal h); impl /*struct*/ QGraphicsItem { pub fn mapToScene<RetType, T: QGraphicsItem_mapToScene<RetType>>(& self, overload_args: T) -> RetType { return overload_args.mapToScene(self); // return 1; } } pub trait QGraphicsItem_mapToScene<RetType> { fn mapToScene(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QPolygonF QGraphicsItem::mapToScene(qreal x, qreal y, qreal w, qreal h); impl<'a> /*trait*/ QGraphicsItem_mapToScene<QPolygonF> for (f64, f64, f64, f64) { fn mapToScene(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem10mapToSceneEdddd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem10mapToSceneEdddd(rsthis.qclsinst, arg0, arg1, arg2, arg3)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPointF QGraphicsItem::mapToScene(qreal x, qreal y); impl<'a> /*trait*/ QGraphicsItem_mapToScene<QPointF> for (f64, f64) { fn mapToScene(self , rsthis: & QGraphicsItem) -> QPointF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem10mapToSceneEdd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem10mapToSceneEdd(rsthis.qclsinst, arg0, arg1)}; let mut ret1 = QPointF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QRectF QGraphicsItem::mapRectFromScene(qreal x, qreal y, qreal w, qreal h); impl<'a> /*trait*/ QGraphicsItem_mapRectFromScene<QRectF> for (f64, f64, f64, f64) { fn mapRectFromScene(self , rsthis: & QGraphicsItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem16mapRectFromSceneEdddd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem16mapRectFromSceneEdddd(rsthis.qclsinst, arg0, arg1, arg2, arg3)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::advance(int phase); impl /*struct*/ QGraphicsItem { pub fn advance<RetType, T: QGraphicsItem_advance<RetType>>(& self, overload_args: T) -> RetType { return overload_args.advance(self); // return 1; } } pub trait QGraphicsItem_advance<RetType> { fn advance(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::advance(int phase); impl<'a> /*trait*/ QGraphicsItem_advance<()> for (i32) { fn advance(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem7advanceEi()}; let arg0 = self as c_int; unsafe {C_ZN13QGraphicsItem7advanceEi(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QMatrix QGraphicsItem::sceneMatrix(); impl /*struct*/ QGraphicsItem { pub fn sceneMatrix<RetType, T: QGraphicsItem_sceneMatrix<RetType>>(& self, overload_args: T) -> RetType { return overload_args.sceneMatrix(self); // return 1; } } pub trait QGraphicsItem_sceneMatrix<RetType> { fn sceneMatrix(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QMatrix QGraphicsItem::sceneMatrix(); impl<'a> /*trait*/ QGraphicsItem_sceneMatrix<QMatrix> for () { fn sceneMatrix(self , rsthis: & QGraphicsItem) -> QMatrix { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem11sceneMatrixEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem11sceneMatrixEv(rsthis.qclsinst)}; let mut ret1 = QMatrix::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::setFiltersChildEvents(bool enabled); impl /*struct*/ QGraphicsItem { pub fn setFiltersChildEvents<RetType, T: QGraphicsItem_setFiltersChildEvents<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setFiltersChildEvents(self); // return 1; } } pub trait QGraphicsItem_setFiltersChildEvents<RetType> { fn setFiltersChildEvents(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setFiltersChildEvents(bool enabled); impl<'a> /*trait*/ QGraphicsItem_setFiltersChildEvents<()> for (i8) { fn setFiltersChildEvents(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem21setFiltersChildEventsEb()}; let arg0 = self as c_char; unsafe {C_ZN13QGraphicsItem21setFiltersChildEventsEb(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QPolygonF QGraphicsItem::mapToScene(const QPolygonF & polygon); impl<'a> /*trait*/ QGraphicsItem_mapToScene<QPolygonF> for (&'a QPolygonF) { fn mapToScene(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem10mapToSceneERK9QPolygonF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem10mapToSceneERK9QPolygonF(rsthis.qclsinst, arg0)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QTransform QGraphicsItem::itemTransform(const QGraphicsItem * other, bool * ok); impl /*struct*/ QGraphicsItem { pub fn itemTransform<RetType, T: QGraphicsItem_itemTransform<RetType>>(& self, overload_args: T) -> RetType { return overload_args.itemTransform(self); // return 1; } } pub trait QGraphicsItem_itemTransform<RetType> { fn itemTransform(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QTransform QGraphicsItem::itemTransform(const QGraphicsItem * other, bool * ok); impl<'a> /*trait*/ QGraphicsItem_itemTransform<QTransform> for (&'a QGraphicsItem, Option<&'a mut Vec<i8>>) { fn itemTransform(self , rsthis: & QGraphicsItem) -> QTransform { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem13itemTransformEPKS_Pb()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {0 as *const i8} else {self.1.unwrap().as_ptr()}) as *mut c_char; let mut ret = unsafe {C_ZNK13QGraphicsItem13itemTransformEPKS_Pb(rsthis.qclsinst, arg0, arg1)}; let mut ret1 = QTransform::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::setTransformOriginPoint(qreal ax, qreal ay); impl<'a> /*trait*/ QGraphicsItem_setTransformOriginPoint<()> for (f64, f64) { fn setTransformOriginPoint(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem23setTransformOriginPointEdd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; unsafe {C_ZN13QGraphicsItem23setTransformOriginPointEdd(rsthis.qclsinst, arg0, arg1)}; // return 1; } } // proto: void QGraphicsItem::moveBy(qreal dx, qreal dy); impl /*struct*/ QGraphicsItem { pub fn moveBy<RetType, T: QGraphicsItem_moveBy<RetType>>(& self, overload_args: T) -> RetType { return overload_args.moveBy(self); // return 1; } } pub trait QGraphicsItem_moveBy<RetType> { fn moveBy(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::moveBy(qreal dx, qreal dy); impl<'a> /*trait*/ QGraphicsItem_moveBy<()> for (f64, f64) { fn moveBy(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem6moveByEdd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; unsafe {C_ZN13QGraphicsItem6moveByEdd(rsthis.qclsinst, arg0, arg1)}; // return 1; } } // proto: QPolygonF QGraphicsItem::mapFromScene(const QPolygonF & polygon); impl<'a> /*trait*/ QGraphicsItem_mapFromScene<QPolygonF> for (&'a QPolygonF) { fn mapFromScene(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem12mapFromSceneERK9QPolygonF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem12mapFromSceneERK9QPolygonF(rsthis.qclsinst, arg0)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QGraphicsItemGroup * QGraphicsItem::group(); impl /*struct*/ QGraphicsItem { pub fn group<RetType, T: QGraphicsItem_group<RetType>>(& self, overload_args: T) -> RetType { return overload_args.group(self); // return 1; } } pub trait QGraphicsItem_group<RetType> { fn group(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QGraphicsItemGroup * QGraphicsItem::group(); impl<'a> /*trait*/ QGraphicsItem_group<QGraphicsItemGroup> for () { fn group(self , rsthis: & QGraphicsItem) -> QGraphicsItemGroup { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem5groupEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem5groupEv(rsthis.qclsinst)}; let mut ret1 = QGraphicsItemGroup::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPainterPath QGraphicsItem::shape(); impl /*struct*/ QGraphicsItem { pub fn shape<RetType, T: QGraphicsItem_shape<RetType>>(& self, overload_args: T) -> RetType { return overload_args.shape(self); // return 1; } } pub trait QGraphicsItem_shape<RetType> { fn shape(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QPainterPath QGraphicsItem::shape(); impl<'a> /*trait*/ QGraphicsItem_shape<QPainterPath> for () { fn shape(self , rsthis: & QGraphicsItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem5shapeEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem5shapeEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPointF QGraphicsItem::mapFromScene(qreal x, qreal y); impl<'a> /*trait*/ QGraphicsItem_mapFromScene<QPointF> for (f64, f64) { fn mapFromScene(self , rsthis: & QGraphicsItem) -> QPointF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem12mapFromSceneEdd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem12mapFromSceneEdd(rsthis.qclsinst, arg0, arg1)}; let mut ret1 = QPointF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::scroll(qreal dx, qreal dy, const QRectF & rect); impl /*struct*/ QGraphicsItem { pub fn scroll<RetType, T: QGraphicsItem_scroll<RetType>>(& self, overload_args: T) -> RetType { return overload_args.scroll(self); // return 1; } } pub trait QGraphicsItem_scroll<RetType> { fn scroll(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::scroll(qreal dx, qreal dy, const QRectF & rect); impl<'a> /*trait*/ QGraphicsItem_scroll<()> for (f64, f64, Option<&'a QRectF>) { fn scroll(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem6scrollEddRK6QRectF()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = (if self.2.is_none() {QRectF::new(()).qclsinst} else {self.2.unwrap().qclsinst}) as *mut c_void; unsafe {C_ZN13QGraphicsItem6scrollEddRK6QRectF(rsthis.qclsinst, arg0, arg1, arg2)}; // return 1; } } // proto: bool QGraphicsItem::isObscuredBy(const QGraphicsItem * item); impl /*struct*/ QGraphicsItem { pub fn isObscuredBy<RetType, T: QGraphicsItem_isObscuredBy<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isObscuredBy(self); // return 1; } } pub trait QGraphicsItem_isObscuredBy<RetType> { fn isObscuredBy(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::isObscuredBy(const QGraphicsItem * item); impl<'a> /*trait*/ QGraphicsItem_isObscuredBy<i8> for (&'a QGraphicsItem) { fn isObscuredBy(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem12isObscuredByEPKS_()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem12isObscuredByEPKS_(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: QPointF QGraphicsItem::mapFromParent(const QPointF & point); impl<'a> /*trait*/ QGraphicsItem_mapFromParent<QPointF> for (&'a QPointF) { fn mapFromParent(self , rsthis: & QGraphicsItem) -> QPointF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem13mapFromParentERK7QPointF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem13mapFromParentERK7QPointF(rsthis.qclsinst, arg0)}; let mut ret1 = QPointF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::setData(int key, const QVariant & value); impl /*struct*/ QGraphicsItem { pub fn setData<RetType, T: QGraphicsItem_setData<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setData(self); // return 1; } } pub trait QGraphicsItem_setData<RetType> { fn setData(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setData(int key, const QVariant & value); impl<'a> /*trait*/ QGraphicsItem_setData<()> for (i32, &'a QVariant) { fn setData(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem7setDataEiRK8QVariant()}; let arg0 = self.0 as c_int; let arg1 = self.1.qclsinst as *mut c_void; unsafe {C_ZN13QGraphicsItem7setDataEiRK8QVariant(rsthis.qclsinst, arg0, arg1)}; // return 1; } } // proto: QGraphicsItem * QGraphicsItem::commonAncestorItem(const QGraphicsItem * other); impl /*struct*/ QGraphicsItem { pub fn commonAncestorItem<RetType, T: QGraphicsItem_commonAncestorItem<RetType>>(& self, overload_args: T) -> RetType { return overload_args.commonAncestorItem(self); // return 1; } } pub trait QGraphicsItem_commonAncestorItem<RetType> { fn commonAncestorItem(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QGraphicsItem * QGraphicsItem::commonAncestorItem(const QGraphicsItem * other); impl<'a> /*trait*/ QGraphicsItem_commonAncestorItem<QGraphicsItem> for (&'a QGraphicsItem) { fn commonAncestorItem(self , rsthis: & QGraphicsItem) -> QGraphicsItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem18commonAncestorItemEPKS_()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem18commonAncestorItemEPKS_(rsthis.qclsinst, arg0)}; let mut ret1 = QGraphicsItem::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPainterPath QGraphicsItem::mapFromScene(const QPainterPath & path); impl<'a> /*trait*/ QGraphicsItem_mapFromScene<QPainterPath> for (&'a QPainterPath) { fn mapFromScene(self , rsthis: & QGraphicsItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem12mapFromSceneERK12QPainterPath()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem12mapFromSceneERK12QPainterPath(rsthis.qclsinst, arg0)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPainterPath QGraphicsItem::mapToScene(const QPainterPath & path); impl<'a> /*trait*/ QGraphicsItem_mapToScene<QPainterPath> for (&'a QPainterPath) { fn mapToScene(self , rsthis: & QGraphicsItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem10mapToSceneERK12QPainterPath()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem10mapToSceneERK12QPainterPath(rsthis.qclsinst, arg0)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPolygonF QGraphicsItem::mapToParent(qreal x, qreal y, qreal w, qreal h); impl<'a> /*trait*/ QGraphicsItem_mapToParent<QPolygonF> for (f64, f64, f64, f64) { fn mapToParent(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem11mapToParentEdddd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem11mapToParentEdddd(rsthis.qclsinst, arg0, arg1, arg2, arg3)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::setGroup(QGraphicsItemGroup * group); impl /*struct*/ QGraphicsItem { pub fn setGroup<RetType, T: QGraphicsItem_setGroup<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setGroup(self); // return 1; } } pub trait QGraphicsItem_setGroup<RetType> { fn setGroup(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setGroup(QGraphicsItemGroup * group); impl<'a> /*trait*/ QGraphicsItem_setGroup<()> for (&'a QGraphicsItemGroup) { fn setGroup(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem8setGroupEP18QGraphicsItemGroup()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN13QGraphicsItem8setGroupEP18QGraphicsItemGroup(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QRectF QGraphicsItem::mapRectFromParent(qreal x, qreal y, qreal w, qreal h); impl<'a> /*trait*/ QGraphicsItem_mapRectFromParent<QRectF> for (f64, f64, f64, f64) { fn mapRectFromParent(self , rsthis: & QGraphicsItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem17mapRectFromParentEdddd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem17mapRectFromParentEdddd(rsthis.qclsinst, arg0, arg1, arg2, arg3)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::show(); impl /*struct*/ QGraphicsItem { pub fn show<RetType, T: QGraphicsItem_show<RetType>>(& self, overload_args: T) -> RetType { return overload_args.show(self); // return 1; } } pub trait QGraphicsItem_show<RetType> { fn show(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::show(); impl<'a> /*trait*/ QGraphicsItem_show<()> for () { fn show(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem4showEv()}; unsafe {C_ZN13QGraphicsItem4showEv(rsthis.qclsinst)}; // return 1; } } // proto: QRectF QGraphicsItem::mapRectFromItem(const QGraphicsItem * item, const QRectF & rect); impl<'a> /*trait*/ QGraphicsItem_mapRectFromItem<QRectF> for (&'a QGraphicsItem, &'a QRectF) { fn mapRectFromItem(self , rsthis: & QGraphicsItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem15mapRectFromItemEPKS_RK6QRectF()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem15mapRectFromItemEPKS_RK6QRectF(rsthis.qclsinst, arg0, arg1)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: qreal QGraphicsItem::y(); impl /*struct*/ QGraphicsItem { pub fn y<RetType, T: QGraphicsItem_y<RetType>>(& self, overload_args: T) -> RetType { return overload_args.y(self); // return 1; } } pub trait QGraphicsItem_y<RetType> { fn y(self , rsthis: & QGraphicsItem) -> RetType; } // proto: qreal QGraphicsItem::y(); impl<'a> /*trait*/ QGraphicsItem_y<f64> for () { fn y(self , rsthis: & QGraphicsItem) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem1yEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem1yEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: QPointF QGraphicsItem::mapFromScene(const QPointF & point); impl<'a> /*trait*/ QGraphicsItem_mapFromScene<QPointF> for (&'a QPointF) { fn mapFromScene(self , rsthis: & QGraphicsItem) -> QPointF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem12mapFromSceneERK7QPointF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem12mapFromSceneERK7QPointF(rsthis.qclsinst, arg0)}; let mut ret1 = QPointF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsItem::hasFocus(); impl /*struct*/ QGraphicsItem { pub fn hasFocus<RetType, T: QGraphicsItem_hasFocus<RetType>>(& self, overload_args: T) -> RetType { return overload_args.hasFocus(self); // return 1; } } pub trait QGraphicsItem_hasFocus<RetType> { fn hasFocus(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::hasFocus(); impl<'a> /*trait*/ QGraphicsItem_hasFocus<i8> for () { fn hasFocus(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem8hasFocusEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem8hasFocusEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: QPainterPath QGraphicsItem::clipPath(); impl /*struct*/ QGraphicsItem { pub fn clipPath<RetType, T: QGraphicsItem_clipPath<RetType>>(& self, overload_args: T) -> RetType { return overload_args.clipPath(self); // return 1; } } pub trait QGraphicsItem_clipPath<RetType> { fn clipPath(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QPainterPath QGraphicsItem::clipPath(); impl<'a> /*trait*/ QGraphicsItem_clipPath<QPainterPath> for () { fn clipPath(self , rsthis: & QGraphicsItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem8clipPathEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem8clipPathEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::setPos(qreal x, qreal y); impl /*struct*/ QGraphicsItem { pub fn setPos<RetType, T: QGraphicsItem_setPos<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setPos(self); // return 1; } } pub trait QGraphicsItem_setPos<RetType> { fn setPos(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setPos(qreal x, qreal y); impl<'a> /*trait*/ QGraphicsItem_setPos<()> for (f64, f64) { fn setPos(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem6setPosEdd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; unsafe {C_ZN13QGraphicsItem6setPosEdd(rsthis.qclsinst, arg0, arg1)}; // return 1; } } // proto: bool QGraphicsItem::isEnabled(); impl /*struct*/ QGraphicsItem { pub fn isEnabled<RetType, T: QGraphicsItem_isEnabled<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isEnabled(self); // return 1; } } pub trait QGraphicsItem_isEnabled<RetType> { fn isEnabled(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::isEnabled(); impl<'a> /*trait*/ QGraphicsItem_isEnabled<i8> for () { fn isEnabled(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem9isEnabledEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem9isEnabledEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: bool QGraphicsItem::contains(const QPointF & point); impl /*struct*/ QGraphicsItem { pub fn contains<RetType, T: QGraphicsItem_contains<RetType>>(& self, overload_args: T) -> RetType { return overload_args.contains(self); // return 1; } } pub trait QGraphicsItem_contains<RetType> { fn contains(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::contains(const QPointF & point); impl<'a> /*trait*/ QGraphicsItem_contains<i8> for (&'a QPointF) { fn contains(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem8containsERK7QPointF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem8containsERK7QPointF(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: bool QGraphicsItem::isPanel(); impl /*struct*/ QGraphicsItem { pub fn isPanel<RetType, T: QGraphicsItem_isPanel<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isPanel(self); // return 1; } } pub trait QGraphicsItem_isPanel<RetType> { fn isPanel(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::isPanel(); impl<'a> /*trait*/ QGraphicsItem_isPanel<i8> for () { fn isPanel(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem7isPanelEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem7isPanelEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: bool QGraphicsItem::filtersChildEvents(); impl /*struct*/ QGraphicsItem { pub fn filtersChildEvents<RetType, T: QGraphicsItem_filtersChildEvents<RetType>>(& self, overload_args: T) -> RetType { return overload_args.filtersChildEvents(self); // return 1; } } pub trait QGraphicsItem_filtersChildEvents<RetType> { fn filtersChildEvents(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::filtersChildEvents(); impl<'a> /*trait*/ QGraphicsItem_filtersChildEvents<i8> for () { fn filtersChildEvents(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem18filtersChildEventsEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem18filtersChildEventsEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsItem::grabKeyboard(); impl /*struct*/ QGraphicsItem { pub fn grabKeyboard<RetType, T: QGraphicsItem_grabKeyboard<RetType>>(& self, overload_args: T) -> RetType { return overload_args.grabKeyboard(self); // return 1; } } pub trait QGraphicsItem_grabKeyboard<RetType> { fn grabKeyboard(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::grabKeyboard(); impl<'a> /*trait*/ QGraphicsItem_grabKeyboard<()> for () { fn grabKeyboard(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem12grabKeyboardEv()}; unsafe {C_ZN13QGraphicsItem12grabKeyboardEv(rsthis.qclsinst)}; // return 1; } } // proto: QPainterPath QGraphicsItem::mapFromItem(const QGraphicsItem * item, const QPainterPath & path); impl<'a> /*trait*/ QGraphicsItem_mapFromItem<QPainterPath> for (&'a QGraphicsItem, &'a QPainterPath) { fn mapFromItem(self , rsthis: & QGraphicsItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem11mapFromItemEPKS_RK12QPainterPath()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem11mapFromItemEPKS_RK12QPainterPath(rsthis.qclsinst, arg0, arg1)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::setActive(bool active); impl /*struct*/ QGraphicsItem { pub fn setActive<RetType, T: QGraphicsItem_setActive<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setActive(self); // return 1; } } pub trait QGraphicsItem_setActive<RetType> { fn setActive(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setActive(bool active); impl<'a> /*trait*/ QGraphicsItem_setActive<()> for (i8) { fn setActive(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem9setActiveEb()}; let arg0 = self as c_char; unsafe {C_ZN13QGraphicsItem9setActiveEb(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QGraphicsObject * QGraphicsItem::toGraphicsObject(); impl /*struct*/ QGraphicsItem { pub fn toGraphicsObject<RetType, T: QGraphicsItem_toGraphicsObject<RetType>>(& self, overload_args: T) -> RetType { return overload_args.toGraphicsObject(self); // return 1; } } pub trait QGraphicsItem_toGraphicsObject<RetType> { fn toGraphicsObject(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QGraphicsObject * QGraphicsItem::toGraphicsObject(); impl<'a> /*trait*/ QGraphicsItem_toGraphicsObject<QGraphicsObject> for () { fn toGraphicsObject(self , rsthis: & QGraphicsItem) -> QGraphicsObject { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem16toGraphicsObjectEv()}; let mut ret = unsafe {C_ZN13QGraphicsItem16toGraphicsObjectEv(rsthis.qclsinst)}; let mut ret1 = QGraphicsObject::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPolygonF QGraphicsItem::mapFromItem(const QGraphicsItem * item, const QPolygonF & polygon); impl<'a> /*trait*/ QGraphicsItem_mapFromItem<QPolygonF> for (&'a QGraphicsItem, &'a QPolygonF) { fn mapFromItem(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem11mapFromItemEPKS_RK9QPolygonF()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem11mapFromItemEPKS_RK9QPolygonF(rsthis.qclsinst, arg0, arg1)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::setHandlesChildEvents(bool enabled); impl /*struct*/ QGraphicsItem { pub fn setHandlesChildEvents<RetType, T: QGraphicsItem_setHandlesChildEvents<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setHandlesChildEvents(self); // return 1; } } pub trait QGraphicsItem_setHandlesChildEvents<RetType> { fn setHandlesChildEvents(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setHandlesChildEvents(bool enabled); impl<'a> /*trait*/ QGraphicsItem_setHandlesChildEvents<()> for (i8) { fn setHandlesChildEvents(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem21setHandlesChildEventsEb()}; let arg0 = self as c_char; unsafe {C_ZN13QGraphicsItem21setHandlesChildEventsEb(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QPolygonF QGraphicsItem::mapFromParent(const QPolygonF & polygon); impl<'a> /*trait*/ QGraphicsItem_mapFromParent<QPolygonF> for (&'a QPolygonF) { fn mapFromParent(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem13mapFromParentERK9QPolygonF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem13mapFromParentERK9QPolygonF(rsthis.qclsinst, arg0)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPointF QGraphicsItem::mapToParent(qreal x, qreal y); impl<'a> /*trait*/ QGraphicsItem_mapToParent<QPointF> for (f64, f64) { fn mapToParent(self , rsthis: & QGraphicsItem) -> QPointF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem11mapToParentEdd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem11mapToParentEdd(rsthis.qclsinst, arg0, arg1)}; let mut ret1 = QPointF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::setMatrix(const QMatrix & matrix, bool combine); impl /*struct*/ QGraphicsItem { pub fn setMatrix<RetType, T: QGraphicsItem_setMatrix<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setMatrix(self); // return 1; } } pub trait QGraphicsItem_setMatrix<RetType> { fn setMatrix(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setMatrix(const QMatrix & matrix, bool combine); impl<'a> /*trait*/ QGraphicsItem_setMatrix<()> for (&'a QMatrix, Option<i8>) { fn setMatrix(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem9setMatrixERK7QMatrixb()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {false as i8} else {self.1.unwrap()}) as c_char; unsafe {C_ZN13QGraphicsItem9setMatrixERK7QMatrixb(rsthis.qclsinst, arg0, arg1)}; // return 1; } } // proto: void QGraphicsItem::update(const QRectF & rect); impl<'a> /*trait*/ QGraphicsItem_update<()> for (Option<&'a QRectF>) { fn update(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem6updateERK6QRectF()}; let arg0 = (if self.is_none() {QRectF::new(()).qclsinst} else {self.unwrap().qclsinst}) as *mut c_void; unsafe {C_ZN13QGraphicsItem6updateERK6QRectF(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QPolygonF QGraphicsItem::mapToItem(const QGraphicsItem * item, const QPolygonF & polygon); impl<'a> /*trait*/ QGraphicsItem_mapToItem<QPolygonF> for (&'a QGraphicsItem, &'a QPolygonF) { fn mapToItem(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem9mapToItemEPKS_RK9QPolygonF()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem9mapToItemEPKS_RK9QPolygonF(rsthis.qclsinst, arg0, arg1)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QTransform QGraphicsItem::transform(); impl /*struct*/ QGraphicsItem { pub fn transform<RetType, T: QGraphicsItem_transform<RetType>>(& self, overload_args: T) -> RetType { return overload_args.transform(self); // return 1; } } pub trait QGraphicsItem_transform<RetType> { fn transform(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QTransform QGraphicsItem::transform(); impl<'a> /*trait*/ QGraphicsItem_transform<QTransform> for () { fn transform(self , rsthis: & QGraphicsItem) -> QTransform { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem9transformEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem9transformEv(rsthis.qclsinst)}; let mut ret1 = QTransform::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QVariant QGraphicsItem::data(int key); impl /*struct*/ QGraphicsItem { pub fn data<RetType, T: QGraphicsItem_data<RetType>>(& self, overload_args: T) -> RetType { return overload_args.data(self); // return 1; } } pub trait QGraphicsItem_data<RetType> { fn data(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QVariant QGraphicsItem::data(int key); impl<'a> /*trait*/ QGraphicsItem_data<QVariant> for (i32) { fn data(self , rsthis: & QGraphicsItem) -> QVariant { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem4dataEi()}; let arg0 = self as c_int; let mut ret = unsafe {C_ZNK13QGraphicsItem4dataEi(rsthis.qclsinst, arg0)}; let mut ret1 = QVariant::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::hide(); impl /*struct*/ QGraphicsItem { pub fn hide<RetType, T: QGraphicsItem_hide<RetType>>(& self, overload_args: T) -> RetType { return overload_args.hide(self); // return 1; } } pub trait QGraphicsItem_hide<RetType> { fn hide(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::hide(); impl<'a> /*trait*/ QGraphicsItem_hide<()> for () { fn hide(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem4hideEv()}; unsafe {C_ZN13QGraphicsItem4hideEv(rsthis.qclsinst)}; // return 1; } } // proto: bool QGraphicsItem::isUnderMouse(); impl /*struct*/ QGraphicsItem { pub fn isUnderMouse<RetType, T: QGraphicsItem_isUnderMouse<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isUnderMouse(self); // return 1; } } pub trait QGraphicsItem_isUnderMouse<RetType> { fn isUnderMouse(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::isUnderMouse(); impl<'a> /*trait*/ QGraphicsItem_isUnderMouse<i8> for () { fn isUnderMouse(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem12isUnderMouseEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem12isUnderMouseEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsItem::setAcceptTouchEvents(bool enabled); impl /*struct*/ QGraphicsItem { pub fn setAcceptTouchEvents<RetType, T: QGraphicsItem_setAcceptTouchEvents<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setAcceptTouchEvents(self); // return 1; } } pub trait QGraphicsItem_setAcceptTouchEvents<RetType> { fn setAcceptTouchEvents(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setAcceptTouchEvents(bool enabled); impl<'a> /*trait*/ QGraphicsItem_setAcceptTouchEvents<()> for (i8) { fn setAcceptTouchEvents(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem20setAcceptTouchEventsEb()}; let arg0 = self as c_char; unsafe {C_ZN13QGraphicsItem20setAcceptTouchEventsEb(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsItem::setAcceptHoverEvents(bool enabled); impl /*struct*/ QGraphicsItem { pub fn setAcceptHoverEvents<RetType, T: QGraphicsItem_setAcceptHoverEvents<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setAcceptHoverEvents(self); // return 1; } } pub trait QGraphicsItem_setAcceptHoverEvents<RetType> { fn setAcceptHoverEvents(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setAcceptHoverEvents(bool enabled); impl<'a> /*trait*/ QGraphicsItem_setAcceptHoverEvents<()> for (i8) { fn setAcceptHoverEvents(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem20setAcceptHoverEventsEb()}; let arg0 = self as c_char; unsafe {C_ZN13QGraphicsItem20setAcceptHoverEventsEb(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QList<QGraphicsItem *> QGraphicsItem::childItems(); impl /*struct*/ QGraphicsItem { pub fn childItems<RetType, T: QGraphicsItem_childItems<RetType>>(& self, overload_args: T) -> RetType { return overload_args.childItems(self); // return 1; } } pub trait QGraphicsItem_childItems<RetType> { fn childItems(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QList<QGraphicsItem *> QGraphicsItem::childItems(); impl<'a> /*trait*/ QGraphicsItem_childItems<u64> for () { fn childItems(self , rsthis: & QGraphicsItem) -> u64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem10childItemsEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem10childItemsEv(rsthis.qclsinst)}; return ret as u64; // 5 // return 1; } } // proto: bool QGraphicsItem::isAncestorOf(const QGraphicsItem * child); impl /*struct*/ QGraphicsItem { pub fn isAncestorOf<RetType, T: QGraphicsItem_isAncestorOf<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isAncestorOf(self); // return 1; } } pub trait QGraphicsItem_isAncestorOf<RetType> { fn isAncestorOf(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::isAncestorOf(const QGraphicsItem * child); impl<'a> /*trait*/ QGraphicsItem_isAncestorOf<i8> for (&'a QGraphicsItem) { fn isAncestorOf(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem12isAncestorOfEPKS_()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem12isAncestorOfEPKS_(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: qreal QGraphicsItem::opacity(); impl /*struct*/ QGraphicsItem { pub fn opacity<RetType, T: QGraphicsItem_opacity<RetType>>(& self, overload_args: T) -> RetType { return overload_args.opacity(self); // return 1; } } pub trait QGraphicsItem_opacity<RetType> { fn opacity(self , rsthis: & QGraphicsItem) -> RetType; } // proto: qreal QGraphicsItem::opacity(); impl<'a> /*trait*/ QGraphicsItem_opacity<f64> for () { fn opacity(self , rsthis: & QGraphicsItem) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem7opacityEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem7opacityEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: bool QGraphicsItem::isVisibleTo(const QGraphicsItem * parent); impl /*struct*/ QGraphicsItem { pub fn isVisibleTo<RetType, T: QGraphicsItem_isVisibleTo<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isVisibleTo(self); // return 1; } } pub trait QGraphicsItem_isVisibleTo<RetType> { fn isVisibleTo(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::isVisibleTo(const QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsItem_isVisibleTo<i8> for (&'a QGraphicsItem) { fn isVisibleTo(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem11isVisibleToEPKS_()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem11isVisibleToEPKS_(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: QString QGraphicsItem::toolTip(); impl /*struct*/ QGraphicsItem { pub fn toolTip<RetType, T: QGraphicsItem_toolTip<RetType>>(& self, overload_args: T) -> RetType { return overload_args.toolTip(self); // return 1; } } pub trait QGraphicsItem_toolTip<RetType> { fn toolTip(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QString QGraphicsItem::toolTip(); impl<'a> /*trait*/ QGraphicsItem_toolTip<QString> for () { fn toolTip(self , rsthis: & QGraphicsItem) -> QString { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem7toolTipEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem7toolTipEv(rsthis.qclsinst)}; let mut ret1 = QString::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QCursor QGraphicsItem::cursor(); impl /*struct*/ QGraphicsItem { pub fn cursor<RetType, T: QGraphicsItem_cursor<RetType>>(& self, overload_args: T) -> RetType { return overload_args.cursor(self); // return 1; } } pub trait QGraphicsItem_cursor<RetType> { fn cursor(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QCursor QGraphicsItem::cursor(); impl<'a> /*trait*/ QGraphicsItem_cursor<QCursor> for () { fn cursor(self , rsthis: & QGraphicsItem) -> QCursor { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem6cursorEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem6cursorEv(rsthis.qclsinst)}; let mut ret1 = QCursor::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPointF QGraphicsItem::mapToScene(const QPointF & point); impl<'a> /*trait*/ QGraphicsItem_mapToScene<QPointF> for (&'a QPointF) { fn mapToScene(self , rsthis: & QGraphicsItem) -> QPointF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem10mapToSceneERK7QPointF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem10mapToSceneERK7QPointF(rsthis.qclsinst, arg0)}; let mut ret1 = QPointF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: qreal QGraphicsItem::zValue(); impl /*struct*/ QGraphicsItem { pub fn zValue<RetType, T: QGraphicsItem_zValue<RetType>>(& self, overload_args: T) -> RetType { return overload_args.zValue(self); // return 1; } } pub trait QGraphicsItem_zValue<RetType> { fn zValue(self , rsthis: & QGraphicsItem) -> RetType; } // proto: qreal QGraphicsItem::zValue(); impl<'a> /*trait*/ QGraphicsItem_zValue<f64> for () { fn zValue(self , rsthis: & QGraphicsItem) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem6zValueEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem6zValueEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: QMatrix QGraphicsItem::matrix(); impl /*struct*/ QGraphicsItem { pub fn matrix<RetType, T: QGraphicsItem_matrix<RetType>>(& self, overload_args: T) -> RetType { return overload_args.matrix(self); // return 1; } } pub trait QGraphicsItem_matrix<RetType> { fn matrix(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QMatrix QGraphicsItem::matrix(); impl<'a> /*trait*/ QGraphicsItem_matrix<QMatrix> for () { fn matrix(self , rsthis: & QGraphicsItem) -> QMatrix { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem6matrixEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem6matrixEv(rsthis.qclsinst)}; let mut ret1 = QMatrix::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QRectF QGraphicsItem::mapRectToScene(qreal x, qreal y, qreal w, qreal h); impl<'a> /*trait*/ QGraphicsItem_mapRectToScene<QRectF> for (f64, f64, f64, f64) { fn mapRectToScene(self , rsthis: & QGraphicsItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem14mapRectToSceneEdddd()}; let arg0 = self.0 as c_double; let arg1 = self.1 as c_double; let arg2 = self.2 as c_double; let arg3 = self.3 as c_double; let mut ret = unsafe {C_ZNK13QGraphicsItem14mapRectToSceneEdddd(rsthis.qclsinst, arg0, arg1, arg2, arg3)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::setPos(const QPointF & pos); impl<'a> /*trait*/ QGraphicsItem_setPos<()> for (&'a QPointF) { fn setPos(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem6setPosERK7QPointF()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN13QGraphicsItem6setPosERK7QPointF(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QGraphicsItem * QGraphicsItem::panel(); impl /*struct*/ QGraphicsItem { pub fn panel<RetType, T: QGraphicsItem_panel<RetType>>(& self, overload_args: T) -> RetType { return overload_args.panel(self); // return 1; } } pub trait QGraphicsItem_panel<RetType> { fn panel(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QGraphicsItem * QGraphicsItem::panel(); impl<'a> /*trait*/ QGraphicsItem_panel<QGraphicsItem> for () { fn panel(self , rsthis: & QGraphicsItem) -> QGraphicsItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem5panelEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem5panelEv(rsthis.qclsinst)}; let mut ret1 = QGraphicsItem::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsItem::isClipped(); impl /*struct*/ QGraphicsItem { pub fn isClipped<RetType, T: QGraphicsItem_isClipped<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isClipped(self); // return 1; } } pub trait QGraphicsItem_isClipped<RetType> { fn isClipped(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::isClipped(); impl<'a> /*trait*/ QGraphicsItem_isClipped<i8> for () { fn isClipped(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem9isClippedEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem9isClippedEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: QGraphicsItem * QGraphicsItem::topLevelItem(); impl /*struct*/ QGraphicsItem { pub fn topLevelItem<RetType, T: QGraphicsItem_topLevelItem<RetType>>(& self, overload_args: T) -> RetType { return overload_args.topLevelItem(self); // return 1; } } pub trait QGraphicsItem_topLevelItem<RetType> { fn topLevelItem(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QGraphicsItem * QGraphicsItem::topLevelItem(); impl<'a> /*trait*/ QGraphicsItem_topLevelItem<QGraphicsItem> for () { fn topLevelItem(self , rsthis: & QGraphicsItem) -> QGraphicsItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem12topLevelItemEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem12topLevelItemEv(rsthis.qclsinst)}; let mut ret1 = QGraphicsItem::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QPolygonF QGraphicsItem::mapToScene(const QRectF & rect); impl<'a> /*trait*/ QGraphicsItem_mapToScene<QPolygonF> for (&'a QRectF) { fn mapToScene(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem10mapToSceneERK6QRectF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem10mapToSceneERK6QRectF(rsthis.qclsinst, arg0)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsItem::setScale(qreal scale); impl /*struct*/ QGraphicsItem { pub fn setScale<RetType, T: QGraphicsItem_setScale<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setScale(self); // return 1; } } pub trait QGraphicsItem_setScale<RetType> { fn setScale(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setScale(qreal scale); impl<'a> /*trait*/ QGraphicsItem_setScale<()> for (f64) { fn setScale(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem8setScaleEd()}; let arg0 = self as c_double; unsafe {C_ZN13QGraphicsItem8setScaleEd(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsItem::setCursor(const QCursor & cursor); impl /*struct*/ QGraphicsItem { pub fn setCursor<RetType, T: QGraphicsItem_setCursor<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setCursor(self); // return 1; } } pub trait QGraphicsItem_setCursor<RetType> { fn setCursor(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setCursor(const QCursor & cursor); impl<'a> /*trait*/ QGraphicsItem_setCursor<()> for (&'a QCursor) { fn setCursor(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem9setCursorERK7QCursor()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN13QGraphicsItem9setCursorERK7QCursor(rsthis.qclsinst, arg0)}; // return 1; } } // proto: bool QGraphicsItem::isVisible(); impl /*struct*/ QGraphicsItem { pub fn isVisible<RetType, T: QGraphicsItem_isVisible<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isVisible(self); // return 1; } } pub trait QGraphicsItem_isVisible<RetType> { fn isVisible(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::isVisible(); impl<'a> /*trait*/ QGraphicsItem_isVisible<i8> for () { fn isVisible(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem9isVisibleEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem9isVisibleEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: QPointF QGraphicsItem::pos(); impl /*struct*/ QGraphicsItem { pub fn pos<RetType, T: QGraphicsItem_pos<RetType>>(& self, overload_args: T) -> RetType { return overload_args.pos(self); // return 1; } } pub trait QGraphicsItem_pos<RetType> { fn pos(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QPointF QGraphicsItem::pos(); impl<'a> /*trait*/ QGraphicsItem_pos<QPointF> for () { fn pos(self , rsthis: & QGraphicsItem) -> QPointF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem3posEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem3posEv(rsthis.qclsinst)}; let mut ret1 = QPointF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsItem::isBlockedByModalPanel(QGraphicsItem ** blockingPanel); impl /*struct*/ QGraphicsItem { pub fn isBlockedByModalPanel<RetType, T: QGraphicsItem_isBlockedByModalPanel<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isBlockedByModalPanel(self); // return 1; } } pub trait QGraphicsItem_isBlockedByModalPanel<RetType> { fn isBlockedByModalPanel(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::isBlockedByModalPanel(QGraphicsItem ** blockingPanel); impl<'a> /*trait*/ QGraphicsItem_isBlockedByModalPanel<i8> for (Option<&'a QGraphicsItem>) { fn isBlockedByModalPanel(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem21isBlockedByModalPanelEPPS_()}; let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem21isBlockedByModalPanelEPPS_(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: qreal QGraphicsItem::effectiveOpacity(); impl /*struct*/ QGraphicsItem { pub fn effectiveOpacity<RetType, T: QGraphicsItem_effectiveOpacity<RetType>>(& self, overload_args: T) -> RetType { return overload_args.effectiveOpacity(self); // return 1; } } pub trait QGraphicsItem_effectiveOpacity<RetType> { fn effectiveOpacity(self , rsthis: & QGraphicsItem) -> RetType; } // proto: qreal QGraphicsItem::effectiveOpacity(); impl<'a> /*trait*/ QGraphicsItem_effectiveOpacity<f64> for () { fn effectiveOpacity(self , rsthis: & QGraphicsItem) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem16effectiveOpacityEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem16effectiveOpacityEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: void QGraphicsItem::ensureVisible(const QRectF & rect, int xmargin, int ymargin); impl<'a> /*trait*/ QGraphicsItem_ensureVisible<()> for (Option<&'a QRectF>, Option<i32>, Option<i32>) { fn ensureVisible(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem13ensureVisibleERK6QRectFii()}; let arg0 = (if self.0.is_none() {QRectF::new(()).qclsinst} else {self.0.unwrap().qclsinst}) as *mut c_void; let arg1 = (if self.1.is_none() {50} else {self.1.unwrap()}) as c_int; let arg2 = (if self.2.is_none() {50} else {self.2.unwrap()}) as c_int; unsafe {C_ZN13QGraphicsItem13ensureVisibleERK6QRectFii(rsthis.qclsinst, arg0, arg1, arg2)}; // return 1; } } // proto: qreal QGraphicsItem::boundingRegionGranularity(); impl /*struct*/ QGraphicsItem { pub fn boundingRegionGranularity<RetType, T: QGraphicsItem_boundingRegionGranularity<RetType>>(& self, overload_args: T) -> RetType { return overload_args.boundingRegionGranularity(self); // return 1; } } pub trait QGraphicsItem_boundingRegionGranularity<RetType> { fn boundingRegionGranularity(self , rsthis: & QGraphicsItem) -> RetType; } // proto: qreal QGraphicsItem::boundingRegionGranularity(); impl<'a> /*trait*/ QGraphicsItem_boundingRegionGranularity<f64> for () { fn boundingRegionGranularity(self , rsthis: & QGraphicsItem) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem25boundingRegionGranularityEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem25boundingRegionGranularityEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: qreal QGraphicsItem::x(); impl /*struct*/ QGraphicsItem { pub fn x<RetType, T: QGraphicsItem_x<RetType>>(& self, overload_args: T) -> RetType { return overload_args.x(self); // return 1; } } pub trait QGraphicsItem_x<RetType> { fn x(self , rsthis: & QGraphicsItem) -> RetType; } // proto: qreal QGraphicsItem::x(); impl<'a> /*trait*/ QGraphicsItem_x<f64> for () { fn x(self , rsthis: & QGraphicsItem) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem1xEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem1xEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: void QGraphicsItem::grabMouse(); impl /*struct*/ QGraphicsItem { pub fn grabMouse<RetType, T: QGraphicsItem_grabMouse<RetType>>(& self, overload_args: T) -> RetType { return overload_args.grabMouse(self); // return 1; } } pub trait QGraphicsItem_grabMouse<RetType> { fn grabMouse(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::grabMouse(); impl<'a> /*trait*/ QGraphicsItem_grabMouse<()> for () { fn grabMouse(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem9grabMouseEv()}; unsafe {C_ZN13QGraphicsItem9grabMouseEv(rsthis.qclsinst)}; // return 1; } } // proto: void QGraphicsItem::setVisible(bool visible); impl /*struct*/ QGraphicsItem { pub fn setVisible<RetType, T: QGraphicsItem_setVisible<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setVisible(self); // return 1; } } pub trait QGraphicsItem_setVisible<RetType> { fn setVisible(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setVisible(bool visible); impl<'a> /*trait*/ QGraphicsItem_setVisible<()> for (i8) { fn setVisible(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem10setVisibleEb()}; let arg0 = self as c_char; unsafe {C_ZN13QGraphicsItem10setVisibleEb(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QGraphicsItem::setRotation(qreal angle); impl /*struct*/ QGraphicsItem { pub fn setRotation<RetType, T: QGraphicsItem_setRotation<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setRotation(self); // return 1; } } pub trait QGraphicsItem_setRotation<RetType> { fn setRotation(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setRotation(qreal angle); impl<'a> /*trait*/ QGraphicsItem_setRotation<()> for (f64) { fn setRotation(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem11setRotationEd()}; let arg0 = self as c_double; unsafe {C_ZN13QGraphicsItem11setRotationEd(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QTransform QGraphicsItem::deviceTransform(const QTransform & viewportTransform); impl /*struct*/ QGraphicsItem { pub fn deviceTransform<RetType, T: QGraphicsItem_deviceTransform<RetType>>(& self, overload_args: T) -> RetType { return overload_args.deviceTransform(self); // return 1; } } pub trait QGraphicsItem_deviceTransform<RetType> { fn deviceTransform(self , rsthis: & QGraphicsItem) -> RetType; } // proto: QTransform QGraphicsItem::deviceTransform(const QTransform & viewportTransform); impl<'a> /*trait*/ QGraphicsItem_deviceTransform<QTransform> for (&'a QTransform) { fn deviceTransform(self , rsthis: & QGraphicsItem) -> QTransform { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem15deviceTransformERK10QTransform()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem15deviceTransformERK10QTransform(rsthis.qclsinst, arg0)}; let mut ret1 = QTransform::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsItem::acceptTouchEvents(); impl /*struct*/ QGraphicsItem { pub fn acceptTouchEvents<RetType, T: QGraphicsItem_acceptTouchEvents<RetType>>(& self, overload_args: T) -> RetType { return overload_args.acceptTouchEvents(self); // return 1; } } pub trait QGraphicsItem_acceptTouchEvents<RetType> { fn acceptTouchEvents(self , rsthis: & QGraphicsItem) -> RetType; } // proto: bool QGraphicsItem::acceptTouchEvents(); impl<'a> /*trait*/ QGraphicsItem_acceptTouchEvents<i8> for () { fn acceptTouchEvents(self , rsthis: & QGraphicsItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem17acceptTouchEventsEv()}; let mut ret = unsafe {C_ZNK13QGraphicsItem17acceptTouchEventsEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: void QGraphicsItem::setTransform(const QTransform & matrix, bool combine); impl /*struct*/ QGraphicsItem { pub fn setTransform<RetType, T: QGraphicsItem_setTransform<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setTransform(self); // return 1; } } pub trait QGraphicsItem_setTransform<RetType> { fn setTransform(self , rsthis: & QGraphicsItem) -> RetType; } // proto: void QGraphicsItem::setTransform(const QTransform & matrix, bool combine); impl<'a> /*trait*/ QGraphicsItem_setTransform<()> for (&'a QTransform, Option<i8>) { fn setTransform(self , rsthis: & QGraphicsItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN13QGraphicsItem12setTransformERK10QTransformb()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {false as i8} else {self.1.unwrap()}) as c_char; unsafe {C_ZN13QGraphicsItem12setTransformERK10QTransformb(rsthis.qclsinst, arg0, arg1)}; // return 1; } } // proto: QPolygonF QGraphicsItem::mapToParent(const QRectF & rect); impl<'a> /*trait*/ QGraphicsItem_mapToParent<QPolygonF> for (&'a QRectF) { fn mapToParent(self , rsthis: & QGraphicsItem) -> QPolygonF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK13QGraphicsItem11mapToParentERK6QRectF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK13QGraphicsItem11mapToParentERK6QRectF(rsthis.qclsinst, arg0)}; let mut ret1 = QPolygonF::inheritFrom(ret as u64); return ret1; // return 1; } } impl /*struct*/ QGraphicsObject { pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QGraphicsObject { return QGraphicsObject{qbase: QObject::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; } } impl Deref for QGraphicsObject { type Target = QObject; fn deref(&self) -> &QObject { return & self.qbase; } } impl AsRef<QObject> for QGraphicsObject { fn as_ref(& self) -> & QObject { return & self.qbase; } } // proto: void QGraphicsObject::QGraphicsObject(QGraphicsItem * parent); impl /*struct*/ QGraphicsObject { pub fn new<T: QGraphicsObject_new>(value: T) -> QGraphicsObject { let rsthis = value.new(); return rsthis; // return 1; } } pub trait QGraphicsObject_new { fn new(self) -> QGraphicsObject; } // proto: void QGraphicsObject::QGraphicsObject(QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsObject_new for (Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsObject { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN15QGraphicsObjectC2EP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsObject_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN15QGraphicsObjectC2EP13QGraphicsItem(arg0)}; let rsthis = QGraphicsObject{qbase: QObject::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: void QGraphicsObject::~QGraphicsObject(); impl /*struct*/ QGraphicsObject { pub fn free<RetType, T: QGraphicsObject_free<RetType>>(& self, overload_args: T) -> RetType { return overload_args.free(self); // return 1; } } pub trait QGraphicsObject_free<RetType> { fn free(self , rsthis: & QGraphicsObject) -> RetType; } // proto: void QGraphicsObject::~QGraphicsObject(); impl<'a> /*trait*/ QGraphicsObject_free<()> for () { fn free(self , rsthis: & QGraphicsObject) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN15QGraphicsObjectD2Ev()}; unsafe {C_ZN15QGraphicsObjectD2Ev(rsthis.qclsinst)}; // return 1; } } // proto: const QMetaObject * QGraphicsObject::metaObject(); impl /*struct*/ QGraphicsObject { pub fn metaObject<RetType, T: QGraphicsObject_metaObject<RetType>>(& self, overload_args: T) -> RetType { return overload_args.metaObject(self); // return 1; } } pub trait QGraphicsObject_metaObject<RetType> { fn metaObject(self , rsthis: & QGraphicsObject) -> RetType; } // proto: const QMetaObject * QGraphicsObject::metaObject(); impl<'a> /*trait*/ QGraphicsObject_metaObject<QMetaObject> for () { fn metaObject(self , rsthis: & QGraphicsObject) -> QMetaObject { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK15QGraphicsObject10metaObjectEv()}; let mut ret = unsafe {C_ZNK15QGraphicsObject10metaObjectEv(rsthis.qclsinst)}; let mut ret1 = QMetaObject::inheritFrom(ret as u64); return ret1; // return 1; } } impl /*struct*/ QGraphicsSimpleTextItem { pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QGraphicsSimpleTextItem { return QGraphicsSimpleTextItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; } } impl Deref for QGraphicsSimpleTextItem { type Target = QAbstractGraphicsShapeItem; fn deref(&self) -> &QAbstractGraphicsShapeItem { return & self.qbase; } } impl AsRef<QAbstractGraphicsShapeItem> for QGraphicsSimpleTextItem { fn as_ref(& self) -> & QAbstractGraphicsShapeItem { return & self.qbase; } } // proto: int QGraphicsSimpleTextItem::type(); impl /*struct*/ QGraphicsSimpleTextItem { pub fn type_<RetType, T: QGraphicsSimpleTextItem_type_<RetType>>(& self, overload_args: T) -> RetType { return overload_args.type_(self); // return 1; } } pub trait QGraphicsSimpleTextItem_type_<RetType> { fn type_(self , rsthis: & QGraphicsSimpleTextItem) -> RetType; } // proto: int QGraphicsSimpleTextItem::type(); impl<'a> /*trait*/ QGraphicsSimpleTextItem_type_<i32> for () { fn type_(self , rsthis: & QGraphicsSimpleTextItem) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK23QGraphicsSimpleTextItem4typeEv()}; let mut ret = unsafe {C_ZNK23QGraphicsSimpleTextItem4typeEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: QFont QGraphicsSimpleTextItem::font(); impl /*struct*/ QGraphicsSimpleTextItem { pub fn font<RetType, T: QGraphicsSimpleTextItem_font<RetType>>(& self, overload_args: T) -> RetType { return overload_args.font(self); // return 1; } } pub trait QGraphicsSimpleTextItem_font<RetType> { fn font(self , rsthis: & QGraphicsSimpleTextItem) -> RetType; } // proto: QFont QGraphicsSimpleTextItem::font(); impl<'a> /*trait*/ QGraphicsSimpleTextItem_font<QFont> for () { fn font(self , rsthis: & QGraphicsSimpleTextItem) -> QFont { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK23QGraphicsSimpleTextItem4fontEv()}; let mut ret = unsafe {C_ZNK23QGraphicsSimpleTextItem4fontEv(rsthis.qclsinst)}; let mut ret1 = QFont::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsSimpleTextItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl /*struct*/ QGraphicsSimpleTextItem { pub fn paint<RetType, T: QGraphicsSimpleTextItem_paint<RetType>>(& self, overload_args: T) -> RetType { return overload_args.paint(self); // return 1; } } pub trait QGraphicsSimpleTextItem_paint<RetType> { fn paint(self , rsthis: & QGraphicsSimpleTextItem) -> RetType; } // proto: void QGraphicsSimpleTextItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); impl<'a> /*trait*/ QGraphicsSimpleTextItem_paint<()> for (&'a QPainter, &'a QStyleOptionGraphicsItem, &'a QWidget) { fn paint(self , rsthis: & QGraphicsSimpleTextItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN23QGraphicsSimpleTextItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; let arg2 = self.2.qclsinst as *mut c_void; unsafe {C_ZN23QGraphicsSimpleTextItem5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget(rsthis.qclsinst, arg0, arg1, arg2)}; // return 1; } } // proto: void QGraphicsSimpleTextItem::~QGraphicsSimpleTextItem(); impl /*struct*/ QGraphicsSimpleTextItem { pub fn free<RetType, T: QGraphicsSimpleTextItem_free<RetType>>(& self, overload_args: T) -> RetType { return overload_args.free(self); // return 1; } } pub trait QGraphicsSimpleTextItem_free<RetType> { fn free(self , rsthis: & QGraphicsSimpleTextItem) -> RetType; } // proto: void QGraphicsSimpleTextItem::~QGraphicsSimpleTextItem(); impl<'a> /*trait*/ QGraphicsSimpleTextItem_free<()> for () { fn free(self , rsthis: & QGraphicsSimpleTextItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN23QGraphicsSimpleTextItemD2Ev()}; unsafe {C_ZN23QGraphicsSimpleTextItemD2Ev(rsthis.qclsinst)}; // return 1; } } // proto: void QGraphicsSimpleTextItem::setText(const QString & text); impl /*struct*/ QGraphicsSimpleTextItem { pub fn setText<RetType, T: QGraphicsSimpleTextItem_setText<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setText(self); // return 1; } } pub trait QGraphicsSimpleTextItem_setText<RetType> { fn setText(self , rsthis: & QGraphicsSimpleTextItem) -> RetType; } // proto: void QGraphicsSimpleTextItem::setText(const QString & text); impl<'a> /*trait*/ QGraphicsSimpleTextItem_setText<()> for (&'a QString) { fn setText(self , rsthis: & QGraphicsSimpleTextItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN23QGraphicsSimpleTextItem7setTextERK7QString()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN23QGraphicsSimpleTextItem7setTextERK7QString(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QString QGraphicsSimpleTextItem::text(); impl /*struct*/ QGraphicsSimpleTextItem { pub fn text<RetType, T: QGraphicsSimpleTextItem_text<RetType>>(& self, overload_args: T) -> RetType { return overload_args.text(self); // return 1; } } pub trait QGraphicsSimpleTextItem_text<RetType> { fn text(self , rsthis: & QGraphicsSimpleTextItem) -> RetType; } // proto: QString QGraphicsSimpleTextItem::text(); impl<'a> /*trait*/ QGraphicsSimpleTextItem_text<QString> for () { fn text(self , rsthis: & QGraphicsSimpleTextItem) -> QString { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK23QGraphicsSimpleTextItem4textEv()}; let mut ret = unsafe {C_ZNK23QGraphicsSimpleTextItem4textEv(rsthis.qclsinst)}; let mut ret1 = QString::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsSimpleTextItem::QGraphicsSimpleTextItem(const QString & text, QGraphicsItem * parent); impl /*struct*/ QGraphicsSimpleTextItem { pub fn new<T: QGraphicsSimpleTextItem_new>(value: T) -> QGraphicsSimpleTextItem { let rsthis = value.new(); return rsthis; // return 1; } } pub trait QGraphicsSimpleTextItem_new { fn new(self) -> QGraphicsSimpleTextItem; } // proto: void QGraphicsSimpleTextItem::QGraphicsSimpleTextItem(const QString & text, QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsSimpleTextItem_new for (&'a QString, Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsSimpleTextItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN23QGraphicsSimpleTextItemC2ERK7QStringP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsSimpleTextItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {0} else {self.1.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN23QGraphicsSimpleTextItemC2ERK7QStringP13QGraphicsItem(arg0, arg1)}; let rsthis = QGraphicsSimpleTextItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: bool QGraphicsSimpleTextItem::isObscuredBy(const QGraphicsItem * item); impl /*struct*/ QGraphicsSimpleTextItem { pub fn isObscuredBy<RetType, T: QGraphicsSimpleTextItem_isObscuredBy<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isObscuredBy(self); // return 1; } } pub trait QGraphicsSimpleTextItem_isObscuredBy<RetType> { fn isObscuredBy(self , rsthis: & QGraphicsSimpleTextItem) -> RetType; } // proto: bool QGraphicsSimpleTextItem::isObscuredBy(const QGraphicsItem * item); impl<'a> /*trait*/ QGraphicsSimpleTextItem_isObscuredBy<i8> for (&'a QGraphicsItem) { fn isObscuredBy(self , rsthis: & QGraphicsSimpleTextItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK23QGraphicsSimpleTextItem12isObscuredByEPK13QGraphicsItem()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK23QGraphicsSimpleTextItem12isObscuredByEPK13QGraphicsItem(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: QPainterPath QGraphicsSimpleTextItem::shape(); impl /*struct*/ QGraphicsSimpleTextItem { pub fn shape<RetType, T: QGraphicsSimpleTextItem_shape<RetType>>(& self, overload_args: T) -> RetType { return overload_args.shape(self); // return 1; } } pub trait QGraphicsSimpleTextItem_shape<RetType> { fn shape(self , rsthis: & QGraphicsSimpleTextItem) -> RetType; } // proto: QPainterPath QGraphicsSimpleTextItem::shape(); impl<'a> /*trait*/ QGraphicsSimpleTextItem_shape<QPainterPath> for () { fn shape(self , rsthis: & QGraphicsSimpleTextItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK23QGraphicsSimpleTextItem5shapeEv()}; let mut ret = unsafe {C_ZNK23QGraphicsSimpleTextItem5shapeEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QGraphicsSimpleTextItem::QGraphicsSimpleTextItem(QGraphicsItem * parent); impl<'a> /*trait*/ QGraphicsSimpleTextItem_new for (Option<&'a QGraphicsItem>) { fn new(self) -> QGraphicsSimpleTextItem { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN23QGraphicsSimpleTextItemC2EP13QGraphicsItem()}; let ctysz: c_int = unsafe{QGraphicsSimpleTextItem_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void; let qthis: u64 = unsafe {C_ZN23QGraphicsSimpleTextItemC2EP13QGraphicsItem(arg0)}; let rsthis = QGraphicsSimpleTextItem{qbase: QAbstractGraphicsShapeItem::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: void QGraphicsSimpleTextItem::setFont(const QFont & font); impl /*struct*/ QGraphicsSimpleTextItem { pub fn setFont<RetType, T: QGraphicsSimpleTextItem_setFont<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setFont(self); // return 1; } } pub trait QGraphicsSimpleTextItem_setFont<RetType> { fn setFont(self , rsthis: & QGraphicsSimpleTextItem) -> RetType; } // proto: void QGraphicsSimpleTextItem::setFont(const QFont & font); impl<'a> /*trait*/ QGraphicsSimpleTextItem_setFont<()> for (&'a QFont) { fn setFont(self , rsthis: & QGraphicsSimpleTextItem) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN23QGraphicsSimpleTextItem7setFontERK5QFont()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN23QGraphicsSimpleTextItem7setFontERK5QFont(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QPainterPath QGraphicsSimpleTextItem::opaqueArea(); impl /*struct*/ QGraphicsSimpleTextItem { pub fn opaqueArea<RetType, T: QGraphicsSimpleTextItem_opaqueArea<RetType>>(& self, overload_args: T) -> RetType { return overload_args.opaqueArea(self); // return 1; } } pub trait QGraphicsSimpleTextItem_opaqueArea<RetType> { fn opaqueArea(self , rsthis: & QGraphicsSimpleTextItem) -> RetType; } // proto: QPainterPath QGraphicsSimpleTextItem::opaqueArea(); impl<'a> /*trait*/ QGraphicsSimpleTextItem_opaqueArea<QPainterPath> for () { fn opaqueArea(self , rsthis: & QGraphicsSimpleTextItem) -> QPainterPath { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK23QGraphicsSimpleTextItem10opaqueAreaEv()}; let mut ret = unsafe {C_ZNK23QGraphicsSimpleTextItem10opaqueAreaEv(rsthis.qclsinst)}; let mut ret1 = QPainterPath::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QRectF QGraphicsSimpleTextItem::boundingRect(); impl /*struct*/ QGraphicsSimpleTextItem { pub fn boundingRect<RetType, T: QGraphicsSimpleTextItem_boundingRect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.boundingRect(self); // return 1; } } pub trait QGraphicsSimpleTextItem_boundingRect<RetType> { fn boundingRect(self , rsthis: & QGraphicsSimpleTextItem) -> RetType; } // proto: QRectF QGraphicsSimpleTextItem::boundingRect(); impl<'a> /*trait*/ QGraphicsSimpleTextItem_boundingRect<QRectF> for () { fn boundingRect(self , rsthis: & QGraphicsSimpleTextItem) -> QRectF { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK23QGraphicsSimpleTextItem12boundingRectEv()}; let mut ret = unsafe {C_ZNK23QGraphicsSimpleTextItem12boundingRectEv(rsthis.qclsinst)}; let mut ret1 = QRectF::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QGraphicsSimpleTextItem::contains(const QPointF & point); impl /*struct*/ QGraphicsSimpleTextItem { pub fn contains<RetType, T: QGraphicsSimpleTextItem_contains<RetType>>(& self, overload_args: T) -> RetType { return overload_args.contains(self); // return 1; } } pub trait QGraphicsSimpleTextItem_contains<RetType> { fn contains(self , rsthis: & QGraphicsSimpleTextItem) -> RetType; } // proto: bool QGraphicsSimpleTextItem::contains(const QPointF & point); impl<'a> /*trait*/ QGraphicsSimpleTextItem_contains<i8> for (&'a QPointF) { fn contains(self , rsthis: & QGraphicsSimpleTextItem) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK23QGraphicsSimpleTextItem8containsERK7QPointF()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK23QGraphicsSimpleTextItem8containsERK7QPointF(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } #[derive(Default)] // for QGraphicsTextItem_linkActivated pub struct QGraphicsTextItem_linkActivated_signal{poi:u64} impl /* struct */ QGraphicsTextItem { pub fn linkActivated(&self) -> QGraphicsTextItem_linkActivated_signal { return QGraphicsTextItem_linkActivated_signal{poi:self.qclsinst}; } } impl /* struct */ QGraphicsTextItem_linkActivated_signal { pub fn connect<T: QGraphicsTextItem_linkActivated_signal_connect>(self, overload_args: T) { overload_args.connect(self); } } pub trait QGraphicsTextItem_linkActivated_signal_connect { fn connect(self, sigthis: QGraphicsTextItem_linkActivated_signal); } #[derive(Default)] // for QGraphicsTextItem_linkHovered pub struct QGraphicsTextItem_linkHovered_signal{poi:u64} impl /* struct */ QGraphicsTextItem { pub fn linkHovered(&self) -> QGraphicsTextItem_linkHovered_signal { return QGraphicsTextItem_linkHovered_signal{poi:self.qclsinst}; } } impl /* struct */ QGraphicsTextItem_linkHovered_signal { pub fn connect<T: QGraphicsTextItem_linkHovered_signal_connect>(self, overload_args: T) { overload_args.connect(self); } } pub trait QGraphicsTextItem_linkHovered_signal_connect { fn connect(self, sigthis: QGraphicsTextItem_linkHovered_signal); } // linkHovered(const class QString &) extern fn QGraphicsTextItem_linkHovered_signal_connect_cb_0(rsfptr:fn(QString), arg0: *mut c_void) { println!("{}:{}", file!(), line!()); let rsarg0 = QString::inheritFrom(arg0 as u64); rsfptr(rsarg0); } extern fn QGraphicsTextItem_linkHovered_signal_connect_cb_box_0(rsfptr_raw:*mut Box<Fn(QString)>, arg0: *mut c_void) { println!("{}:{}", file!(), line!()); let rsfptr = unsafe{Box::from_raw(rsfptr_raw)}; let rsarg0 = QString::inheritFrom(arg0 as u64); // rsfptr(rsarg0); unsafe{(*rsfptr_raw)(rsarg0)}; } impl /* trait */ QGraphicsTextItem_linkHovered_signal_connect for fn(QString) { fn connect(self, sigthis: QGraphicsTextItem_linkHovered_signal) { // do smth... // self as u64; // error for Fn, Ok for fn self as *mut c_void as u64; self as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsTextItem_linkHovered_signal_connect_cb_0 as *mut c_void; let arg2 = self as *mut c_void; unsafe {QGraphicsTextItem_SlotProxy_connect__ZN17QGraphicsTextItem11linkHoveredERK7QString(arg0, arg1, arg2)}; } } impl /* trait */ QGraphicsTextItem_linkHovered_signal_connect for Box<Fn(QString)> { fn connect(self, sigthis: QGraphicsTextItem_linkHovered_signal) { // do smth... // Box::into_raw(self) as u64; // Box::into_raw(self) as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsTextItem_linkHovered_signal_connect_cb_box_0 as *mut c_void; let arg2 = Box::into_raw(Box::new(self)) as *mut c_void; unsafe {QGraphicsTextItem_SlotProxy_connect__ZN17QGraphicsTextItem11linkHoveredERK7QString(arg0, arg1, arg2)}; } } // linkActivated(const class QString &) extern fn QGraphicsTextItem_linkActivated_signal_connect_cb_1(rsfptr:fn(QString), arg0: *mut c_void) { println!("{}:{}", file!(), line!()); let rsarg0 = QString::inheritFrom(arg0 as u64); rsfptr(rsarg0); } extern fn QGraphicsTextItem_linkActivated_signal_connect_cb_box_1(rsfptr_raw:*mut Box<Fn(QString)>, arg0: *mut c_void) { println!("{}:{}", file!(), line!()); let rsfptr = unsafe{Box::from_raw(rsfptr_raw)}; let rsarg0 = QString::inheritFrom(arg0 as u64); // rsfptr(rsarg0); unsafe{(*rsfptr_raw)(rsarg0)}; } impl /* trait */ QGraphicsTextItem_linkActivated_signal_connect for fn(QString) { fn connect(self, sigthis: QGraphicsTextItem_linkActivated_signal) { // do smth... // self as u64; // error for Fn, Ok for fn self as *mut c_void as u64; self as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsTextItem_linkActivated_signal_connect_cb_1 as *mut c_void; let arg2 = self as *mut c_void; unsafe {QGraphicsTextItem_SlotProxy_connect__ZN17QGraphicsTextItem13linkActivatedERK7QString(arg0, arg1, arg2)}; } } impl /* trait */ QGraphicsTextItem_linkActivated_signal_connect for Box<Fn(QString)> { fn connect(self, sigthis: QGraphicsTextItem_linkActivated_signal) { // do smth... // Box::into_raw(self) as u64; // Box::into_raw(self) as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsTextItem_linkActivated_signal_connect_cb_box_1 as *mut c_void; let arg2 = Box::into_raw(Box::new(self)) as *mut c_void; unsafe {QGraphicsTextItem_SlotProxy_connect__ZN17QGraphicsTextItem13linkActivatedERK7QString(arg0, arg1, arg2)}; } } #[derive(Default)] // for QGraphicsObject_childrenChanged pub struct QGraphicsObject_childrenChanged_signal{poi:u64} impl /* struct */ QGraphicsObject { pub fn childrenChanged(&self) -> QGraphicsObject_childrenChanged_signal { return QGraphicsObject_childrenChanged_signal{poi:self.qclsinst}; } } impl /* struct */ QGraphicsObject_childrenChanged_signal { pub fn connect<T: QGraphicsObject_childrenChanged_signal_connect>(self, overload_args: T) { overload_args.connect(self); } } pub trait QGraphicsObject_childrenChanged_signal_connect { fn connect(self, sigthis: QGraphicsObject_childrenChanged_signal); } #[derive(Default)] // for QGraphicsObject_parentChanged pub struct QGraphicsObject_parentChanged_signal{poi:u64} impl /* struct */ QGraphicsObject { pub fn parentChanged(&self) -> QGraphicsObject_parentChanged_signal { return QGraphicsObject_parentChanged_signal{poi:self.qclsinst}; } } impl /* struct */ QGraphicsObject_parentChanged_signal { pub fn connect<T: QGraphicsObject_parentChanged_signal_connect>(self, overload_args: T) { overload_args.connect(self); } } pub trait QGraphicsObject_parentChanged_signal_connect { fn connect(self, sigthis: QGraphicsObject_parentChanged_signal); } #[derive(Default)] // for QGraphicsObject_heightChanged pub struct QGraphicsObject_heightChanged_signal{poi:u64} impl /* struct */ QGraphicsObject { pub fn heightChanged(&self) -> QGraphicsObject_heightChanged_signal { return QGraphicsObject_heightChanged_signal{poi:self.qclsinst}; } } impl /* struct */ QGraphicsObject_heightChanged_signal { pub fn connect<T: QGraphicsObject_heightChanged_signal_connect>(self, overload_args: T) { overload_args.connect(self); } } pub trait QGraphicsObject_heightChanged_signal_connect { fn connect(self, sigthis: QGraphicsObject_heightChanged_signal); } #[derive(Default)] // for QGraphicsObject_zChanged pub struct QGraphicsObject_zChanged_signal{poi:u64} impl /* struct */ QGraphicsObject { pub fn zChanged(&self) -> QGraphicsObject_zChanged_signal { return QGraphicsObject_zChanged_signal{poi:self.qclsinst}; } } impl /* struct */ QGraphicsObject_zChanged_signal { pub fn connect<T: QGraphicsObject_zChanged_signal_connect>(self, overload_args: T) { overload_args.connect(self); } } pub trait QGraphicsObject_zChanged_signal_connect { fn connect(self, sigthis: QGraphicsObject_zChanged_signal); } #[derive(Default)] // for QGraphicsObject_visibleChanged pub struct QGraphicsObject_visibleChanged_signal{poi:u64} impl /* struct */ QGraphicsObject { pub fn visibleChanged(&self) -> QGraphicsObject_visibleChanged_signal { return QGraphicsObject_visibleChanged_signal{poi:self.qclsinst}; } } impl /* struct */ QGraphicsObject_visibleChanged_signal { pub fn connect<T: QGraphicsObject_visibleChanged_signal_connect>(self, overload_args: T) { overload_args.connect(self); } } pub trait QGraphicsObject_visibleChanged_signal_connect { fn connect(self, sigthis: QGraphicsObject_visibleChanged_signal); } #[derive(Default)] // for QGraphicsObject_yChanged pub struct QGraphicsObject_yChanged_signal{poi:u64} impl /* struct */ QGraphicsObject { pub fn yChanged(&self) -> QGraphicsObject_yChanged_signal { return QGraphicsObject_yChanged_signal{poi:self.qclsinst}; } } impl /* struct */ QGraphicsObject_yChanged_signal { pub fn connect<T: QGraphicsObject_yChanged_signal_connect>(self, overload_args: T) { overload_args.connect(self); } } pub trait QGraphicsObject_yChanged_signal_connect { fn connect(self, sigthis: QGraphicsObject_yChanged_signal); } #[derive(Default)] // for QGraphicsObject_widthChanged pub struct QGraphicsObject_widthChanged_signal{poi:u64} impl /* struct */ QGraphicsObject { pub fn widthChanged(&self) -> QGraphicsObject_widthChanged_signal { return QGraphicsObject_widthChanged_signal{poi:self.qclsinst}; } } impl /* struct */ QGraphicsObject_widthChanged_signal { pub fn connect<T: QGraphicsObject_widthChanged_signal_connect>(self, overload_args: T) { overload_args.connect(self); } } pub trait QGraphicsObject_widthChanged_signal_connect { fn connect(self, sigthis: QGraphicsObject_widthChanged_signal); } #[derive(Default)] // for QGraphicsObject_opacityChanged pub struct QGraphicsObject_opacityChanged_signal{poi:u64} impl /* struct */ QGraphicsObject { pub fn opacityChanged(&self) -> QGraphicsObject_opacityChanged_signal { return QGraphicsObject_opacityChanged_signal{poi:self.qclsinst}; } } impl /* struct */ QGraphicsObject_opacityChanged_signal { pub fn connect<T: QGraphicsObject_opacityChanged_signal_connect>(self, overload_args: T) { overload_args.connect(self); } } pub trait QGraphicsObject_opacityChanged_signal_connect { fn connect(self, sigthis: QGraphicsObject_opacityChanged_signal); } #[derive(Default)] // for QGraphicsObject_rotationChanged pub struct QGraphicsObject_rotationChanged_signal{poi:u64} impl /* struct */ QGraphicsObject { pub fn rotationChanged(&self) -> QGraphicsObject_rotationChanged_signal { return QGraphicsObject_rotationChanged_signal{poi:self.qclsinst}; } } impl /* struct */ QGraphicsObject_rotationChanged_signal { pub fn connect<T: QGraphicsObject_rotationChanged_signal_connect>(self, overload_args: T) { overload_args.connect(self); } } pub trait QGraphicsObject_rotationChanged_signal_connect { fn connect(self, sigthis: QGraphicsObject_rotationChanged_signal); } #[derive(Default)] // for QGraphicsObject_enabledChanged pub struct QGraphicsObject_enabledChanged_signal{poi:u64} impl /* struct */ QGraphicsObject { pub fn enabledChanged(&self) -> QGraphicsObject_enabledChanged_signal { return QGraphicsObject_enabledChanged_signal{poi:self.qclsinst}; } } impl /* struct */ QGraphicsObject_enabledChanged_signal { pub fn connect<T: QGraphicsObject_enabledChanged_signal_connect>(self, overload_args: T) { overload_args.connect(self); } } pub trait QGraphicsObject_enabledChanged_signal_connect { fn connect(self, sigthis: QGraphicsObject_enabledChanged_signal); } #[derive(Default)] // for QGraphicsObject_xChanged pub struct QGraphicsObject_xChanged_signal{poi:u64} impl /* struct */ QGraphicsObject { pub fn xChanged(&self) -> QGraphicsObject_xChanged_signal { return QGraphicsObject_xChanged_signal{poi:self.qclsinst}; } } impl /* struct */ QGraphicsObject_xChanged_signal { pub fn connect<T: QGraphicsObject_xChanged_signal_connect>(self, overload_args: T) { overload_args.connect(self); } } pub trait QGraphicsObject_xChanged_signal_connect { fn connect(self, sigthis: QGraphicsObject_xChanged_signal); } #[derive(Default)] // for QGraphicsObject_scaleChanged pub struct QGraphicsObject_scaleChanged_signal{poi:u64} impl /* struct */ QGraphicsObject { pub fn scaleChanged(&self) -> QGraphicsObject_scaleChanged_signal { return QGraphicsObject_scaleChanged_signal{poi:self.qclsinst}; } } impl /* struct */ QGraphicsObject_scaleChanged_signal { pub fn connect<T: QGraphicsObject_scaleChanged_signal_connect>(self, overload_args: T) { overload_args.connect(self); } } pub trait QGraphicsObject_scaleChanged_signal_connect { fn connect(self, sigthis: QGraphicsObject_scaleChanged_signal); } // yChanged() extern fn QGraphicsObject_yChanged_signal_connect_cb_0(rsfptr:fn(), ) { println!("{}:{}", file!(), line!()); rsfptr(); } extern fn QGraphicsObject_yChanged_signal_connect_cb_box_0(rsfptr_raw:*mut Box<Fn()>, ) { println!("{}:{}", file!(), line!()); let rsfptr = unsafe{Box::from_raw(rsfptr_raw)}; // rsfptr(); unsafe{(*rsfptr_raw)()}; } impl /* trait */ QGraphicsObject_yChanged_signal_connect for fn() { fn connect(self, sigthis: QGraphicsObject_yChanged_signal) { // do smth... // self as u64; // error for Fn, Ok for fn self as *mut c_void as u64; self as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_yChanged_signal_connect_cb_0 as *mut c_void; let arg2 = self as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject8yChangedEv(arg0, arg1, arg2)}; } } impl /* trait */ QGraphicsObject_yChanged_signal_connect for Box<Fn()> { fn connect(self, sigthis: QGraphicsObject_yChanged_signal) { // do smth... // Box::into_raw(self) as u64; // Box::into_raw(self) as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_yChanged_signal_connect_cb_box_0 as *mut c_void; let arg2 = Box::into_raw(Box::new(self)) as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject8yChangedEv(arg0, arg1, arg2)}; } } // opacityChanged() extern fn QGraphicsObject_opacityChanged_signal_connect_cb_1(rsfptr:fn(), ) { println!("{}:{}", file!(), line!()); rsfptr(); } extern fn QGraphicsObject_opacityChanged_signal_connect_cb_box_1(rsfptr_raw:*mut Box<Fn()>, ) { println!("{}:{}", file!(), line!()); let rsfptr = unsafe{Box::from_raw(rsfptr_raw)}; // rsfptr(); unsafe{(*rsfptr_raw)()}; } impl /* trait */ QGraphicsObject_opacityChanged_signal_connect for fn() { fn connect(self, sigthis: QGraphicsObject_opacityChanged_signal) { // do smth... // self as u64; // error for Fn, Ok for fn self as *mut c_void as u64; self as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_opacityChanged_signal_connect_cb_1 as *mut c_void; let arg2 = self as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject14opacityChangedEv(arg0, arg1, arg2)}; } } impl /* trait */ QGraphicsObject_opacityChanged_signal_connect for Box<Fn()> { fn connect(self, sigthis: QGraphicsObject_opacityChanged_signal) { // do smth... // Box::into_raw(self) as u64; // Box::into_raw(self) as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_opacityChanged_signal_connect_cb_box_1 as *mut c_void; let arg2 = Box::into_raw(Box::new(self)) as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject14opacityChangedEv(arg0, arg1, arg2)}; } } // visibleChanged() extern fn QGraphicsObject_visibleChanged_signal_connect_cb_2(rsfptr:fn(), ) { println!("{}:{}", file!(), line!()); rsfptr(); } extern fn QGraphicsObject_visibleChanged_signal_connect_cb_box_2(rsfptr_raw:*mut Box<Fn()>, ) { println!("{}:{}", file!(), line!()); let rsfptr = unsafe{Box::from_raw(rsfptr_raw)}; // rsfptr(); unsafe{(*rsfptr_raw)()}; } impl /* trait */ QGraphicsObject_visibleChanged_signal_connect for fn() { fn connect(self, sigthis: QGraphicsObject_visibleChanged_signal) { // do smth... // self as u64; // error for Fn, Ok for fn self as *mut c_void as u64; self as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_visibleChanged_signal_connect_cb_2 as *mut c_void; let arg2 = self as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject14visibleChangedEv(arg0, arg1, arg2)}; } } impl /* trait */ QGraphicsObject_visibleChanged_signal_connect for Box<Fn()> { fn connect(self, sigthis: QGraphicsObject_visibleChanged_signal) { // do smth... // Box::into_raw(self) as u64; // Box::into_raw(self) as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_visibleChanged_signal_connect_cb_box_2 as *mut c_void; let arg2 = Box::into_raw(Box::new(self)) as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject14visibleChangedEv(arg0, arg1, arg2)}; } } // childrenChanged() extern fn QGraphicsObject_childrenChanged_signal_connect_cb_3(rsfptr:fn(), ) { println!("{}:{}", file!(), line!()); rsfptr(); } extern fn QGraphicsObject_childrenChanged_signal_connect_cb_box_3(rsfptr_raw:*mut Box<Fn()>, ) { println!("{}:{}", file!(), line!()); let rsfptr = unsafe{Box::from_raw(rsfptr_raw)}; // rsfptr(); unsafe{(*rsfptr_raw)()}; } impl /* trait */ QGraphicsObject_childrenChanged_signal_connect for fn() { fn connect(self, sigthis: QGraphicsObject_childrenChanged_signal) { // do smth... // self as u64; // error for Fn, Ok for fn self as *mut c_void as u64; self as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_childrenChanged_signal_connect_cb_3 as *mut c_void; let arg2 = self as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject15childrenChangedEv(arg0, arg1, arg2)}; } } impl /* trait */ QGraphicsObject_childrenChanged_signal_connect for Box<Fn()> { fn connect(self, sigthis: QGraphicsObject_childrenChanged_signal) { // do smth... // Box::into_raw(self) as u64; // Box::into_raw(self) as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_childrenChanged_signal_connect_cb_box_3 as *mut c_void; let arg2 = Box::into_raw(Box::new(self)) as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject15childrenChangedEv(arg0, arg1, arg2)}; } } // zChanged() extern fn QGraphicsObject_zChanged_signal_connect_cb_4(rsfptr:fn(), ) { println!("{}:{}", file!(), line!()); rsfptr(); } extern fn QGraphicsObject_zChanged_signal_connect_cb_box_4(rsfptr_raw:*mut Box<Fn()>, ) { println!("{}:{}", file!(), line!()); let rsfptr = unsafe{Box::from_raw(rsfptr_raw)}; // rsfptr(); unsafe{(*rsfptr_raw)()}; } impl /* trait */ QGraphicsObject_zChanged_signal_connect for fn() { fn connect(self, sigthis: QGraphicsObject_zChanged_signal) { // do smth... // self as u64; // error for Fn, Ok for fn self as *mut c_void as u64; self as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_zChanged_signal_connect_cb_4 as *mut c_void; let arg2 = self as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject8zChangedEv(arg0, arg1, arg2)}; } } impl /* trait */ QGraphicsObject_zChanged_signal_connect for Box<Fn()> { fn connect(self, sigthis: QGraphicsObject_zChanged_signal) { // do smth... // Box::into_raw(self) as u64; // Box::into_raw(self) as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_zChanged_signal_connect_cb_box_4 as *mut c_void; let arg2 = Box::into_raw(Box::new(self)) as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject8zChangedEv(arg0, arg1, arg2)}; } } // widthChanged() extern fn QGraphicsObject_widthChanged_signal_connect_cb_5(rsfptr:fn(), ) { println!("{}:{}", file!(), line!()); rsfptr(); } extern fn QGraphicsObject_widthChanged_signal_connect_cb_box_5(rsfptr_raw:*mut Box<Fn()>, ) { println!("{}:{}", file!(), line!()); let rsfptr = unsafe{Box::from_raw(rsfptr_raw)}; // rsfptr(); unsafe{(*rsfptr_raw)()}; } impl /* trait */ QGraphicsObject_widthChanged_signal_connect for fn() { fn connect(self, sigthis: QGraphicsObject_widthChanged_signal) { // do smth... // self as u64; // error for Fn, Ok for fn self as *mut c_void as u64; self as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_widthChanged_signal_connect_cb_5 as *mut c_void; let arg2 = self as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject12widthChangedEv(arg0, arg1, arg2)}; } } impl /* trait */ QGraphicsObject_widthChanged_signal_connect for Box<Fn()> { fn connect(self, sigthis: QGraphicsObject_widthChanged_signal) { // do smth... // Box::into_raw(self) as u64; // Box::into_raw(self) as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_widthChanged_signal_connect_cb_box_5 as *mut c_void; let arg2 = Box::into_raw(Box::new(self)) as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject12widthChangedEv(arg0, arg1, arg2)}; } } // rotationChanged() extern fn QGraphicsObject_rotationChanged_signal_connect_cb_6(rsfptr:fn(), ) { println!("{}:{}", file!(), line!()); rsfptr(); } extern fn QGraphicsObject_rotationChanged_signal_connect_cb_box_6(rsfptr_raw:*mut Box<Fn()>, ) { println!("{}:{}", file!(), line!()); let rsfptr = unsafe{Box::from_raw(rsfptr_raw)}; // rsfptr(); unsafe{(*rsfptr_raw)()}; } impl /* trait */ QGraphicsObject_rotationChanged_signal_connect for fn() { fn connect(self, sigthis: QGraphicsObject_rotationChanged_signal) { // do smth... // self as u64; // error for Fn, Ok for fn self as *mut c_void as u64; self as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_rotationChanged_signal_connect_cb_6 as *mut c_void; let arg2 = self as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject15rotationChangedEv(arg0, arg1, arg2)}; } } impl /* trait */ QGraphicsObject_rotationChanged_signal_connect for Box<Fn()> { fn connect(self, sigthis: QGraphicsObject_rotationChanged_signal) { // do smth... // Box::into_raw(self) as u64; // Box::into_raw(self) as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_rotationChanged_signal_connect_cb_box_6 as *mut c_void; let arg2 = Box::into_raw(Box::new(self)) as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject15rotationChangedEv(arg0, arg1, arg2)}; } } // enabledChanged() extern fn QGraphicsObject_enabledChanged_signal_connect_cb_7(rsfptr:fn(), ) { println!("{}:{}", file!(), line!()); rsfptr(); } extern fn QGraphicsObject_enabledChanged_signal_connect_cb_box_7(rsfptr_raw:*mut Box<Fn()>, ) { println!("{}:{}", file!(), line!()); let rsfptr = unsafe{Box::from_raw(rsfptr_raw)}; // rsfptr(); unsafe{(*rsfptr_raw)()}; } impl /* trait */ QGraphicsObject_enabledChanged_signal_connect for fn() { fn connect(self, sigthis: QGraphicsObject_enabledChanged_signal) { // do smth... // self as u64; // error for Fn, Ok for fn self as *mut c_void as u64; self as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_enabledChanged_signal_connect_cb_7 as *mut c_void; let arg2 = self as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject14enabledChangedEv(arg0, arg1, arg2)}; } } impl /* trait */ QGraphicsObject_enabledChanged_signal_connect for Box<Fn()> { fn connect(self, sigthis: QGraphicsObject_enabledChanged_signal) { // do smth... // Box::into_raw(self) as u64; // Box::into_raw(self) as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_enabledChanged_signal_connect_cb_box_7 as *mut c_void; let arg2 = Box::into_raw(Box::new(self)) as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject14enabledChangedEv(arg0, arg1, arg2)}; } } // scaleChanged() extern fn QGraphicsObject_scaleChanged_signal_connect_cb_8(rsfptr:fn(), ) { println!("{}:{}", file!(), line!()); rsfptr(); } extern fn QGraphicsObject_scaleChanged_signal_connect_cb_box_8(rsfptr_raw:*mut Box<Fn()>, ) { println!("{}:{}", file!(), line!()); let rsfptr = unsafe{Box::from_raw(rsfptr_raw)}; // rsfptr(); unsafe{(*rsfptr_raw)()}; } impl /* trait */ QGraphicsObject_scaleChanged_signal_connect for fn() { fn connect(self, sigthis: QGraphicsObject_scaleChanged_signal) { // do smth... // self as u64; // error for Fn, Ok for fn self as *mut c_void as u64; self as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_scaleChanged_signal_connect_cb_8 as *mut c_void; let arg2 = self as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject12scaleChangedEv(arg0, arg1, arg2)}; } } impl /* trait */ QGraphicsObject_scaleChanged_signal_connect for Box<Fn()> { fn connect(self, sigthis: QGraphicsObject_scaleChanged_signal) { // do smth... // Box::into_raw(self) as u64; // Box::into_raw(self) as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_scaleChanged_signal_connect_cb_box_8 as *mut c_void; let arg2 = Box::into_raw(Box::new(self)) as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject12scaleChangedEv(arg0, arg1, arg2)}; } } // heightChanged() extern fn QGraphicsObject_heightChanged_signal_connect_cb_9(rsfptr:fn(), ) { println!("{}:{}", file!(), line!()); rsfptr(); } extern fn QGraphicsObject_heightChanged_signal_connect_cb_box_9(rsfptr_raw:*mut Box<Fn()>, ) { println!("{}:{}", file!(), line!()); let rsfptr = unsafe{Box::from_raw(rsfptr_raw)}; // rsfptr(); unsafe{(*rsfptr_raw)()}; } impl /* trait */ QGraphicsObject_heightChanged_signal_connect for fn() { fn connect(self, sigthis: QGraphicsObject_heightChanged_signal) { // do smth... // self as u64; // error for Fn, Ok for fn self as *mut c_void as u64; self as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_heightChanged_signal_connect_cb_9 as *mut c_void; let arg2 = self as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject13heightChangedEv(arg0, arg1, arg2)}; } } impl /* trait */ QGraphicsObject_heightChanged_signal_connect for Box<Fn()> { fn connect(self, sigthis: QGraphicsObject_heightChanged_signal) { // do smth... // Box::into_raw(self) as u64; // Box::into_raw(self) as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_heightChanged_signal_connect_cb_box_9 as *mut c_void; let arg2 = Box::into_raw(Box::new(self)) as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject13heightChangedEv(arg0, arg1, arg2)}; } } // parentChanged() extern fn QGraphicsObject_parentChanged_signal_connect_cb_10(rsfptr:fn(), ) { println!("{}:{}", file!(), line!()); rsfptr(); } extern fn QGraphicsObject_parentChanged_signal_connect_cb_box_10(rsfptr_raw:*mut Box<Fn()>, ) { println!("{}:{}", file!(), line!()); let rsfptr = unsafe{Box::from_raw(rsfptr_raw)}; // rsfptr(); unsafe{(*rsfptr_raw)()}; } impl /* trait */ QGraphicsObject_parentChanged_signal_connect for fn() { fn connect(self, sigthis: QGraphicsObject_parentChanged_signal) { // do smth... // self as u64; // error for Fn, Ok for fn self as *mut c_void as u64; self as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_parentChanged_signal_connect_cb_10 as *mut c_void; let arg2 = self as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject13parentChangedEv(arg0, arg1, arg2)}; } } impl /* trait */ QGraphicsObject_parentChanged_signal_connect for Box<Fn()> { fn connect(self, sigthis: QGraphicsObject_parentChanged_signal) { // do smth... // Box::into_raw(self) as u64; // Box::into_raw(self) as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_parentChanged_signal_connect_cb_box_10 as *mut c_void; let arg2 = Box::into_raw(Box::new(self)) as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject13parentChangedEv(arg0, arg1, arg2)}; } } // xChanged() extern fn QGraphicsObject_xChanged_signal_connect_cb_11(rsfptr:fn(), ) { println!("{}:{}", file!(), line!()); rsfptr(); } extern fn QGraphicsObject_xChanged_signal_connect_cb_box_11(rsfptr_raw:*mut Box<Fn()>, ) { println!("{}:{}", file!(), line!()); let rsfptr = unsafe{Box::from_raw(rsfptr_raw)}; // rsfptr(); unsafe{(*rsfptr_raw)()}; } impl /* trait */ QGraphicsObject_xChanged_signal_connect for fn() { fn connect(self, sigthis: QGraphicsObject_xChanged_signal) { // do smth... // self as u64; // error for Fn, Ok for fn self as *mut c_void as u64; self as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_xChanged_signal_connect_cb_11 as *mut c_void; let arg2 = self as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject8xChangedEv(arg0, arg1, arg2)}; } } impl /* trait */ QGraphicsObject_xChanged_signal_connect for Box<Fn()> { fn connect(self, sigthis: QGraphicsObject_xChanged_signal) { // do smth... // Box::into_raw(self) as u64; // Box::into_raw(self) as *mut c_void; let arg0 = sigthis.poi as *mut c_void; let arg1 = QGraphicsObject_xChanged_signal_connect_cb_box_11 as *mut c_void; let arg2 = Box::into_raw(Box::new(self)) as *mut c_void; unsafe {QGraphicsObject_SlotProxy_connect__ZN15QGraphicsObject8xChangedEv(arg0, arg1, arg2)}; } } // <= body block end
use clap::App; mod config; mod lib; fn main() { let _matches = App::new("cale") .version("0.1") .subcommand(App::new("now").about("shows current activity")) .subcommand(App::new("today").about("shows today plan")) .get_matches(); if let Some(_matches) = _matches.subcommand_matches("now") { lib::now(String::from(config::PATH)).unwrap(); } if let Some(_matches) = _matches.subcommand_matches("today") { lib::today(String::from(config::PATH)).unwrap(); } }
use winapi::um::winuser::{WS_VISIBLE, WS_DISABLED, WS_TABSTOP, WS_EX_CONTROLPARENT}; use std::cell::RefCell; use std::rc::Rc; use crate::win32::window_helper as wh; use crate::win32::base_helper::check_hwnd; use crate::{NwgError, Font, RawEventHandler, bind_raw_event_handler_inner, unbind_raw_event_handler}; use super::{ControlBase, ControlHandle, TextInput, Button, ButtonFlags, TextInputFlags}; const NOT_BOUND: &'static str = "UpDown is not yet bound to a winapi object"; const BAD_HANDLE: &'static str = "INTERNAL ERROR: UpDown handle is not HWND!"; bitflags! { /** The NumberSelect flags * NONE: No flags. Equivalent to a invisible blank NumberSelect. * VISIBLE: The NumberSelect is immediatly visible after creation * DISABLED: The NumberSelect cannot be interacted with by the user. It also has a grayed out look. * TAB_STOP: The control can be selected using tab navigation. */ pub struct NumberSelectFlags: u32 { const NONE = 0; const VISIBLE = WS_VISIBLE; const DISABLED = WS_DISABLED; const TAB_STOP = WS_TABSTOP; } } /// The value inside a number select and the limits of that value #[derive(Copy, Clone, Debug)] pub enum NumberSelectData { Int { value: i64, step: i64, max: i64, min: i64 }, Float { value: f64, step: f64, max: f64, min: f64, decimals: u8 }, } impl NumberSelectData { pub fn formatted_value(&self) -> String { match self { NumberSelectData::Int{ value, ..} => format!("{}", value), NumberSelectData::Float{ value, decimals, ..} => format!("{:.*}", *decimals as usize, value), } } pub fn decrease(&mut self) { match self { NumberSelectData::Int{ value, step, min, ..} => { *value -= *step; *value = i64::max(*value, *min); }, NumberSelectData::Float{ value, step, min, ..} => { *value -= *step; *value = f64::max(*value, *min); } } } pub fn increase(&mut self) { match self { NumberSelectData::Int{ value, step, max, ..} => { *value += *step; *value = i64::min(*value, *max); }, NumberSelectData::Float{ value, step, max, ..} => { *value += *step; *value = f64::min(*value, *max); } } } } impl Default for NumberSelectData { fn default() -> NumberSelectData { NumberSelectData::Int { value: 0, step: 1, max: i64::max_value(), min: i64::min_value(), } } } /** A NumberSelect control is a pair of arrow buttons that the user can click to increment or decrement a value. NumberSelect is implemented as a custom control because the one provided by winapi really sucks. Requires the `number-select` feature. **Builder parameters:** * `parent`: **Required.** The number select parent container. * `value`: The default value of the number select * `size`: The number select size. * `position`: The number select position. * `enabled`: If the number select can be used by the user. It also has a grayed out look if disabled. * `flags`: A combination of the NumberSelectFlags values. * `font`: The font used for the number select text **Control events:** * `MousePress(_)`: Generic mouse press events on the button * `OnMouseMove`: Generic mouse mouse event ```rust use native_windows_gui as nwg; fn build_number_select(num_select: &mut nwg::NumberSelect, window: &nwg::Window, font: &nwg::Font) { nwg::NumberSelect::builder() .font(Some(font)) .parent(window) .build(num_select); } ``` */ #[derive(Default)] pub struct NumberSelect { pub handle: ControlHandle, data: Rc<RefCell<NumberSelectData>>, edit: TextInput, btn_up: Button, btn_down: Button, handler: Option<RawEventHandler> } impl NumberSelect { pub fn builder<'a>() -> NumberSelectBuilder<'a> { NumberSelectBuilder { size: (100, 25), position: (0, 0), data: NumberSelectData::default(), enabled: true, flags: None, font: None, parent: None } } /// Returns inner data specifying the possible input of a number select /// See [NumberSelectData](enum.NumberSelectData.html) for the possible values pub fn data(&self) -> NumberSelectData { self.data.borrow().clone() } /// Sets the inner data specifying the possible input of a number select. Also update the value display. /// See [NumberSelectData](enum.NumberSelectData.html) for the possible values pub fn set_data(&self, v: NumberSelectData) { *self.data.borrow_mut() = v; self.edit.set_text(&v.formatted_value()); } /// Returns the font of the control pub fn font(&self) -> Option<Font> { let handle = check_hwnd(&self.handle, NOT_BOUND, BAD_HANDLE); let font_handle = wh::get_window_font(handle); if font_handle.is_null() { None } else { Some(Font { handle: font_handle }) } } /// Sets the font of the control pub fn set_font(&self, font: Option<&Font>) { let handle = check_hwnd(&self.handle, NOT_BOUND, BAD_HANDLE); unsafe { wh::set_window_font(handle, font.map(|f| f.handle), true); } } /// Returns true if the control currently has the keyboard focus pub fn focus(&self) -> bool { let handle = check_hwnd(&self.handle, NOT_BOUND, BAD_HANDLE); unsafe { wh::get_focus(handle) } } /// Sets the keyboard focus on the button. pub fn set_focus(&self) { let handle = check_hwnd(&self.handle, NOT_BOUND, BAD_HANDLE); unsafe { wh::set_focus(handle); } } /// Returns true if the control user can interact with the control, return false otherwise pub fn enabled(&self) -> bool { let handle = check_hwnd(&self.handle, NOT_BOUND, BAD_HANDLE); unsafe { wh::get_window_enabled(handle) } } /// Enable or disable the control pub fn set_enabled(&self, v: bool) { let handle = check_hwnd(&self.handle, NOT_BOUND, BAD_HANDLE); unsafe { wh::set_window_enabled(handle, v) } } /// Returns true if the control is visible to the user. Will return true even if the /// control is outside of the parent client view (ex: at the position (10000, 10000)) pub fn visible(&self) -> bool { let handle = check_hwnd(&self.handle, NOT_BOUND, BAD_HANDLE); unsafe { wh::get_window_visibility(handle) } } /// Show or hide the control to the user pub fn set_visible(&self, v: bool) { let handle = check_hwnd(&self.handle, NOT_BOUND, BAD_HANDLE); unsafe { wh::set_window_visibility(handle, v) } } /// Returns the size of the control in the parent window pub fn size(&self) -> (u32, u32) { let handle = check_hwnd(&self.handle, NOT_BOUND, BAD_HANDLE); unsafe { wh::get_window_size(handle) } } /// Sets the size of the control in the parent window pub fn set_size(&self, x: u32, y: u32) { let handle = check_hwnd(&self.handle, NOT_BOUND, BAD_HANDLE); unsafe { wh::set_window_size(handle, x, y, false) } } /// Returns the position of the control in the parent window pub fn position(&self) -> (i32, i32) { let handle = check_hwnd(&self.handle, NOT_BOUND, BAD_HANDLE); unsafe { wh::get_window_position(handle) } } /// Sets the position of the control in the parent window pub fn set_position(&self, x: i32, y: i32) { let handle = check_hwnd(&self.handle, NOT_BOUND, BAD_HANDLE); unsafe { wh::set_window_position(handle, x, y) } } /// Winapi class name used during control creation pub fn class_name(&self) -> &'static str { "NativeWindowsGuiWindow" } /// Winapi base flags used during window creation pub fn flags(&self) -> u32 { ::winapi::um::winuser::WS_VISIBLE } /// Winapi flags required by the control pub fn forced_flags(&self) -> u32 { use winapi::um::winuser::{WS_BORDER, WS_CHILD, WS_CLIPCHILDREN}; WS_CHILD | WS_BORDER | WS_CLIPCHILDREN } } impl Drop for NumberSelect { fn drop(&mut self) { if let Some(h) = self.handler.as_ref() { drop(unbind_raw_event_handler(h)); } self.handle.destroy(); } } pub struct NumberSelectBuilder<'a> { size: (i32, i32), position: (i32, i32), data: NumberSelectData, enabled: bool, flags: Option<NumberSelectFlags>, font: Option<&'a Font>, parent: Option<ControlHandle> } impl<'a> NumberSelectBuilder<'a> { pub fn flags(mut self, flags: NumberSelectFlags) -> NumberSelectBuilder<'a> { self.flags = Some(flags); self } pub fn size(mut self, size: (i32, i32)) -> NumberSelectBuilder<'a> { self.size = size; self } pub fn position(mut self, pos: (i32, i32)) -> NumberSelectBuilder<'a> { self.position = pos; self } pub fn enabled(mut self, e: bool) -> NumberSelectBuilder<'a> { self.enabled = e; self } pub fn font(mut self, font: Option<&'a Font>) -> NumberSelectBuilder<'a> { self.font = font; self } // Int values pub fn value_int(mut self, v: i64) -> NumberSelectBuilder<'a> { match &mut self.data { NumberSelectData::Int { value, .. } => { *value = v; } data => *data = NumberSelectData::Int { value: v, step: 1, max: i64::max_value(), min: i64::min_value() } } self } pub fn step_int(mut self, v: i64) -> NumberSelectBuilder<'a> { match &mut self.data { NumberSelectData::Int { step, .. } => { *step = v; } data => *data = NumberSelectData::Int { value: 0, step: v, max: i64::max_value(), min: i64::min_value() } } self } pub fn max_int(mut self, v: i64) -> NumberSelectBuilder<'a> { match &mut self.data { NumberSelectData::Int { max, .. } => { *max = v; } data => *data = NumberSelectData::Int { value: 0, step: 1, max: v, min: i64::min_value() } } self } pub fn min_int(mut self, v: i64) -> NumberSelectBuilder<'a> { match &mut self.data { NumberSelectData::Int { min, .. } => { *min = v; } data => *data = NumberSelectData::Int { value: 0, step: 1, max: i64::max_value(), min: v } } self } // Float values pub fn value_float(mut self, v: f64) -> NumberSelectBuilder<'a> { match &mut self.data { NumberSelectData::Float { value, .. } => { *value = v; } data => *data = NumberSelectData::Float { value: v, step: 1.0, max: 1000000.0, min: -1000000.0, decimals: 2 } } self } pub fn step_float(mut self, v: f64) -> NumberSelectBuilder<'a> { match &mut self.data { NumberSelectData::Float { step, .. } => { *step = v; } data => *data = NumberSelectData::Float { value: 0.0, step: v, max: 1000000.0, min: -1000000.0, decimals: 2 } } self } pub fn max_float(mut self, v: f64) -> NumberSelectBuilder<'a> { match &mut self.data { NumberSelectData::Float { max, .. } => { *max = v; } data => *data = NumberSelectData::Float { value: 0.0, step: 1.0, max: v, min: -1000000.0, decimals: 2 } } self } pub fn min_float(mut self, v: f64) -> NumberSelectBuilder<'a> { match &mut self.data { NumberSelectData::Float { min, .. } => { *min = v; } data => *data = NumberSelectData::Float { value: 0.0, step: 1.0, max: 1000000.0, min: v, decimals: 2 } } self } pub fn decimals(mut self, v: u8) -> NumberSelectBuilder<'a> { match &mut self.data { NumberSelectData::Float { decimals, .. } => { *decimals = v; } data => *data = NumberSelectData::Float { value: 0.0, step: 1.0, max: 1000000.0, min: -1000000.0, decimals: v } } self } pub fn parent<C: Into<ControlHandle>>(mut self, p: C) -> NumberSelectBuilder<'a> { self.parent = Some(p.into()); self } pub fn build(self, out: &mut NumberSelect) -> Result<(), NwgError> { let flags = self.flags.map(|f| f.bits()).unwrap_or(out.flags()); let (btn_flags, text_flags) = if flags & WS_TABSTOP == WS_TABSTOP { (ButtonFlags::VISIBLE | ButtonFlags::TAB_STOP, TextInputFlags::VISIBLE | TextInputFlags::TAB_STOP) } else { (ButtonFlags::VISIBLE, TextInputFlags::VISIBLE) }; let parent = match self.parent { Some(p) => Ok(p), None => Err(NwgError::no_parent("NumberSelect")) }?; *out = Default::default(); let (w, h) = self.size; if out.handler.is_some() { unbind_raw_event_handler(out.handler.as_ref().unwrap())?; } *out = NumberSelect::default(); *out.data.borrow_mut() = self.data; out.handle = ControlBase::build_hwnd() .class_name(out.class_name()) .forced_flags(out.forced_flags()) .ex_flags(WS_EX_CONTROLPARENT) .flags(flags) .size(self.size) .position(self.position) .parent(Some(parent)) .build()?; TextInput::builder() .text(&self.data.formatted_value()) .size((w-19, h)) .parent(&out.handle) .flags(text_flags) .build(&mut out.edit)?; Button::builder() .text("+") .size((20, h/2+1)) .position((w-20, -1)) .parent(&out.handle) .flags(btn_flags) .build(&mut out.btn_up)?; Button::builder() .text("-") .size((20, h/2+1)) .position((w-20, (h/2)-1)) .parent(&out.handle) .flags(btn_flags) .build(&mut out.btn_down)?; if self.font.is_some() { out.btn_up.set_font(self.font); out.btn_down.set_font(self.font); out.edit.set_font(self.font); } else { let font = Font::global_default(); let font_ref = font.as_ref(); out.btn_up.set_font(font_ref); out.btn_down.set_font(font_ref); out.edit.set_font(font_ref); } let handler_data = out.data.clone(); let plus_button = out.btn_up.handle.clone(); let minus_button = out.btn_down.handle.clone(); let text_handle = out.edit.handle.clone(); let handler = bind_raw_event_handler_inner(&out.handle, 0x4545, move |_hwnd, msg, w, l| { use winapi::shared::windef::HWND; use winapi::um::winuser::{WM_COMMAND, BN_CLICKED}; use winapi::shared::minwindef::HIWORD; match msg { WM_COMMAND => { let handle = ControlHandle::Hwnd(l as HWND); let message = HIWORD(w as u32) as u16; if message == BN_CLICKED && handle == plus_button { let mut data = handler_data.borrow_mut(); data.increase(); let handle = text_handle.hwnd().unwrap(); let text = data.formatted_value(); unsafe { wh::set_window_text(handle, &text); } } else if message == BN_CLICKED && handle == minus_button { let mut data = handler_data.borrow_mut(); data.decrease(); let handle = text_handle.hwnd().unwrap(); let text = data.formatted_value(); unsafe { wh::set_window_text(handle, &text); } } }, _ => {} } None }); out.handler = Some(handler.unwrap()); if !self.enabled { out.set_enabled(self.enabled); } Ok(()) } }
use std::collections::HashMap; use crate::lexer::{self, LexValue, Lexer}; use crate::{Result, Error}; macro_rules! gimme { ($x:expr) => { match $x { Ok(e) => e, Err(e) => return Err(e), }; }; } #[derive(Debug, Clone)] pub(crate) enum BinaryOps { Assign, Add, Sub, Mul, Div, Equal, NEqual, Less, More, LessEqual, MoreEqual, } #[derive(Debug, Clone)] pub(crate) struct Binary { pub(crate) left: Expr, pub(crate) op: BinaryOps, pub(crate) right: Expr, } #[derive(Debug, Clone)] pub(crate) struct If { pub(crate) cond: Expr, pub(crate) then: Expr, pub(crate) els: Option<Expr>, } #[derive(Debug, Clone)] pub(crate) struct Block { pub(crate) statements: Vec<Expr> } #[derive(Debug, Clone)] pub(crate) struct Def { pub(crate) name: String, pub(crate) typ: Type, } #[derive(Debug, Clone)] pub(crate) struct Prototype { pub(crate) name: String, pub(crate) args: Vec<Def>, pub(crate) ty: Type, } #[derive(Debug, Clone)] pub(crate) struct Call { pub(crate) name: String, pub(crate) args: Vec<Expr>, } #[derive(Debug, Clone)] pub(crate) struct Function { pub(crate) proto: Prototype, pub(crate) body: Expr, } #[derive(Debug, Clone)] pub(crate) enum Expr { Binary(Box<Binary>), Variable(String), If(Box<If>), Number(isize), Block(Block), Def(Def), Call(Call), FnDef(Box<Function>), StructDef(StructDef), } #[derive(Debug, Clone)] pub(crate) struct StructDef { name: String, vals: Vec<Def>, } #[derive(Debug, Clone)] pub(crate) enum Type { I64, Struct(String), } #[derive(Debug, Clone)] pub(crate) struct Parser { lexer: lexer::Lexer, types: HashMap<String, Type>, } impl Parser { pub(crate) fn new(l: Lexer, t: HashMap<String, Type>) -> Parser { return Parser {lexer: l, types: t}; } fn parse_punc(&mut self, v: LexValue) -> Result<Expr> { match v.clone().get().as_bytes()[0] as char { '(' => { let e = self.parse_maybe(); if self.lexer.cont.as_bytes()[self.lexer.index] as char != ')' { Err(Error::new(format!("Expected a closing bracket to match that at {}", v.start), self.lexer.index)) } else { self.lexer.index+=1; e } } '{' => { let e = self.parse_block(); e } _ => Err(Error::new(String::from("Unexpected punctation literal"), v.start)), } } fn parse_if(&mut self) -> Result<Expr> { let cond = self.parse_maybe(); let cond = match cond { Ok(c) => c, Err(e) => return Err(e), }; let then = self.parse_maybe(); let then = match then { Ok(t) => t, Err(e) => return Err(e), }; let mut els = None; match self.lexer.clone().lex() { Ok(l) => { if l.get_val().get() == String::from("else") { self.lexer.lex().unwrap(); let e = self.parse_maybe(); let e = match e { Ok(e) => e, Err(e) => return Err(e), }; els = Some(e); } }, Err(_) => (), } let i = If {cond, then, els}; return Ok(Expr::If(Box::new(i))); } fn parse_block(&mut self) -> Result<Expr> { let mut statements = vec![]; let mut is_defs = true; loop { if let Ok(x) = self.lexer.clone().lex() { if x.get_val().get() == String::from("}") { self.lexer.lex().unwrap(); break; } let s = self.parse_maybe(); let s = gimme!(s); if !matches!(s, Expr::Def(_)) { is_defs = false; } statements.push(s); } else { let e = self.lexer.lex().unwrap_err(); return Err(e); } } if is_defs { if let Ok(Expr::Variable(x)) = self.clone().parse_maybe() { self.clone().parse_maybe().unwrap(); let mut defs = vec![]; for i in statements { if let Expr::Def(d) = i { defs.push(d); } else { panic!(); } } let d = StructDef { name: x.clone(), vals: defs, }; self.types.insert(x.clone(), Type::Struct(x)); return Ok(Expr::StructDef(d)); } } return Ok(Expr::Block(Block {statements})); } fn parse_fndef(&mut self, args: Vec<Expr>, v: LexValue) -> Result<Expr> { if let Ok(lexer::LexToken::Id(x)) = self.lexer.clone().lex() { self.lexer.lex().unwrap(); let ty = &self.types.get(&x.get()).unwrap().clone(); let body = self.parse_maybe(); let body = gimme!(body); let mut a = vec![]; for i in args { match i { Expr::Def(d) => a.push(d), x => return Err(Error::new(format!("Cannot use {:?} as a variable def within a function prototype", x), v.start)) } } let proto = Prototype { name: v.get(), args: a, ty: ty.clone()}; let f = Function { proto, body }; return Ok(Expr::FnDef(Box::new(f))); } else {panic!()} } fn parse_call(&mut self, v: LexValue) -> Result<Expr> { self.lexer.lex().unwrap(); let mut args = vec![]; loop { if let Ok(lexer::LexToken::Punc(x)) = self.lexer.clone().lex() { if x.get() == String::from(")") { self.lexer.lex().unwrap(); break; } } match self.parse_maybe() { Ok(p) => args.push(p), Err(e) => return Err(e), } } if let Ok(lexer::LexToken::Id(x)) = self.lexer.clone().lex() { if self.types.contains_key(&x.get()) { return self.parse_fndef(args, v)} } let p = Call {name: v.get(), args}; Ok(Expr::Call(p)) } fn parse_id(&mut self, v: LexValue) -> Result<Expr> { match &v.clone().get() as &str { "if" => self.parse_if(), x => { let peeked = self.lexer.clone().lex(); if let Ok(lexer::LexToken::Punc(x)) = &peeked { if x.get() == String::from("(") { return self.parse_call(v) } } if let Ok(lexer::LexToken::Id(_x)) = peeked {if self.types.contains_key(&_x.get()) { self.lexer.lex().unwrap(); let d = Def {name: x.to_string(), typ: self.types.get(&_x.get()).unwrap().clone()}; return Ok(Expr::Def(d)); } } Ok(Expr::Variable(x.to_string())) } } } fn maybe_binary(&mut self, e: Expr) -> Result<Expr> { if let Ok(lexer::LexToken::Op(o)) = self.lexer.clone().lex() { self.lexer.lex().unwrap(); let op = match &o.get() as &str { "+" => BinaryOps::Add, "-" => BinaryOps::Sub, "*" => BinaryOps::Mul, "/" => BinaryOps::Div, "==" => BinaryOps::Equal, "!=" => BinaryOps::NEqual, "<" => BinaryOps::Less, ">" => BinaryOps::More, "<="|"=<" => BinaryOps::LessEqual, ">="|"=>" => BinaryOps::MoreEqual, "=" => BinaryOps::Assign, _ => return Err(Error::new(format!("BUG: Unknown binary operator {}", o.get()), o.start)), }; let rhs = self.parse_maybe(); let rhs = match rhs { Ok(rhs) => rhs, Err(e) => return Err(e), }; let b = Binary {left: e, op: op, right: rhs}; return Ok(Expr::Binary(Box::new(b))); } return Ok(e); } fn parse_number(&mut self, n: LexValue) -> Result<Expr> { let s = n.get(); let num = s.parse::<isize>(); let num = match num { Ok(num) => num, Err(_) => return Err(Error {msg: format!("I can't parse {} as a number.", s), index: n.start}) }; return Ok(Expr::Number(num)); } pub(crate) fn parse_maybe(&mut self) -> Result<Expr> { let p = self.parse(); let p = match p { Ok(p) => p, Err(e) => return Err(e), }; let mb = self.maybe_binary(p); let mb = match mb { Ok(mb) => mb, Err(e) => return Err(e), }; return Ok(mb); } fn parse(&mut self) -> Result<Expr> { let l = self.lexer.lex(); let l = match l { Ok(l) => l, Err(e) => return Err(e), }; let e = match l { lexer::LexToken::Punc(p) => self.parse_punc(p), lexer::LexToken::Id(i) => self.parse_id(i), lexer::LexToken::Op(_) => todo!(), lexer::LexToken::Number(n) => self.parse_number(n), }; return e; } }
fn what_is_it<T>(x: T) { match x { 123 => println!("i32"), 123.0 => println!("f64"), } } fn main() { let x: Option<i32> = Some(5); match x { Some(x1) => println!("{}", x1), None => println!("nothing"), } what_is_it(5); what_is_it(5.55); }
use std; use std::path::PathBuf; use itertools::Itertools; use thiserror::Error; use firefly_diagnostics::*; use firefly_intern::Symbol; use firefly_parser::SourceError; use crate::lexer::{LexicalError, LexicalToken, TokenConvertError}; use crate::parser::ParserError; use super::directive::Directive; use super::directives::DirectiveError; use super::macros::{MacroCall, MacroDef, Stringify}; #[derive(Debug, Error)] pub enum PreprocessorError { #[error(transparent)] Lexical { #[from] source: LexicalError, }, #[error(transparent)] Source { #[from] source: SourceError, }, #[error("error occurred while including {path:?}")] IncludeError { source: std::io::Error, path: PathBuf, span: SourceSpan, }, #[error("unable to parse constant expression")] ParseError { span: SourceSpan, inner: Box<ParserError>, }, #[error("{reason}")] CompilerError { span: Option<SourceSpan>, reason: String, }, #[error("invalid constant expression found in preprocessor directive")] InvalidConstExpression { span: SourceSpan }, #[error(transparent)] EvalError { #[from] source: crate::evaluator::EvalError, }, #[error(transparent)] BadDirective { #[from] source: DirectiveError, }, #[error("invalid conditional expression")] InvalidConditional { span: SourceSpan }, #[error("call to builtin function failed")] BuiltinFailed { span: SourceSpan, source: Box<dyn std::error::Error + Send + Sync + 'static>, }, #[error("found orphaned '-end.' directive")] OrphanedEnd { directive: Directive }, #[error("found orphaned '-else.' directive")] OrphanedElse { directive: Directive }, #[error("undefined macro")] UndefinedStringifyMacro { call: Stringify }, #[error("undefined macro")] UndefinedMacro { call: MacroCall }, #[error("invalid macro invocation")] BadMacroCall { call: MacroCall, def: MacroDef, reason: String, }, #[error("{}", .diagnostic.message)] ShowDiagnostic { diagnostic: Diagnostic }, #[error("unexpected token")] InvalidTokenType { token: LexicalToken, expected: String, }, #[error("unexpected token")] UnexpectedToken { token: LexicalToken, expected: Vec<String>, }, #[error("unexpected eof")] UnexpectedEOF, #[error("warning directive: {message}")] WarningDirective { span: SourceSpan, message: Symbol, as_error: bool, }, } impl ToDiagnostic for PreprocessorError { fn to_diagnostic(&self) -> Diagnostic { //let span = self.span(); //let msg = self.to_string(); match self { PreprocessorError::Lexical { source } => source.to_diagnostic(), PreprocessorError::Source { source } => source.to_diagnostic(), PreprocessorError::IncludeError { span, .. } => { Diagnostic::error() .with_message(self.to_string()) .with_labels(vec![ Label::primary(span.source_id(), *span) .with_message("while processing include directive"), ]) }, PreprocessorError::ParseError { span, inner } => { let err = inner.to_diagnostic(); err.with_labels(vec![ Label::secondary(span.source_id(), *span) .with_message("parsing of this expression failed when attempting to evaluate it as a constant") ]) } PreprocessorError::CompilerError { span: Some(span), reason } => Diagnostic::error() .with_message("found error directive") .with_labels(vec![ Label::primary(span.source_id(), *span) .with_message(reason) ]), PreprocessorError::CompilerError { span: None, reason } => Diagnostic::error().with_message(reason), PreprocessorError::InvalidConstExpression { span, .. } => Diagnostic::error() .with_message(self.to_string()) .with_labels(vec![ Label::primary(span.source_id(), *span) .with_message("expected valid constant expression (example: `?OTP_VERSION >= 21`)") ]), PreprocessorError::EvalError { source } => source.to_diagnostic(), PreprocessorError::BadDirective { source } => source.to_diagnostic(), PreprocessorError::InvalidConditional { span, .. } => Diagnostic::error() .with_message(self.to_string()) .with_labels(vec![ Label::primary(span.source_id(), *span) .with_message("expected 'true', 'false', or an expression which can be evaluated to 'true' or 'false'") ]), PreprocessorError::BuiltinFailed { span, source } => Diagnostic::error() .with_message(self.to_string()) .with_labels(vec![ Label::primary(span.source_id(), *span) .with_message(source.to_string()) ]), PreprocessorError::OrphanedEnd { directive } => { let span = directive.span(); Diagnostic::error() .with_message(self.to_string()) .with_labels(vec![ Label::primary(span.source_id(), span) ]) } PreprocessorError::OrphanedElse { directive } => { let span = directive.span(); Diagnostic::error() .with_message(self.to_string()) .with_labels(vec![ Label::primary(span.source_id(), span) ]) } PreprocessorError::UndefinedStringifyMacro { call } => { let span = call.span(); Diagnostic::error() .with_message(self.to_string()) .with_labels(vec![ Label::primary(span.source_id(), span) ]) } PreprocessorError::UndefinedMacro { call } => { let span = call.span(); Diagnostic::error() .with_message(self.to_string()) .with_labels(vec![ Label::primary(span.source_id(), span) ]) } PreprocessorError::BadMacroCall { call, def: MacroDef::String(_), reason, .. } => { let span = call.span(); Diagnostic::error() .with_message(self.to_string()) .with_labels(vec![ Label::primary(span.source_id(), span) .with_message(reason.to_owned()) ]) } PreprocessorError::BadMacroCall { call, def, reason, .. } => { let secondary_span = match def { MacroDef::Static(ref define) => define.span(), MacroDef::Dynamic(ref tokens) => { assert!(tokens.len() > 0); SourceSpan::new( tokens[0].span().start(), tokens.last().unwrap().span().end() ) }, _ => unreachable!() }; let call_span = call.span(); Diagnostic::error() .with_message(self.to_string()) .with_labels(vec![ Label::primary(call_span.source_id(), call_span) .with_message("this macro call does not match its definition"), Label::secondary(secondary_span.source_id(), secondary_span) .with_message(reason.to_owned()) ]) } PreprocessorError::ShowDiagnostic { diagnostic } => diagnostic.clone(), PreprocessorError::InvalidTokenType { token, expected } => { let token_span = token.span(); Diagnostic::error() .with_message(self.to_string()) .with_labels(vec![ Label::primary(token_span.source_id(), token_span) .with_message(format!("expected \"{}\"", expected)) ]) } PreprocessorError::UnexpectedToken { token, expected } => { let token_span = token.span(); if expected.len() > 0 { let expected = expected.iter() .map(|t| format!("\"{}\"", t)) .join(", "); Diagnostic::error() .with_message(self.to_string()) .with_labels(vec![ Label::primary(token_span.source_id(), token_span) .with_message(format!("expected one of {}", expected)) ]) } else { Diagnostic::error() .with_message(self.to_string()) .with_labels(vec![ Label::primary(token_span.source_id(), token_span) ]) } } PreprocessorError::UnexpectedEOF => Diagnostic::error().with_message(self.to_string()), PreprocessorError::WarningDirective { span, message, as_error } => { let message_str = message.as_str().get(); if *as_error { Diagnostic::error() } else { Diagnostic::warning() } .with_message("found warning directive") .with_labels(vec![ Label::primary(span.source_id(), *span).with_message(message_str), ]) } } } } impl From<TokenConvertError> for PreprocessorError { fn from(err: TokenConvertError) -> PreprocessorError { let span = err.span; let token = LexicalToken(span.start(), err.token, span.end()); PreprocessorError::InvalidTokenType { token, expected: err.expected.to_string(), } } } impl From<Diagnostic> for PreprocessorError { fn from(diagnostic: Diagnostic) -> Self { PreprocessorError::ShowDiagnostic { diagnostic } } }
/// Asynchronously calls use std::sync::{Arc, Mutex}; use std::sync::mpsc::{sync_channel, Receiver, SyncSender, TryRecvError}; use std::thread; use common::scene::Scene; use common::simulation::LightSegment; use tracer::job::{Job, JobProducer}; /// Each `Tracer` runs on its own thread. The `Simulator` interacts with the Tracer /// object, which in turn interacts with the underlying thread. pub struct Tracer { stop_sender: SyncSender<bool>, } impl Tracer { /// Creates the tracer and starts running. pub fn new(job_producer_mutex: &Arc<Mutex<JobProducer>>) -> Tracer { let (stop_sender, stop_receiver) = sync_channel(1); // When stopping, block until the thread has quit. let tracer = Tracer { stop_sender: stop_sender, }; let job_producer_mutex_clone = job_producer_mutex.clone(); thread::spawn(move || { run_tracer(stop_receiver, job_producer_mutex_clone); }); return tracer; } /// Stops the tracer thread and destroys the object. Will block the calling thread until the /// thread has quit. pub fn stop(self) { self.stop_sender.send(true).unwrap(); } } /// Main tracer function, running on the tracer thread. fn run_tracer(stop_receiver: Receiver<bool>, job_producer_mutex: Arc<Mutex<JobProducer>>) { loop { // Check if the thread should exit. match stop_receiver.try_recv() { Result::Ok(_) => return, Result::Err(TryRecvError::Disconnected) => { panic!("Disconnected stop receiver. Maybe thread wasn't stopped?") } Result::Err(TryRecvError::Empty) => (), } let trace_job: Option<Job>; { trace_job = job_producer_mutex.lock().unwrap().take_job(); } match trace_job { // TODO: This would be more efficient if it used a condition variable to wait until // there was more to process. Option::None => continue, Option::Some(job) => { // TODO: Do the tracing and drawing } } } }
// Copyright 2020-2021, The Tremor Team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #![cfg(not(tarpaulin_include))] //! # UDP Offramp //! //! Sends each message as a udp datagram //! //! ## Configuration //! //! See [Config](struct.Config.html) for details. use std::time::Instant; use crate::sink::prelude::*; use async_std::net::UdpSocket; use halfbrown::HashMap; /// An offramp that write a given file pub struct Udp { socket: Option<UdpSocket>, config: Config, postprocessors: Postprocessors, } #[derive(Deserialize, Debug)] struct Host { host: String, port: u16, } impl Default for Host { fn default() -> Self { Self { host: String::from("0.0.0.0"), port: 0, } } } #[derive(Deserialize, Debug)] pub struct Config { /// Host to use as source host: String, port: u16, dst_host: Option<String>, dst_port: Option<u16>, #[serde(default = "Host::default")] bind: Host, #[serde(default = "t")] bound: bool, } fn t() -> bool { true } impl ConfigImpl for Config {} impl Udp { /// Binds and possibly 'connects' the udp socket async fn bind(&mut self) -> Result<()> { if self.socket.is_none() { info!( "[Sink::UDP] binding to {}:{} ...", self.config.bind.host, self.config.bind.port ); let socket = UdpSocket::bind((self.config.bind.host.as_str(), self.config.bind.port)).await?; info!("[Sink::UDP] bound."); if self.config.bound { info!( "[Sink::UDP] set peer address to {}:{} ...", self.config.host, self.config.port ); socket .connect((self.config.host.as_str(), self.config.port)) .await?; info!("[Sink::UDP] peer address set."); } self.socket = Some(socket); }; Ok(()) } } impl offramp::Impl for Udp { fn from_config(config: &Option<OpConfig>) -> Result<Box<dyn Offramp>> { if let Some(config) = config { let mut config: Config = Config::new(config)?; if !config.bound { warn!("The `bound` setting of the UDP offramp is deprecated, in future re-binding will only work over the $udp metadata"); } if let Some(dst_port) = config.dst_port.take() { warn!("The `dst_port` setting of the UDP offramp is deprecated, this will in future be `port` and current `port` will be `bind.port`."); config.bind.port = config.port; config.port = dst_port; } if let Some(dst_host) = config.dst_host.take() { warn!("The `dst_host` setting of the UDP offramp is deprecated, this will in future be `host` and current `host` will be `bind.host`."); config.bind.host = config.host; config.host = dst_host; } Ok(SinkManager::new_box(Self { socket: None, config, postprocessors: vec![], })) } else { Err("UDP offramp requires a config".into()) } } } impl Udp { /// serialize event and send each serialized packet async fn send_event(&mut self, codec: &mut dyn Codec, event: &Event) -> Result<()> { let socket = self .socket .as_ref() .ok_or_else(|| Error::from(ErrorKind::NoSocket))?; let ingest_ns = event.ingest_ns; for (value, meta) in event.value_meta_iter() { let raw = codec.encode(value)?; for processed in postprocess(&mut self.postprocessors, ingest_ns, raw)? { let udp = meta.get("udp"); if let Some((host, port)) = udp.get_str("host").zip(udp.get_u16("port")) { socket.send_to(&processed, (host, port)).await?; } else if self.config.bound { socket.send(&processed).await?; } else { warn!("using `bound` in the UDP sink config is deprecated please use $udp.host and $udp.port instead!"); // reaquire the destination to handle DNS changes or multi IP dns entries socket .send_to(&processed, (self.config.host.as_str(), self.config.port)) .await?; } } } Ok(()) } } #[async_trait::async_trait] impl Sink for Udp { #[allow(clippy::cast_possible_truncation)] async fn on_event( &mut self, _input: &str, codec: &mut dyn Codec, _codec_map: &HashMap<String, Box<dyn Codec>>, mut event: Event, ) -> ResultVec { let processing_start = Instant::now(); // TODO: how to properly report error metrics if we dont raise an error here? let replies = match self.send_event(codec, &event).await { Ok(()) => { // success if event.transactional { Some(vec![sink::Reply::Insight(event.insight_ack_with_timing( processing_start.elapsed().as_millis() as u64, ))]) } else { None } } // for UDP we only trigger CB if there is no socket available, as we can't recover from anything else Err(e @ Error(ErrorKind::NoSocket, _)) => { // trigger CB error!("[Sink::UDP] Error sending event: {}.", e); if event.transactional { Some(vec![ sink::Reply::Insight(event.to_fail()), sink::Reply::Insight(event.insight_trigger()), ]) } else { Some(vec![sink::Reply::Insight(event.insight_trigger())]) // we always send a trigger } } // all other errors (coded/preprocessor etc.) we just result in a fail Err(e) => { // regular error, no reason for CB error!("[Sink::UDP] Error sending event: {}", e); if event.transactional { Some(vec![sink::Reply::Insight(event.to_fail())]) } else { None } } }; Ok(replies) } fn default_codec(&self) -> &str { "json" } #[allow(clippy::too_many_arguments)] async fn init( &mut self, _sink_uid: u64, _sink_url: &TremorUrl, _codec: &dyn Codec, _codec_map: &HashMap<String, Box<dyn Codec>>, processors: Processors<'_>, _is_linked: bool, _reply_channel: Sender<sink::Reply>, ) -> Result<()> { self.postprocessors = make_postprocessors(processors.post)?; self.bind().await?; Ok(()) } async fn on_signal(&mut self, signal: Event) -> ResultVec { if self.socket.is_none() { self.bind().await?; Ok(Some(vec![sink::Reply::Insight(Event::cb_restore( signal.ingest_ns, ))])) } else { Ok(None) } } fn is_active(&self) -> bool { self.socket.is_some() } fn auto_ack(&self) -> bool { false } }
use crate::{ common::*, list::{Cons, List, Nil}, }; pub use base::*; pub use ops::*; mod base { use super::*; pub trait BitSet where Self: List, { } impl<B, Tail> BitSet for Cons<B, Tail> where B: Bit, Tail: BitSet, { } impl BitSet for Nil {} } mod ops { use super::*; typ! { pub fn Length<input>(input: BitSet) -> Unsigned { match input { #[generics(bit: Bit, tail: BitSet)] Cons::<bit, tail> => Length(tail) + 1u, Nil => 0u, } } pub fn BitSetAdd<lhs, rhs>(lhs: BitSet, rhs: BitSet) -> BitSet { BitSetAddRecursive(lhs, rhs, B0) } fn BitSetAddRecursive<lhs, rhs, carry>(lhs: BitSet, rhs: BitSet, carry: Bit) -> BitSet { match (lhs, rhs) { (Nil, Nil) => Nil, #[generics(lbit: Bit, ltail: BitSet, rbit: Bit, rtail: BitSet)] (Cons::<lbit, ltail>, Cons::<rbit, rtail>) => { let output: Bit = lbit.BitXor(rbit).BitXor(carry); let new_carry: Bit = lbit & rbit | lbit & carry | rbit & carry; let new_tail = BitSetAddRecursive(ltail, rtail, new_carry); Cons::<output, new_tail> } } } pub fn Truncate<input, len>(input: BitSet, len: Unsigned) -> BitSet { TruncateRecursive(input, input, len) } fn TruncateRecursive<saved, remaining, len>(saved: BitSet, remaining: BitSet, len: Unsigned) -> BitSet { if len == 0u { Reverse(saved) } else { match remaining { #[generics(bit: Bit, tail: BitSet)] Cons::<bit, tail> => { let new_saved = Cons::<bit, saved>; let new_remaining = tail; let new_len: Unsigned = len - 1u; TruncateRecursive(new_saved, new_remaining, new_len) } } } } pub fn Reverse<input>(input: BitSet) -> BitSet { ReverseRecursive(Nil, input) } fn ReverseRecursive<saved, remaining>(saved: BitSet, remaining: BitSet) -> BitSet { match remaining { #[generics(bit: Bit, tail: BitSet)] Cons::<bit, tail> => { let new_saved = Cons::<bit, saved>; let new_remaining = tail; ReverseRecursive(new_saved, new_remaining) } Nil => saved, } } } }
//! //! Channels lite //! pub mod channel_author; pub mod channel_subscriber; pub mod utils; use iota_streams::app::transport::tangle::client::SendTrytesOptions; /// /// Network Urls /// /// Pre-defined iota network urls /// pub enum Network { /// Main network /// Main, /// Dev network /// Devnet, /// Community network /// Comnet, /// Custom network URL /// /// Arguments: /// * Custome url /// * Min weight magnitude /// Custom(&'static str, u8), } impl Network { /// /// To string /// pub fn as_string(&self) -> &'static str { match self { Self::Custom(url, _) => url, Self::Main => "https://nodes.iota.cafe:443", Self::Comnet => "https://nodes.comnet.thetangle.org:443", Self::Devnet => "https://nodes.devnet.iota.org:443", } } /// /// Send Options /// pub fn send_options(&self) -> SendTrytesOptions { let mut send_opt = SendTrytesOptions::default(); match self { Self::Custom(_, mwm) => { send_opt.min_weight_magnitude = *mwm; send_opt.local_pow = false; } Self::Main => { send_opt.min_weight_magnitude = 14; send_opt.local_pow = false; } Self::Comnet => { send_opt.min_weight_magnitude = 10; send_opt.local_pow = false; } Self::Devnet => { send_opt.min_weight_magnitude = 9; send_opt.local_pow = false; } } send_opt } }
mod place; mod stmt; mod term; mod operand; mod value; mod cast; mod ratio; use crate::{FunctionCtx, Error}; use lowlang_syntax as syntax; use syntax::layout::TyLayout; use cranelift_module::{Backend, Module, Linkage, FuncId, DataId}; use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext}; use cranelift_codegen::ir::{AbiParam, Signature, ExternalName, InstBuilder}; use std::collections::BTreeMap; pub fn translate<'t, 'l, B: Backend>( mut module: Module<B>, layouts: &syntax::layout::LayoutCtx<'t, 'l>, package: &syntax::Package<'t> ) -> Result<B::Product, Error> { let mut func_ids = BTreeMap::new(); let mut data_ids = BTreeMap::new(); for (ext_id, ext) in &package.externs { match ext { syntax::Extern::Proc(name, sig) => { let sign = crate::pass::call_sig(&module, layouts, sig); let func = module.declare_function(name, Linkage::Import, &sign).unwrap(); let rets = sig.2.iter().map(|r| r.layout(layouts)).collect(); func_ids.insert(*ext_id, (func, sign, rets)); }, _ => unimplemented!(), } } for (glob_id, glob) in &package.globals { let data_id = module.declare_data( &glob.name, if glob.export { Linkage::Export } else { Linkage::Local }, true, Some(glob.ty.layout(layouts).details.align as u8) )?; let mut data_ctx = cranelift_module::DataContext::new(); if let Some(init) = &glob.init { data_ctx.define(init.clone()); } else { data_ctx.define_zeroinit(glob.ty.layout(layouts).details.size); } module.define_data(data_id, &data_ctx)?; data_ids.insert(*glob_id, (data_id, glob.ty.layout(layouts))); } for (body_id, body) in &package.bodies { let mut sig = module.make_signature(); for ret in body.rets() { match crate::pass::pass_mode(&module, ret.ty.layout(layouts)) { crate::pass::PassMode::NoPass => {}, crate::pass::PassMode::ByVal(ty) => sig.returns.push(AbiParam::new(ty)), crate::pass::PassMode::ByRef => sig.params.push(AbiParam::new(module.target_config().pointer_type())), } } for arg in body.args() { match crate::pass::pass_mode(&module, arg.ty.layout(layouts)) { crate::pass::PassMode::NoPass => {}, crate::pass::PassMode::ByVal(ty) => sig.params.push(AbiParam::new(ty)), crate::pass::PassMode::ByRef => sig.params.push(AbiParam::new(module.target_config().pointer_type())), } } let func = module.declare_function( &body.name, if body.export { Linkage::Export } else { Linkage::Local }, &sig, )?; let rets = body.rets().into_iter().map(|r| r.ty.layout(layouts)).collect(); func_ids.insert(*body_id, (func, sig, rets)); } let mut bytes_count = 0; for (body_id, body) in &package.bodies { trans_body(&mut module, layouts, package, &func_ids, &data_ids, body_id, body, &mut bytes_count)?; } module.finalize_definitions(); Ok(module.finish()) } fn trans_body<'a, 't, 'l>( module: &'a mut Module<impl Backend>, layouts: &'a syntax::layout::LayoutCtx<'t, 'l>, package: *const syntax::Package<'t>, func_ids: &'a BTreeMap<syntax::ItemId, (FuncId, Signature, Vec<TyLayout<'t, 'l>>)>, data_ids: &'a BTreeMap<syntax::ItemId, (DataId, TyLayout<'t, 'l>)>, body_id: &'a syntax::ItemId, body: &'a syntax::Body<'t>, bytes_count: &'a mut usize, ) -> Result<(), Error> { let (func, sig, _) = &func_ids[body_id]; let mut ctx = module.make_context(); let mut func_ctx = FunctionBuilderContext::new(); ctx.func.signature = sig.clone(); ctx.func.name = ExternalName::user(0, func.as_u32()); let mut builder = FunctionBuilder::new(&mut ctx.func, &mut func_ctx); let start_ebb = builder.create_ebb(); builder.switch_to_block(start_ebb); let blocks = body.blocks.iter().map(|(id, _)| (*id, builder.create_ebb())).collect(); let mut fx = FunctionCtx { pointer_type: module.target_config().pointer_type(), layouts, package, module, builder, body, func_ids, data_ids, blocks, locals: BTreeMap::new(), bytes_count, }; let ssa_map = crate::analyze::analyze(&fx); fn local_place<'a, 't, 'l>( fx: &mut FunctionCtx<'a, 't, 'l, impl Backend>, id: syntax::LocalId, layout: TyLayout<'t, 'l>, ssa: bool ) -> crate::place::Place<'t, 'l> { let place = if ssa { crate::place::Place::new_var(fx, id, layout) } else { crate::place::Place::new_stack(fx, layout) }; fx.locals.insert(id, place); place } for ret in body.rets() { let layout = ret.ty.layout(fx.layouts); match crate::pass::pass_mode(fx.module, layout) { crate::pass::PassMode::NoPass => { fx.locals.insert(ret.id, crate::place::Place { kind: crate::place::PlaceKind::NoPlace, layout, }); }, crate::pass::PassMode::ByVal(_) => { let ssa = ssa_map[&ret.id] == crate::analyze::SsaKind::Ssa; local_place(&mut fx, ret.id, layout, ssa); }, crate::pass::PassMode::ByRef => { let ret_param = fx.builder.append_ebb_param(start_ebb, fx.pointer_type); fx.locals.insert(ret.id, crate::place::Place { kind: crate::place::PlaceKind::Addr(crate::ptr::Pointer::addr(ret_param)), layout, }); }, } } for arg in body.args() { let layout = arg.ty.layout(fx.layouts); let value = crate::pass::value_for_param(&mut fx, start_ebb, layout); let ssa = ssa_map[&arg.id] == crate::analyze::SsaKind::Ssa; let place = local_place(&mut fx, arg.id, layout, ssa); if let Some(value) = value { place.store(&mut fx, value); } } for (id, decl) in body.locals.iter() { match &decl.kind { syntax::LocalKind::Var | syntax::LocalKind::Tmp => { let layout = decl.ty.layout(fx.layouts); local_place(&mut fx, *id, layout, ssa_map[id] == crate::analyze::SsaKind::Ssa); }, _ => {}, } } let first_block = *fx.blocks.iter().next().unwrap().1; fx.builder.ins().jump(first_block, &[]); for (id, block) in &body.blocks { fx.builder.switch_to_block(fx.blocks[&id]); for stmt in &block.stmts { fx.trans_stmt(stmt); } fx.trans_term(&block.term); } fx.builder.seal_all_blocks(); fx.builder.finalize(); // println!("{}", fx.builder.func.display(fx.module.isa())); module.define_function(*func, &mut ctx)?; module.clear_context(&mut ctx); Ok(()) }
pub use gl::types::*; use std::ffi::CString; use std::{fs, ptr, str}; pub enum ShaderKind { Vertex, Fragment, Geometry, TessellationControl, TessellationEvaluation, Compute, } impl Default for ShaderKind { fn default() -> Self { ShaderKind::Vertex } } #[derive(Default)] pub struct Shader { pub id: GLuint, pub kind: ShaderKind, } impl Shader { pub fn new(kind: ShaderKind) -> Shader { let id = unsafe { gl::CreateShader(Shader::map_type(&kind)) }; Shader { id, kind } } pub fn load_file(&mut self, path: &str) { let text = fs::read_to_string(path).unwrap(); self.load(&text); } pub fn load(&self, source: &str) { let source_str = CString::new(source.as_bytes()).unwrap(); unsafe { gl::ShaderSource(self.id, 1, &source_str.as_ptr(), ptr::null()); gl::CompileShader(self.id); } self.check_compilation(); } // TODO: Add something to identify the shader that failed fn check_compilation(&self) { let mut success = gl::FALSE as GLint; unsafe { gl::GetShaderiv(self.id, gl::COMPILE_STATUS, &mut success); } if success == gl::TRUE as GLint { return; } let mut info_log_length = 0; unsafe { gl::GetShaderiv(self.id, gl::INFO_LOG_LENGTH, &mut info_log_length); } let mut info_log = vec![0; info_log_length as usize]; unsafe { gl::GetShaderInfoLog( self.id, info_log_length, ptr::null_mut(), info_log.as_mut_ptr() as *mut GLchar, ); } println!( "ERROR: Shader compilation failed.\n{}\n", str::from_utf8(&info_log).unwrap() ); } fn map_type(shader_type: &ShaderKind) -> GLuint { match shader_type { ShaderKind::Vertex => gl::VERTEX_SHADER, ShaderKind::Fragment => gl::FRAGMENT_SHADER, ShaderKind::Geometry => gl::GEOMETRY_SHADER, ShaderKind::TessellationControl => gl::TESS_CONTROL_SHADER, ShaderKind::TessellationEvaluation => gl::TESS_EVALUATION_SHADER, ShaderKind::Compute => gl::COMPUTE_SHADER, } } }
use std::net::{TcpListener, ToSocketAddrs}; use std::path::Path; use anyhow::{Context, Error}; use clap::{App, Arg}; use fehler::throws; use threadpool::ThreadPool; use isner::connection_handler::run; use isner::file_handler::FileHandler; const DEFAULT_HOST: &str = "127.0.0.1"; const DEFAULT_PORT: &str = "8000"; const DEFAULT_CONCURRENCY: &str = "10"; fn build_args<'a>() -> App<'a, 'a> { App::new("isner") .version("0.0.1-alpha.1") .author("Elias Tandel <elias.tandel@gmail.com>") .about("Simple file server in rust") .arg( Arg::with_name("host") .help("Address to which the server will be bound") .short("h") .long("host") .value_name("ADDRESS") .default_value(DEFAULT_HOST), ) .arg( Arg::with_name("port") .help("Port to which the server will be bound") .short("p") .long("port") .value_name("PORT") .default_value(DEFAULT_PORT), ) .arg( Arg::with_name("concurrency") .help("Maximum number of concurrent requests") .short("c") .long("concurrency") .default_value(DEFAULT_CONCURRENCY), ) .arg( Arg::with_name("directory") .help("Root directory") .short("d") .long("directory") .value_name("DIR") .required(true) ) } #[throws] fn main() { env_logger::init(); let matches = build_args().get_matches(); let listener = { let host = matches.value_of("host").unwrap_or(DEFAULT_HOST); let port = matches .value_of("port") .unwrap_or(DEFAULT_PORT) .parse::<u16>()?; let mut addrs_iter = (host, port).to_socket_addrs().context("Invalid address")?; let bind_to = addrs_iter.next().context("Invalid address")?; TcpListener::bind(bind_to).with_context(|| format!("Could not bind to {}", bind_to))? }; let pool = { let pool_size = matches .value_of("concurrency") .unwrap_or(DEFAULT_CONCURRENCY) .parse::<usize>() .context("concurrency value must be integer")?; ThreadPool::new(pool_size) }; let root_dir = matches.value_of("directory").unwrap(); let handler = FileHandler::new(Path::new(root_dir).to_owned()); run(listener, pool, handler); }
/* * @lc app=leetcode.cn id=32 lang=rust * * [32] 最长有效括号 * * https://leetcode-cn.com/problems/longest-valid-parentheses/description/ * * algorithms * Hard (25.50%) * Total Accepted: 6.9K * Total Submissions: 27K * Testcase Example: '"(()"' * * 给定一个只包含 '(' 和 ')' 的字符串,找出最长的包含有效括号的子串的长度。 * * 示例 1: * * 输入: "(()" * 输出: 2 * 解释: 最长有效括号子串为 "()" * * * 示例 2: * * 输入: ")()())" * 输出: 4 * 解释: 最长有效括号子串为 "()()" * * */ impl Solution { pub fn longest_valid_parentheses(s: String) -> i32 { let chars: Vec<_> = s.chars().collect(); let l = s.len(); let mut v = vec![0; l + 1]; let mut res = 0; for i1 in 1..=l { let mut temp = 0; let mut count = 0; v[i1 - 1] = 0; for i2 in i1..=l { if chars[i2 - 1] == '(' { v[i2] = v[i2 - 1] + 1; } else { if v[i2 - 1] > 0 { v[i2] = v[i2 - 1] - 1; if v[i2] == 0 { temp += count + 1; res = res.max(temp); count = 0; } else { count += 1; } } else { break; } } } } res * 2 } } fn main() {} struct Solution {} #[cfg(test)] mod tests { use test_case::test_case; use crate::Solution; #[test_case(4, ")()())"; "1")] #[test_case(2, "(()"; "2")] #[test_case(4, "(())((("; "3")] #[test_case(4, "(()()(("; "4")] #[test_case(0, ""; "5")] #[test_case(4, ")()())"; "6")] fn test_pair(n: i32, s: &str) { assert_eq!(n, Solution::longest_valid_parentheses(s.to_string())); } #[test] fn test1() {} }
extern crate common; extern crate serde_cbor; pub mod cluster_api; pub mod cluster_communication;
//! Data structures and functionality for `animanager` manifests. #![deny(missing_docs, missing_debug_implementations, trivial_casts, trivial_numeric_casts, unsafe_code)] #![warn(dead_code)] #![cfg_attr(test, feature(plugin))] #![cfg_attr(test, plugin(clippy))] #[macro_use] extern crate log; #[macro_use] extern crate serde_derive; extern crate chrono; extern crate flate2; extern crate openssl; //extern crate ordered_float; extern crate rand; extern crate serde; extern crate serde_cbor; extern crate serde_json; extern crate serde_yaml; extern crate storage; extern crate strsim; extern crate uuid; #[cfg(test)] extern crate tempfile; pub mod error; pub mod format; pub mod tags; pub use error::ManifestError; use std::collections::{HashMap, HashSet}; use std::fmt; use std::fs::File; use std::io::{Read, Write}; use std::mem::replace; use std::path::Path; //use ordered_float::OrderedFloat; use rand::{thread_rng, Rng}; use storage::{Container, StorageRoot, StorageMetadata, aes}; use uuid::Uuid; use format::{ManifestFormat, ManifestSerializationOptions}; use tags::TagId; /// A unique identifier for a node. pub type NodeId = Uuid; /// A unique identifier for a stream. pub type StreamId = Uuid; /// A manifest contains metadata to track and organize media. #[derive(Serialize, Deserialize, Debug)] pub struct Manifest { /// Nodes in the media tree. nodes: HashMap<NodeId, Node>, /// A handy pointer to the root node. root_node_id: NodeId, /// Streams of content referred to by nodes in the tree. streams: HashMap<StreamId, Stream>, /// Describes the tags used to categorize streams. pub tags: tags::TagData, /// Describes the containers available for storing things. storage: StorageRoot, /// The "trash can" for streams; removed streams go here, along with pointers to /// the nodes they were originally attached to. stream_trash: Vec<(Stream, Vec<NodeId>)>, } impl Default for Manifest { fn default() -> Self { let root_node_id = NodeId::new_v4(); let root_node = Node { type_: NodeType::Root, parent: root_node_id.clone(), children: Default::default(), streams: Default::default(), }; debug!("Creating new Manifest with root node ID {}", root_node_id); Manifest { nodes: { let mut nodes = HashMap::new(); nodes.insert(root_node_id, root_node); nodes }, streams: Default::default(), tags: Default::default(), storage: Default::default(), stream_trash: Default::default(), root_node_id, } } } impl Manifest { /// Copies the data from the file at the given path and adds it to the given node as a new stream. pub fn add_stream_to_node_from_file<P: AsRef<Path>>( &mut self, node_id: &NodeId, stream_type: StreamType, path: P ) -> Result<StreamId, ManifestError> { let file = std::fs::File::open(path)?; let size = file.metadata()?.len(); self.add_stream_to_node(node_id, stream_type, file, size) } /// Copies the data from the given Read and adds it to the given node as a new stream. pub fn add_stream_to_node<R: Read>( &mut self, node_id: &NodeId, stream_type: StreamType, data: R, size: u64, ) -> Result<StreamId, ManifestError> { info!("Adding stream of size {} to node {}", size, node_id); if let Some(ref mut node) = self.nodes.get_mut(node_id) { let new_id = StreamId::new_v4(); let metadata = self.storage.add_from_read(data, size)?; debug!("Added new stream ({}) to storage", new_id); let stream = Stream { type_: stream_type, owner: node_id.clone(), tags: Default::default(), metadata, }; self.streams.insert(new_id, stream); node.streams.insert(new_id); Ok(new_id) } else { warn!("Tried to use unknown node {}", node_id); Err(ManifestError::UnknownNode(node_id.clone())) } } /// Moves a stream to the trash. O(# nodes). pub fn remove_stream(&mut self, stream_id: &StreamId) -> Result<(), ManifestError> { info!("Moving stream {} to the trash", stream_id); if let Some(stream) = self.streams.remove(stream_id) { let mut old_nodes = Vec::new(); for (id, ref mut node) in self.nodes.iter_mut() { if node.streams.remove(stream_id) { old_nodes.push(id.clone()); } } debug!("Removed stream was attached to {} nodes", old_nodes.len()); self.stream_trash.push((stream, old_nodes)); Ok(()) } else { warn!("Tried to remove unknown stream {}", stream_id); Err(ManifestError::UnknownStream(stream_id.clone())) } } /// Restores a stream from the trash to its original position. Returns true if it re-attached /// the stream to a node. If the stream could not be restored to any nodes, this will remove it /// from storage as well (which can fail) to avoid orphaning it. O(# number of items in trash). pub fn restore_stream(&mut self, idx: usize) -> Result<bool, ManifestError> { info!("Restoring stream at index {}/{} from trash", idx, self.stream_trash.len()); if idx >= self.stream_trash.len() { return Ok(false); } let (stream, node_ids) = self.stream_trash.remove(idx); let new_id = StreamId::new_v4(); let mut restored_any = false; for node_id in node_ids { if let Some(ref mut node) = self.nodes.get_mut(&node_id) { node.streams.insert(new_id); restored_any = true; } // If a node has since been removed, we can't restore to it but also // don't want to fail. } if restored_any { self.streams.insert(new_id, stream); } else { // If we weren't able to retore to any nodes, then we need to delete the stream // from storage (or risk orphaning it). warn!("Tried to restore stream but no nodes matched; removing orphan"); self.storage.remove_data(stream.metadata)?; } Ok(restored_any) } /// Empties the stream trash permanently. This can fail since this removes the /// streams from storage as well. pub fn empty_stream_trash(&mut self) -> Result<(), ManifestError> { info!("Emptying stream trash ({} items)", self.stream_trash.len()); for (stream, _) in self.stream_trash.drain(..) { self.storage.remove_data(stream.metadata)?; } Ok(()) } /// Tries to load the given stream's data. pub fn open_stream(&self, stream_id: &StreamId) -> Result<Box<Read>, ManifestError> { if let Some(ref stream) = self.streams.get(stream_id) { debug!("Opening stream {}", stream_id); Ok(self.storage.open(&stream.metadata)?) } else { warn!("Tried to open unknown stream {}", stream_id); Err(ManifestError::UnknownStream(stream_id.clone())) } } /// Adds a tag to a stream. Returns true on success; false on failure. This can return false /// if the stream already has a tag which is mutually exclusive with the given tag. pub fn add_tag_to_stream( &mut self, stream_id: &StreamId, tag_id: &tags::TagId ) -> Result<bool, ManifestError> { info!("Adding tag {} to stream {}", tag_id, stream_id); if let Some(ref mut stream) = self.streams.get_mut(stream_id) { // Check for mutually exlcusive tags if self.tags.can_tag_join_collection(&stream.tags, tag_id) { stream.tags.insert(tag_id.clone()); Ok(true) } else { Ok(false) } } else { warn!("Tried to add tag to unknown stream {}", stream_id); Err(ManifestError::UnknownStream(stream_id.clone())) } } /// Removes the given tag from the given stream. Returns true if the tag existed and was removed. /// O(1). pub fn remove_tag_from_stream( &mut self, stream_id: &StreamId, tag_id: &tags::TagId ) -> Result<bool, ManifestError> { info!("Removing tag {} from stream {}", tag_id, stream_id); if let Some(ref mut stream) = self.streams.get_mut(stream_id) { Ok(stream.tags.remove(tag_id)) } else { warn!("Tried to remove tag from unknown stream {}", stream_id); Err(ManifestError::UnknownStream(stream_id.clone())) } } /// Queries the tags on the given stream. O(1). pub fn get_stream_tags( &self, stream_id: &StreamId ) -> Result<HashSet<TagId>, ManifestError> { info!("Querying tags on stream {}", stream_id); if let Some(ref stream) = self.streams.get(stream_id) { Ok(stream.tags.iter().cloned().collect()) } else { warn!("Tried to query tags from unknown stream {}", stream_id); Err(ManifestError::UnknownStream(stream_id.clone())) } } /// Determines the type and size of the given stream. pub fn get_stream_metadata(&self, stream_id: &StreamId) -> Result<(StreamType, u64), ManifestError> { info!("Querying type and size of stream {}", stream_id); if let Some(ref stream) = self.streams.get(stream_id) { Ok((stream.type_.clone(), stream.metadata.get_size())) } else { warn!("Tried to query type and size of unknown stream {}", stream_id); Err(ManifestError::UnknownStream(stream_id.clone())) } } /// Gets the ID of the root node. O(1). pub fn get_root_node_id(&self) -> NodeId { self.root_node_id } /// Checks if the manifest contains the given node. pub fn contains_node(&self, id: &NodeId) -> bool { self.nodes.contains_key(id) } /// Gets an iterator over the streams a node owns. O(1). pub fn get_node_streams( &self, node_id: &NodeId ) -> Result<HashSet<StreamId>, ManifestError> { Ok(self.nodes .get(node_id) .ok_or_else(|| ManifestError::UnknownNode(node_id.clone()))? .streams.iter().cloned().collect() ) } /// Gets an iterator over the streams a node owns that have the given type. O(1). /// The returned stream IDs are guaranteed to exist. pub fn get_node_streams_with_type( &self, node_id: &NodeId, stream_type: &StreamType ) -> Result<HashSet<StreamId>, ManifestError> { Ok(self.nodes .get(node_id) .ok_or_else(|| ManifestError::UnknownNode(node_id.clone()))? .streams.iter().filter(|stream_id| { self.streams .get(stream_id) .map_or(false, |stream| stream.type_ == *stream_type) }).cloned().collect() ) } /// Gets an iterator over the child nodes of a node. O(1). pub fn get_node_children( &self, node_id: &NodeId ) -> Result<HashSet<NodeId>, ManifestError> { Ok(self.nodes .get(node_id) .ok_or_else(|| ManifestError::UnknownNode(node_id.clone()))? .children.iter().cloned().collect() ) } /// Gets an iterator over the children of a node that have the given type. O(1). /// The returned node IDs are guaranteed to exist. pub fn get_node_children_with_type( &self, node_id: &NodeId, node_type: &NodeType ) -> Result<HashSet<NodeId>, ManifestError> { Ok(self.nodes .get(node_id) .ok_or_else(|| ManifestError::UnknownNode(node_id.clone()))? .children.iter().filter(|sub_node_id| { self.nodes .get(sub_node_id) .map_or(false, |sub_node| sub_node.type_ == *node_type) }).cloned().collect() ) } /// Gets the node that owns the given stream. O(1). pub fn get_stream_owner(&self, stream_id: &StreamId) -> Result<NodeId, ManifestError> { Ok(self.streams .get(stream_id) .ok_or_else(|| ManifestError::UnknownStream(stream_id.clone()))? .owner.clone() ) } /// Gets the parent of the given node. O(1). pub fn get_node_parent(&self, node_id: &NodeId) -> Result<NodeId, ManifestError> { Ok(self.nodes .get(node_id) .ok_or_else(|| ManifestError::UnknownNode(node_id.clone()))? .parent.clone() ) } /// Gets the type of the given node. O(1). pub fn get_node_type(&self, node_id: &NodeId) -> Result<NodeType, ManifestError> { Ok(self.nodes .get(node_id) .ok_or_else(|| ManifestError::UnknownNode(node_id.clone()))? .type_.clone() ) } /// Finds all nodes containing streams with the given tag. O(# streams). pub fn find_nodes_by_tag(&self, tag_id: &tags::TagId) -> HashSet<NodeId> { self.nodes.iter() .filter(|(_id, node)| node.streams.iter().any(|s_id| { if let Some(ref stream) = self.streams.get(s_id) { stream.tags.contains(tag_id) } else { false } })) .map(|(id, _node)| id.clone()) .collect() } /// Creates a new node under the given parent. O(1). pub fn create_node(&mut self, parent_id: &NodeId, type_: NodeType) -> Result<NodeId, ManifestError> { info!("Creating new node under {} with type {:?}", parent_id, type_); let new_id = NodeId::new_v4(); let node = Node { type_, parent: parent_id.clone(), children: Default::default(), streams: Default::default(), }; self.nodes .get_mut(parent_id) .ok_or_else(|| ManifestError::UnknownNode(parent_id.clone()))? .children.insert(new_id); self.nodes.insert(new_id, node); Ok(new_id) } // Storage access /// Adds a local storage container. pub fn add_local_storage_container( &mut self, path: String, capacity: Option<u64> ) -> Uuid { let capacity = match capacity { Some(cap) => cap, None => { unimplemented!("need to be able to get free space of a volume cross-platform") }, }; let container = Container::LocalStorage { used_space: 0, path, capacity, }; // TODO: allow customizing alpha self.storage.add_container(container, 0.5f64) } /// Gets the list of all containers. pub fn get_containers(&self) -> impl Iterator<Item = &Container> { self.storage.iter() } // Serialization /// Loads a serialized manifest from a file. pub fn load_from_file<P: AsRef<Path>>( path: P, load_options: &ManifestSerializationOptions, ) -> Result<Self, ManifestError> { info!("Loading manifest from {:?}", path.as_ref()); Manifest::load_from_reader(File::open(path)?, load_options) } /// Loads a serialized manifest from a reader. pub fn load_from_reader<R: Read>( reader: R, load_options: &ManifestSerializationOptions, ) -> Result<Self, ManifestError> { let mut reader: Option<Box<Read>> = Some(Box::new(reader)); if let Some(ref passphrase) = load_options.passphrase { info!("Loading encrypted manifest"); let key = { let mut buf = [0; 64]; reader.as_mut().unwrap().by_ref().take(64).read_exact( &mut buf[..], )?; aes::derive_key(passphrase, &buf[..]) }; let aes_reader = aes::AESReader::new(&key, reader.take().unwrap())?; replace(&mut reader, Some(Box::new(aes_reader))); } if load_options.compressed { info!("Loading compressed manifest"); let zlib_reader = flate2::read::ZlibDecoder::new(reader.take().unwrap()); replace(&mut reader, Some(Box::new(zlib_reader))); } Ok(match load_options.format { ManifestFormat::Json | ManifestFormat::JsonPretty => serde_json::from_reader::<_, Self>(&mut reader.unwrap())?, ManifestFormat::Yaml => serde_yaml::from_reader::<_, Self>(&mut reader.unwrap())?, ManifestFormat::Cbor => serde_cbor::from_reader::<Self, _>(&mut reader.unwrap())?, }) } /// Serializes the manifest to a file. pub fn save_to_file<P: AsRef<Path>>( &self, path: P, save_options: &ManifestSerializationOptions, ) -> Result<(), ManifestError> { info!("Saving manifest to {:?}", path.as_ref()); self.save_to_writer(File::create(path)?, save_options) } /// Serializes the manifest to a writer. pub fn save_to_writer<W: Write>( &self, writer: W, save_options: &ManifestSerializationOptions, ) -> Result<(), ManifestError> { let mut writer: Option<Box<Write>> = Some(Box::new(writer)); if let Some(ref passphrase) = save_options.passphrase { info!("Saving manifest encrypted; generating new salt"); let mut salt = [0; 64]; thread_rng().fill(&mut salt); writer.as_mut().unwrap().write_all(&salt)?; let key = aes::derive_key(passphrase, &salt[..]); let aes_writer = aes::AESWriter::new(&key, writer.take().unwrap())?; replace(&mut writer, Some(Box::new(aes_writer))); } if save_options.compressed { info!("Saving manifest compressed"); let zlib_writer = flate2::write::ZlibEncoder::new( writer.take().unwrap(), Default::default(), ); replace(&mut writer, Some(Box::new(zlib_writer))); } match save_options.format { ManifestFormat::Json => { info!("Saving manifest in Json format"); serde_json::to_writer(&mut writer.unwrap(), self)?; } ManifestFormat::JsonPretty => { info!("Saving manifest in JsonPretty format"); serde_json::to_writer_pretty(&mut writer.unwrap(), self)?; } ManifestFormat::Yaml => { info!("Saving manifest in Yaml format"); serde_yaml::to_writer(&mut writer.unwrap(), self)?; } ManifestFormat::Cbor => { info!("Saving manifest in Cbor format"); serde_cbor::ser::to_writer(&mut writer.unwrap(), self)?; } } Ok(()) } } /// A node in the tree that makes up the manifest. #[derive(Serialize, Deserialize, Debug)] #[serde(deny_unknown_fields)] pub struct Node { // The type of the node. Describes its content. #[serde(rename = "type")] type_: NodeType, // The ID of the parent of this node. For the root node, this is this node's // own ID. parent: NodeId, // If this node has any children, these are their IDs. children: HashSet<NodeId>, // If this node has any content streams, these are their IDs. streams: HashSet<StreamId>, } /// The various types of node. #[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)] pub enum NodeType { /// The root node. It only makes sense for one to exist per tree. Root, /// This is intended for flexibility - if there is some metadata or /// other information regarding a piece of media that doesn't fit into /// one of the predefined node types, this is the node type to use. Other(String), /// A title node contains human-readable names, typically of its parent. /// For example, a node with type `Book` likely has a child `Title` /// containing the title of the book. Title, /// A `PublicationTime` node typically contains `DateTime` streams containing /// publication dates. PublicationTime, /// A `Franchise` node corresponds to a single copyright or fictional universe. /// For example, multiple TV shows set in the same universe might all fall into /// one `Franchise`. Multiple adaptations of a work might also fall into one. Franchise, /// A `Show` node corresponds to a piece of media consisting of one or more /// videos called `Episode`s, divided into groups (typically by airing time) /// called `Season`s. Show, /// A `Season` of a `Show` is a group of several `Episode`s. Season, /// An `Episode` is typically one short piece of video content in a `Season` /// or `Show`. Episode, /// Corresponds to a movie, pretty straightforward. Movie, /// A `FanmadeContent` node typically doesn't contain any streams of its own, /// but contains nodes with fan art, etc. for its parent. FanmadeContent, /// A `Game` node is a bit abstract - typically it contains a binary stream /// which represents an archive of a video game's content. It could also /// contain materials related to a board game. VNs fall into this category. Game, /// Corresponds to a single image. Image, /// A `Literature` node contains things like book series. It is likely /// found immediately beneath a `Franchise` node. Literature, /// A `Book` is typically found immediately beneath a `Literature` node (where /// it represents a full book) or beneath a `Comic` node (where it represents /// a volume). It represents a single physical bound book. Book, /// A `Comic` node is suitable for Manga, Comic Books, or other, similar media. /// It likely contains multiple `Chapter` nodes, possibly beneath `Book` nodes. /// A node of this type typically does *not* contain multiple `Image` subnodes. Comic, /// A `Chapter` is typically found under either a `Comic` node or a `Book` /// node. It typically contains a visual stream or streams corresponding to a /// chapter of the overall work (as opposed to many `Image` subnodes). Chapter, /// An `Album` node is a container for `Music` nodes. Album, /// A `Music` node contains things like songs, soundtracks, etc. It likely /// has a single audio stream, and a `Creators` and `Title` subnode. Music, /// A node for non-music audio media like radio shows or commentary. MiscAudio, } impl fmt::Display for NodeType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{:?}", self) } } /// A stream contains a locator for actual data and metadata about the format of /// the data it references. #[derive(Debug, Serialize, Deserialize)] #[serde(deny_unknown_fields)] pub struct Stream { // The type of the stream. #[serde(rename = "type")] type_: StreamType, // The ID of the node that owns this stream owner: NodeId, // Used by the storage module to describe the location and common metadata about // a piece of media. metadata: StorageMetadata, // The ids of user-defined tags on media. This could be things like "language: en-US", // "meta: Translated", "genre: romcom", or anything else. tags: HashSet<tags::TagId>, } /// The type of a stream is broad. #[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)] pub enum StreamType { /// The stream contains audio data only. Audio { /// The sampling rate of the audio. bit_rate: u64, /// True if the stream is compressed lossily. lossy: bool, /// The duration of the stream in milliseconds, rounded to the nearest millisecond. duration: u64, /// True if the media is in a preferred container (Matroska). preferred_container: bool, }, /// The stream contains video data as well as audio data. Visual { /// The sampling rate of the audio. audio_bit_rate: u64, /// True if the audio data is compressed lossily. audio_lossy: bool, /// The framerate of the video. video_frame_rate: u64, /// True if the video data is compressed lossily. video_lossy: bool, /// The (width, height) of the video. video_resolution: (u64, u64), /// The duration of the stream in milliseconds, rounded to the nearest millisecond. duration: u64, /// True if the media is in a preferred container (Matroska). preferred_container: bool, }, /// The stream contains text data. Text { /// True if the stream contains raw text only. If so, the text should be stored as /// UTF-8. raw: bool, }, /// The stream contains data that represents a particular time. DateTime, /// The stream contains an archive of other (non-indexed) content. Archive { /// True if the archive is compressed. compressed: bool, }, }
use super::*; mod with_async_false; mod with_async_true; mod with_invalid_option; mod without_async; fn async_option(value: bool, process: &Process) -> Term { option("async", value, process) } fn option(key: &str, value: bool, process: &Process) -> Term { process.tuple_from_slice(&[Atom::str_to_term(key), value.into()]) }
#[derive(Clone, Debug)] pub struct LllPanel { pub win: ncurses::WINDOW, pub panel: ncurses::PANEL, pub rows: i32, pub cols: i32, // coords (y, x) pub coords: (usize, usize), } impl std::ops::Drop for LllPanel { fn drop(&mut self) { ncurses::del_panel(self.panel); ncurses::delwin(self.win); ncurses::update_panels(); } } impl LllPanel { pub fn new(rows: i32, cols: i32, coords: (usize, usize)) -> Self { let win = ncurses::newwin(rows, cols, coords.0 as i32, coords.1 as i32); let panel = ncurses::new_panel(win); ncurses::leaveok(win, true); ncurses::wnoutrefresh(win); LllPanel { win, panel, rows, cols, coords, } } pub fn move_to_top(&self) { ncurses::top_panel(self.panel); } pub fn queue_for_refresh(&self) { ncurses::wnoutrefresh(self.win); } }
pub mod androidsurfacecreateinfokhr; pub mod descriptorupdatetemplateentrykhr; pub mod displaymodecreateinfokhr; pub mod displaymodeparameterkhr; pub mod displaymodepropertieskhr; pub mod displaypresentinfokhr; pub mod displaysurfacecreateinfokhr; pub mod formatproperties2khr; pub mod imageformatproperties2khr; pub mod physicaldevicefeatures2khr; pub mod physicaldeviceimageformatinfo2khr; pub mod physicaldevicememoryproperties2khr; pub mod physicaldeviceproperties2khr; pub mod physicaldevicepushdescriptorpropertieskhr; pub mod physicaldevicesparseimageformatinfo2khr; pub mod presentinfokhr; pub mod queuefamilyproperties2khr; pub mod sparseimageformatproperties2khr; pub mod surfacecapabilitieskhr; pub mod surfaceformatkhr; pub mod swapchaincreateinfokhr; pub mod waylandsurfacecreateinfokhr; pub mod win32surfacecreateinfokhr; pub mod xcbsurfacecreateinfokhr; pub mod xlibsurfacecreateinfokhr; pub mod memoryrequirements2khr; pub mod prelude;
use serde_json::{Result, Value}; fn main() { println!("Hello, world!"); }
use std::io::{self, Read}; use std::fs::File; use crate::advent::Day; pub fn read_input(d: Day) -> io::Result<String> { let filename = match d { 1..=9 => format!("inputs/0{}.txt", d), _ => format!("inputs/{}.txt",d), }; let mut tmp = String::new(); let mut file = File::open(filename)?; file.read_to_string(&mut tmp)?; Ok(tmp) }
#[macro_export] macro_rules! errno { ($errno_expr: expr, $error_msg: expr) => {{ let inner_error = { let errno: Errno = $errno_expr; let msg: &'static str = $error_msg; (errno, msg) }; let error = $crate::Error::embedded(inner_error, Some(ErrorLocation::new(file!(), line!()))); error }}; ($error_expr: expr) => {{ let inner_error = $error_expr; let error = $crate::Error::boxed(inner_error, Some(ErrorLocation::new(file!(), line!()))); error }}; } #[macro_export] macro_rules! return_errno { ($errno_expr: expr, $error_msg: expr) => {{ return Err(errno!($errno_expr, $error_msg)); }}; ($error_expr: expr) => {{ return Err(errno!($error_expr)); }}; }
//! Circuit Lab Simulation software, developed by Sleep Ibis LLC and funded by Northwestern University, //! is circuit simulation software specifically designed to assist teachers in designing and //! deploying circuit labs for beginning physics/engineering students. //! The program runs on Windows, MacOs and Linux operating systems. //! The program was written in the [rust](https://www.rust-lang.org/) programming language. //! //! //! # How to read this documentation //! //! This documentation is meant to serve as guide for future developers. It is meant help developers who wish //! to further develop this program. If you are new to rust please take a look //! [here](https://www.rust-lang.org/learn/get-started), the rust installation guide, and //! [here](https://doc.rust-lang.org/book/), a beginner to intermediate guide which might be useful for those getting //! started or want to learn abit more. //! //! //! //! # Getting started //! //! Compilation is done using rust's default compilation and packaging tool, `cargo`. //! To compile a release build execute the following command: `cargo build --release`. //! To compile and run a release build execute: `cargo run --release`. //! Note, first time compilation will attempt to download external dependencies from rust's //! package registry. //! //! //! The main logic path begins in `main.rs` then diverges depending on the operating system. //! These paths converge in `lab_sim.rs`. Logic specific to the circuit simulation can be found //! in `lab_sims.rs`. Various helper modules have been developed to help make development easier. //! The dominant logic paths and helper modules can be found below. //! //! //! ```text //! //! Main Logic Path: Helper Modules: //! =============== =============== //! main.rs rendering_tools //! | input_hander //! | debug_tools //! V misc //! -------------------------- //! | | | //! | | | //! V V V //! unix/ macos/ windows/ //! mod.rs mod.rs mod.rs //! | | | //! -> lab_sims.rs <- //! //! ``` //! //! //#![allow(warnings)] //TODO #![allow(unused_results)] extern crate stb_tt_sys; extern crate stb_image_sys; extern crate miniz; use std::ptr::{null, null_mut}; mod inputhandler; mod ui_tools; mod lab_sims; mod os_util; mod debug_tools; mod misc; mod rendertools; use rendertools::{TGBitmapHeaderInfo, TGBitmap }; #[cfg(target_os = "windows")] mod windows; #[cfg(target_os = "windows")] use windows::*; #[cfg(target_os = "macos")] extern crate core_graphics; #[cfg(target_os = "macos")] extern crate core_foundation; #[cfg(target_os = "macos")] #[macro_use] extern crate cocoa; #[cfg(target_os = "macos")] #[macro_use] extern crate objc; #[cfg(target_os = "macos")] mod macos; #[cfg(target_os = "macos")] use macos::*; #[cfg(target_os = "linux")] extern crate x11; #[cfg(target_os = "linux")] mod unix; #[cfg(target_os = "linux")] use unix::make_window; const FONT_NOTOSANS : &[u8] = std::include_bytes!("../assets/NotoSans-Regular.ttf");//TODO better pathing maybe const FONT_NOTOSANS_BOLD : &[u8] = std::include_bytes!("../assets/NotoSans-Bold.ttf");//TODO better pathing maybe #[derive(PartialEq, Copy, Clone, Debug, Default)] pub struct WindowInfo{ pub x: i32, pub y: i32, pub w: i32, pub h: i32, } pub struct WindowCanvas{ pub info : TGBitmapHeaderInfo, pub w: i32, pub h: i32, pub display_width: i32, pub display_height: i32, pub display_width_mm: i32, pub display_height_mm: i32, pub dpmm: f32, pub buffer: *mut std::ffi::c_void } static mut GLOBAL_WINDOWINFO : WindowInfo = WindowInfo{ x: 0, y: 0, w: 0, h: 0}; static mut GLOBAL_BACKBUFFER : WindowCanvas = WindowCanvas{ info : TGBitmapHeaderInfo{ header_size : 0, width : 0, height : 0, planes : 0, bit_per_pixel : 0, compression : 0,//BI_RGB, image_size: 0, x_px_per_meter: 0, y_px_per_meter: 0, colors_used: 0, colors_important: 0, }, w : 0, h : 0, display_width : 0i32, display_height: 0i32, display_width_mm : 0i32, display_height_mm: 0i32, dpmm: 0f32, buffer : null_mut(), }; pub struct OsPackage{ pub window_canvas: &'static mut WindowCanvas, pub window_info: &'static mut WindowInfo, } pub static mut SETICON : Option<TGBitmap> = None; pub fn set_icon( _bmp: &TGBitmap){unsafe{ let mut v = vec![0; _bmp.rgba.len()]; v.copy_from_slice(&_bmp.rgba); let bmp = TGBitmap{ file_header: _bmp.file_header, info_header: _bmp.info_header, height: _bmp.height, width: _bmp.width, rgba: v, }; SETICON = Some( bmp ); }} #[cfg(target_os = "windows")] mod udp{ use crate::dynamic_lib_loading::*; static mut UDP_LIB : Option<DyLib> = None; static mut GET_UDP_STATS : Option<fn (*mut _MIB_UDPSTATS)->u32> = None; #[derive(Debug, Default)] #[allow(non_camel_case_types)] pub struct _MIB_UDPSTATS { //NOTE //InDatagrams and OutDatagrams //are a cumulative accounting not based on when GetUdpStatistics is last called pub dwInDatagrams : u32, pub dwNoPorts : u32, pub dwInErrors : u32, pub dwOutDatagrams: u32, pub dwNumAddrs : u32, } pub fn load_udplib()->Option<()>{unsafe{ let lib = open_lib( "Iphlpapi.dll", 0 ); match lib { Ok(_lib)=>{ UDP_LIB = Some(_lib); let get_udp_stats = get_fn( UDP_LIB.as_ref().unwrap(), "GetUdpStatistics" ); GET_UDP_STATS = std::mem::transmute(get_udp_stats.unwrap()); return Some(()); }, Err(_)=>{ return None; } } return Some(()); }} pub fn get_udp_stats(stats: &mut _MIB_UDPSTATS)->Result<u32, String>{unsafe{ match GET_UDP_STATS{ None=>{ return Err("GET_UDP_STATS not set up".to_string()); } Some(_fn)=>{ return Ok(_fn( stats as *mut _)); } } }} } /// This function is the access point for the program. fn main() { make_window(); //pause(); } //TODO //move some where else #[cfg(target_os = "windows")] pub mod dynamic_lib_loading{ use std::os::raw::{c_int, c_void}; extern "C" { fn LoadLibraryA( path: *const i8 ) -> *mut c_void; fn GetProcAddress( lib: *mut c_void, name: *const i8 ) -> *mut c_void; fn FreeLibrary( lib: *mut c_void ) -> c_int; fn GetLastError() -> u32; } //TODO //This is temporary should be replaced by windows enums pub const RTLD_LAZY : i32 = 0x00001; /* Lazy function call binding. */ pub struct DyLib(*mut c_void); pub fn open_lib( lib_path: &str, _flag: i32 )->Result<DyLib, String>{unsafe{ let _path = lib_path.to_string() + "\0"; let lib = LoadLibraryA( _path.as_ptr() as *const i8); if lib.is_null(){ let s = format!("Could not open lib \n{:?}\n\n For more info => https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes", GetLastError()); return Err(s); } Ok(DyLib(lib as *mut c_void)) }} pub fn get_fn( shared_lib_handle: &DyLib, name: &str)-> Result<*mut (), String>{ unsafe{ let fn_name = name.to_string() + "\0"; let function = GetProcAddress(shared_lib_handle.0 as _, fn_name.as_ptr() as *const i8) as *mut (); if function.is_null(){ let s = format!("Could not get function \n{:?}", GetLastError()); return Err(s); } Ok(function) }} pub fn get_error()->String{ "Windows version has not been implemented".to_string() } pub fn close_lib(shared_lib_handle: &DyLib){unsafe{ if FreeLibrary(shared_lib_handle.0 as _) == 0{ println!("Could not properly close shared library."); println!("{}", format!("{:?}", GetLastError())); } }} } //#[cfg(target_os = "linux")] #[cfg(target_os = "macos")] pub mod dynamic_lib_loading{ #![allow(unused_imports)] #![allow(non_camel_case_types)] #![allow(dead_code)] use std::ffi::CString; use std::ptr; use std::os::raw::{c_int, c_char, c_void}; // //This is a lib of dlopen and dlclose using rust //Comments copied from the following source files // /usr/include/dlfcn.h // https://www.unvanquished.net/~modi/code/include/x86_64-linux-gnu/bits/dlfcn.h.html /* These are the possible values for the REQUEST argument to `dlinfo'. */ enum DL_INFO{ /* Treat ARG as `lmid_t *'; store namespace ID for HANDLE there. */ RTLD_DI_LMID = 1, /* Treat ARG as `struct link_map **'; store the `struct link_map *' for HANDLE there. */ RTLD_DI_LINKMAP = 2, RTLD_DI_CONFIGADDR = 3, /* Unsupported, defined by Solaris. */ /* Treat ARG as `Dl_serinfo *' (see below), and fill in to describe the directories that will be searched for dependencies of this object. RTLD_DI_SERINFOSIZE fills in just the `dls_cnt' and `dls_size' entries to indicate the size of the buffer that must be passed to RTLD_DI_SERINFO to fill in the full information. */ RTLD_DI_SERINFO = 4, RTLD_DI_SERINFOSIZE = 5, /* Treat ARG as `char *', and store there the directory name used to expand $ORIGIN in this shared object's dependency file names. */ RTLD_DI_ORIGIN = 6, RTLD_DI_PROFILENAME = 7, /* Unsupported, defined by Solaris. */ RTLD_DI_PROFILEOUT = 8, /* Unsupported, defined by Solaris. */ /* Treat ARG as `size_t *', and store there the TLS module ID of this object's PT_TLS segment, as used in TLS relocations; store zero if this object does not define a PT_TLS segment. */ RTLD_DI_TLS_MODID = 9, /* Treat ARG as `void **', and store there a pointer to the calling thread's TLS block corresponding to this object's PT_TLS segment. Store a null pointer if this object does not define a PT_TLS segment, or if the calling thread has not allocated a block for it. */ RTLD_DI_TLS_DATA = 10, //RTLD_DI_MAX = 10 } /* The MODE argument to `dlopen' contains one of the following: */ pub const RTLD_LAZY : i32 = 0x00001; /* Lazy function call binding. */ pub const RTLD_NOW : i32 = 0x00002; /* Immediate function call binding. */ pub const RTLD_BINDING_MASK : i32 = 0x3 ; /* Mask of binding time value. */ pub const RTLD_NOLOAD : i32 = 0x00004; /* Do not load the object. */ pub const RTLD_DEEPBIND : i32 = 0x00008; /* Use deep binding. */ /* If the following bit is set in the MODE argument to `dlopen', * the symbols of the loaded object and its dependencies are made * visible as if the object were linked directly into the program. */ pub const RTLD_GLOBAL : i32 = 0x00100; /* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL. * The implementation does this by default and so we can define the * value to zero. */ pub const RTLD_LOCAL : i32 = 0; /* Do not delete object when closed. */ pub const RTLD_NODELETE : i32 = 0x01000; struct Dl_info{ dli_fname: *mut c_char, /* File name of defining object. */ dli_fbase: *mut c_void, /* Load address of that object. */ dli_sname: *mut c_char, /* Name of nearest symbol. */ dli_saddr: *mut c_void, /* Exact value of nearest symbol. */ //dlerror } /* This is the type of elements in `Dl_serinfo', below. The `dls_name' member points to space in the buffer passed to `dlinfo'. */ struct Dl_serpath { dls_name: *mut c_char, /* Name of library search path directory. */ dls_flags: u32, /* Indicates where this directory came from. */ } /* This is the structure that must be passed (by reference) to `dlinfo' for the RTLD_DI_SERINFO and RTLD_DI_SERINFOSIZE requests. */ struct Dl_serinfo { dls_size: usize, /* Size in bytes of the whole buffer. */ dls_cnt: u32, /* Number of elements in `dls_serpath'. */ dls_serpath: [Dl_serpath;1], /* Actually longer, dls_cnt elements. */ } //TODO //Think about changing from c_int to i32 or something extern "C" { pub fn dlopen(filename: *const c_char, flag: c_int) -> *mut c_void; pub fn dlsym(lib_handle: *mut c_void, name: *const c_char) -> *mut c_void; pub fn dlclose(lib_handle: *mut c_void) -> c_int; pub fn dlinfo(lib_handle: *mut c_void, request: c_int, info: *mut c_void) -> c_int; pub fn dlerror() -> *mut c_char; } pub struct DyLib(*mut c_void); pub fn open_lib( lib_path: &str, flag: i32 )->Result<DyLib, String>{unsafe{ //TODO //Get enums dlopen uses let shared_lib_handle = dlopen(CString::new(lib_path).unwrap().as_ptr(), flag as c_int); if shared_lib_handle.is_null(){ println!("{:?}", get_error()); Err(format!("Shared lib is null! {} Check file path/name.", lib_path)) } else{ Ok( DyLib(shared_lib_handle) ) } }} //Example //let function : fn()->i32= transmute_copy((dlsym(shared_lib_handle, CString::new(name).unwrap().as_ptr()) as *mut ()).as_mut()); pub fn get_fn( shared_lib_handle: &DyLib, name: &str)-> Result<*mut (), String>{ unsafe{ let _fn = dlsym(shared_lib_handle.0, CString::new(name).unwrap().as_ptr()); if _fn.is_null() { Err("Function name could not be found.".to_string()) } else{ Ok(_fn as *mut () ) } }} pub fn get_error()->String{unsafe{ let error = dlerror(); if error.is_null(){ return "No Error".to_string(); } else{ CString::from_raw(error).into_string().unwrap() } }} pub fn close_lib(shared_lib_handle: &DyLib){unsafe{ if dlclose(shared_lib_handle.0) != 0{ println!("Could not properly close shared library."); } }} }
use std::sync::Arc; fn main() { let x = Arc::new(5); let y = x.clone(); println!("{}", x); println!("{}", y); let a = Arc::new("hi"); let b = a.clone(); println!("{}", a); println!("{}", b); let h = Arc::new(1.5); let i = h.clone(); println!("{}", h); println!("{}", i); }
extern crate handlebars; use crate::data::{VisualizationData, Visualizable, ExternalEvent, ResourceAccessPoint_extract}; use crate::svg_frontend::{code_panel, timeline_panel, utils}; use handlebars::Handlebars; use serde::Serialize; use std::cmp; use std::collections::BTreeMap; #[derive(Serialize)] struct SvgData { visualization_name: String, css: String, code: String, diagram: String, tl_id: String, tl_width: i32, height: i32, } pub fn render_svg(input_path: &String, output_path: &String, visualization_data: & mut VisualizationData) { //------------------------sort HashMap<usize, Vec<ExternalEvent>>---------------------- // first by sorting "to" from small to large number then sort by "from" from small to large number // Q: does for loop do the "move"? // Q: how is this okay?? for (line_number, event_vec) in & mut visualization_data.event_line_map{ event_vec.sort_by(|a, b| ResourceAccessPoint_extract(a).1.as_ref().unwrap().hash().cmp(&ResourceAccessPoint_extract(b).1.as_ref().unwrap().hash()) .then(ResourceAccessPoint_extract(a).0.as_ref().unwrap().hash().cmp(&ResourceAccessPoint_extract(b).0.as_ref().unwrap().hash()))); } // Q: is this a copy? //-----------------------update line number for external events------------------ for (line_number, event) in visualization_data.preprocess_external_events.clone(){ let mut extra_line : usize = 0; for (info_line_number, event_vec) in &visualization_data.event_line_map{ if info_line_number < &line_number { extra_line += (event_vec.len()-1); } else { break; } } let final_line_num = line_number.clone()+extra_line; visualization_data.append_processed_external_event(event, final_line_num); } //-----------------------update event_line_map line number------------------ let mut event_line_map_replace: BTreeMap<usize, Vec<ExternalEvent>> = BTreeMap::new(); let mut extra_line_sum = 0; for (line_number, event_vec) in &visualization_data.event_line_map { event_line_map_replace.insert(line_number+extra_line_sum, event_vec.clone()); extra_line_sum += event_vec.len()-1; } visualization_data.event_line_map = event_line_map_replace; //--------------------------------------------------------------------------- // debug!("-------------------------visualization data.timelines------------------"); // debug!("{:?}", visualization_data.timelines); // debug!("-------------------------visualization data.external_events------------------"); // debug!("{:?}", visualization_data.external_events); // debug!("-------------------------visualization data.event_line_map------------------"); // debug!("{:?}", visualization_data.event_line_map); // let example_dir_path = format!("examples/book_{}_{}/", listing_id, description); // let code_image_file_path = format!("rustBook/src/img/vis_{}_code.svg", listing_id); // let timeline_image_file_path = format!("rustBook/src/img/vis_{}_timeline.svg", listing_id); let code_image_file_path = format!("{}vis_code.svg", output_path); let timeline_image_file_path = format!("{}vis_timeline.svg", output_path); let mut code_panel_string = String::new(); let mut num_lines = 0; let svg_code_template = utils::read_file_to_string("src/svg_frontend/code_template.svg") .unwrap_or("Reading template.svg failed.".to_owned()); let svg_timeline_template = utils::read_file_to_string("src/svg_frontend/timeline_template.svg") .unwrap_or("Reading template.svg failed.".to_owned()); let mut handlebars = Handlebars::new(); // We want to preserve the inputs `as is`, and want to make no changes based on html escape. handlebars.register_escape_fn(handlebars::no_escape); let code_svg_template = svg_code_template; let tl_svg_template = svg_timeline_template; // register the template. The template string will be verified and compiled. assert!(handlebars .register_template_string("code_svg_template", code_svg_template) .is_ok()); assert!(handlebars .register_template_string("timeline_svg_template", tl_svg_template) .is_ok()); let css_string = utils::read_file_to_string("src/svg_frontend/book_svg_style.css") .unwrap_or("Reading book_svg_style.css failed.".to_owned()); // data for code panel if let Ok(lines) = utils::read_lines(input_path.to_owned() + "annotated_source.rs") { let (output, line_of_code) = code_panel::render_code_panel(lines, &visualization_data.event_line_map); code_panel_string = output; num_lines = line_of_code; } // data for tl panel let (timeline_panel_string, max_width) = timeline_panel::render_timeline_panel(visualization_data); let svg_data = SvgData { visualization_name: input_path.to_owned(), css: css_string, code: code_panel_string, diagram: timeline_panel_string, tl_id: "tl_".to_owned() + input_path, tl_width: cmp::max(max_width, 200), height: (num_lines * 20 + 80) + 50, }; let final_code_svg_content = handlebars.render("code_svg_template", &svg_data).unwrap(); let final_timeline_svg_content = handlebars.render("timeline_svg_template", &svg_data).unwrap(); // print for debugging // println!("{}", final_code_svg_content); // println!("{}", final_timeline_svg_content); // write to file // utils::create_and_write_to_file(&final_code_svg_content, example_dir_path.clone() + "rendering_code.svg"); // write svg to /examples // utils::create_and_write_to_file(&final_timeline_svg_content, example_dir_path.clone() + "rendering_timeline.svg"); // write svg to /examples utils::create_and_write_to_file(&final_code_svg_content, code_image_file_path); // write svg code utils::create_and_write_to_file(&final_timeline_svg_content, timeline_image_file_path); // write svg timeline }
// RISCV #[cfg(feature = "board_qemu")] pub const KERNEL_OFFSET: usize = 0xFFFF_FFFF_8000_0000; #[cfg(feature = "board_qemu")] pub const MEMORY_OFFSET: usize = 0x8000_0000; #[cfg(feature = "board_qemu")] pub const MEMORY_END: usize = 0x8800_0000; // TODO: get memory end from device tree #[cfg(feature = "board_d1")] pub const KERNEL_OFFSET: usize = 0xFFFFFFFF_C0000000; #[cfg(feature = "board_d1")] pub const MEMORY_OFFSET: usize = 0x40000000; #[cfg(feature = "board_d1")] pub const MEMORY_END: usize = 0x60000000; // 512M pub const PHYSICAL_MEMORY_OFFSET: usize = KERNEL_OFFSET - MEMORY_OFFSET; pub const KERNEL_HEAP_SIZE: usize = 8 * 1024 * 1024; // 8 MB pub const PAGE_SIZE: usize = 1 << 12; pub const KERNEL_L2: usize = (KERNEL_OFFSET >> 30) & 0o777; pub const PHYSICAL_MEMORY_L2: usize = (PHYSICAL_MEMORY_OFFSET >> 30) & 0o777;
use anyhow::Error; use log::{error, info, warn}; use serde::{Deserialize, Serialize}; use std::result::Result; use yew::format::Binary; use yew::services::websocket::{WebSocketService, WebSocketStatus, WebSocketTask}; use yew::services::Task; use yew::worker::*; use yew::Callback; use state_history::{Handler as ShipHandler, Ship}; static ADDRESS: &str = "ws://localhost:8080"; #[derive(Eq, PartialEq)] pub enum ConnectionStatus { Offline, Online, } #[derive(Serialize, Deserialize, Debug)] pub enum Request { Connect, Subscribe, Unsubscribe, } #[derive(Serialize, Deserialize, Debug, Copy, Clone)] pub enum Response { Connected, Disconnected, UpdatedHeadLib(u32, u32), } #[derive(Debug)] pub enum ResponseType { Text(String), Binary(Vec<u8>), Error(Error), } impl From<Result<String, Error>> for ResponseType { fn from(data: Result<String, Error>) -> Self { match data { Ok(data) => ResponseType::Text(data), Err(e) => ResponseType::Error(e), } } } impl From<Result<Vec<u8>, Error>> for ResponseType { fn from(data: Result<Vec<u8>, Error>) -> Self { match data { Ok(data) => ResponseType::Binary(data), Err(e) => ResponseType::Error(e), } } } pub enum Msg { SetConnected, SetDisconnected, NotifyHeadLib, WsResponse(ResponseType), } struct ShipTask { ws: WebSocketTask, head_lib_callback: Callback<(u32, u32)>, } impl ShipHandler for ShipTask { fn request_bin(&mut self, bin: Vec<u8>) { let bin: Binary = Ok(bin); self.ws.send_binary(bin); } fn notify_head_lib(&self, head_lib: (u32, u32)) { self.head_lib_callback.emit(head_lib); } } pub struct ShipWorker { link: AgentLink<ShipWorker>, subscribers: Vec<HandlerId>, ws_service: WebSocketService, status: ConnectionStatus, ship: Option<Ship<ShipTask>>, } impl Agent for ShipWorker { type Reach = Context; type Message = Msg; type Input = Request; type Output = Response; fn create(link: AgentLink<Self>) -> Self { ShipWorker { link, ws_service: WebSocketService::new(), // ws: None, subscribers: vec![], status: ConnectionStatus::Offline, ship: None, } } fn update(&mut self, msg: Self::Message) { match msg { Msg::SetConnected => { self.status = ConnectionStatus::Online; self.notify_subscribers(Response::Connected); } Msg::SetDisconnected => { self.status = ConnectionStatus::Offline; self.ship = None; // self.ws = None; self.notify_subscribers(Response::Disconnected); } Msg::NotifyHeadLib => { if let Some(ship) = &self.ship { let (head, lib) = ship.get_state(); self.notify_subscribers(Response::UpdatedHeadLib(head, lib)); } } Msg::WsResponse(data) => { if let Some(ship) = &mut self.ship { match data { ResponseType::Binary(bin) => ship .process_ship_binary(bin) .unwrap_or_else(|_| self.disconnect()), ResponseType::Text(txt) => ship .process_ship_text(txt) .unwrap_or_else(|_| self.disconnect()), ResponseType::Error(e) => { error!("ship ws got error, disconnecting...\n{:?}", e); self.disconnect(); } } } } } } fn handle_input(&mut self, msg: Self::Input, who: HandlerId) { match msg { Request::Connect => self.connect(), Request::Subscribe => self.subscribers.push(who), Request::Unsubscribe => self.subscribers.retain(|&i| i != who), } } } impl ShipWorker { fn notify_subscribers(&self, response: Response) { self.subscribers .iter() .for_each(|&i| self.link.respond(i, response)); } fn connect(&mut self) { if self.ship.is_some() { warn!("ship websocket connection is in progress..."); return; } let ws_callback = self .link .callback(|data: ResponseType| Msg::WsResponse(data)); let notification_callback = self.link.callback(|status| match status { WebSocketStatus::Opened => Msg::SetConnected, WebSocketStatus::Closed | WebSocketStatus::Error => Msg::SetDisconnected, }); let ws = self .ws_service .connect(ADDRESS, ws_callback, notification_callback) .expect("fail to instantiate websocket"); let head_lib_callback = self .link .callback(|_head_lib: (u32, u32)| Msg::NotifyHeadLib); let ship_task = ShipTask { ws, head_lib_callback, }; self.ship = Some(Ship::new(ship_task)); } fn disconnect(&mut self) { if self.ship.is_none() { warn!("ship websocket is already off..."); } else { self.ship.take().unwrap().handler.ws.cancel(); self.ship = None; } } }
pub use super::super::super::{Rocket, Stage, Engine}; use crate::runtime::renderer::views::deep_dive::dict::Fuel; pub fn wiki() -> Rocket { Rocket { name: "Falcon 9 Block 5".to_string(), stages: vec![ Stage { name: "Booster".to_string(), engines: vec![ Engine { count: 9, name: "Merlin 1D+".to_string(), class: "Atmospheric".to_string(), manufacturer: "SpaceX".to_string(), engine_type: "Bi-propellant".to_string(), thrust_sea: "845 kN".to_string(), thrust_vac: "981 kN".to_string(), thrust_weight_sea: "86,166 kgf".to_string(), thrust_weight_vac: "100,035 kgf".to_string(), cycle: "Gas Generator".to_string(), fuels: vec![ Fuel { name: "Liquid Oxygen".to_string(), abbrev: "LOX".to_string(), class: "".to_string(), density_g_ml: "1.141 g/ml".to_string(), mass_kg_l: "1.141 kg/l".to_string(), }, Fuel { name: "Refined Petroleum 1".to_string(), abbrev: "RP-1".to_string(), class: "".to_string(), density_g_ml: "0.81".to_string(), mass_kg_l: "0.81 kg/l".to_string(), } ], specific_impulse: "310 Seconds".to_string(), gimbal: "??? Degrees".to_string(), min_throttle: "57%".to_string(), min_throttle_as_newtons: "482 kN".to_string(), min_throttle_sea: "64%".to_string(), min_throttle_sea_as_newtons: "626 kN".to_string(), } ], thrust_weight_sea: "775, 494 kgf".to_string(), thrust_weight_vac: "900, 315 kgf".to_string(), } ], reusable: "Fully".to_string(), entered_service: "".to_string(), retired: false, retired_date: "".to_string(), human_rated: true, capacity_leo: "".to_string(), capacity_gto: "".to_string(), capacity_mto: "".to_string(), height: "".to_string(), diameter: "".to_string(), country: "USA".to_string(), manufacturer: "SpaceX".to_string(), family: "Falcon".to_string(), first_flight: "".to_string(), } }
//! ```elixir //! # label 1 //! # pushed to stack: () //! # returned from call: {:ok, document} //! # full stack: ({:ok, document}) //! # returns: {:ok, body} | :error //! body_tuple = Lumen.Web.Document.body(document) //! Lumen.Web.Wait.with_return(body_tuple) //! ``` use std::convert::TryInto; use liblumen_alloc::erts::process::Process; use liblumen_alloc::erts::term::prelude::*; #[native_implemented::label] fn result(process: &Process, ok_document: Term) -> Term { assert!( ok_document.is_boxed_tuple(), "ok_document ({:?}) is not a tuple", ok_document ); let ok_document_tuple: Boxed<Tuple> = ok_document.try_into().unwrap(); assert_eq!(ok_document_tuple.len(), 2); assert_eq!(ok_document_tuple[0], Atom::str_to_term("ok")); let document = ok_document_tuple[1]; assert!(document.is_boxed_resource_reference()); process.queue_frame_with_arguments( liblumen_web::document::body_1::frame().with_arguments(false, &[document]), ); Term::NONE }
/* This is a Rust program to read integer input from the user and print it */ use std::io; use std::process; // process::exit(1) function is available in std::process fn main() { let mut a = String::new(); println!("Enter a number:"); // Reading the input from user io::stdin() .read_line(&mut a) .expect("Unable to read input!"); // Other variants of signed integers 18, i16, i64 and isize, // and unsigned integers u8, u16, u32, u64 and usize can be read by // replacing i32 with respective data types. // The same way, float can be read using f32(single precision) or f64(double precision) // by replacing i32 with respective data types. // With the piece of code below, extract only integer(i32) data. // If any other data is present, this prints Invalid input and exits. let a: f32 = match a.trim().parse() { Ok(num) => num, Err(_) => { println!("Invalid input."); process::exit(1); } }; println!("Given number is: {}",a); }
#![feature(test)] extern crate test; use std::hint::black_box; use test::Bencher; use wasabi_leb128::{ReadLeb128, WriteLeb128}; const VALUES: [i64; 13] = [ -100000, -10000, -1000, -100, -10, -1, 0, 1, 10, 100, 1000, 10000, 100000, ]; const ITERATIONS: usize = 10_000; // Use the gimli.rs leb128 crate as a baseline, since it has already been optimized a bit, it seems. #[bench] fn bench_read_gimli(bencher: &mut Bencher) { for &i in &VALUES { let mut vec = Vec::new(); gimli_leb128::write::signed(&mut vec, i).unwrap(); bencher.iter(|| { for _ in 0..ITERATIONS { let result: i64 = gimli_leb128::read::signed(&mut vec.as_slice()).unwrap(); black_box(result); } }) } } #[bench] fn bench_read_ours(bencher: &mut Bencher) { for &i in &VALUES { let mut vec = Vec::new(); vec.write_leb128(i).unwrap(); bencher.iter(|| { for _ in 0..ITERATIONS { let result: i64 = vec.as_slice().read_leb128().unwrap().0; black_box(result); } }) } } #[bench] fn bench_write_gimli(bencher: &mut Bencher) { for &i in &VALUES { let mut vec = Vec::new(); bencher.iter(|| { for _ in 0..ITERATIONS { black_box(gimli_leb128::write::signed(&mut vec, i).unwrap()); } }) } } #[bench] fn bench_write_ours(bencher: &mut Bencher) { for &i in &VALUES { let mut vec = Vec::new(); bencher.iter(|| { for _ in 0..ITERATIONS { black_box(vec.write_leb128(i).unwrap()); } }) } }
use crate::io::read_bytes; use std::io::Read; use std::result::Result; pub fn read_varint<R>(reader: &mut R) -> Result<u8, ()> where R: Read, { let mut result = 0; let mut pos = 0; loop { let bytes = read_bytes(reader, 1); if bytes.is_empty() { assert_ne!(pos, 0); return Err(()); } let byte = bytes[0]; // We only read one byte anyway. result |= (byte & 0x80) << pos; pos += 7; if byte & 0x80 != 0 { assert!(byte != 0 || pos == 7); return Ok(result); } } } pub fn read_identifier<R>(reader: &mut R) -> Result<(u8, u8), String> where R: Read, { let identifier = match read_varint(reader) { Ok(v) => { v } Err(_) => { return Err("Failed to read identifier!".to_string()); } }; Ok((identifier >> 3, identifier & 0x07)) }
#[macro_use] extern crate lazy_static; pub mod commands; pub mod events; pub mod jitqueue; mod socket; pub mod stats;
/* * Firecracker API * * RESTful public-facing API. The API is accessible through HTTP calls on specific URLs carrying JSON modeled data. The transport medium is a Unix Domain Socket. * * The version of the OpenAPI document: 0.25.0 * Contact: compute-capsule@amazon.com * Generated by: https://openapi-generator.tech */ /// BalloonUpdate : Balloon device descriptor. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct BalloonUpdate { /// Target balloon size in MiB. #[serde(rename = "amount_mib")] pub amount_mib: i32, } impl BalloonUpdate { /// Balloon device descriptor. pub fn new(amount_mib: i32) -> BalloonUpdate { BalloonUpdate { amount_mib } } }
use crate::Error; use std::time::Duration; #[derive(Debug, Clone, PartialEq, Eq)] pub struct ClientConfig { pub(crate) bootstrap_servers: String, pub(crate) request_timeout: Duration, pub(crate) tcp_write_timeout: Duration, pub(crate) tcp_read_timeout: Duration, pub(crate) client_id: String, } impl ClientConfig { pub fn builder() -> ClientConfigBuilder { ClientConfigBuilder::default() } } pub struct ClientConfigBuilder { bootstrap_servers: Option<String>, request_timeout: Duration, tcp_write_timeout: Duration, tcp_read_timeout: Duration, } impl Default for ClientConfigBuilder { fn default() -> Self { ClientConfigBuilder { bootstrap_servers: None, request_timeout: Duration::from_secs(10), tcp_read_timeout: Duration::from_secs(1), tcp_write_timeout: Duration::from_secs(1), } } } impl ClientConfigBuilder { pub fn bootstrap_servers(mut self, val: String) -> Self { self.bootstrap_servers = Some(val); self } pub fn build(self) -> Result<ClientConfig, Error> { let bootstrap_servers = self .bootstrap_servers .map(Ok) .unwrap_or(Err(Error::IncompleteConfig("bootstrap_servers")))?; Ok(ClientConfig { bootstrap_servers, request_timeout: self.request_timeout, tcp_read_timeout: self.tcp_read_timeout, tcp_write_timeout: self.tcp_write_timeout, client_id: "rskafka".to_string(), }) } }
use std::num::Float; use std::old_io::fs::File; use std::old_io::stdio; use image::*; use vec::{ Vec3, rotate, dot }; use ray::{ Ray, Inter }; use material::Color; use object::{ Object, Objects }; use light::{ Light, Lights }; pub struct Picture { pub w: u32, pub h: u32, pub path: Path, bounce: u32, sample: u32, } impl Picture { pub fn new(w: u32, h: u32, path: &str, bounce: u32, sample: u32) -> Picture { Picture { w: w, h: h, path: Path::new(path), bounce: bounce, sample: sample } } // Picture a scene pub fn shot(&self, eye: &Eye, scene: &Scene, progress: bool) -> DynamicImage { // Initialize variables used to compute ray let w = (self.w * self.sample) as f64; let h = (self.h * self.sample) as f64; let dist = 100.; let screen_x = (eye.fov / 2.).tan() * dist; let screen_y = screen_x * h / w; let step = Vec3::new(screen_x / w, -screen_y / h, 0.); let start = Vec3::new(-screen_x / 2., screen_y / 2., -dist) + step / 2.; // Make ray let make_ray = |px, py, sx, sy| { let x = px * self.sample + sx; let y = py * self.sample + sy; let cur = Vec3::new(x as f64, y as f64, 0.); let mut dir = start + cur * step; dir = rotate(dir, eye.dir).normalize(); Ray::new(eye.pos, dir) }; // Create raw buffer of pixels let mut pixels = Vec::with_capacity((self.h * self.w) as usize); let to_u8 = 255. / (self.sample * self.sample) as f64; for py in 0..self.h { for px in 0..self.w { let color = (0..(self.sample * self.sample)) .map(|c| (c / self.sample, c % self.sample)) .map(|(sx, sy)| { // Compute color scene.raytrace(make_ray(px, py, sx, sy), 1. /* Air */, self.bounce) }) .fold(Color::new(0., 0., 0.), |acc, item| acc + item) * to_u8; // Push pixel's colors to raw buffer pixels.push(color.r as u8); pixels.push(color.g as u8); pixels.push(color.b as u8); } // Show progress if progress { print!("\r{:03}%", (py + 1) * 100 / self.h); stdio::flush(); } } // Show progress if progress { println!(""); } // Create image from raw buffer let img_buf = ImageBuffer::from_raw(self.w, self.h, pixels).unwrap(); ImageRgb8(img_buf) } // Write image to file pub fn save(&self, img: &DynamicImage) { let mut out = File::create(&self.path).unwrap(); let _ = img.save(&mut out, PNG); } } pub struct Eye { pos: Vec3, dir: Vec3, fov: f64, } impl Eye { pub fn new(pos: Vec3, dir: Vec3, fov: f64) -> Eye { Eye { pos: pos, dir: dir, fov: fov } } } pub struct Scene<'a> { objects: Objects<'a>, lights: Lights<'a>, ambient: f64, back: Color, } impl<'a> Scene<'a> { pub fn new(objects: Objects<'a>, lights: Lights<'a>, ambient: f64, back: Color) -> Scene<'a> { Scene { objects: objects, lights: lights, ambient: ambient, back: back } } #[allow(dead_code)] pub fn add_object(&mut self, object: Box<Object + 'a>) { self.objects.add(object); } #[allow(dead_code)] pub fn add_light(&mut self, light: Box<Light + 'a>) { self.lights.add(light); } pub fn raytrace(&self, ray: Ray, refr_idx: f64, count: u32) -> Color { // Compute intersection let inter = self.objects.intersect(&ray); if inter.is_none() { return self.back; } // Compute lighting let mat = &inter.as_ref().unwrap().mat; let mut color = mat.color; let (spec, diff) = self.lights.bright(&ray, inter.as_ref().unwrap(), self); color = color * diff * mat.diff + Color::new(1., 1., 1.) * spec * mat.spec; // Compute refraction if mat.refr != 0. && count > 0 { color = color + self.refraction(ray.dir, refr_idx, inter.as_ref().unwrap(), count); } // Compute reflection if mat.refl != 0. && count > 0 { color = color + self.reflection(ray.dir, refr_idx, inter.as_ref().unwrap(), count); } color.normalize() } fn refraction(&self, ray_dir: Vec3, refr_idx: f64, inter: &Inter, count: u32) -> Color { let n = refr_idx / inter.mat.refr_idx; let c1 = -dot(inter.normal, ray_dir); let c2 = (1. - n * n * (1. - c1 * c1)).sqrt(); let dir = (ray_dir * n + inter.normal * (n * c1 - c2)).normalize(); let ray = Ray::new(inter.pos + dir * 0.00001, dir); self.raytrace(ray, inter.mat.refr_idx, count - 1) * inter.mat.refr } fn reflection(&self, ray_dir: Vec3, refr_idx: f64, inter: &Inter, count: u32) -> Color { let c1 = -dot(inter.normal, ray_dir); let dir = (ray_dir + inter.normal * 2. * c1).normalize(); let ray = Ray::new(inter.pos + dir * 0.00001, dir); self.raytrace(ray, refr_idx, count - 1) * inter.mat.refl } pub fn shadow(&self, from: Vec3, to: Vec3) -> f64 { let dir = (to - from).normalize(); let ray = Ray::new(from + dir * 0.00001, dir); // Compute intersection let inter = self.objects.intersect(&ray); if inter.is_none() || (to - inter.unwrap().pos).x * dir.x < 0. { return 1.; } self.ambient } }
use gl::types::*; // BUFFER TYPES pub trait BufferType { fn value() -> GLenum; } pub struct ElementArrayBuffer(); pub struct ArrayBuffer(); impl BufferType for ArrayBuffer { fn value() -> GLenum { gl::ARRAY_BUFFER } } impl BufferType for ElementArrayBuffer { fn value() -> GLenum { gl::ELEMENT_ARRAY_BUFFER } } // BUFFER ACCES pub trait BufferAcces { fn value() -> GLenum; } pub struct StaticBuffer(); pub struct DynamicBuffer(); impl BufferAcces for StaticBuffer { fn value() -> GLenum { gl::STATIC_DRAW } } impl BufferAcces for DynamicBuffer { fn value() -> GLenum { gl::DYNAMIC_DRAW } }
// auto generated, do not modify. // created: Mon Feb 22 23:57:02 2016 // src-file: /QtGui/qimage.h // dst-file: /src/gui/qimage.rs // // header block begin => #![feature(libc)] #![feature(core)] #![feature(collections)] extern crate libc; use self::libc::*; // <= header block end // main block begin => // <= main block end // use block begin => use super::qpaintdevice::*; // 773 use std::ops::Deref; use super::super::core::qrect::*; // 771 use super::qtransform::*; // 773 use super::super::core::qsize::*; // 771 use super::super::core::qstring::*; // 771 use super::super::core::qbytearray::*; // 771 use super::super::core::qpoint::*; // 771 use super::qmatrix::*; // 773 use super::super::core::qiodevice::*; // 771 use super::super::core::qstringlist::*; // 771 use super::qpixelformat::*; // 773 use super::qcolor::*; // 773 use super::qpaintengine::*; // 773 // use super::qvector::*; // 775 // <= use block end // ext block begin => // #[link(name = "Qt5Core")] // #[link(name = "Qt5Gui")] // #[link(name = "Qt5Widgets")] // #[link(name = "QtInline")] extern { fn QImage_Class_Size() -> c_int; // proto: QImage QImage::copy(const QRect & rect); fn C_ZNK6QImage4copyERK5QRect(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: static QTransform QImage::trueMatrix(const QTransform & , int w, int h); fn C_ZN6QImage10trueMatrixERK10QTransformii(arg0: *mut c_void, arg1: c_int, arg2: c_int) -> *mut c_void; // proto: uchar * QImage::bits(); fn C_ZN6QImage4bitsEv(qthis: u64 /* *mut c_void*/) -> *mut c_uchar; // proto: void QImage::setAlphaChannel(const QImage & alphaChannel); fn C_ZN6QImage15setAlphaChannelERKS_(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: QString QImage::text(const QString & key); fn C_ZNK6QImage4textERK7QString(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void; // proto: QRect QImage::rect(); fn C_ZNK6QImage4rectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QImage::QImage(const char *const [] xpm); fn C_ZN6QImageC2EPKPKc(arg0: *mut *mut c_char) -> u64; // proto: QImage QImage::createHeuristicMask(bool clipTight); fn C_ZNK6QImage19createHeuristicMaskEb(qthis: u64 /* *mut c_void*/, arg0: c_char) -> *mut c_void; // proto: const uchar * QImage::constBits(); fn C_ZNK6QImage9constBitsEv(qthis: u64 /* *mut c_void*/) -> *mut c_uchar; // proto: QImage && QImage::mirrored(bool horizontally, bool vertically); fn C_ZNO6QImage8mirroredEbb(qthis: u64 /* *mut c_void*/, arg0: c_char, arg1: c_char) -> *mut c_void; // proto: static QImage QImage::fromData(const QByteArray & data, const char * format); fn C_ZN6QImage8fromDataERK10QByteArrayPKc(arg0: *mut c_void, arg1: *mut c_char) -> *mut c_void; // proto: static QImage QImage::fromData(const uchar * data, int size, const char * format); fn C_ZN6QImage8fromDataEPKhiPKc(arg0: *mut c_uchar, arg1: c_int, arg2: *mut c_char) -> *mut c_void; // proto: bool QImage::isDetached(); fn C_ZNK6QImage10isDetachedEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: void QImage::setOffset(const QPoint & ); fn C_ZN6QImage9setOffsetERK6QPoint(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: static QMatrix QImage::trueMatrix(const QMatrix & , int w, int h); fn C_ZN6QImage10trueMatrixERK7QMatrixii(arg0: *mut c_void, arg1: c_int, arg2: c_int) -> *mut c_void; // proto: bool QImage::isGrayscale(); fn C_ZNK6QImage11isGrayscaleEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: bool QImage::save(QIODevice * device, const char * format, int quality); fn C_ZNK6QImage4saveEP9QIODevicePKci(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_char, arg2: c_int) -> c_char; // proto: int QImage::depth(); fn C_ZNK6QImage5depthEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: QImage QImage::alphaChannel(); fn C_ZNK6QImage12alphaChannelEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: bool QImage::hasAlphaChannel(); fn C_ZNK6QImage15hasAlphaChannelEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: bool QImage::loadFromData(const uchar * buf, int len, const char * format); fn C_ZN6QImage12loadFromDataEPKhiPKc(qthis: u64 /* *mut c_void*/, arg0: *mut c_uchar, arg1: c_int, arg2: *mut c_char) -> c_char; // proto: QImage && QImage::rgbSwapped(); fn C_ZNO6QImage10rgbSwappedEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: int QImage::colorCount(); fn C_ZNK6QImage10colorCountEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: bool QImage::allGray(); fn C_ZNK6QImage7allGrayEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: void QImage::setColorCount(int ); fn C_ZN6QImage13setColorCountEi(qthis: u64 /* *mut c_void*/, arg0: c_int); // proto: QRgb QImage::pixel(const QPoint & pt); fn C_ZNK6QImage5pixelERK6QPoint(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_uint; // proto: void QImage::setDevicePixelRatio(qreal scaleFactor); fn C_ZN6QImage19setDevicePixelRatioEd(qthis: u64 /* *mut c_void*/, arg0: c_double); // proto: QImage QImage::copy(int x, int y, int w, int h); fn C_ZNK6QImage4copyEiiii(qthis: u64 /* *mut c_void*/, arg0: c_int, arg1: c_int, arg2: c_int, arg3: c_int) -> *mut c_void; // proto: void QImage::setText(const QString & key, const QString & value); fn C_ZN6QImage7setTextERK7QStringS2_(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_void); // proto: QRgb QImage::color(int i); fn C_ZNK6QImage5colorEi(qthis: u64 /* *mut c_void*/, arg0: c_int) -> c_uint; // proto: void QImage::setPixel(const QPoint & pt, uint index_or_rgb); fn C_ZN6QImage8setPixelERK6QPointj(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: c_uint); // proto: QPoint QImage::offset(); fn C_ZNK6QImage6offsetEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: const uchar * QImage::constScanLine(int ); fn C_ZNK6QImage13constScanLineEi(qthis: u64 /* *mut c_void*/, arg0: c_int) -> *mut c_uchar; // proto: QStringList QImage::textKeys(); fn C_ZNK6QImage8textKeysEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: int QImage::dotsPerMeterY(); fn C_ZNK6QImage13dotsPerMeterYEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: void QImage::fill(uint pixel); fn C_ZN6QImage4fillEj(qthis: u64 /* *mut c_void*/, arg0: c_uint); // proto: QPixelFormat QImage::pixelFormat(); fn C_ZNK6QImage11pixelFormatEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: int QImage::dotsPerMeterX(); fn C_ZNK6QImage13dotsPerMeterXEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: void QImage::setDotsPerMeterY(int ); fn C_ZN6QImage16setDotsPerMeterYEi(qthis: u64 /* *mut c_void*/, arg0: c_int); // proto: int QImage::bitPlaneCount(); fn C_ZNK6QImage13bitPlaneCountEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: void QImage::fill(const QColor & color); fn C_ZN6QImage4fillERK6QColor(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: void QImage::detach(); fn C_ZN6QImage6detachEv(qthis: u64 /* *mut c_void*/); // proto: bool QImage::loadFromData(const QByteArray & data, const char * aformat); fn C_ZN6QImage12loadFromDataERK10QByteArrayPKc(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_char) -> c_char; // proto: void QImage::QImage(const QString & fileName, const char * format); fn C_ZN6QImageC2ERK7QStringPKc(arg0: *mut c_void, arg1: *mut c_char) -> u64; // proto: QPaintEngine * QImage::paintEngine(); fn C_ZNK6QImage11paintEngineEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: void QImage::QImage(const QImage & ); fn C_ZN6QImageC2ERKS_(arg0: *mut c_void) -> u64; // proto: void QImage::swap(QImage & other); fn C_ZN6QImage4swapERS_(qthis: u64 /* *mut c_void*/, arg0: *mut c_void); // proto: qreal QImage::devicePixelRatio(); fn C_ZNK6QImage16devicePixelRatioEv(qthis: u64 /* *mut c_void*/) -> c_double; // proto: int QImage::devType(); fn C_ZNK6QImage7devTypeEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: bool QImage::valid(const QPoint & pt); fn C_ZNK6QImage5validERK6QPoint(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char; // proto: int QImage::pixelIndex(const QPoint & pt); fn C_ZNK6QImage10pixelIndexERK6QPoint(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_int; // proto: void QImage::setDotsPerMeterX(int ); fn C_ZN6QImage16setDotsPerMeterXEi(qthis: u64 /* *mut c_void*/, arg0: c_int); // proto: void QImage::setPixel(int x, int y, uint index_or_rgb); fn C_ZN6QImage8setPixelEiij(qthis: u64 /* *mut c_void*/, arg0: c_int, arg1: c_int, arg2: c_uint); // proto: bool QImage::load(const QString & fileName, const char * format); fn C_ZN6QImage4loadERK7QStringPKc(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_char) -> c_char; // proto: QVector<QRgb> QImage::colorTable(); fn C_ZNK6QImage10colorTableEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: QSize QImage::size(); fn C_ZNK6QImage4sizeEv(qthis: u64 /* *mut c_void*/) -> *mut c_void; // proto: int QImage::height(); fn C_ZNK6QImage6heightEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: int QImage::pixelIndex(int x, int y); fn C_ZNK6QImage10pixelIndexEii(qthis: u64 /* *mut c_void*/, arg0: c_int, arg1: c_int) -> c_int; // proto: int QImage::width(); fn C_ZNK6QImage5widthEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: bool QImage::load(QIODevice * device, const char * format); fn C_ZN6QImage4loadEP9QIODevicePKc(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_char) -> c_char; // proto: void QImage::QImage(); fn C_ZN6QImageC2Ev() -> u64; // proto: uchar * QImage::scanLine(int ); fn C_ZN6QImage8scanLineEi(qthis: u64 /* *mut c_void*/, arg0: c_int) -> *mut c_uchar; // proto: int QImage::bytesPerLine(); fn C_ZNK6QImage12bytesPerLineEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: qint64 QImage::cacheKey(); fn C_ZNK6QImage8cacheKeyEv(qthis: u64 /* *mut c_void*/) -> c_longlong; // proto: QRgb QImage::pixel(int x, int y); fn C_ZNK6QImage5pixelEii(qthis: u64 /* *mut c_void*/, arg0: c_int, arg1: c_int) -> c_uint; // proto: void QImage::~QImage(); fn C_ZN6QImageD2Ev(qthis: u64 /* *mut c_void*/); // proto: bool QImage::save(const QString & fileName, const char * format, int quality); fn C_ZNK6QImage4saveERK7QStringPKci(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: *mut c_char, arg2: c_int) -> c_char; // proto: void QImage::setColor(int i, QRgb c); fn C_ZN6QImage8setColorEij(qthis: u64 /* *mut c_void*/, arg0: c_int, arg1: c_uint); // proto: bool QImage::isNull(); fn C_ZNK6QImage6isNullEv(qthis: u64 /* *mut c_void*/) -> c_char; // proto: int QImage::byteCount(); fn C_ZNK6QImage9byteCountEv(qthis: u64 /* *mut c_void*/) -> c_int; // proto: bool QImage::valid(int x, int y); fn C_ZNK6QImage5validEii(qthis: u64 /* *mut c_void*/, arg0: c_int, arg1: c_int) -> c_char; } // <= ext block end // body block begin => // class sizeof(QImage)=32 #[derive(Default)] pub struct QImage { qbase: QPaintDevice, pub qclsinst: u64 /* *mut c_void*/, } impl /*struct*/ QImage { pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QImage { return QImage{qbase: QPaintDevice::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; } } impl Deref for QImage { type Target = QPaintDevice; fn deref(&self) -> &QPaintDevice { return & self.qbase; } } impl AsRef<QPaintDevice> for QImage { fn as_ref(& self) -> & QPaintDevice { return & self.qbase; } } // proto: QImage QImage::copy(const QRect & rect); impl /*struct*/ QImage { pub fn copy<RetType, T: QImage_copy<RetType>>(& self, overload_args: T) -> RetType { return overload_args.copy(self); // return 1; } } pub trait QImage_copy<RetType> { fn copy(self , rsthis: & QImage) -> RetType; } // proto: QImage QImage::copy(const QRect & rect); impl<'a> /*trait*/ QImage_copy<QImage> for (Option<&'a QRect>) { fn copy(self , rsthis: & QImage) -> QImage { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage4copyERK5QRect()}; let arg0 = (if self.is_none() {QRect::new(()).qclsinst} else {self.unwrap().qclsinst}) as *mut c_void; let mut ret = unsafe {C_ZNK6QImage4copyERK5QRect(rsthis.qclsinst, arg0)}; let mut ret1 = QImage::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: static QTransform QImage::trueMatrix(const QTransform & , int w, int h); impl /*struct*/ QImage { pub fn trueMatrix_s<RetType, T: QImage_trueMatrix_s<RetType>>( overload_args: T) -> RetType { return overload_args.trueMatrix_s(); // return 1; } } pub trait QImage_trueMatrix_s<RetType> { fn trueMatrix_s(self ) -> RetType; } // proto: static QTransform QImage::trueMatrix(const QTransform & , int w, int h); impl<'a> /*trait*/ QImage_trueMatrix_s<QTransform> for (&'a QTransform, i32, i32) { fn trueMatrix_s(self ) -> QTransform { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage10trueMatrixERK10QTransformii()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1 as c_int; let arg2 = self.2 as c_int; let mut ret = unsafe {C_ZN6QImage10trueMatrixERK10QTransformii(arg0, arg1, arg2)}; let mut ret1 = QTransform::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: uchar * QImage::bits(); impl /*struct*/ QImage { pub fn bits<RetType, T: QImage_bits<RetType>>(& self, overload_args: T) -> RetType { return overload_args.bits(self); // return 1; } } pub trait QImage_bits<RetType> { fn bits(self , rsthis: & QImage) -> RetType; } // proto: uchar * QImage::bits(); impl<'a> /*trait*/ QImage_bits<String> for () { fn bits(self , rsthis: & QImage) -> String { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage4bitsEv()}; let mut ret = unsafe {C_ZN6QImage4bitsEv(rsthis.qclsinst)}; let slen = unsafe {strlen(ret as *const i8)} as usize; return unsafe{String::from_raw_parts(ret as *mut u8, slen, slen+1)}; // return 1; } } // proto: void QImage::setAlphaChannel(const QImage & alphaChannel); impl /*struct*/ QImage { pub fn setAlphaChannel<RetType, T: QImage_setAlphaChannel<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setAlphaChannel(self); // return 1; } } pub trait QImage_setAlphaChannel<RetType> { fn setAlphaChannel(self , rsthis: & QImage) -> RetType; } // proto: void QImage::setAlphaChannel(const QImage & alphaChannel); impl<'a> /*trait*/ QImage_setAlphaChannel<()> for (&'a QImage) { fn setAlphaChannel(self , rsthis: & QImage) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage15setAlphaChannelERKS_()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN6QImage15setAlphaChannelERKS_(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QString QImage::text(const QString & key); impl /*struct*/ QImage { pub fn text<RetType, T: QImage_text<RetType>>(& self, overload_args: T) -> RetType { return overload_args.text(self); // return 1; } } pub trait QImage_text<RetType> { fn text(self , rsthis: & QImage) -> RetType; } // proto: QString QImage::text(const QString & key); impl<'a> /*trait*/ QImage_text<QString> for (Option<&'a QString>) { fn text(self , rsthis: & QImage) -> QString { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage4textERK7QString()}; let arg0 = (if self.is_none() {QString::new(()).qclsinst} else {self.unwrap().qclsinst}) as *mut c_void; let mut ret = unsafe {C_ZNK6QImage4textERK7QString(rsthis.qclsinst, arg0)}; let mut ret1 = QString::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: QRect QImage::rect(); impl /*struct*/ QImage { pub fn rect<RetType, T: QImage_rect<RetType>>(& self, overload_args: T) -> RetType { return overload_args.rect(self); // return 1; } } pub trait QImage_rect<RetType> { fn rect(self , rsthis: & QImage) -> RetType; } // proto: QRect QImage::rect(); impl<'a> /*trait*/ QImage_rect<QRect> for () { fn rect(self , rsthis: & QImage) -> QRect { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage4rectEv()}; let mut ret = unsafe {C_ZNK6QImage4rectEv(rsthis.qclsinst)}; let mut ret1 = QRect::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QImage::QImage(const char *const [] xpm); impl /*struct*/ QImage { pub fn new<T: QImage_new>(value: T) -> QImage { let rsthis = value.new(); return rsthis; // return 1; } } pub trait QImage_new { fn new(self) -> QImage; } // proto: void QImage::QImage(const char *const [] xpm); impl<'a> /*trait*/ QImage_new for (&'a Vec<&'a i8>) { fn new(self) -> QImage { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImageC2EPKPKc()}; let ctysz: c_int = unsafe{QImage_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self.as_ptr() as *mut *mut c_char; let qthis: u64 = unsafe {C_ZN6QImageC2EPKPKc(arg0)}; let rsthis = QImage{qbase: QPaintDevice::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: QImage QImage::createHeuristicMask(bool clipTight); impl /*struct*/ QImage { pub fn createHeuristicMask<RetType, T: QImage_createHeuristicMask<RetType>>(& self, overload_args: T) -> RetType { return overload_args.createHeuristicMask(self); // return 1; } } pub trait QImage_createHeuristicMask<RetType> { fn createHeuristicMask(self , rsthis: & QImage) -> RetType; } // proto: QImage QImage::createHeuristicMask(bool clipTight); impl<'a> /*trait*/ QImage_createHeuristicMask<QImage> for (Option<i8>) { fn createHeuristicMask(self , rsthis: & QImage) -> QImage { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage19createHeuristicMaskEb()}; let arg0 = (if self.is_none() {true as i8} else {self.unwrap()}) as c_char; let mut ret = unsafe {C_ZNK6QImage19createHeuristicMaskEb(rsthis.qclsinst, arg0)}; let mut ret1 = QImage::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: const uchar * QImage::constBits(); impl /*struct*/ QImage { pub fn constBits<RetType, T: QImage_constBits<RetType>>(& self, overload_args: T) -> RetType { return overload_args.constBits(self); // return 1; } } pub trait QImage_constBits<RetType> { fn constBits(self , rsthis: & QImage) -> RetType; } // proto: const uchar * QImage::constBits(); impl<'a> /*trait*/ QImage_constBits<String> for () { fn constBits(self , rsthis: & QImage) -> String { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage9constBitsEv()}; let mut ret = unsafe {C_ZNK6QImage9constBitsEv(rsthis.qclsinst)}; let slen = unsafe {strlen(ret as *const i8)} as usize; return unsafe{String::from_raw_parts(ret as *mut u8, slen, slen+1)}; // return 1; } } // proto: QImage && QImage::mirrored(bool horizontally, bool vertically); impl /*struct*/ QImage { pub fn mirrored<RetType, T: QImage_mirrored<RetType>>(& self, overload_args: T) -> RetType { return overload_args.mirrored(self); // return 1; } } pub trait QImage_mirrored<RetType> { fn mirrored(self , rsthis: & QImage) -> RetType; } // proto: QImage && QImage::mirrored(bool horizontally, bool vertically); impl<'a> /*trait*/ QImage_mirrored<QImage> for (Option<i8>, Option<i8>) { fn mirrored(self , rsthis: & QImage) -> QImage { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNO6QImage8mirroredEbb()}; let arg0 = (if self.0.is_none() {false as i8} else {self.0.unwrap()}) as c_char; let arg1 = (if self.1.is_none() {true as i8} else {self.1.unwrap()}) as c_char; let mut ret = unsafe {C_ZNO6QImage8mirroredEbb(rsthis.qclsinst, arg0, arg1)}; let mut ret1 = QImage::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: static QImage QImage::fromData(const QByteArray & data, const char * format); impl /*struct*/ QImage { pub fn fromData_s<RetType, T: QImage_fromData_s<RetType>>( overload_args: T) -> RetType { return overload_args.fromData_s(); // return 1; } } pub trait QImage_fromData_s<RetType> { fn fromData_s(self ) -> RetType; } // proto: static QImage QImage::fromData(const QByteArray & data, const char * format); impl<'a> /*trait*/ QImage_fromData_s<QImage> for (&'a QByteArray, Option<&'a String>) { fn fromData_s(self ) -> QImage { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage8fromDataERK10QByteArrayPKc()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {0 as *const u8} else {self.1.unwrap().as_ptr()}) as *mut c_char; let mut ret = unsafe {C_ZN6QImage8fromDataERK10QByteArrayPKc(arg0, arg1)}; let mut ret1 = QImage::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: static QImage QImage::fromData(const uchar * data, int size, const char * format); impl<'a> /*trait*/ QImage_fromData_s<QImage> for (&'a String, i32, Option<&'a String>) { fn fromData_s(self ) -> QImage { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage8fromDataEPKhiPKc()}; let arg0 = self.0.as_ptr() as *mut c_uchar; let arg1 = self.1 as c_int; let arg2 = (if self.2.is_none() {0 as *const u8} else {self.2.unwrap().as_ptr()}) as *mut c_char; let mut ret = unsafe {C_ZN6QImage8fromDataEPKhiPKc(arg0, arg1, arg2)}; let mut ret1 = QImage::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QImage::isDetached(); impl /*struct*/ QImage { pub fn isDetached<RetType, T: QImage_isDetached<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isDetached(self); // return 1; } } pub trait QImage_isDetached<RetType> { fn isDetached(self , rsthis: & QImage) -> RetType; } // proto: bool QImage::isDetached(); impl<'a> /*trait*/ QImage_isDetached<i8> for () { fn isDetached(self , rsthis: & QImage) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage10isDetachedEv()}; let mut ret = unsafe {C_ZNK6QImage10isDetachedEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: void QImage::setOffset(const QPoint & ); impl /*struct*/ QImage { pub fn setOffset<RetType, T: QImage_setOffset<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setOffset(self); // return 1; } } pub trait QImage_setOffset<RetType> { fn setOffset(self , rsthis: & QImage) -> RetType; } // proto: void QImage::setOffset(const QPoint & ); impl<'a> /*trait*/ QImage_setOffset<()> for (&'a QPoint) { fn setOffset(self , rsthis: & QImage) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage9setOffsetERK6QPoint()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN6QImage9setOffsetERK6QPoint(rsthis.qclsinst, arg0)}; // return 1; } } // proto: static QMatrix QImage::trueMatrix(const QMatrix & , int w, int h); impl<'a> /*trait*/ QImage_trueMatrix_s<QMatrix> for (&'a QMatrix, i32, i32) { fn trueMatrix_s(self ) -> QMatrix { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage10trueMatrixERK7QMatrixii()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1 as c_int; let arg2 = self.2 as c_int; let mut ret = unsafe {C_ZN6QImage10trueMatrixERK7QMatrixii(arg0, arg1, arg2)}; let mut ret1 = QMatrix::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QImage::isGrayscale(); impl /*struct*/ QImage { pub fn isGrayscale<RetType, T: QImage_isGrayscale<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isGrayscale(self); // return 1; } } pub trait QImage_isGrayscale<RetType> { fn isGrayscale(self , rsthis: & QImage) -> RetType; } // proto: bool QImage::isGrayscale(); impl<'a> /*trait*/ QImage_isGrayscale<i8> for () { fn isGrayscale(self , rsthis: & QImage) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage11isGrayscaleEv()}; let mut ret = unsafe {C_ZNK6QImage11isGrayscaleEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: bool QImage::save(QIODevice * device, const char * format, int quality); impl /*struct*/ QImage { pub fn save<RetType, T: QImage_save<RetType>>(& self, overload_args: T) -> RetType { return overload_args.save(self); // return 1; } } pub trait QImage_save<RetType> { fn save(self , rsthis: & QImage) -> RetType; } // proto: bool QImage::save(QIODevice * device, const char * format, int quality); impl<'a> /*trait*/ QImage_save<i8> for (&'a QIODevice, Option<&'a String>, Option<i32>) { fn save(self , rsthis: & QImage) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage4saveEP9QIODevicePKci()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {0 as *const u8} else {self.1.unwrap().as_ptr()}) as *mut c_char; let arg2 = (if self.2.is_none() {-1} else {self.2.unwrap()}) as c_int; let mut ret = unsafe {C_ZNK6QImage4saveEP9QIODevicePKci(rsthis.qclsinst, arg0, arg1, arg2)}; return ret as i8; // 1 // return 1; } } // proto: int QImage::depth(); impl /*struct*/ QImage { pub fn depth<RetType, T: QImage_depth<RetType>>(& self, overload_args: T) -> RetType { return overload_args.depth(self); // return 1; } } pub trait QImage_depth<RetType> { fn depth(self , rsthis: & QImage) -> RetType; } // proto: int QImage::depth(); impl<'a> /*trait*/ QImage_depth<i32> for () { fn depth(self , rsthis: & QImage) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage5depthEv()}; let mut ret = unsafe {C_ZNK6QImage5depthEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: QImage QImage::alphaChannel(); impl /*struct*/ QImage { pub fn alphaChannel<RetType, T: QImage_alphaChannel<RetType>>(& self, overload_args: T) -> RetType { return overload_args.alphaChannel(self); // return 1; } } pub trait QImage_alphaChannel<RetType> { fn alphaChannel(self , rsthis: & QImage) -> RetType; } // proto: QImage QImage::alphaChannel(); impl<'a> /*trait*/ QImage_alphaChannel<QImage> for () { fn alphaChannel(self , rsthis: & QImage) -> QImage { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage12alphaChannelEv()}; let mut ret = unsafe {C_ZNK6QImage12alphaChannelEv(rsthis.qclsinst)}; let mut ret1 = QImage::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: bool QImage::hasAlphaChannel(); impl /*struct*/ QImage { pub fn hasAlphaChannel<RetType, T: QImage_hasAlphaChannel<RetType>>(& self, overload_args: T) -> RetType { return overload_args.hasAlphaChannel(self); // return 1; } } pub trait QImage_hasAlphaChannel<RetType> { fn hasAlphaChannel(self , rsthis: & QImage) -> RetType; } // proto: bool QImage::hasAlphaChannel(); impl<'a> /*trait*/ QImage_hasAlphaChannel<i8> for () { fn hasAlphaChannel(self , rsthis: & QImage) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage15hasAlphaChannelEv()}; let mut ret = unsafe {C_ZNK6QImage15hasAlphaChannelEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: bool QImage::loadFromData(const uchar * buf, int len, const char * format); impl /*struct*/ QImage { pub fn loadFromData<RetType, T: QImage_loadFromData<RetType>>(& self, overload_args: T) -> RetType { return overload_args.loadFromData(self); // return 1; } } pub trait QImage_loadFromData<RetType> { fn loadFromData(self , rsthis: & QImage) -> RetType; } // proto: bool QImage::loadFromData(const uchar * buf, int len, const char * format); impl<'a> /*trait*/ QImage_loadFromData<i8> for (&'a String, i32, Option<&'a String>) { fn loadFromData(self , rsthis: & QImage) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage12loadFromDataEPKhiPKc()}; let arg0 = self.0.as_ptr() as *mut c_uchar; let arg1 = self.1 as c_int; let arg2 = (if self.2.is_none() {0 as *const u8} else {self.2.unwrap().as_ptr()}) as *mut c_char; let mut ret = unsafe {C_ZN6QImage12loadFromDataEPKhiPKc(rsthis.qclsinst, arg0, arg1, arg2)}; return ret as i8; // 1 // return 1; } } // proto: QImage && QImage::rgbSwapped(); impl /*struct*/ QImage { pub fn rgbSwapped<RetType, T: QImage_rgbSwapped<RetType>>(& self, overload_args: T) -> RetType { return overload_args.rgbSwapped(self); // return 1; } } pub trait QImage_rgbSwapped<RetType> { fn rgbSwapped(self , rsthis: & QImage) -> RetType; } // proto: QImage && QImage::rgbSwapped(); impl<'a> /*trait*/ QImage_rgbSwapped<QImage> for () { fn rgbSwapped(self , rsthis: & QImage) -> QImage { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNO6QImage10rgbSwappedEv()}; let mut ret = unsafe {C_ZNO6QImage10rgbSwappedEv(rsthis.qclsinst)}; let mut ret1 = QImage::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: int QImage::colorCount(); impl /*struct*/ QImage { pub fn colorCount<RetType, T: QImage_colorCount<RetType>>(& self, overload_args: T) -> RetType { return overload_args.colorCount(self); // return 1; } } pub trait QImage_colorCount<RetType> { fn colorCount(self , rsthis: & QImage) -> RetType; } // proto: int QImage::colorCount(); impl<'a> /*trait*/ QImage_colorCount<i32> for () { fn colorCount(self , rsthis: & QImage) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage10colorCountEv()}; let mut ret = unsafe {C_ZNK6QImage10colorCountEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: bool QImage::allGray(); impl /*struct*/ QImage { pub fn allGray<RetType, T: QImage_allGray<RetType>>(& self, overload_args: T) -> RetType { return overload_args.allGray(self); // return 1; } } pub trait QImage_allGray<RetType> { fn allGray(self , rsthis: & QImage) -> RetType; } // proto: bool QImage::allGray(); impl<'a> /*trait*/ QImage_allGray<i8> for () { fn allGray(self , rsthis: & QImage) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage7allGrayEv()}; let mut ret = unsafe {C_ZNK6QImage7allGrayEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: void QImage::setColorCount(int ); impl /*struct*/ QImage { pub fn setColorCount<RetType, T: QImage_setColorCount<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setColorCount(self); // return 1; } } pub trait QImage_setColorCount<RetType> { fn setColorCount(self , rsthis: & QImage) -> RetType; } // proto: void QImage::setColorCount(int ); impl<'a> /*trait*/ QImage_setColorCount<()> for (i32) { fn setColorCount(self , rsthis: & QImage) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage13setColorCountEi()}; let arg0 = self as c_int; unsafe {C_ZN6QImage13setColorCountEi(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QRgb QImage::pixel(const QPoint & pt); impl /*struct*/ QImage { pub fn pixel<RetType, T: QImage_pixel<RetType>>(& self, overload_args: T) -> RetType { return overload_args.pixel(self); // return 1; } } pub trait QImage_pixel<RetType> { fn pixel(self , rsthis: & QImage) -> RetType; } // proto: QRgb QImage::pixel(const QPoint & pt); impl<'a> /*trait*/ QImage_pixel<u32> for (&'a QPoint) { fn pixel(self , rsthis: & QImage) -> u32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage5pixelERK6QPoint()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK6QImage5pixelERK6QPoint(rsthis.qclsinst, arg0)}; return ret as u32; // 1 // return 1; } } // proto: void QImage::setDevicePixelRatio(qreal scaleFactor); impl /*struct*/ QImage { pub fn setDevicePixelRatio<RetType, T: QImage_setDevicePixelRatio<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setDevicePixelRatio(self); // return 1; } } pub trait QImage_setDevicePixelRatio<RetType> { fn setDevicePixelRatio(self , rsthis: & QImage) -> RetType; } // proto: void QImage::setDevicePixelRatio(qreal scaleFactor); impl<'a> /*trait*/ QImage_setDevicePixelRatio<()> for (f64) { fn setDevicePixelRatio(self , rsthis: & QImage) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage19setDevicePixelRatioEd()}; let arg0 = self as c_double; unsafe {C_ZN6QImage19setDevicePixelRatioEd(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QImage QImage::copy(int x, int y, int w, int h); impl<'a> /*trait*/ QImage_copy<QImage> for (i32, i32, i32, i32) { fn copy(self , rsthis: & QImage) -> QImage { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage4copyEiiii()}; let arg0 = self.0 as c_int; let arg1 = self.1 as c_int; let arg2 = self.2 as c_int; let arg3 = self.3 as c_int; let mut ret = unsafe {C_ZNK6QImage4copyEiiii(rsthis.qclsinst, arg0, arg1, arg2, arg3)}; let mut ret1 = QImage::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QImage::setText(const QString & key, const QString & value); impl /*struct*/ QImage { pub fn setText<RetType, T: QImage_setText<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setText(self); // return 1; } } pub trait QImage_setText<RetType> { fn setText(self , rsthis: & QImage) -> RetType; } // proto: void QImage::setText(const QString & key, const QString & value); impl<'a> /*trait*/ QImage_setText<()> for (&'a QString, &'a QString) { fn setText(self , rsthis: & QImage) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage7setTextERK7QStringS2_()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.qclsinst as *mut c_void; unsafe {C_ZN6QImage7setTextERK7QStringS2_(rsthis.qclsinst, arg0, arg1)}; // return 1; } } // proto: QRgb QImage::color(int i); impl /*struct*/ QImage { pub fn color<RetType, T: QImage_color<RetType>>(& self, overload_args: T) -> RetType { return overload_args.color(self); // return 1; } } pub trait QImage_color<RetType> { fn color(self , rsthis: & QImage) -> RetType; } // proto: QRgb QImage::color(int i); impl<'a> /*trait*/ QImage_color<u32> for (i32) { fn color(self , rsthis: & QImage) -> u32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage5colorEi()}; let arg0 = self as c_int; let mut ret = unsafe {C_ZNK6QImage5colorEi(rsthis.qclsinst, arg0)}; return ret as u32; // 1 // return 1; } } // proto: void QImage::setPixel(const QPoint & pt, uint index_or_rgb); impl /*struct*/ QImage { pub fn setPixel<RetType, T: QImage_setPixel<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setPixel(self); // return 1; } } pub trait QImage_setPixel<RetType> { fn setPixel(self , rsthis: & QImage) -> RetType; } // proto: void QImage::setPixel(const QPoint & pt, uint index_or_rgb); impl<'a> /*trait*/ QImage_setPixel<()> for (&'a QPoint, u32) { fn setPixel(self , rsthis: & QImage) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage8setPixelERK6QPointj()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1 as c_uint; unsafe {C_ZN6QImage8setPixelERK6QPointj(rsthis.qclsinst, arg0, arg1)}; // return 1; } } // proto: QPoint QImage::offset(); impl /*struct*/ QImage { pub fn offset<RetType, T: QImage_offset<RetType>>(& self, overload_args: T) -> RetType { return overload_args.offset(self); // return 1; } } pub trait QImage_offset<RetType> { fn offset(self , rsthis: & QImage) -> RetType; } // proto: QPoint QImage::offset(); impl<'a> /*trait*/ QImage_offset<QPoint> for () { fn offset(self , rsthis: & QImage) -> QPoint { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage6offsetEv()}; let mut ret = unsafe {C_ZNK6QImage6offsetEv(rsthis.qclsinst)}; let mut ret1 = QPoint::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: const uchar * QImage::constScanLine(int ); impl /*struct*/ QImage { pub fn constScanLine<RetType, T: QImage_constScanLine<RetType>>(& self, overload_args: T) -> RetType { return overload_args.constScanLine(self); // return 1; } } pub trait QImage_constScanLine<RetType> { fn constScanLine(self , rsthis: & QImage) -> RetType; } // proto: const uchar * QImage::constScanLine(int ); impl<'a> /*trait*/ QImage_constScanLine<String> for (i32) { fn constScanLine(self , rsthis: & QImage) -> String { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage13constScanLineEi()}; let arg0 = self as c_int; let mut ret = unsafe {C_ZNK6QImage13constScanLineEi(rsthis.qclsinst, arg0)}; let slen = unsafe {strlen(ret as *const i8)} as usize; return unsafe{String::from_raw_parts(ret as *mut u8, slen, slen+1)}; // return 1; } } // proto: QStringList QImage::textKeys(); impl /*struct*/ QImage { pub fn textKeys<RetType, T: QImage_textKeys<RetType>>(& self, overload_args: T) -> RetType { return overload_args.textKeys(self); // return 1; } } pub trait QImage_textKeys<RetType> { fn textKeys(self , rsthis: & QImage) -> RetType; } // proto: QStringList QImage::textKeys(); impl<'a> /*trait*/ QImage_textKeys<QStringList> for () { fn textKeys(self , rsthis: & QImage) -> QStringList { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage8textKeysEv()}; let mut ret = unsafe {C_ZNK6QImage8textKeysEv(rsthis.qclsinst)}; let mut ret1 = QStringList::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: int QImage::dotsPerMeterY(); impl /*struct*/ QImage { pub fn dotsPerMeterY<RetType, T: QImage_dotsPerMeterY<RetType>>(& self, overload_args: T) -> RetType { return overload_args.dotsPerMeterY(self); // return 1; } } pub trait QImage_dotsPerMeterY<RetType> { fn dotsPerMeterY(self , rsthis: & QImage) -> RetType; } // proto: int QImage::dotsPerMeterY(); impl<'a> /*trait*/ QImage_dotsPerMeterY<i32> for () { fn dotsPerMeterY(self , rsthis: & QImage) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage13dotsPerMeterYEv()}; let mut ret = unsafe {C_ZNK6QImage13dotsPerMeterYEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: void QImage::fill(uint pixel); impl /*struct*/ QImage { pub fn fill<RetType, T: QImage_fill<RetType>>(& self, overload_args: T) -> RetType { return overload_args.fill(self); // return 1; } } pub trait QImage_fill<RetType> { fn fill(self , rsthis: & QImage) -> RetType; } // proto: void QImage::fill(uint pixel); impl<'a> /*trait*/ QImage_fill<()> for (u32) { fn fill(self , rsthis: & QImage) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage4fillEj()}; let arg0 = self as c_uint; unsafe {C_ZN6QImage4fillEj(rsthis.qclsinst, arg0)}; // return 1; } } // proto: QPixelFormat QImage::pixelFormat(); impl /*struct*/ QImage { pub fn pixelFormat<RetType, T: QImage_pixelFormat<RetType>>(& self, overload_args: T) -> RetType { return overload_args.pixelFormat(self); // return 1; } } pub trait QImage_pixelFormat<RetType> { fn pixelFormat(self , rsthis: & QImage) -> RetType; } // proto: QPixelFormat QImage::pixelFormat(); impl<'a> /*trait*/ QImage_pixelFormat<QPixelFormat> for () { fn pixelFormat(self , rsthis: & QImage) -> QPixelFormat { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage11pixelFormatEv()}; let mut ret = unsafe {C_ZNK6QImage11pixelFormatEv(rsthis.qclsinst)}; let mut ret1 = QPixelFormat::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: int QImage::dotsPerMeterX(); impl /*struct*/ QImage { pub fn dotsPerMeterX<RetType, T: QImage_dotsPerMeterX<RetType>>(& self, overload_args: T) -> RetType { return overload_args.dotsPerMeterX(self); // return 1; } } pub trait QImage_dotsPerMeterX<RetType> { fn dotsPerMeterX(self , rsthis: & QImage) -> RetType; } // proto: int QImage::dotsPerMeterX(); impl<'a> /*trait*/ QImage_dotsPerMeterX<i32> for () { fn dotsPerMeterX(self , rsthis: & QImage) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage13dotsPerMeterXEv()}; let mut ret = unsafe {C_ZNK6QImage13dotsPerMeterXEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: void QImage::setDotsPerMeterY(int ); impl /*struct*/ QImage { pub fn setDotsPerMeterY<RetType, T: QImage_setDotsPerMeterY<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setDotsPerMeterY(self); // return 1; } } pub trait QImage_setDotsPerMeterY<RetType> { fn setDotsPerMeterY(self , rsthis: & QImage) -> RetType; } // proto: void QImage::setDotsPerMeterY(int ); impl<'a> /*trait*/ QImage_setDotsPerMeterY<()> for (i32) { fn setDotsPerMeterY(self , rsthis: & QImage) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage16setDotsPerMeterYEi()}; let arg0 = self as c_int; unsafe {C_ZN6QImage16setDotsPerMeterYEi(rsthis.qclsinst, arg0)}; // return 1; } } // proto: int QImage::bitPlaneCount(); impl /*struct*/ QImage { pub fn bitPlaneCount<RetType, T: QImage_bitPlaneCount<RetType>>(& self, overload_args: T) -> RetType { return overload_args.bitPlaneCount(self); // return 1; } } pub trait QImage_bitPlaneCount<RetType> { fn bitPlaneCount(self , rsthis: & QImage) -> RetType; } // proto: int QImage::bitPlaneCount(); impl<'a> /*trait*/ QImage_bitPlaneCount<i32> for () { fn bitPlaneCount(self , rsthis: & QImage) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage13bitPlaneCountEv()}; let mut ret = unsafe {C_ZNK6QImage13bitPlaneCountEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: void QImage::fill(const QColor & color); impl<'a> /*trait*/ QImage_fill<()> for (&'a QColor) { fn fill(self , rsthis: & QImage) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage4fillERK6QColor()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN6QImage4fillERK6QColor(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QImage::detach(); impl /*struct*/ QImage { pub fn detach<RetType, T: QImage_detach<RetType>>(& self, overload_args: T) -> RetType { return overload_args.detach(self); // return 1; } } pub trait QImage_detach<RetType> { fn detach(self , rsthis: & QImage) -> RetType; } // proto: void QImage::detach(); impl<'a> /*trait*/ QImage_detach<()> for () { fn detach(self , rsthis: & QImage) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage6detachEv()}; unsafe {C_ZN6QImage6detachEv(rsthis.qclsinst)}; // return 1; } } // proto: bool QImage::loadFromData(const QByteArray & data, const char * aformat); impl<'a> /*trait*/ QImage_loadFromData<i8> for (&'a QByteArray, Option<&'a String>) { fn loadFromData(self , rsthis: & QImage) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage12loadFromDataERK10QByteArrayPKc()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {0 as *const u8} else {self.1.unwrap().as_ptr()}) as *mut c_char; let mut ret = unsafe {C_ZN6QImage12loadFromDataERK10QByteArrayPKc(rsthis.qclsinst, arg0, arg1)}; return ret as i8; // 1 // return 1; } } // proto: void QImage::QImage(const QString & fileName, const char * format); impl<'a> /*trait*/ QImage_new for (&'a QString, Option<&'a String>) { fn new(self) -> QImage { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImageC2ERK7QStringPKc()}; let ctysz: c_int = unsafe{QImage_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {0 as *const u8} else {self.1.unwrap().as_ptr()}) as *mut c_char; let qthis: u64 = unsafe {C_ZN6QImageC2ERK7QStringPKc(arg0, arg1)}; let rsthis = QImage{qbase: QPaintDevice::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: QPaintEngine * QImage::paintEngine(); impl /*struct*/ QImage { pub fn paintEngine<RetType, T: QImage_paintEngine<RetType>>(& self, overload_args: T) -> RetType { return overload_args.paintEngine(self); // return 1; } } pub trait QImage_paintEngine<RetType> { fn paintEngine(self , rsthis: & QImage) -> RetType; } // proto: QPaintEngine * QImage::paintEngine(); impl<'a> /*trait*/ QImage_paintEngine<QPaintEngine> for () { fn paintEngine(self , rsthis: & QImage) -> QPaintEngine { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage11paintEngineEv()}; let mut ret = unsafe {C_ZNK6QImage11paintEngineEv(rsthis.qclsinst)}; let mut ret1 = QPaintEngine::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: void QImage::QImage(const QImage & ); impl<'a> /*trait*/ QImage_new for (&'a QImage) { fn new(self) -> QImage { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImageC2ERKS_()}; let ctysz: c_int = unsafe{QImage_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let arg0 = self.qclsinst as *mut c_void; let qthis: u64 = unsafe {C_ZN6QImageC2ERKS_(arg0)}; let rsthis = QImage{qbase: QPaintDevice::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: void QImage::swap(QImage & other); impl /*struct*/ QImage { pub fn swap<RetType, T: QImage_swap<RetType>>(& self, overload_args: T) -> RetType { return overload_args.swap(self); // return 1; } } pub trait QImage_swap<RetType> { fn swap(self , rsthis: & QImage) -> RetType; } // proto: void QImage::swap(QImage & other); impl<'a> /*trait*/ QImage_swap<()> for (&'a QImage) { fn swap(self , rsthis: & QImage) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage4swapERS_()}; let arg0 = self.qclsinst as *mut c_void; unsafe {C_ZN6QImage4swapERS_(rsthis.qclsinst, arg0)}; // return 1; } } // proto: qreal QImage::devicePixelRatio(); impl /*struct*/ QImage { pub fn devicePixelRatio<RetType, T: QImage_devicePixelRatio<RetType>>(& self, overload_args: T) -> RetType { return overload_args.devicePixelRatio(self); // return 1; } } pub trait QImage_devicePixelRatio<RetType> { fn devicePixelRatio(self , rsthis: & QImage) -> RetType; } // proto: qreal QImage::devicePixelRatio(); impl<'a> /*trait*/ QImage_devicePixelRatio<f64> for () { fn devicePixelRatio(self , rsthis: & QImage) -> f64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage16devicePixelRatioEv()}; let mut ret = unsafe {C_ZNK6QImage16devicePixelRatioEv(rsthis.qclsinst)}; return ret as f64; // 1 // return 1; } } // proto: int QImage::devType(); impl /*struct*/ QImage { pub fn devType<RetType, T: QImage_devType<RetType>>(& self, overload_args: T) -> RetType { return overload_args.devType(self); // return 1; } } pub trait QImage_devType<RetType> { fn devType(self , rsthis: & QImage) -> RetType; } // proto: int QImage::devType(); impl<'a> /*trait*/ QImage_devType<i32> for () { fn devType(self , rsthis: & QImage) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage7devTypeEv()}; let mut ret = unsafe {C_ZNK6QImage7devTypeEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: bool QImage::valid(const QPoint & pt); impl /*struct*/ QImage { pub fn valid<RetType, T: QImage_valid<RetType>>(& self, overload_args: T) -> RetType { return overload_args.valid(self); // return 1; } } pub trait QImage_valid<RetType> { fn valid(self , rsthis: & QImage) -> RetType; } // proto: bool QImage::valid(const QPoint & pt); impl<'a> /*trait*/ QImage_valid<i8> for (&'a QPoint) { fn valid(self , rsthis: & QImage) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage5validERK6QPoint()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK6QImage5validERK6QPoint(rsthis.qclsinst, arg0)}; return ret as i8; // 1 // return 1; } } // proto: int QImage::pixelIndex(const QPoint & pt); impl /*struct*/ QImage { pub fn pixelIndex<RetType, T: QImage_pixelIndex<RetType>>(& self, overload_args: T) -> RetType { return overload_args.pixelIndex(self); // return 1; } } pub trait QImage_pixelIndex<RetType> { fn pixelIndex(self , rsthis: & QImage) -> RetType; } // proto: int QImage::pixelIndex(const QPoint & pt); impl<'a> /*trait*/ QImage_pixelIndex<i32> for (&'a QPoint) { fn pixelIndex(self , rsthis: & QImage) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage10pixelIndexERK6QPoint()}; let arg0 = self.qclsinst as *mut c_void; let mut ret = unsafe {C_ZNK6QImage10pixelIndexERK6QPoint(rsthis.qclsinst, arg0)}; return ret as i32; // 1 // return 1; } } // proto: void QImage::setDotsPerMeterX(int ); impl /*struct*/ QImage { pub fn setDotsPerMeterX<RetType, T: QImage_setDotsPerMeterX<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setDotsPerMeterX(self); // return 1; } } pub trait QImage_setDotsPerMeterX<RetType> { fn setDotsPerMeterX(self , rsthis: & QImage) -> RetType; } // proto: void QImage::setDotsPerMeterX(int ); impl<'a> /*trait*/ QImage_setDotsPerMeterX<()> for (i32) { fn setDotsPerMeterX(self , rsthis: & QImage) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage16setDotsPerMeterXEi()}; let arg0 = self as c_int; unsafe {C_ZN6QImage16setDotsPerMeterXEi(rsthis.qclsinst, arg0)}; // return 1; } } // proto: void QImage::setPixel(int x, int y, uint index_or_rgb); impl<'a> /*trait*/ QImage_setPixel<()> for (i32, i32, u32) { fn setPixel(self , rsthis: & QImage) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage8setPixelEiij()}; let arg0 = self.0 as c_int; let arg1 = self.1 as c_int; let arg2 = self.2 as c_uint; unsafe {C_ZN6QImage8setPixelEiij(rsthis.qclsinst, arg0, arg1, arg2)}; // return 1; } } // proto: bool QImage::load(const QString & fileName, const char * format); impl /*struct*/ QImage { pub fn load<RetType, T: QImage_load<RetType>>(& self, overload_args: T) -> RetType { return overload_args.load(self); // return 1; } } pub trait QImage_load<RetType> { fn load(self , rsthis: & QImage) -> RetType; } // proto: bool QImage::load(const QString & fileName, const char * format); impl<'a> /*trait*/ QImage_load<i8> for (&'a QString, Option<&'a String>) { fn load(self , rsthis: & QImage) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage4loadERK7QStringPKc()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {0 as *const u8} else {self.1.unwrap().as_ptr()}) as *mut c_char; let mut ret = unsafe {C_ZN6QImage4loadERK7QStringPKc(rsthis.qclsinst, arg0, arg1)}; return ret as i8; // 1 // return 1; } } // proto: QVector<QRgb> QImage::colorTable(); impl /*struct*/ QImage { pub fn colorTable<RetType, T: QImage_colorTable<RetType>>(& self, overload_args: T) -> RetType { return overload_args.colorTable(self); // return 1; } } pub trait QImage_colorTable<RetType> { fn colorTable(self , rsthis: & QImage) -> RetType; } // proto: QVector<QRgb> QImage::colorTable(); impl<'a> /*trait*/ QImage_colorTable<u64> for () { fn colorTable(self , rsthis: & QImage) -> u64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage10colorTableEv()}; let mut ret = unsafe {C_ZNK6QImage10colorTableEv(rsthis.qclsinst)}; return ret as u64; // 5 // return 1; } } // proto: QSize QImage::size(); impl /*struct*/ QImage { pub fn size<RetType, T: QImage_size<RetType>>(& self, overload_args: T) -> RetType { return overload_args.size(self); // return 1; } } pub trait QImage_size<RetType> { fn size(self , rsthis: & QImage) -> RetType; } // proto: QSize QImage::size(); impl<'a> /*trait*/ QImage_size<QSize> for () { fn size(self , rsthis: & QImage) -> QSize { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage4sizeEv()}; let mut ret = unsafe {C_ZNK6QImage4sizeEv(rsthis.qclsinst)}; let mut ret1 = QSize::inheritFrom(ret as u64); return ret1; // return 1; } } // proto: int QImage::height(); impl /*struct*/ QImage { pub fn height<RetType, T: QImage_height<RetType>>(& self, overload_args: T) -> RetType { return overload_args.height(self); // return 1; } } pub trait QImage_height<RetType> { fn height(self , rsthis: & QImage) -> RetType; } // proto: int QImage::height(); impl<'a> /*trait*/ QImage_height<i32> for () { fn height(self , rsthis: & QImage) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage6heightEv()}; let mut ret = unsafe {C_ZNK6QImage6heightEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: int QImage::pixelIndex(int x, int y); impl<'a> /*trait*/ QImage_pixelIndex<i32> for (i32, i32) { fn pixelIndex(self , rsthis: & QImage) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage10pixelIndexEii()}; let arg0 = self.0 as c_int; let arg1 = self.1 as c_int; let mut ret = unsafe {C_ZNK6QImage10pixelIndexEii(rsthis.qclsinst, arg0, arg1)}; return ret as i32; // 1 // return 1; } } // proto: int QImage::width(); impl /*struct*/ QImage { pub fn width<RetType, T: QImage_width<RetType>>(& self, overload_args: T) -> RetType { return overload_args.width(self); // return 1; } } pub trait QImage_width<RetType> { fn width(self , rsthis: & QImage) -> RetType; } // proto: int QImage::width(); impl<'a> /*trait*/ QImage_width<i32> for () { fn width(self , rsthis: & QImage) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage5widthEv()}; let mut ret = unsafe {C_ZNK6QImage5widthEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: bool QImage::load(QIODevice * device, const char * format); impl<'a> /*trait*/ QImage_load<i8> for (&'a QIODevice, &'a String) { fn load(self , rsthis: & QImage) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage4loadEP9QIODevicePKc()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = self.1.as_ptr() as *mut c_char; let mut ret = unsafe {C_ZN6QImage4loadEP9QIODevicePKc(rsthis.qclsinst, arg0, arg1)}; return ret as i8; // 1 // return 1; } } // proto: void QImage::QImage(); impl<'a> /*trait*/ QImage_new for () { fn new(self) -> QImage { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImageC2Ev()}; let ctysz: c_int = unsafe{QImage_Class_Size()}; let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64; let qthis: u64 = unsafe {C_ZN6QImageC2Ev()}; let rsthis = QImage{qbase: QPaintDevice::inheritFrom(qthis), qclsinst: qthis, ..Default::default()}; return rsthis; // return 1; } } // proto: uchar * QImage::scanLine(int ); impl /*struct*/ QImage { pub fn scanLine<RetType, T: QImage_scanLine<RetType>>(& self, overload_args: T) -> RetType { return overload_args.scanLine(self); // return 1; } } pub trait QImage_scanLine<RetType> { fn scanLine(self , rsthis: & QImage) -> RetType; } // proto: uchar * QImage::scanLine(int ); impl<'a> /*trait*/ QImage_scanLine<String> for (i32) { fn scanLine(self , rsthis: & QImage) -> String { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage8scanLineEi()}; let arg0 = self as c_int; let mut ret = unsafe {C_ZN6QImage8scanLineEi(rsthis.qclsinst, arg0)}; let slen = unsafe {strlen(ret as *const i8)} as usize; return unsafe{String::from_raw_parts(ret as *mut u8, slen, slen+1)}; // return 1; } } // proto: int QImage::bytesPerLine(); impl /*struct*/ QImage { pub fn bytesPerLine<RetType, T: QImage_bytesPerLine<RetType>>(& self, overload_args: T) -> RetType { return overload_args.bytesPerLine(self); // return 1; } } pub trait QImage_bytesPerLine<RetType> { fn bytesPerLine(self , rsthis: & QImage) -> RetType; } // proto: int QImage::bytesPerLine(); impl<'a> /*trait*/ QImage_bytesPerLine<i32> for () { fn bytesPerLine(self , rsthis: & QImage) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage12bytesPerLineEv()}; let mut ret = unsafe {C_ZNK6QImage12bytesPerLineEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: qint64 QImage::cacheKey(); impl /*struct*/ QImage { pub fn cacheKey<RetType, T: QImage_cacheKey<RetType>>(& self, overload_args: T) -> RetType { return overload_args.cacheKey(self); // return 1; } } pub trait QImage_cacheKey<RetType> { fn cacheKey(self , rsthis: & QImage) -> RetType; } // proto: qint64 QImage::cacheKey(); impl<'a> /*trait*/ QImage_cacheKey<i64> for () { fn cacheKey(self , rsthis: & QImage) -> i64 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage8cacheKeyEv()}; let mut ret = unsafe {C_ZNK6QImage8cacheKeyEv(rsthis.qclsinst)}; return ret as i64; // 1 // return 1; } } // proto: QRgb QImage::pixel(int x, int y); impl<'a> /*trait*/ QImage_pixel<u32> for (i32, i32) { fn pixel(self , rsthis: & QImage) -> u32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage5pixelEii()}; let arg0 = self.0 as c_int; let arg1 = self.1 as c_int; let mut ret = unsafe {C_ZNK6QImage5pixelEii(rsthis.qclsinst, arg0, arg1)}; return ret as u32; // 1 // return 1; } } // proto: void QImage::~QImage(); impl /*struct*/ QImage { pub fn free<RetType, T: QImage_free<RetType>>(& self, overload_args: T) -> RetType { return overload_args.free(self); // return 1; } } pub trait QImage_free<RetType> { fn free(self , rsthis: & QImage) -> RetType; } // proto: void QImage::~QImage(); impl<'a> /*trait*/ QImage_free<()> for () { fn free(self , rsthis: & QImage) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImageD2Ev()}; unsafe {C_ZN6QImageD2Ev(rsthis.qclsinst)}; // return 1; } } // proto: bool QImage::save(const QString & fileName, const char * format, int quality); impl<'a> /*trait*/ QImage_save<i8> for (&'a QString, Option<&'a String>, Option<i32>) { fn save(self , rsthis: & QImage) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage4saveERK7QStringPKci()}; let arg0 = self.0.qclsinst as *mut c_void; let arg1 = (if self.1.is_none() {0 as *const u8} else {self.1.unwrap().as_ptr()}) as *mut c_char; let arg2 = (if self.2.is_none() {-1} else {self.2.unwrap()}) as c_int; let mut ret = unsafe {C_ZNK6QImage4saveERK7QStringPKci(rsthis.qclsinst, arg0, arg1, arg2)}; return ret as i8; // 1 // return 1; } } // proto: void QImage::setColor(int i, QRgb c); impl /*struct*/ QImage { pub fn setColor<RetType, T: QImage_setColor<RetType>>(& self, overload_args: T) -> RetType { return overload_args.setColor(self); // return 1; } } pub trait QImage_setColor<RetType> { fn setColor(self , rsthis: & QImage) -> RetType; } // proto: void QImage::setColor(int i, QRgb c); impl<'a> /*trait*/ QImage_setColor<()> for (i32, u32) { fn setColor(self , rsthis: & QImage) -> () { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZN6QImage8setColorEij()}; let arg0 = self.0 as c_int; let arg1 = self.1 as c_uint; unsafe {C_ZN6QImage8setColorEij(rsthis.qclsinst, arg0, arg1)}; // return 1; } } // proto: bool QImage::isNull(); impl /*struct*/ QImage { pub fn isNull<RetType, T: QImage_isNull<RetType>>(& self, overload_args: T) -> RetType { return overload_args.isNull(self); // return 1; } } pub trait QImage_isNull<RetType> { fn isNull(self , rsthis: & QImage) -> RetType; } // proto: bool QImage::isNull(); impl<'a> /*trait*/ QImage_isNull<i8> for () { fn isNull(self , rsthis: & QImage) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage6isNullEv()}; let mut ret = unsafe {C_ZNK6QImage6isNullEv(rsthis.qclsinst)}; return ret as i8; // 1 // return 1; } } // proto: int QImage::byteCount(); impl /*struct*/ QImage { pub fn byteCount<RetType, T: QImage_byteCount<RetType>>(& self, overload_args: T) -> RetType { return overload_args.byteCount(self); // return 1; } } pub trait QImage_byteCount<RetType> { fn byteCount(self , rsthis: & QImage) -> RetType; } // proto: int QImage::byteCount(); impl<'a> /*trait*/ QImage_byteCount<i32> for () { fn byteCount(self , rsthis: & QImage) -> i32 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage9byteCountEv()}; let mut ret = unsafe {C_ZNK6QImage9byteCountEv(rsthis.qclsinst)}; return ret as i32; // 1 // return 1; } } // proto: bool QImage::valid(int x, int y); impl<'a> /*trait*/ QImage_valid<i8> for (i32, i32) { fn valid(self , rsthis: & QImage) -> i8 { // let qthis: *mut c_void = unsafe{calloc(1, 32)}; // unsafe{_ZNK6QImage5validEii()}; let arg0 = self.0 as c_int; let arg1 = self.1 as c_int; let mut ret = unsafe {C_ZNK6QImage5validEii(rsthis.qclsinst, arg0, arg1)}; return ret as i8; // 1 // return 1; } } // <= body block end
use crate::impl_pnext; use crate::prelude::*; use std::os::raw::c_void; use std::ptr; #[repr(C)] pub struct VkPhysicalDeviceProperties2KHR { pub sType: VkStructureType, pub pNext: *const c_void, pub properties: VkPhysicalDeviceProperties, } impl VkPhysicalDeviceProperties2KHR { pub fn new(properties: VkPhysicalDeviceProperties) -> Self { VkPhysicalDeviceProperties2KHR { sType: VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR, pNext: ptr::null(), properties, } } } impl Default for VkPhysicalDeviceProperties2KHR { fn default() -> Self { Self::new(VkPhysicalDeviceProperties::default()) } } unsafe impl Sync for VkPhysicalDeviceProperties2KHR {} unsafe impl Send for VkPhysicalDeviceProperties2KHR {} impl_pnext!( VkPhysicalDeviceProperties2KHR, VkPhysicalDeviceRayTracingPropertiesNV ); impl_pnext!( VkPhysicalDeviceProperties2KHR, VkPhysicalDeviceDescriptorIndexingPropertiesEXT );
/// Score of base matching algorithm(fzy, skim, etc). pub type Score = i32; #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum RankCriterion { /// Matching score. Score, /// Char index of first matched item. Begin, /// Char index of last matched item. End, /// Length of raw text. Length, NegativeScore, NegativeBegin, NegativeEnd, NegativeLength, } pub fn parse_criteria(text: &str) -> Option<RankCriterion> { match text.to_lowercase().as_ref() { "score" => Some(RankCriterion::Score), "begin" => Some(RankCriterion::Begin), "end" => Some(RankCriterion::End), "length" => Some(RankCriterion::Length), "-score" => Some(RankCriterion::NegativeScore), "-begin" => Some(RankCriterion::NegativeBegin), "-end" => Some(RankCriterion::NegativeEnd), "-length" => Some(RankCriterion::NegativeLength), _ => None, } } /// The greater, the better. pub type Rank = [Score; 4]; #[derive(Debug, Clone)] pub struct RankCalculator { criteria: Vec<RankCriterion>, } impl Default for RankCalculator { fn default() -> Self { Self { criteria: vec![ RankCriterion::Score, RankCriterion::NegativeBegin, RankCriterion::NegativeEnd, RankCriterion::NegativeLength, ], } } } impl RankCalculator { pub fn new(mut criteria: Vec<RankCriterion>) -> Self { if !criteria.contains(&RankCriterion::Score) && !criteria.contains(&RankCriterion::NegativeScore) { criteria.insert(0, RankCriterion::Score); } criteria.dedup(); criteria.truncate(4); Self { criteria } } /// Sort criteria for [`MatchedItem`], the greater the better. pub fn calculate_rank(&self, score: Score, begin: usize, end: usize, length: usize) -> Rank { let mut rank = [0; 4]; let begin = begin as i32; let end = end as i32; let length = length as i32; for (index, criterion) in self.criteria.iter().enumerate() { let value = match criterion { RankCriterion::Score => score, RankCriterion::Begin => begin, RankCriterion::End => end, RankCriterion::Length => length, RankCriterion::NegativeScore => -score, RankCriterion::NegativeBegin => -begin, RankCriterion::NegativeEnd => -end, RankCriterion::NegativeLength => -length, }; rank[index] = value; } rank } } /// A tuple of (score, matched_indices) for the line has a match given the query string. #[derive(Debug, Clone, PartialEq, Eq)] pub struct MatchResult { pub score: Score, pub indices: Vec<usize>, } impl MatchResult { pub fn new(score: Score, indices: Vec<usize>) -> Self { Self { score, indices } } pub fn add_score(&mut self, score: Score) { self.score += score; } pub fn extend_indices(&mut self, indices: Vec<usize>) { self.indices.extend(indices); self.indices.sort_unstable(); self.indices.dedup(); } } #[cfg(test)] mod tests { use super::*; #[test] fn test_default_rank_sort() { let rank_calculator = RankCalculator::default(); let rank0 = rank_calculator.calculate_rank(99, 5, 10, 15); // The greater `score`, the higher the rank. let rank1 = rank_calculator.calculate_rank(100, 5, 10, 15); assert!(rank0 < rank1); // The smaller `begin`, the higher the rank. let rank2 = rank_calculator.calculate_rank(100, 8, 10, 15); assert!(rank1 > rank2); // The smaller `end`, the higher the rank. let rank3 = rank_calculator.calculate_rank(100, 8, 12, 15); assert!(rank2 > rank3); // The smaller `length`, the higher the rank. let rank4 = rank_calculator.calculate_rank(100, 8, 12, 17); assert!(rank3 > rank4); } }
use std::io::{self, Read}; fn parse_input(input: &String) -> Vec<i64> { input .split("\n") .map(|line| line.parse::<i64>().unwrap()) .collect::<Vec<i64>>() } fn find_sum(sum: i64, numbers: &Vec<i64>, start: usize, end: usize) -> bool { for i in numbers[start..end].iter() { for j in numbers[start..end].iter() { if i + j == sum && i != j { return true; } } } false } fn main() { let mut buffer = String::new(); io::stdin() .read_to_string(&mut buffer) .expect("Failed to read from stdin"); let numbers = parse_input(&buffer); for (index, number) in numbers[25..].iter().enumerate() { if !find_sum(*number, &numbers, index, index + 25) { println!("{}", number); break; } } }
#[doc = "Reader of register SYNC"] pub type R = crate::R<u32, super::SYNC>; #[doc = "Writer for register SYNC"] pub type W = crate::W<u32, super::SYNC>; #[doc = "Register SYNC `reset()`'s with value 0"] impl crate::ResetValue for super::SYNC { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0 } } #[doc = "Synchronize GPTM Timer 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum SYNCT0_A { #[doc = "0: GPTM0 is not affected"] NONE = 0, #[doc = "1: A timeout event for Timer A of GPTM0 is triggered"] TA = 1, #[doc = "2: A timeout event for Timer B of GPTM0 is triggered"] TB = 2, #[doc = "3: A timeout event for both Timer A and Timer B of GPTM0 is triggered"] TATB = 3, } impl From<SYNCT0_A> for u8 { #[inline(always)] fn from(variant: SYNCT0_A) -> Self { variant as _ } } #[doc = "Reader of field `SYNCT0`"] pub type SYNCT0_R = crate::R<u8, SYNCT0_A>; impl SYNCT0_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SYNCT0_A { match self.bits { 0 => SYNCT0_A::NONE, 1 => SYNCT0_A::TA, 2 => SYNCT0_A::TB, 3 => SYNCT0_A::TATB, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `NONE`"] #[inline(always)] pub fn is_none(&self) -> bool { *self == SYNCT0_A::NONE } #[doc = "Checks if the value of the field is `TA`"] #[inline(always)] pub fn is_ta(&self) -> bool { *self == SYNCT0_A::TA } #[doc = "Checks if the value of the field is `TB`"] #[inline(always)] pub fn is_tb(&self) -> bool { *self == SYNCT0_A::TB } #[doc = "Checks if the value of the field is `TATB`"] #[inline(always)] pub fn is_tatb(&self) -> bool { *self == SYNCT0_A::TATB } } #[doc = "Write proxy for field `SYNCT0`"] pub struct SYNCT0_W<'a> { w: &'a mut W, } impl<'a> SYNCT0_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SYNCT0_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "GPTM0 is not affected"] #[inline(always)] pub fn none(self) -> &'a mut W { self.variant(SYNCT0_A::NONE) } #[doc = "A timeout event for Timer A of GPTM0 is triggered"] #[inline(always)] pub fn ta(self) -> &'a mut W { self.variant(SYNCT0_A::TA) } #[doc = "A timeout event for Timer B of GPTM0 is triggered"] #[inline(always)] pub fn tb(self) -> &'a mut W { self.variant(SYNCT0_A::TB) } #[doc = "A timeout event for both Timer A and Timer B of GPTM0 is triggered"] #[inline(always)] pub fn tatb(self) -> &'a mut W { self.variant(SYNCT0_A::TATB) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03); self.w } } #[doc = "Synchronize GPTM Timer 1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum SYNCT1_A { #[doc = "0: GPTM1 is not affected"] NONE = 0, #[doc = "1: A timeout event for Timer A of GPTM1 is triggered"] TA = 1, #[doc = "2: A timeout event for Timer B of GPTM1 is triggered"] TB = 2, #[doc = "3: A timeout event for both Timer A and Timer B of GPTM1 is triggered"] TATB = 3, } impl From<SYNCT1_A> for u8 { #[inline(always)] fn from(variant: SYNCT1_A) -> Self { variant as _ } } #[doc = "Reader of field `SYNCT1`"] pub type SYNCT1_R = crate::R<u8, SYNCT1_A>; impl SYNCT1_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SYNCT1_A { match self.bits { 0 => SYNCT1_A::NONE, 1 => SYNCT1_A::TA, 2 => SYNCT1_A::TB, 3 => SYNCT1_A::TATB, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `NONE`"] #[inline(always)] pub fn is_none(&self) -> bool { *self == SYNCT1_A::NONE } #[doc = "Checks if the value of the field is `TA`"] #[inline(always)] pub fn is_ta(&self) -> bool { *self == SYNCT1_A::TA } #[doc = "Checks if the value of the field is `TB`"] #[inline(always)] pub fn is_tb(&self) -> bool { *self == SYNCT1_A::TB } #[doc = "Checks if the value of the field is `TATB`"] #[inline(always)] pub fn is_tatb(&self) -> bool { *self == SYNCT1_A::TATB } } #[doc = "Write proxy for field `SYNCT1`"] pub struct SYNCT1_W<'a> { w: &'a mut W, } impl<'a> SYNCT1_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SYNCT1_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "GPTM1 is not affected"] #[inline(always)] pub fn none(self) -> &'a mut W { self.variant(SYNCT1_A::NONE) } #[doc = "A timeout event for Timer A of GPTM1 is triggered"] #[inline(always)] pub fn ta(self) -> &'a mut W { self.variant(SYNCT1_A::TA) } #[doc = "A timeout event for Timer B of GPTM1 is triggered"] #[inline(always)] pub fn tb(self) -> &'a mut W { self.variant(SYNCT1_A::TB) } #[doc = "A timeout event for both Timer A and Timer B of GPTM1 is triggered"] #[inline(always)] pub fn tatb(self) -> &'a mut W { self.variant(SYNCT1_A::TATB) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2); self.w } } #[doc = "Synchronize GPTM Timer 2\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum SYNCT2_A { #[doc = "0: GPTM2 is not affected"] NONE = 0, #[doc = "1: A timeout event for Timer A of GPTM2 is triggered"] TA = 1, #[doc = "2: A timeout event for Timer B of GPTM2 is triggered"] TB = 2, #[doc = "3: A timeout event for both Timer A and Timer B of GPTM2 is triggered"] TATB = 3, } impl From<SYNCT2_A> for u8 { #[inline(always)] fn from(variant: SYNCT2_A) -> Self { variant as _ } } #[doc = "Reader of field `SYNCT2`"] pub type SYNCT2_R = crate::R<u8, SYNCT2_A>; impl SYNCT2_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SYNCT2_A { match self.bits { 0 => SYNCT2_A::NONE, 1 => SYNCT2_A::TA, 2 => SYNCT2_A::TB, 3 => SYNCT2_A::TATB, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `NONE`"] #[inline(always)] pub fn is_none(&self) -> bool { *self == SYNCT2_A::NONE } #[doc = "Checks if the value of the field is `TA`"] #[inline(always)] pub fn is_ta(&self) -> bool { *self == SYNCT2_A::TA } #[doc = "Checks if the value of the field is `TB`"] #[inline(always)] pub fn is_tb(&self) -> bool { *self == SYNCT2_A::TB } #[doc = "Checks if the value of the field is `TATB`"] #[inline(always)] pub fn is_tatb(&self) -> bool { *self == SYNCT2_A::TATB } } #[doc = "Write proxy for field `SYNCT2`"] pub struct SYNCT2_W<'a> { w: &'a mut W, } impl<'a> SYNCT2_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SYNCT2_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "GPTM2 is not affected"] #[inline(always)] pub fn none(self) -> &'a mut W { self.variant(SYNCT2_A::NONE) } #[doc = "A timeout event for Timer A of GPTM2 is triggered"] #[inline(always)] pub fn ta(self) -> &'a mut W { self.variant(SYNCT2_A::TA) } #[doc = "A timeout event for Timer B of GPTM2 is triggered"] #[inline(always)] pub fn tb(self) -> &'a mut W { self.variant(SYNCT2_A::TB) } #[doc = "A timeout event for both Timer A and Timer B of GPTM2 is triggered"] #[inline(always)] pub fn tatb(self) -> &'a mut W { self.variant(SYNCT2_A::TATB) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); self.w } } #[doc = "Synchronize GPTM Timer 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum SYNCT3_A { #[doc = "0: GPTM3 is not affected"] NONE = 0, #[doc = "1: A timeout event for Timer A of GPTM3 is triggered"] TA = 1, #[doc = "2: A timeout event for Timer B of GPTM3 is triggered"] TB = 2, #[doc = "3: A timeout event for both Timer A and Timer B of GPTM3 is triggered"] TATB = 3, } impl From<SYNCT3_A> for u8 { #[inline(always)] fn from(variant: SYNCT3_A) -> Self { variant as _ } } #[doc = "Reader of field `SYNCT3`"] pub type SYNCT3_R = crate::R<u8, SYNCT3_A>; impl SYNCT3_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SYNCT3_A { match self.bits { 0 => SYNCT3_A::NONE, 1 => SYNCT3_A::TA, 2 => SYNCT3_A::TB, 3 => SYNCT3_A::TATB, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `NONE`"] #[inline(always)] pub fn is_none(&self) -> bool { *self == SYNCT3_A::NONE } #[doc = "Checks if the value of the field is `TA`"] #[inline(always)] pub fn is_ta(&self) -> bool { *self == SYNCT3_A::TA } #[doc = "Checks if the value of the field is `TB`"] #[inline(always)] pub fn is_tb(&self) -> bool { *self == SYNCT3_A::TB } #[doc = "Checks if the value of the field is `TATB`"] #[inline(always)] pub fn is_tatb(&self) -> bool { *self == SYNCT3_A::TATB } } #[doc = "Write proxy for field `SYNCT3`"] pub struct SYNCT3_W<'a> { w: &'a mut W, } impl<'a> SYNCT3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SYNCT3_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "GPTM3 is not affected"] #[inline(always)] pub fn none(self) -> &'a mut W { self.variant(SYNCT3_A::NONE) } #[doc = "A timeout event for Timer A of GPTM3 is triggered"] #[inline(always)] pub fn ta(self) -> &'a mut W { self.variant(SYNCT3_A::TA) } #[doc = "A timeout event for Timer B of GPTM3 is triggered"] #[inline(always)] pub fn tb(self) -> &'a mut W { self.variant(SYNCT3_A::TB) } #[doc = "A timeout event for both Timer A and Timer B of GPTM3 is triggered"] #[inline(always)] pub fn tatb(self) -> &'a mut W { self.variant(SYNCT3_A::TATB) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x03 << 6)) | (((value as u32) & 0x03) << 6); self.w } } #[doc = "Synchronize GPTM Timer 4\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum SYNCT4_A { #[doc = "0: GPTM4 is not affected"] NONE = 0, #[doc = "1: A timeout event for Timer A of GPTM4 is triggered"] TA = 1, #[doc = "2: A timeout event for Timer B of GPTM4 is triggered"] TB = 2, #[doc = "3: A timeout event for both Timer A and Timer B of GPTM4 is triggered"] TATB = 3, } impl From<SYNCT4_A> for u8 { #[inline(always)] fn from(variant: SYNCT4_A) -> Self { variant as _ } } #[doc = "Reader of field `SYNCT4`"] pub type SYNCT4_R = crate::R<u8, SYNCT4_A>; impl SYNCT4_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SYNCT4_A { match self.bits { 0 => SYNCT4_A::NONE, 1 => SYNCT4_A::TA, 2 => SYNCT4_A::TB, 3 => SYNCT4_A::TATB, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `NONE`"] #[inline(always)] pub fn is_none(&self) -> bool { *self == SYNCT4_A::NONE } #[doc = "Checks if the value of the field is `TA`"] #[inline(always)] pub fn is_ta(&self) -> bool { *self == SYNCT4_A::TA } #[doc = "Checks if the value of the field is `TB`"] #[inline(always)] pub fn is_tb(&self) -> bool { *self == SYNCT4_A::TB } #[doc = "Checks if the value of the field is `TATB`"] #[inline(always)] pub fn is_tatb(&self) -> bool { *self == SYNCT4_A::TATB } } #[doc = "Write proxy for field `SYNCT4`"] pub struct SYNCT4_W<'a> { w: &'a mut W, } impl<'a> SYNCT4_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SYNCT4_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "GPTM4 is not affected"] #[inline(always)] pub fn none(self) -> &'a mut W { self.variant(SYNCT4_A::NONE) } #[doc = "A timeout event for Timer A of GPTM4 is triggered"] #[inline(always)] pub fn ta(self) -> &'a mut W { self.variant(SYNCT4_A::TA) } #[doc = "A timeout event for Timer B of GPTM4 is triggered"] #[inline(always)] pub fn tb(self) -> &'a mut W { self.variant(SYNCT4_A::TB) } #[doc = "A timeout event for both Timer A and Timer B of GPTM4 is triggered"] #[inline(always)] pub fn tatb(self) -> &'a mut W { self.variant(SYNCT4_A::TATB) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); self.w } } #[doc = "Synchronize GPTM Timer 5\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum SYNCT5_A { #[doc = "0: GPTM5 is not affected"] NONE = 0, #[doc = "1: A timeout event for Timer A of GPTM5 is triggered"] TA = 1, #[doc = "2: A timeout event for Timer B of GPTM5 is triggered"] TB = 2, #[doc = "3: A timeout event for both Timer A and Timer B of GPTM5 is triggered"] TATB = 3, } impl From<SYNCT5_A> for u8 { #[inline(always)] fn from(variant: SYNCT5_A) -> Self { variant as _ } } #[doc = "Reader of field `SYNCT5`"] pub type SYNCT5_R = crate::R<u8, SYNCT5_A>; impl SYNCT5_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SYNCT5_A { match self.bits { 0 => SYNCT5_A::NONE, 1 => SYNCT5_A::TA, 2 => SYNCT5_A::TB, 3 => SYNCT5_A::TATB, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `NONE`"] #[inline(always)] pub fn is_none(&self) -> bool { *self == SYNCT5_A::NONE } #[doc = "Checks if the value of the field is `TA`"] #[inline(always)] pub fn is_ta(&self) -> bool { *self == SYNCT5_A::TA } #[doc = "Checks if the value of the field is `TB`"] #[inline(always)] pub fn is_tb(&self) -> bool { *self == SYNCT5_A::TB } #[doc = "Checks if the value of the field is `TATB`"] #[inline(always)] pub fn is_tatb(&self) -> bool { *self == SYNCT5_A::TATB } } #[doc = "Write proxy for field `SYNCT5`"] pub struct SYNCT5_W<'a> { w: &'a mut W, } impl<'a> SYNCT5_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SYNCT5_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "GPTM5 is not affected"] #[inline(always)] pub fn none(self) -> &'a mut W { self.variant(SYNCT5_A::NONE) } #[doc = "A timeout event for Timer A of GPTM5 is triggered"] #[inline(always)] pub fn ta(self) -> &'a mut W { self.variant(SYNCT5_A::TA) } #[doc = "A timeout event for Timer B of GPTM5 is triggered"] #[inline(always)] pub fn tb(self) -> &'a mut W { self.variant(SYNCT5_A::TB) } #[doc = "A timeout event for both Timer A and Timer B of GPTM5 is triggered"] #[inline(always)] pub fn tatb(self) -> &'a mut W { self.variant(SYNCT5_A::TATB) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x03 << 10)) | (((value as u32) & 0x03) << 10); self.w } } #[doc = "Synchronize GPTM Timer 6\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum SYNCT6_A { #[doc = "0: GPTM6 is not affected"] NONE = 0, #[doc = "1: A timeout event for Timer A of GPTM6 is triggered"] TA = 1, #[doc = "2: A timeout event for Timer B of GPTM6 is triggered"] TB = 2, #[doc = "3: A timeout event for both Timer A and Timer B of GPTM6 is triggered"] TATB = 3, } impl From<SYNCT6_A> for u8 { #[inline(always)] fn from(variant: SYNCT6_A) -> Self { variant as _ } } #[doc = "Reader of field `SYNCT6`"] pub type SYNCT6_R = crate::R<u8, SYNCT6_A>; impl SYNCT6_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SYNCT6_A { match self.bits { 0 => SYNCT6_A::NONE, 1 => SYNCT6_A::TA, 2 => SYNCT6_A::TB, 3 => SYNCT6_A::TATB, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `NONE`"] #[inline(always)] pub fn is_none(&self) -> bool { *self == SYNCT6_A::NONE } #[doc = "Checks if the value of the field is `TA`"] #[inline(always)] pub fn is_ta(&self) -> bool { *self == SYNCT6_A::TA } #[doc = "Checks if the value of the field is `TB`"] #[inline(always)] pub fn is_tb(&self) -> bool { *self == SYNCT6_A::TB } #[doc = "Checks if the value of the field is `TATB`"] #[inline(always)] pub fn is_tatb(&self) -> bool { *self == SYNCT6_A::TATB } } #[doc = "Write proxy for field `SYNCT6`"] pub struct SYNCT6_W<'a> { w: &'a mut W, } impl<'a> SYNCT6_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SYNCT6_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "GPTM6 is not affected"] #[inline(always)] pub fn none(self) -> &'a mut W { self.variant(SYNCT6_A::NONE) } #[doc = "A timeout event for Timer A of GPTM6 is triggered"] #[inline(always)] pub fn ta(self) -> &'a mut W { self.variant(SYNCT6_A::TA) } #[doc = "A timeout event for Timer B of GPTM6 is triggered"] #[inline(always)] pub fn tb(self) -> &'a mut W { self.variant(SYNCT6_A::TB) } #[doc = "A timeout event for both Timer A and Timer B of GPTM6 is triggered"] #[inline(always)] pub fn tatb(self) -> &'a mut W { self.variant(SYNCT6_A::TATB) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); self.w } } #[doc = "Synchronize GPTM Timer 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum SYNCT7_A { #[doc = "0: GPT7 is not affected"] NONE = 0, #[doc = "1: A timeout event for Timer A of GPTM7 is triggered"] TA = 1, #[doc = "2: A timeout event for Timer B of GPTM7 is triggered"] TB = 2, #[doc = "3: A timeout event for both Timer A and Timer B of GPTM7 is triggered"] TATB = 3, } impl From<SYNCT7_A> for u8 { #[inline(always)] fn from(variant: SYNCT7_A) -> Self { variant as _ } } #[doc = "Reader of field `SYNCT7`"] pub type SYNCT7_R = crate::R<u8, SYNCT7_A>; impl SYNCT7_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SYNCT7_A { match self.bits { 0 => SYNCT7_A::NONE, 1 => SYNCT7_A::TA, 2 => SYNCT7_A::TB, 3 => SYNCT7_A::TATB, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `NONE`"] #[inline(always)] pub fn is_none(&self) -> bool { *self == SYNCT7_A::NONE } #[doc = "Checks if the value of the field is `TA`"] #[inline(always)] pub fn is_ta(&self) -> bool { *self == SYNCT7_A::TA } #[doc = "Checks if the value of the field is `TB`"] #[inline(always)] pub fn is_tb(&self) -> bool { *self == SYNCT7_A::TB } #[doc = "Checks if the value of the field is `TATB`"] #[inline(always)] pub fn is_tatb(&self) -> bool { *self == SYNCT7_A::TATB } } #[doc = "Write proxy for field `SYNCT7`"] pub struct SYNCT7_W<'a> { w: &'a mut W, } impl<'a> SYNCT7_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SYNCT7_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "GPT7 is not affected"] #[inline(always)] pub fn none(self) -> &'a mut W { self.variant(SYNCT7_A::NONE) } #[doc = "A timeout event for Timer A of GPTM7 is triggered"] #[inline(always)] pub fn ta(self) -> &'a mut W { self.variant(SYNCT7_A::TA) } #[doc = "A timeout event for Timer B of GPTM7 is triggered"] #[inline(always)] pub fn tb(self) -> &'a mut W { self.variant(SYNCT7_A::TB) } #[doc = "A timeout event for both Timer A and Timer B of GPTM7 is triggered"] #[inline(always)] pub fn tatb(self) -> &'a mut W { self.variant(SYNCT7_A::TATB) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); self.w } } impl R { #[doc = "Bits 0:1 - Synchronize GPTM Timer 0"] #[inline(always)] pub fn synct0(&self) -> SYNCT0_R { SYNCT0_R::new((self.bits & 0x03) as u8) } #[doc = "Bits 2:3 - Synchronize GPTM Timer 1"] #[inline(always)] pub fn synct1(&self) -> SYNCT1_R { SYNCT1_R::new(((self.bits >> 2) & 0x03) as u8) } #[doc = "Bits 4:5 - Synchronize GPTM Timer 2"] #[inline(always)] pub fn synct2(&self) -> SYNCT2_R { SYNCT2_R::new(((self.bits >> 4) & 0x03) as u8) } #[doc = "Bits 6:7 - Synchronize GPTM Timer 3"] #[inline(always)] pub fn synct3(&self) -> SYNCT3_R { SYNCT3_R::new(((self.bits >> 6) & 0x03) as u8) } #[doc = "Bits 8:9 - Synchronize GPTM Timer 4"] #[inline(always)] pub fn synct4(&self) -> SYNCT4_R { SYNCT4_R::new(((self.bits >> 8) & 0x03) as u8) } #[doc = "Bits 10:11 - Synchronize GPTM Timer 5"] #[inline(always)] pub fn synct5(&self) -> SYNCT5_R { SYNCT5_R::new(((self.bits >> 10) & 0x03) as u8) } #[doc = "Bits 12:13 - Synchronize GPTM Timer 6"] #[inline(always)] pub fn synct6(&self) -> SYNCT6_R { SYNCT6_R::new(((self.bits >> 12) & 0x03) as u8) } #[doc = "Bits 14:15 - Synchronize GPTM Timer 7"] #[inline(always)] pub fn synct7(&self) -> SYNCT7_R { SYNCT7_R::new(((self.bits >> 14) & 0x03) as u8) } } impl W { #[doc = "Bits 0:1 - Synchronize GPTM Timer 0"] #[inline(always)] pub fn synct0(&mut self) -> SYNCT0_W { SYNCT0_W { w: self } } #[doc = "Bits 2:3 - Synchronize GPTM Timer 1"] #[inline(always)] pub fn synct1(&mut self) -> SYNCT1_W { SYNCT1_W { w: self } } #[doc = "Bits 4:5 - Synchronize GPTM Timer 2"] #[inline(always)] pub fn synct2(&mut self) -> SYNCT2_W { SYNCT2_W { w: self } } #[doc = "Bits 6:7 - Synchronize GPTM Timer 3"] #[inline(always)] pub fn synct3(&mut self) -> SYNCT3_W { SYNCT3_W { w: self } } #[doc = "Bits 8:9 - Synchronize GPTM Timer 4"] #[inline(always)] pub fn synct4(&mut self) -> SYNCT4_W { SYNCT4_W { w: self } } #[doc = "Bits 10:11 - Synchronize GPTM Timer 5"] #[inline(always)] pub fn synct5(&mut self) -> SYNCT5_W { SYNCT5_W { w: self } } #[doc = "Bits 12:13 - Synchronize GPTM Timer 6"] #[inline(always)] pub fn synct6(&mut self) -> SYNCT6_W { SYNCT6_W { w: self } } #[doc = "Bits 14:15 - Synchronize GPTM Timer 7"] #[inline(always)] pub fn synct7(&mut self) -> SYNCT7_W { SYNCT7_W { w: self } } }
use numeral::*; use ops::*; #[derive(Clone, PartialEq, Debug)] pub enum Expr { Time, Num(Numeral), UnExpr(UnOp, Box<Expr>), BinExpr(Box<Expr>, BinOp, Box<Expr>), }
// Copyright (c) 2021 ESRLabs // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use std::{ collections::HashMap, ffi::OsStr, path::{Path, PathBuf}, }; use super::{ error::Error, key::{self, PublicKey}, Container, RepositoryId, }; use futures::future::OptionFuture; use log::debug; use npk::{manifest::Manifest, npk::Npk}; use tokio::{fs, task}; #[derive(Debug)] pub(super) struct Repository { pub(super) id: RepositoryId, pub(super) dir: PathBuf, pub(super) key: Option<PublicKey>, pub(super) containers: HashMap<Container, (PathBuf, Manifest)>, } impl Repository { pub async fn new( id: RepositoryId, dir: PathBuf, key: Option<&Path>, ) -> Result<Repository, Error> { let key: OptionFuture<_> = key.map(|k| key::load(&k)).into(); let mut containers = HashMap::new(); let mut readir = fs::read_dir(&dir) .await .map_err(|e| Error::Io("Repository read dir".into(), e))?; while let Ok(Some(entry)) = readir.next_entry().await { let npk_extension = Some(OsStr::new("npk")); if entry.path().extension() != npk_extension { continue; } let npk = task::block_in_place(|| Npk::from_path(entry.path().as_path(), None)) .map_err(Error::Npk)?; let name = npk.manifest().name.clone(); let version = npk.manifest().version.clone(); let container = Container::new(name, version); containers.insert(container.clone(), (entry.path(), npk.manifest().clone())); } Ok(Repository { id, dir, key: key.await.transpose().map_err(Error::Key)?, containers, }) } pub async fn add(&mut self, container: &Container, src: &Path) -> Result<(), Error> { let dest = self .dir .join(format!("{}-{}.npk", container.name(), container.version())); // Check if the npk already in the repository if dest.exists() { return Err(Error::InstallDuplicate(container.clone())); } // Copy the npk to the repository fs::copy(src, &dest) .await .map_err(|e| Error::Io("Failed to copy npk to repository".into(), e))?; let npk = task::block_in_place(|| Npk::from_path(dest.as_path(), None)).map_err(Error::Npk)?; let name = npk.manifest().name.clone(); let version = npk.manifest().version.clone(); let container = Container::new(name, version); self.containers .insert(container, (dest.to_owned(), npk.manifest().clone())); Ok(()) } pub async fn remove(&mut self, container: &Container) -> Result<(), Error> { if let Some((npk, _)) = self.containers.remove(&container) { debug!("Removing {}", npk.display()); fs::remove_file(npk) .await .map_err(|e| Error::Io("Failed to remove npk".into(), e)) .map(drop) } else { Err(Error::InvalidContainer(container.clone())) } } }
pub struct Graph { size: usize, vertexes: Vec<u32>, edges: Vec<Box<Vec<usize>>>, } #[allow(dead_code)] impl Graph { pub fn new(size: usize) -> Graph { Graph { size, vertexes: vec![99; size], edges: vec![Box::new(vec![]); size], } } pub fn add_edge(&mut self, node_a: usize, node_b: usize) { //Make sure the nodes are on the graph assert!(node_a <= self.size); assert!(node_b <= self.size); { let node_a_edges = self.edges.get_mut(node_a-1).unwrap(); //prevent redundant edges. if node_a_edges.contains(&node_b) { return; } node_a_edges.push(node_b); } let node_b_edges = self.edges.get_mut(node_b-1).unwrap(); node_b_edges.push(node_a); } pub fn remove_edge(&mut self, node_a: usize, node_b: usize) { //Make sure the nodes are on the graph assert!(node_a <= self.size); assert!(node_b <= self.size); { let node_a_edges = self.edges.get_mut(node_a - 1).unwrap(); node_a_edges.iter() .position(|&n| n == node_b) .map(|e| node_a_edges.remove(e)); } let node_b_edges = self.edges.get_mut(node_b-1).unwrap(); node_b_edges.iter() .position(|&n| n==node_a) .map(|e| node_b_edges.remove(e)); } pub fn get_vertex_value(&self, node: usize) -> u32 { assert!(node <= self.size); self.vertexes[node-1] } pub fn set_vertex_value(&mut self, node: usize, value: u32) { assert!(node <= self.size); self.vertexes[node-1] = value; } pub fn neighbors(&self, node: usize) -> Vec<usize> { assert!(node <= self.size); return *self.edges.get(node-1).unwrap().clone(); } pub fn adjacent(&self, node_a: usize, node_b: usize) -> bool { assert!(node_a <= self.size); assert!(node_b <= self.size); self.neighbors(node_a).contains(&node_b) } } #[cfg(test)] mod tests { use super::*; #[test] #[should_panic] fn invalid_add_edge_test() { let mut graph = Graph::new(4); graph.add_edge(5,1); } #[test] fn valid_add_edge_test() { let mut graph = Graph::new(9); graph.add_edge(1, 2); graph.add_edge(1, 4); graph.add_edge(2, 1); graph.add_edge(2, 3); graph.add_edge(2, 5); graph.add_edge(9, 1); assert_eq!(graph.neighbors(1), [2, 4, 9]); assert_eq!(graph.neighbors(2), [1, 3, 5]); } #[test] fn empty_edge_test() { let graph = Graph::new(4); assert_eq!(graph.neighbors(1), []); assert_eq!(graph.neighbors(4), []); } #[test] fn remove_edge_test() { let mut graph = Graph::new(9); graph.add_edge(1, 2); graph.add_edge(1, 4); graph.add_edge(2, 1); graph.add_edge(2, 3); graph.add_edge(2, 5); graph.add_edge(9, 1); assert_eq!(graph.neighbors(1), [2, 4, 9]); assert_eq!(graph.neighbors(2), [1, 3, 5]); graph.remove_edge(1, 2); assert_eq!(graph.neighbors(1), [4, 9]); assert_eq!(graph.neighbors(2), [3, 5]); } #[test] fn set_get_vertex_value_test() { let mut graph = Graph::new(9); graph.set_vertex_value(1, 5); graph.set_vertex_value(9, 3); assert_eq!(graph.get_vertex_value(1), 5); assert_eq!(graph.get_vertex_value(9), 3); } #[test] fn adjacency_test() { let mut graph = Graph::new(9); graph.add_edge(1, 2); graph.add_edge(1, 4); graph.add_edge(2, 1); graph.add_edge(2, 3); graph.add_edge(2, 5); graph.add_edge(9, 1); assert!(graph.adjacent(1,2)); assert!(!graph.adjacent(1,3)); } #[test] #[should_panic] fn invalid_adjacency_test() { let mut graph = Graph::new(9); graph.add_edge(1, 2); graph.adjacent(10,1); } #[test] #[should_panic] fn invalid_set_vertex_test() { let mut graph = Graph::new(9); graph.set_vertex_value(10,0); } }
use criterion::{criterion_group, criterion_main, Criterion}; use day11::{part1, part2}; fn part1_benchmark(c: &mut Criterion) { c.bench_function("part1", move |b| b.iter(|| part1(9306, 300, 300))); } fn part2_benchmark(c: &mut Criterion) { c.bench_function("part2", move |b| b.iter(|| part2(9306, 300))); } criterion_group!(benches, part1_benchmark, part2_benchmark); criterion_main!(benches);
extern crate log; use std::env; use std::process; use std::time::Instant; use anyhow::{anyhow, bail}; use firefly_compiler as driver; use firefly_util::time; pub fn main() -> anyhow::Result<()> { // Handle unexpected panics by presenting a user-friendly bug report prompt; // except when we're requesting debug info from the compiler explicitly, in // which case we don't want to hide the panic if env::var_os("LUMEN_LOG").is_none() { human_panic::setup_panic!(); } // Initialize logger let mut builder = env_logger::Builder::from_env("LUMEN_LOG"); builder.format_indent(Some(2)); if let Ok(precision) = env::var("LUMEN_LOG_WITH_TIME") { match precision.as_str() { "s" => builder.format_timestamp_secs(), "ms" => builder.format_timestamp_millis(), "us" => builder.format_timestamp_micros(), "ns" => builder.format_timestamp_nanos(), other => bail!( "invalid LUMEN_LOG_WITH_TIME precision, expected one of [s, ms, us, ns], got '{}'", other ), }; } else { builder.format_timestamp(None); } builder.init(); // Get current working directory let cwd = env::current_dir().map_err(|e| anyhow!("Current directory is invalid: {}", e))?; // Get the current instant, in case needed for timing later let print_timings = env::var("LUMEN_TIMING").is_ok(); let start = Instant::now(); // Run compiler match driver::run_compiler(cwd, env::args_os()) { Ok(status_code) => { time::print_time_passes_entry(print_timings, "\ttotal", start.elapsed()); process::exit(status_code); } Err(err) => { time::print_time_passes_entry(print_timings, "\ttotal", start.elapsed()); if let Some(err) = err.downcast_ref::<clap::Error>() { err.exit() } else { eprintln!("{}", err); process::exit(1); } } } }
// Copyright 2011 Google Inc. All Rights Reserved. // Copyright 2017 The Ninja-rs Project Developers. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use std; use libc; use libc_stdhandle; use errno; use num_cpus; use std::path::PathBuf; use std::ffi::OsString; /// The primary interface to metrics. Use METRIC_RECORD("foobar") at the top /// of a function to get timing stats recorded for each call of the function. macro_rules! metric_record { ($metric: expr) => { metric_record!($metric, METRIC_VAR, metric_borrow); }; ($metric: expr, $metric_var: ident, $metric_borrow: ident) => { lazy_static! { static ref $metric_var : Option<::std::sync::Arc<::std::sync::Mutex<$crate::metrics::Metric>>> = $crate::debug_flags::METRICS.as_ref() .map(|m| m.lock().unwrap().new_metric($metric)); } let mut $metric_borrow = $metric_var.as_ref().map(|r| r.lock().unwrap()); let _ = $crate::metrics::ScopedMetric::new($metric_borrow.as_mut().map(|r| &mut **r)); }; } #[macro_export] macro_rules! explain { ($fmt:expr) => (if $crate::debug_flags::EXPLAINING { eprint!(concat!("ninja explain: ", $fmt, "\n")) }); ($fmt:expr, $($arg:tt)*) => (if $crate::debug_flags::EXPLAINING { eprint!(concat!("ninja explain: ", $fmt, "\n"), $($arg)*) }); } /// Log a fatal message and exit. #[macro_export] macro_rules! fatal { ($fmt:expr) => ({ eprint!(concat!("ninja fatal: ", $fmt, "\n")); $crate::utils::exit(); }); ($fmt:expr, $($arg:tt)*) => ({ eprint!(concat!("ninja fatal: ", $fmt, "\n"), $($arg)*); $crate::utils::exit(); }); } /// Log a warning message. #[macro_export] macro_rules! warning { ($fmt:expr) => (eprint!(concat!("ninja warning: ", $fmt, "\n"))); ($fmt:expr, $($arg:tt)*) => (eprint!(concat!("ninja warning: ", $fmt, "\n"), $($arg)*)); } /// Log an error message. #[macro_export] macro_rules! error { ($fmt:expr) => (eprint!(concat!("ninja error: ", $fmt, "\n"))); ($fmt:expr, $($arg:tt)*) => (eprint!(concat!("ninja error: ", $fmt, "\n"), $($arg)*)); } #[cfg(windows)] pub fn exit() -> ! { use kernel32; use std::io::Write; // On Windows, some tools may inject extra threads. // exit() may block on locks held by those threads, so forcibly exit. let _ = std::io::stderr().flush(); let _ = std::io::stdout().flush(); unsafe { kernel32::ExitProcess(1); } unreachable!() } #[cfg(not(windows))] pub fn exit() -> ! { unsafe { libc::exit(1); } unreachable!() } pub trait ZeroOrErrnoResult { fn as_zero_errno_result(self) -> Result<(), errno::Errno>; } impl ZeroOrErrnoResult for libc::c_int { fn as_zero_errno_result(self) -> Result<(), errno::Errno> { if self == 0 { Ok(()) } else { Err(errno::errno()) } } } pub fn set_stdout_linebuffered() { unsafe { libc::setvbuf( libc_stdhandle::stdout(), std::ptr::null_mut(), libc::_IOLBF, libc::BUFSIZ as _, ); } } pub fn get_processor_count() -> usize { num_cpus::get() } #[cfg(unix)] fn pathbuf_from_bytes_os(bytes: Vec<u8>) -> Result<PathBuf, Vec<u8>> { use std::os::unix::ffi::OsStringExt; Ok(PathBuf::from(OsString::from_vec(bytes))) } #[cfg(not(unix))] fn pathbuf_from_bytes_os(bytes: Vec<u8>) -> Result<PathBuf, Vec<u8>> { Err(bytes) } pub fn pathbuf_from_bytes(mut bytes: Vec<u8>) -> Result<PathBuf, Vec<u8>> { bytes = match String::from_utf8(bytes) { Ok(r) => { return Ok(PathBuf::from(r)); } Err(e) => e.into_bytes(), }; return pathbuf_from_bytes_os(bytes); } pub trait RangeContains<T> { fn contains_stable(&self, item: T) -> bool; } impl<Idx: PartialOrd<Idx>> RangeContains<Idx> for std::ops::Range<Idx> { fn contains_stable(&self, item: Idx) -> bool { (self.start <= item) && (item < self.end) } } /* /// Canonicalize a path like "foo/../bar.h" into just "bar.h". /// |slash_bits| has bits set starting from lowest for a backslash that was /// normalized to a forward slash. (only used on Windows) bool CanonicalizePath(string* path, uint64_t* slash_bits, string* err); bool CanonicalizePath(char* path, size_t* len, uint64_t* slash_bits, string* err); /// Appends |input| to |*result|, escaping according to the whims of either /// Bash, or Win32's CommandLineToArgvW(). /// Appends the string directly to |result| without modification if we can /// determine that it contains no problematic characters. void GetShellEscapedString(const string& input, string* result); void GetWin32EscapedString(const string& input, string* result); /// Read a file to a string (in text mode: with CRLF conversion /// on Windows). /// Returns -errno and fills in \a err on error. int ReadFile(const string& path, string* contents, string* err); */ /// Mark a file descriptor to not be inherited on exec()s. #[cfg(unix)] pub fn set_close_on_exec(fd: ::libc::c_int) { use libc; use errno; unsafe { let flags = libc::fcntl(fd, libc::F_GETFD); if flags < 0 { fatal!("fcntl(F_GETFD): {}", errno::errno()); } if libc::fcntl(fd, libc::F_SETFD, flags | libc::FD_CLOEXEC) < 0 { fatal!("fcntl(F_SETFD): {}", errno::errno()); } } } /* /// Given a misspelled string and a list of correct spellings, returns /// the closest match or NULL if there is no close enough match. const char* SpellcheckStringV(const string& text, const vector<const char*>& words); /// Like SpellcheckStringV, but takes a NULL-terminated list. const char* SpellcheckString(const char* text, ...); bool islatinalpha(int c); /// Removes all Ansi escape codes (http://www.termsys.demon.co.uk/vtansi.htm). string StripAnsiEscapeCodes(const string& in); /// @return the number of processors on the machine. Useful for an initial /// guess for how many jobs to run in parallel. @return 0 on error. int GetProcessorCount(); /// @return the load average of the machine. A negative value is returned /// on error. double GetLoadAverage(); /// Elide the given string @a str with '...' in the middle if the length /// exceeds @a width. string ElideMiddle(const string& str, size_t width); /// Truncates a file to the given size. bool Truncate(const string& path, size_t size, string* err); #ifdef _MSC_VER #define snprintf _snprintf #define fileno _fileno #define unlink _unlink #define chdir _chdir #define strtoull _strtoui64 #define getcwd _getcwd #define PATH_MAX _MAX_PATH #endif #ifdef _WIN32 /// Convert the value returned by GetLastError() into a string. string GetLastErrorString(); /// Calls Fatal() with a function name and GetLastErrorString. NORETURN void Win32Fatal(const char* function); #endif #include "util.h" #ifdef __CYGWIN__ #include <windows.h> #include <io.h> #elif defined( _WIN32) #include <windows.h> #include <io.h> #include <share.h> #endif #include <assert.h> #include <errno.h> #include <fcntl.h>c #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <sys/types.h> #ifndef _WIN32 #include <unistd.h> #include <sys/time.h> #endif #include <vector> #if defined(__APPLE__) || defined(__FreeBSD__) #include <sys/sysctl.h> #elif defined(__SVR4) && defined(__sun) #include <unistd.h> #include <sys/loadavg.h> #elif defined(_AIX) #include <libperfstat.h> #elif defined(linux) || defined(__GLIBC__) #include <sys/sysinfo.h> #endif #include "edit_distance.h" #include "metrics.h" */ /* static bool IsPathSeparator(char c) { #ifdef _WIN32 return c == '/' || c == '\\'; #else return c == '/'; #endif } */ #[cfg(windows)] pub const WINDOWS_PATH: bool = true; #[cfg(not(windows))] pub const WINDOWS_PATH: bool = false; fn is_path_separator(c: u8) -> bool { c == b'/' || WINDOWS_PATH && c == b'\\' } pub fn canonicalize_path(path: &mut Vec<u8>) -> Result<u64, String> { metric_record!("canonicalize str"); let (newsize, slash_bits) = canonicalize_path_slice(path.as_mut_slice())?; path.truncate(newsize); Ok(slash_bits) } pub fn canonicalize_path_slice(path: &mut [u8]) -> Result<(usize, u64), String> { // WARNING: this function is performance-critical; please benchmark // any changes you make to it. metric_record!("canonicalize path"); if path.is_empty() { return Err("empty path".to_owned()); } const MAX_PATH_COMPONENTS: usize = 60usize; let mut components = [0usize; MAX_PATH_COMPONENTS]; let mut component_count = 0usize; let len = path.len(); let start = 0; let end = len; let mut dst = 0; let mut src = 0; if is_path_separator(path[0]) { if WINDOWS_PATH && len >= 2 && is_path_separator(path[1]) { src += 1; dst += 1; } src += 1; dst += 1; } while src < end { if path[src] == b'.' && (src + 1 == end || is_path_separator(path[src + 1])) { // '.' component; eliminate. src += 2; } else if path[src] == b'.' && path[src + 1] == b'.' && (src + 2 == end || is_path_separator(path[src + 2])) { if component_count == 0 { path[dst] = path[src]; path[dst + 1] = path[src + 1]; path[dst + 2] = path[src + 2]; dst += 3; } else { dst = components[component_count - 1]; component_count -= 1; } src += 3; } else if is_path_separator(path[src]) { src += 1; } else { if component_count == MAX_PATH_COMPONENTS { fatal!( "path has too many components : {}", String::from_utf8_lossy(path) ); } components[component_count] = dst; component_count += 1; while { path[dst] = path[src]; dst += 1; src += 1; src < end && !is_path_separator(path[dst - 1]) } {} } } if dst == start { path[dst] = b'.'; dst += 1; } let new_len = dst - start; let mut slash_bits = 0u64; if WINDOWS_PATH { let mut mask = 1u64; for i in 0..new_len { if path[i] == b'\\' { slash_bits |= mask; path[i] = b'/'; mask <<= 1; } else if path[i] == b'/' { mask <<= 1; } } } Ok((new_len, slash_bits)) } // static pub fn decanonicalize_path(path: &[u8], slash_bits: u64) -> Vec<u8> { let mut result = path.to_owned(); if WINDOWS_PATH { let mut mask = 1u64; for c in result.iter_mut().filter(|c| **c == b'/') { if (slash_bits & mask) != 0 { *c = b'\\'; } mask <<= 1; } } result } pub trait ExtendFromEscapedSlice<T> { fn extend_from_shell_escaped_slice(&mut self, other: &[T]); fn extend_from_win32_escaped_slice(&mut self, other: &[T]); } #[inline] fn is_known_shell_safe_character(ch: u8) -> bool { match ch { b'A'...b'Z' => true, b'a'...b'z' => true, b'0'...b'9' => true, b'_' | b'+' | b'-' | b'.' | b'/' => true, _ => false, } } #[inline] fn is_known_win32_safe_char(ch: u8) -> bool { match ch { b' ' | b'"' => false, _ => true, } } #[inline] fn slice_needs_shell_escaping(input: &[u8]) -> bool { !input.iter().cloned().all(is_known_shell_safe_character) } #[inline] fn slice_needs_win32_escaping(input: &[u8]) -> bool { !input.iter().cloned().all(is_known_win32_safe_char) } impl ExtendFromEscapedSlice<u8> for Vec<u8> { fn extend_from_shell_escaped_slice(&mut self, input: &[u8]) { if !slice_needs_shell_escaping(input) { self.extend_from_slice(input); return; } unimplemented!() /* const char kQuote = '\''; const char kEscapeSequence[] = "'\\'"; result->push_back(kQuote); string::const_iterator span_begin = input.begin(); for (string::const_iterator it = input.begin(), end = input.end(); it != end; ++it) { if (*it == kQuote) { result->append(span_begin, it); result->append(kEscapeSequence); span_begin = it; } } result->append(span_begin, input.end()); result->push_back(kQuote); */ } fn extend_from_win32_escaped_slice(&mut self, input: &[u8]) { if !slice_needs_win32_escaping(input) { self.extend_from_slice(input); return; } /* const char kQuote = '"'; const char kBackslash = '\\'; result->push_back(kQuote); size_t consecutive_backslash_count = 0; string::const_iterator span_begin = input.begin(); for (string::const_iterator it = input.begin(), end = input.end(); it != end; ++it) { switch (*it) { case kBackslash: ++consecutive_backslash_count; break; case kQuote: result->append(span_begin, it); result->append(consecutive_backslash_count + 1, kBackslash); span_begin = it; consecutive_backslash_count = 0; break; default: consecutive_backslash_count = 0; break; } } result->append(span_begin, input.end()); result->append(consecutive_backslash_count, kBackslash); result->push_back(kQuote); */ unimplemented!() } } /* int ReadFile(const string& path, string* contents, string* err) { #ifdef _WIN32 // This makes a ninja run on a set of 1500 manifest files about 4% faster // than using the generic fopen code below. err->clear(); HANDLE f = ::CreateFile(path.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL); if (f == INVALID_HANDLE_VALUE) { err->assign(GetLastErrorString()); return -ENOENT; } for (;;) { DWORD len; char buf[64 << 10]; if (!::ReadFile(f, buf, sizeof(buf), &len, NULL)) { err->assign(GetLastErrorString()); contents->clear(); return -1; } if (len == 0) break; contents->append(buf, len); } ::CloseHandle(f); return 0; #else FILE* f = fopen(path.c_str(), "rb"); if (!f) { err->assign(strerror(errno)); return -errno; } char buf[64 << 10]; size_t len; while ((len = fread(buf, 1, sizeof(buf), f)) > 0) { contents->append(buf, len); } if (ferror(f)) { err->assign(strerror(errno)); // XXX errno? contents->clear(); fclose(f); return -errno; } fclose(f); return 0; #endif } void SetCloseOnExec(int fd) { #ifndef _WIN32 int flags = fcntl(fd, F_GETFD); if (flags < 0) { perror("fcntl(F_GETFD)"); } else { if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) perror("fcntl(F_SETFD)"); } #else HANDLE hd = (HANDLE) _get_osfhandle(fd); if (! SetHandleInformation(hd, HANDLE_FLAG_INHERIT, 0)) { fprintf(stderr, "SetHandleInformation(): %s", GetLastErrorString().c_str()); } #endif // ! _WIN32 } const char* SpellcheckStringV(const string& text, const vector<const char*>& words) { const bool kAllowReplacements = true; const int kMaxValidEditDistance = 3; int min_distance = kMaxValidEditDistance + 1; const char* result = NULL; for (vector<const char*>::const_iterator i = words.begin(); i != words.end(); ++i) { int distance = EditDistance(*i, text, kAllowReplacements, kMaxValidEditDistance); if (distance < min_distance) { min_distance = distance; result = *i; } } return result; } const char* SpellcheckString(const char* text, ...) { // Note: This takes a const char* instead of a string& because using // va_start() with a reference parameter is undefined behavior. va_list ap; va_start(ap, text); vector<const char*> words; const char* word; while ((word = va_arg(ap, const char*))) words.push_back(word); va_end(ap); return SpellcheckStringV(text, words); } #ifdef _WIN32 string GetLastErrorString() { DWORD err = GetLastError(); char* msg_buf; FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (char*)&msg_buf, 0, NULL); string msg = msg_buf; LocalFree(msg_buf); return msg; } void Win32Fatal(const char* function) { Fatal("%s: %s", function, GetLastErrorString().c_str()); } #endif bool islatinalpha(int c) { // isalpha() is locale-dependent. return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); } string StripAnsiEscapeCodes(const string& in) { string stripped; stripped.reserve(in.size()); for (size_t i = 0; i < in.size(); ++i) { if (in[i] != '\33') { // Not an escape code. stripped.push_back(in[i]); continue; } // Only strip CSIs for now. if (i + 1 >= in.size()) break; if (in[i + 1] != '[') continue; // Not a CSI. i += 2; // Skip everything up to and including the next [a-zA-Z]. while (i < in.size() && !islatinalpha(in[i])) ++i; } return stripped; } */ #[cfg(windows)] pub fn get_load_average() -> Option<f64> { use std::mem::zeroed; use winapi; use kernel32; use winapi::FILETIME; fn filetime_to_tickcount(ft: &FILETIME) -> u64 { ((ft.dwHighDateTime as u64) << 32) | (ft.dwLowDateTime as u64) } fn calculate_processor_load(idle_ticks: u64, total_ticks: u64) -> Option<f64> { static mut PREVIOUS_IDLE_TICKS: u64 = 0; static mut PREVIOUS_TOTAL_TICKS: u64 = 0; static mut PREVIOUS_LOAD: Option<f64> = None; let (previous_idle_ticks, previous_total_ticks, previous_load) = unsafe { (PREVIOUS_IDLE_TICKS, PREVIOUS_TOTAL_TICKS, PREVIOUS_LOAD) }; let idle_ticks_since_last_time = idle_ticks - previous_idle_ticks; let total_ticks_since_last_time = total_ticks - previous_total_ticks; let first_call = previous_total_ticks == 0; let ticks_not_updated_since_last_call = total_ticks_since_last_time == 0; let load; if first_call || ticks_not_updated_since_last_call { load = previous_load; } else { // Calculate load. let idle_to_total_ratio = idle_ticks_since_last_time as f64 / total_ticks_since_last_time as f64; let load_since_last_call = 1.0f64 - idle_to_total_ratio; // Filter/smooth result when possible. load = Some(if let Some(previous_load) = previous_load { 0.9 * previous_load + 0.1 * load_since_last_call } else { load_since_last_call }); } unsafe { PREVIOUS_LOAD = load; PREVIOUS_TOTAL_TICKS = total_ticks; PREVIOUS_IDLE_TICKS = idle_ticks; } load } unsafe { let mut idle_time = zeroed::<FILETIME>(); let mut kernel_time = zeroed::<FILETIME>(); let mut user_time = zeroed::<FILETIME>(); if kernel32::GetSystemTimes(&mut idle_time, &mut kernel_time, &mut user_time) == winapi::FALSE { return None; }; let idle_ticks = filetime_to_tickcount(&idle_time); let total_ticks = filetime_to_tickcount(&kernel_time) + filetime_to_tickcount(&user_time); if let Some(processor_load) = calculate_processor_load(idle_ticks, total_ticks) { Some(processor_load * get_processor_count() as f64) } else { None } } } /* double GetLoadAverage() { FILETIME idle_time, kernel_time, user_time; BOOL get_system_time_succeeded = GetSystemTimes(&idle_time, &kernel_time, &user_time); double posix_compatible_load; if (get_system_time_succeeded) { uint64_t idle_ticks = FileTimeToTickCount(idle_time); // kernel_time from GetSystemTimes already includes idle_time. uint64_t total_ticks = FileTimeToTickCount(kernel_time) + FileTimeToTickCount(user_time); double processor_load = CalculateProcessorLoad(idle_ticks, total_ticks); posix_compatible_load = processor_load * GetProcessorCount(); } else { posix_compatible_load = -0.0; } return posix_compatible_load; } #elif defined(_AIX) double GetLoadAverage() { perfstat_cpu_total_t cpu_stats; if (perfstat_cpu_total(NULL, &cpu_stats, sizeof(cpu_stats), 1) < 0) { return -0.0f; } // Calculation taken from comment in libperfstats.h return double(cpu_stats.loadavg[0]) / double(1 << SBITS); } #elif defined(__UCLIBC__) double GetLoadAverage() { struct sysinfo si; if (sysinfo(&si) != 0) return -0.0f; return 1.0 / (1 << SI_LOAD_SHIFT) * si.loads[0]; } #else */ #[cfg(unix)] pub fn get_load_average() -> Option<f64> { let mut load_avg: [f64; 3] = [0.0f64, 0.0f64, 0.0f64]; unsafe { if libc::getloadavg(load_avg.as_mut_ptr(), 3) < 0 { return None; } } Some(load_avg[0]) } /* double GetLoadAverage() { double loadavg[3] = { 0.0f, 0.0f, 0.0f }; if (getloadavg(loadavg, 3) < 0) { // Maybe we should return an error here or the availability of // getloadavg(3) should be checked when ninja is configured. return -0.0f; } return loadavg[0]; } #endif // _WIN32 string ElideMiddle(const string& str, size_t width) { const int kMargin = 3; // Space for "...". string result = str; if (result.size() + kMargin > width) { size_t elide_size = (width - kMargin) / 2; result = result.substr(0, elide_size) + "..." + result.substr(result.size() - elide_size, elide_size); } return result; } bool Truncate(const string& path, size_t size, string* err) { #ifdef _WIN32 int fh = _sopen(path.c_str(), _O_RDWR | _O_CREAT, _SH_DENYNO, _S_IREAD | _S_IWRITE); int success = _chsize(fh, size); _close(fh); #else int success = truncate(path.c_str(), size); #endif // Both truncate() and _chsize() return 0 on success and set errno and return // -1 on failure. if (success < 0) { *err = strerror(errno); return false; } return true; } */ #[cfg(test)] mod tests { use super::*; #[test] fn canonicalize_path_path_samples() { struct TestItem { path: &'static [u8], result: &'static [u8], } assert_eq!(canonicalize_path(&mut vec![]), Err("empty path".to_owned())); let test_items = vec![ TestItem { path: b"foo.h", result: b"foo.h", }, ]; for test_item in test_items { let mut path = test_item.path.to_owned(); assert!(canonicalize_path(&mut path).is_ok()); assert_eq!(path.as_slice(), test_item.result); } } } /* namespace { bool CanonicalizePath(string* path, string* err) { uint64_t unused; return ::CanonicalizePath(path, &unused, err); } } // namespace TEST(CanonicalizePath, PathSamples) { string path; string err; EXPECT_FALSE(CanonicalizePath(&path, &err)); EXPECT_EQ("empty path", err); path = "foo.h"; err = ""; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("foo.h", path); path = "./foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("foo.h", path); path = "./foo/./bar.h"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("foo/bar.h", path); path = "./x/foo/../bar.h"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("x/bar.h", path); path = "./x/foo/../../bar.h"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("bar.h", path); path = "foo//bar"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("foo/bar", path); path = "foo//.//..///bar"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("bar", path); path = "./x/../foo/../../bar.h"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("../bar.h", path); path = "foo/./."; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("foo", path); path = "foo/bar/.."; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("foo", path); path = "foo/.hidden_bar"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("foo/.hidden_bar", path); path = "/foo"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("/foo", path); path = "//foo"; EXPECT_TRUE(CanonicalizePath(&path, &err)); #ifdef _WIN32 EXPECT_EQ("//foo", path); #else EXPECT_EQ("/foo", path); #endif path = "/"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("", path); path = "/foo/.."; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("", path); path = "."; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ(".", path); path = "./."; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ(".", path); path = "foo/.."; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ(".", path); } #ifdef _WIN32 TEST(CanonicalizePath, PathSamplesWindows) { string path; string err; EXPECT_FALSE(CanonicalizePath(&path, &err)); EXPECT_EQ("empty path", err); path = "foo.h"; err = ""; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("foo.h", path); path = ".\\foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("foo.h", path); path = ".\\foo\\.\\bar.h"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("foo/bar.h", path); path = ".\\x\\foo\\..\\bar.h"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("x/bar.h", path); path = ".\\x\\foo\\..\\..\\bar.h"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("bar.h", path); path = "foo\\\\bar"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("foo/bar", path); path = "foo\\\\.\\\\..\\\\\\bar"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("bar", path); path = ".\\x\\..\\foo\\..\\..\\bar.h"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("../bar.h", path); path = "foo\\.\\."; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("foo", path); path = "foo\\bar\\.."; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("foo", path); path = "foo\\.hidden_bar"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("foo/.hidden_bar", path); path = "\\foo"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("/foo", path); path = "\\\\foo"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("//foo", path); path = "\\"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("", path); } TEST(CanonicalizePath, SlashTracking) { string path; string err; uint64_t slash_bits; path = "foo.h"; err = ""; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ("foo.h", path); EXPECT_EQ(0, slash_bits); path = "a\\foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ("a/foo.h", path); EXPECT_EQ(1, slash_bits); path = "a/bcd/efh\\foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ("a/bcd/efh/foo.h", path); EXPECT_EQ(4, slash_bits); path = "a\\bcd/efh\\foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ("a/bcd/efh/foo.h", path); EXPECT_EQ(5, slash_bits); path = "a\\bcd\\efh\\foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ("a/bcd/efh/foo.h", path); EXPECT_EQ(7, slash_bits); path = "a/bcd/efh/foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ("a/bcd/efh/foo.h", path); EXPECT_EQ(0, slash_bits); path = "a\\./efh\\foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ("a/efh/foo.h", path); EXPECT_EQ(3, slash_bits); path = "a\\../efh\\foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ("efh/foo.h", path); EXPECT_EQ(1, slash_bits); path = "a\\b\\c\\d\\e\\f\\g\\foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ("a/b/c/d/e/f/g/foo.h", path); EXPECT_EQ(127, slash_bits); path = "a\\b\\c\\..\\..\\..\\g\\foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ("g/foo.h", path); EXPECT_EQ(1, slash_bits); path = "a\\b/c\\../../..\\g\\foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ("g/foo.h", path); EXPECT_EQ(1, slash_bits); path = "a\\b/c\\./../..\\g\\foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ("a/g/foo.h", path); EXPECT_EQ(3, slash_bits); path = "a\\b/c\\./../..\\g/foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ("a/g/foo.h", path); EXPECT_EQ(1, slash_bits); path = "a\\\\\\foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ("a/foo.h", path); EXPECT_EQ(1, slash_bits); path = "a/\\\\foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ("a/foo.h", path); EXPECT_EQ(0, slash_bits); path = "a\\//foo.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ("a/foo.h", path); EXPECT_EQ(1, slash_bits); } TEST(CanonicalizePath, CanonicalizeNotExceedingLen) { // Make sure searching \/ doesn't go past supplied len. char buf[] = "foo/bar\\baz.h\\"; // Last \ past end. uint64_t slash_bits; string err; size_t size = 13; EXPECT_TRUE(::CanonicalizePath(buf, &size, &slash_bits, &err)); EXPECT_EQ(0, strncmp("foo/bar/baz.h", buf, size)); EXPECT_EQ(2, slash_bits); // Not including the trailing one. } TEST(CanonicalizePath, TooManyComponents) { string path; string err; uint64_t slash_bits; // 64 is OK. path = "a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./" "a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./x.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ(slash_bits, 0x0); // Backslashes version. path = "a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\" "a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\" "a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\" "a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\x.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ(slash_bits, 0xffffffff); // 65 is OK if #component is less than 60 after path canonicalization. err = ""; path = "a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./" "a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./a/./x/y.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ(slash_bits, 0x0); // Backslashes version. err = ""; path = "a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\" "a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\" "a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\" "a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\a\\.\\x\\y.h"; EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ(slash_bits, 0x1ffffffff); // 59 after canonicalization is OK. err = ""; path = "a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/" "a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/x/y.h"; EXPECT_EQ(58, std::count(path.begin(), path.end(), '/')); EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ(slash_bits, 0x0); // Backslashes version. err = ""; path = "a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\" "a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\" "a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\" "a\\a\\a\\a\\a\\a\\a\\a\\a\\x\\y.h"; EXPECT_EQ(58, std::count(path.begin(), path.end(), '\\')); EXPECT_TRUE(CanonicalizePath(&path, &slash_bits, &err)); EXPECT_EQ(slash_bits, 0x3ffffffffffffff); } #endif TEST(CanonicalizePath, UpDir) { string path, err; path = "../../foo/bar.h"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("../../foo/bar.h", path); path = "test/../../foo/bar.h"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("../foo/bar.h", path); } TEST(CanonicalizePath, AbsolutePath) { string path = "/usr/include/stdio.h"; string err; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("/usr/include/stdio.h", path); } TEST(CanonicalizePath, NotNullTerminated) { string path; string err; size_t len; uint64_t unused; path = "foo/. bar/."; len = strlen("foo/."); // Canonicalize only the part before the space. EXPECT_TRUE(CanonicalizePath(&path[0], &len, &unused, &err)); EXPECT_EQ(strlen("foo"), len); EXPECT_EQ("foo/. bar/.", string(path)); path = "foo/../file bar/."; len = strlen("foo/../file"); EXPECT_TRUE(CanonicalizePath(&path[0], &len, &unused, &err)); EXPECT_EQ(strlen("file"), len); EXPECT_EQ("file ./file bar/.", string(path)); } TEST(PathEscaping, TortureTest) { string result; GetWin32EscapedString("foo bar\\\"'$@d!st!c'\\path'\\", &result); EXPECT_EQ("\"foo bar\\\\\\\"'$@d!st!c'\\path'\\\\\"", result); result.clear(); GetShellEscapedString("foo bar\"/'$@d!st!c'/path'", &result); EXPECT_EQ("'foo bar\"/'\\''$@d!st!c'\\''/path'\\'''", result); } TEST(PathEscaping, SensiblePathsAreNotNeedlesslyEscaped) { const char* path = "some/sensible/path/without/crazy/characters.c++"; string result; GetWin32EscapedString(path, &result); EXPECT_EQ(path, result); result.clear(); GetShellEscapedString(path, &result); EXPECT_EQ(path, result); } TEST(PathEscaping, SensibleWin32PathsAreNotNeedlesslyEscaped) { const char* path = "some\\sensible\\path\\without\\crazy\\characters.c++"; string result; GetWin32EscapedString(path, &result); EXPECT_EQ(path, result); } TEST(StripAnsiEscapeCodes, EscapeAtEnd) { string stripped = StripAnsiEscapeCodes("foo\33"); EXPECT_EQ("foo", stripped); stripped = StripAnsiEscapeCodes("foo\33["); EXPECT_EQ("foo", stripped); } TEST(StripAnsiEscapeCodes, StripColors) { // An actual clang warning. string input = "\33[1maffixmgr.cxx:286:15: \33[0m\33[0;1;35mwarning: " "\33[0m\33[1musing the result... [-Wparentheses]\33[0m"; string stripped = StripAnsiEscapeCodes(input); EXPECT_EQ("affixmgr.cxx:286:15: warning: using the result... [-Wparentheses]", stripped); } TEST(ElideMiddle, NothingToElide) { string input = "Nothing to elide in this short string."; EXPECT_EQ(input, ElideMiddle(input, 80)); } TEST(ElideMiddle, ElideInTheMiddle) { string input = "01234567890123456789"; string elided = ElideMiddle(input, 10); EXPECT_EQ("012...789", elided); } */
#[doc = "Reader of register CR0"] pub type R = crate::R<u32, super::CR0>; #[doc = "Writer for register CR0"] pub type W = crate::W<u32, super::CR0>; #[doc = "Register CR0 `reset()`'s with value 0"] impl crate::ResetValue for super::CR0 { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0 } } #[doc = "SSI Data Size Select\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum DSS_A { #[doc = "3: 4-bit data"] _4 = 3, #[doc = "4: 5-bit data"] _5 = 4, #[doc = "5: 6-bit data"] _6 = 5, #[doc = "6: 7-bit data"] _7 = 6, #[doc = "7: 8-bit data"] _8 = 7, #[doc = "8: 9-bit data"] _9 = 8, #[doc = "9: 10-bit data"] _10 = 9, #[doc = "10: 11-bit data"] _11 = 10, #[doc = "11: 12-bit data"] _12 = 11, #[doc = "12: 13-bit data"] _13 = 12, #[doc = "13: 14-bit data"] _14 = 13, #[doc = "14: 15-bit data"] _15 = 14, #[doc = "15: 16-bit data"] _16 = 15, } impl From<DSS_A> for u8 { #[inline(always)] fn from(variant: DSS_A) -> Self { variant as _ } } #[doc = "Reader of field `DSS`"] pub type DSS_R = crate::R<u8, DSS_A>; impl DSS_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> crate::Variant<u8, DSS_A> { use crate::Variant::*; match self.bits { 3 => Val(DSS_A::_4), 4 => Val(DSS_A::_5), 5 => Val(DSS_A::_6), 6 => Val(DSS_A::_7), 7 => Val(DSS_A::_8), 8 => Val(DSS_A::_9), 9 => Val(DSS_A::_10), 10 => Val(DSS_A::_11), 11 => Val(DSS_A::_12), 12 => Val(DSS_A::_13), 13 => Val(DSS_A::_14), 14 => Val(DSS_A::_15), 15 => Val(DSS_A::_16), i => Res(i), } } #[doc = "Checks if the value of the field is `_4`"] #[inline(always)] pub fn is_4(&self) -> bool { *self == DSS_A::_4 } #[doc = "Checks if the value of the field is `_5`"] #[inline(always)] pub fn is_5(&self) -> bool { *self == DSS_A::_5 } #[doc = "Checks if the value of the field is `_6`"] #[inline(always)] pub fn is_6(&self) -> bool { *self == DSS_A::_6 } #[doc = "Checks if the value of the field is `_7`"] #[inline(always)] pub fn is_7(&self) -> bool { *self == DSS_A::_7 } #[doc = "Checks if the value of the field is `_8`"] #[inline(always)] pub fn is_8(&self) -> bool { *self == DSS_A::_8 } #[doc = "Checks if the value of the field is `_9`"] #[inline(always)] pub fn is_9(&self) -> bool { *self == DSS_A::_9 } #[doc = "Checks if the value of the field is `_10`"] #[inline(always)] pub fn is_10(&self) -> bool { *self == DSS_A::_10 } #[doc = "Checks if the value of the field is `_11`"] #[inline(always)] pub fn is_11(&self) -> bool { *self == DSS_A::_11 } #[doc = "Checks if the value of the field is `_12`"] #[inline(always)] pub fn is_12(&self) -> bool { *self == DSS_A::_12 } #[doc = "Checks if the value of the field is `_13`"] #[inline(always)] pub fn is_13(&self) -> bool { *self == DSS_A::_13 } #[doc = "Checks if the value of the field is `_14`"] #[inline(always)] pub fn is_14(&self) -> bool { *self == DSS_A::_14 } #[doc = "Checks if the value of the field is `_15`"] #[inline(always)] pub fn is_15(&self) -> bool { *self == DSS_A::_15 } #[doc = "Checks if the value of the field is `_16`"] #[inline(always)] pub fn is_16(&self) -> bool { *self == DSS_A::_16 } } #[doc = "Write proxy for field `DSS`"] pub struct DSS_W<'a> { w: &'a mut W, } impl<'a> DSS_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: DSS_A) -> &'a mut W { unsafe { self.bits(variant.into()) } } #[doc = "4-bit data"] #[inline(always)] pub fn _4(self) -> &'a mut W { self.variant(DSS_A::_4) } #[doc = "5-bit data"] #[inline(always)] pub fn _5(self) -> &'a mut W { self.variant(DSS_A::_5) } #[doc = "6-bit data"] #[inline(always)] pub fn _6(self) -> &'a mut W { self.variant(DSS_A::_6) } #[doc = "7-bit data"] #[inline(always)] pub fn _7(self) -> &'a mut W { self.variant(DSS_A::_7) } #[doc = "8-bit data"] #[inline(always)] pub fn _8(self) -> &'a mut W { self.variant(DSS_A::_8) } #[doc = "9-bit data"] #[inline(always)] pub fn _9(self) -> &'a mut W { self.variant(DSS_A::_9) } #[doc = "10-bit data"] #[inline(always)] pub fn _10(self) -> &'a mut W { self.variant(DSS_A::_10) } #[doc = "11-bit data"] #[inline(always)] pub fn _11(self) -> &'a mut W { self.variant(DSS_A::_11) } #[doc = "12-bit data"] #[inline(always)] pub fn _12(self) -> &'a mut W { self.variant(DSS_A::_12) } #[doc = "13-bit data"] #[inline(always)] pub fn _13(self) -> &'a mut W { self.variant(DSS_A::_13) } #[doc = "14-bit data"] #[inline(always)] pub fn _14(self) -> &'a mut W { self.variant(DSS_A::_14) } #[doc = "15-bit data"] #[inline(always)] pub fn _15(self) -> &'a mut W { self.variant(DSS_A::_15) } #[doc = "16-bit data"] #[inline(always)] pub fn _16(self) -> &'a mut W { self.variant(DSS_A::_16) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !0x0f) | ((value as u32) & 0x0f); self.w } } #[doc = "SSI Frame Format Select\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum FRF_A { #[doc = "0: Freescale SPI Frame Format"] MOTO = 0, #[doc = "1: Synchronous Serial Frame Format"] TI = 1, } impl From<FRF_A> for u8 { #[inline(always)] fn from(variant: FRF_A) -> Self { variant as _ } } #[doc = "Reader of field `FRF`"] pub type FRF_R = crate::R<u8, FRF_A>; impl FRF_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> crate::Variant<u8, FRF_A> { use crate::Variant::*; match self.bits { 0 => Val(FRF_A::MOTO), 1 => Val(FRF_A::TI), i => Res(i), } } #[doc = "Checks if the value of the field is `MOTO`"] #[inline(always)] pub fn is_moto(&self) -> bool { *self == FRF_A::MOTO } #[doc = "Checks if the value of the field is `TI`"] #[inline(always)] pub fn is_ti(&self) -> bool { *self == FRF_A::TI } } #[doc = "Write proxy for field `FRF`"] pub struct FRF_W<'a> { w: &'a mut W, } impl<'a> FRF_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FRF_A) -> &'a mut W { unsafe { self.bits(variant.into()) } } #[doc = "Freescale SPI Frame Format"] #[inline(always)] pub fn moto(self) -> &'a mut W { self.variant(FRF_A::MOTO) } #[doc = "Synchronous Serial Frame Format"] #[inline(always)] pub fn ti(self) -> &'a mut W { self.variant(FRF_A::TI) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4); self.w } } #[doc = "Reader of field `SPO`"] pub type SPO_R = crate::R<bool, bool>; #[doc = "Write proxy for field `SPO`"] pub struct SPO_W<'a> { w: &'a mut W, } impl<'a> SPO_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); self.w } } #[doc = "Reader of field `SPH`"] pub type SPH_R = crate::R<bool, bool>; #[doc = "Write proxy for field `SPH`"] pub struct SPH_W<'a> { w: &'a mut W, } impl<'a> SPH_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); self.w } } #[doc = "Reader of field `SCR`"] pub type SCR_R = crate::R<u8, u8>; #[doc = "Write proxy for field `SCR`"] pub struct SCR_W<'a> { w: &'a mut W, } impl<'a> SCR_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0xff << 8)) | (((value as u32) & 0xff) << 8); self.w } } impl R { #[doc = "Bits 0:3 - SSI Data Size Select"] #[inline(always)] pub fn dss(&self) -> DSS_R { DSS_R::new((self.bits & 0x0f) as u8) } #[doc = "Bits 4:5 - SSI Frame Format Select"] #[inline(always)] pub fn frf(&self) -> FRF_R { FRF_R::new(((self.bits >> 4) & 0x03) as u8) } #[doc = "Bit 6 - SSI Serial Clock Polarity"] #[inline(always)] pub fn spo(&self) -> SPO_R { SPO_R::new(((self.bits >> 6) & 0x01) != 0) } #[doc = "Bit 7 - SSI Serial Clock Phase"] #[inline(always)] pub fn sph(&self) -> SPH_R { SPH_R::new(((self.bits >> 7) & 0x01) != 0) } #[doc = "Bits 8:15 - SSI Serial Clock Rate"] #[inline(always)] pub fn scr(&self) -> SCR_R { SCR_R::new(((self.bits >> 8) & 0xff) as u8) } } impl W { #[doc = "Bits 0:3 - SSI Data Size Select"] #[inline(always)] pub fn dss(&mut self) -> DSS_W { DSS_W { w: self } } #[doc = "Bits 4:5 - SSI Frame Format Select"] #[inline(always)] pub fn frf(&mut self) -> FRF_W { FRF_W { w: self } } #[doc = "Bit 6 - SSI Serial Clock Polarity"] #[inline(always)] pub fn spo(&mut self) -> SPO_W { SPO_W { w: self } } #[doc = "Bit 7 - SSI Serial Clock Phase"] #[inline(always)] pub fn sph(&mut self) -> SPH_W { SPH_W { w: self } } #[doc = "Bits 8:15 - SSI Serial Clock Rate"] #[inline(always)] pub fn scr(&mut self) -> SCR_W { SCR_W { w: self } } }
#![allow(unused_must_use)] // use std::fs; // use std::path; fn main() { // use std::env; // let out_dir = env::var("OUT_DIR").unwrap(); // let path = path::Path::new(&out_dir); // let deps_dir = path.parent().unwrap().parent().unwrap().parent().unwrap().join("deps"); // let new_name = deps_dir.clone().join("xpsupport.dll"); // if !new_name.exists() // { // let r = fs::read_dir(&deps_dir); // match r // { // Ok(_) => // { // println!("cargo:rustc-link-search=11"); // for entry in r.unwrap() { // if let Ok(entry) = entry // { // let path = entry.path(); // if path.is_file() // && path.extension().unwrap() == "dll" // && path.file_name().unwrap().to_str().unwrap().starts_with("xpsupport-"){ // println!("cargo:rustc-link-search={}", path.to_str().unwrap()); // println!("cargo:rustc-link-search={}", new_name.to_str().unwrap()); // fs::rename(path, &new_name); // break; // } // } // } // }, // Err(e)=> // { // println!("{:?}", e); // } // } // } // println!("cargo:rustc-link-search={}", deps_dir.to_str().unwrap()); // // by the way, copy xpsupport.dll to target directory // let copy_path = deps_dir.clone().parent().unwrap().join("xpsupport.dll"); // if !copy_path.exists() // { // fs::copy(new_name, copy_path); // } println!("cargo:rustc-flags=-l xpsupport"); }
pub fn do_a_struct() { #[derive(Debug)] struct MyStruct { foo: String, bar: bool, tup: (u32, u32), } let a_struct = MyStruct { foo: String::new(), bar: false, tup: (7, 8), }; println!("I made a struct: {:?}.", a_struct.foo); } pub fn generics() { let number_list = vec![18, 30, 11, 19]; let result = largest(&number_list); println!("largest number is: {}.", result) } pub fn largest<T: PartialOrd>(list: &[T]) -> &T { let mut largest = &list[0]; for item in list { if item > largest { largest = item; } } largest }
//! # Special Topics //! //! These are short recipes for accomplishing common tasks. //! //! - [Why `winnow`?][why] //! - Formats: //! - [Elements of Programming Languages][language] //! - [Arithmetic][arithmetic] //! - [s-expression][s_expression] //! - [json] //! - [INI][ini] //! - [HTTP][http] //! - Special Topics: //! - [Implementing `FromStr`][fromstr] //! - [Performance][performance] //! - [Parsing Partial Input][partial] //! - [Custom stream][stream] //! - [Custom errors][error] //! //! See also parsers written with `winnow`: //! //! - [`toml_edit`](https://crates.io/crates/toml_edit) //! - [`hcl-edit`](https://crates.io/crates/hcl-edit) pub mod arithmetic; pub mod error; pub mod fromstr; pub mod http; pub mod ini; pub mod json; pub mod language; pub mod partial; pub mod performance; pub mod s_expression; pub mod stream; pub mod why;
extern crate glium; extern crate runic; const FRAG: &str = include_str!("fancy.frag"); use glium::*; use glutin::*; use glium::uniforms::*; fn main() { // Create the events loop, and display as per normal let mut events_loop = EventsLoop::new(); let window = glutin::WindowBuilder::new() .with_dimensions((512, 512).into()) .with_title("Runic Fancy Example"); let context = glutin::ContextBuilder::new() .with_vsync(true); let display = glium::Display::new(window, context, &events_loop).unwrap(); // Create a custom program with our own fragmentation shader let program = Program::from_source(&display, runic::VERT, FRAG, None).unwrap(); // Create a cached font let mut cached_font = runic::CachedFont::from_bytes(include_bytes!("fonts/WenQuanYiMicroHei.ttf"), &display).unwrap(); let mut text: String = "It does custom shaders too: ".into(); let mut running = true; let mut time = 0.0_f32; while running { events_loop.poll_events(|event| if let Event::WindowEvent {event, ..} = event { match event { WindowEvent::CloseRequested => running = false, WindowEvent::ReceivedCharacter(character) => text.push(character), _ => {} } }); let mut target = display.draw(); target.clear_color(0.0, 0.0, 0.0, 1.0); // Get the vertices for the font and make a vertex buffer let vertices: Vec<_> = cached_font.get_vertices(&text, [10.0, 10.0], 24.0, false, &display).unwrap().collect(); let vertex_buffer = VertexBuffer::new(&display, &vertices).unwrap(); // Setup uniforms let uniforms = uniform! { sampler: Sampler::new(cached_font.cache().texture()), colour: [1.0, 0.0, 0.0, 1.0_f32], time: time }; // Draw the font to the frame! target.draw( &vertex_buffer, glium::index::NoIndices(glium::index::PrimitiveType::TrianglesList), &program, &uniforms, &glium::DrawParameters { blend: glium::Blend::alpha_blending(), ..Default::default() } ).unwrap(); target.finish().unwrap(); time += 0.1; } }
use unicycle::pin_slab::PinSlab; struct Foo(u32); struct Bar(Vec<u32>); #[global_allocator] static ALLOCATOR: checkers::Allocator = checkers::Allocator::system(); #[checkers::test] fn test_pin_slab_memory_leak() { let mut copy = PinSlab::new(); copy.insert(Foo(42)); let mut non_copy = PinSlab::new(); non_copy.insert(Bar(vec![42])); }
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 use std::fmt::{Display, Formatter, Result}; /// This struct represents the strongly typed equivalent of the json body /// from vsock related requests. #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)] #[serde(deny_unknown_fields)] pub struct VsockDeviceConfig { /// ID of the vsock device. pub vsock_id: String, /// A 32-bit Context Identifier (CID) used to identify the guest. pub guest_cid: u32, /// Path to local unix socket. pub uds_path: String, } /// Errors associated with `VsockDeviceConfig`. #[derive(Debug)] pub enum VsockError { /// The update is not allowed after booting the microvm. UpdateNotAllowedPostBoot, } impl Display for VsockError { fn fmt(&self, f: &mut Formatter) -> Result { use self::VsockError::*; match *self { UpdateNotAllowedPostBoot => { write!(f, "The update operation is not allowed after boot.",) } } } }
// Copyright (c) 2016 The Rouille developers // Licensed under the Apache License, Version 2.0 // <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT // license <LICENSE-MIT or http://opensource.org/licenses/MIT>, // at your option. All files in the project carrying such // notice may not be copied, modified, or distributed except // according to those terms. use std::io; use std::io::Write; use std::mem; use std::sync::mpsc::Sender; use ReadWrite; use Upgrade; use websocket::low_level; /// A successful websocket. An open channel of communication. Implements `Read` and `Write`. pub struct Websocket { // The socket. `None` if closed. socket: Option<Box<dyn ReadWrite + Send>>, // The websocket state machine. state_machine: low_level::StateMachine, // True if the fragmented message currently being processed is binary. False if string. Pings // are excluded. current_message_binary: bool, // Buffer for the fragmented message currently being processed. Pings are excluded. current_message_payload: Vec<u8>, // Opcode of the fragment currently being processed. current_frame_opcode: u8, // Fin flag of the fragment currently being processed. current_frame_fin: bool, // Data of the fragment currently being processed. current_frame_payload: Vec<u8>, // Queue of the messages that are going to be returned by `next()`. messages_in_queue: Vec<Message>, } /// A message produced by a websocket connection. #[derive(Debug, Clone, PartialEq, Eq)] pub enum Message { /// Text data. If the client is in Javascript, this happens when the client called `send()` /// with a string. Text(String), /// Binary data. If the client is in Javascript, this happens when the client called `send()` /// with a blob or an arraybuffer. Binary(Vec<u8>), } /// Error that can happen when sending a message to the client. #[derive(Debug)] pub enum SendError { /// Failed to transfer the message on the socket. IoError(io::Error), /// The websocket connection is closed. Closed, } impl From<io::Error> for SendError { #[inline] fn from(err: io::Error) -> SendError { SendError::IoError(err) } } impl Websocket { /// Sends text data over the websocket. /// /// Returns an error if the message didn't send correctly or if the connection is closed. /// /// If the client is in javascript, the message will contain a string. #[inline] pub fn send_text(&mut self, data: &str) -> Result<(), SendError> { let socket = match self.socket { Some(ref mut s) => s, None => return Err(SendError::Closed), }; send(data.as_bytes(), Write::by_ref(socket), 0x1)?; Ok(()) } /// Sends binary data over the websocket. /// /// Returns an error if the message didn't send correctly or if the connection is closed. /// /// If the client is in javascript, the message will contain a blob or an arraybuffer. #[inline] pub fn send_binary(&mut self, data: &[u8]) -> Result<(), SendError> { let socket = match self.socket { Some(ref mut s) => s, None => return Err(SendError::Closed), }; send(data, Write::by_ref(socket), 0x2)?; Ok(()) } /// Returns `true` if the websocket has been closed by either the client (voluntarily or not) /// or by the server (if the websocket protocol was violated). #[inline] pub fn is_closed(&self) -> bool { self.socket.is_none() } // TODO: give access to close reason } impl Upgrade for Sender<Websocket> { fn build(&mut self, socket: Box<dyn ReadWrite + Send>) { let websocket = Websocket { socket: Some(socket), state_machine: low_level::StateMachine::new(), current_message_binary: false, current_message_payload: Vec::new(), current_frame_opcode: 0, current_frame_fin: false, current_frame_payload: Vec::new(), messages_in_queue: Vec::new(), }; let _ = self.send(websocket); } } impl Iterator for Websocket { type Item = Message; fn next(&mut self) -> Option<Message> { loop { // If the socket is `None`, the connection has been closed. self.socket.as_ref()?; // There may be some messages waiting to be processed. if !self.messages_in_queue.is_empty() { return Some(self.messages_in_queue.remove(0)); } // Read `n` bytes in `buf`. let mut buf = [0; 256]; let n = match self.socket.as_mut().unwrap().read(&mut buf) { Ok(n) if n == 0 => { // Read returning zero means EOF self.socket = None; return None; } Ok(n) => n, Err(ref err) if err.kind() == io::ErrorKind::Interrupted => 0, Err(_) => { self.socket = None; return None; } }; // Fill `messages_in_queue` by analyzing the packets. for element in self.state_machine.feed(&buf[0..n]) { match element { low_level::Element::FrameStart { fin, opcode, .. } => { debug_assert!(self.current_frame_payload.is_empty()); self.current_frame_fin = fin; self.current_frame_opcode = opcode; } low_level::Element::Data { data, last_in_frame, } => { // Under normal circumstances we just handle data by pushing it to // `current_frame_payload`. self.current_frame_payload.extend(data); // But if the frame is finished we additionally need to dispatch it. if last_in_frame { match self.current_frame_opcode { // Frame is a continuation of the current message. 0x0 => { self.current_message_payload .append(&mut self.current_frame_payload); // If the message is finished, dispatch it. if self.current_frame_fin { let binary = mem::take(&mut self.current_message_payload); if self.current_message_binary { self.messages_in_queue.push(Message::Binary(binary)); } else { let string = match String::from_utf8(binary) { Ok(s) => s, Err(_) => { // Closing connection because text wasn't UTF-8 let _ = send( b"1007 Invalid UTF-8 encoding", Write::by_ref( self.socket.as_mut().unwrap(), ), 0x8, ); self.socket = None; return None; } }; self.messages_in_queue.push(Message::Text(string)); } } } // Frame is an individual text frame. 0x1 => { // If we're in the middle of a message, this frame is invalid // and we need to close. if !self.current_message_payload.is_empty() { let _ = send( b"1002 Expected continuation frame", Write::by_ref(self.socket.as_mut().unwrap()), 0x8, ); self.socket = None; return None; } if self.current_frame_fin { // There's only one frame in this message. let binary = mem::take(&mut self.current_frame_payload); let string = match String::from_utf8(binary) { Ok(s) => s, Err(_err) => { // Closing connection because text wasn't UTF-8 let _ = send( b"1007 Invalid UTF-8 encoding", Write::by_ref(self.socket.as_mut().unwrap()), 0x8, ); self.socket = None; return None; } }; self.messages_in_queue.push(Message::Text(string)); } else { // Start of a fragmented message. self.current_message_binary = false; self.current_message_payload .append(&mut self.current_frame_payload); } } // Frame is an individual binary frame. 0x2 => { // If we're in the middle of a message, this frame is invalid // and we need to close. if !self.current_message_payload.is_empty() { let _ = send( b"1002 Expected continuation frame", Write::by_ref(self.socket.as_mut().unwrap()), 0x8, ); self.socket = None; return None; } if self.current_frame_fin { let binary = mem::take(&mut self.current_frame_payload); self.messages_in_queue.push(Message::Binary(binary)); } else { // Start of a fragmented message. self.current_message_binary = true; self.current_message_payload .append(&mut self.current_frame_payload); } } // Close request. 0x8 => { // We need to send a confirmation. let _ = send( &self.current_frame_payload, Write::by_ref(self.socket.as_mut().unwrap()), 0x8, ); // Since the packets are always received in order, and since // the server is considered dead as soon as it sends the // confirmation, we have no risk of losing packets. self.socket = None; return None; } // Ping. 0x9 => { // Send the pong. let _ = send( &self.current_frame_payload, Write::by_ref(self.socket.as_mut().unwrap()), 0xA, ); } // Pong. We ignore this as there's nothing to do. 0xA => {} // Unknown opcode means error and close. _ => { let _ = send( b"Unknown opcode", Write::by_ref(self.socket.as_mut().unwrap()), 0x8, ); self.socket = None; return None; } } self.current_frame_payload.clear(); } } low_level::Element::Error { desc } => { // The low level layer signaled an error. Sending it to client and closing. let _ = send( desc.as_bytes(), Write::by_ref(self.socket.as_mut().unwrap()), 0x8, ); self.socket = None; return None; } } } } } } // Sends a message to a websocket. // TODO: message fragmentation? fn send<W: Write>(data: &[u8], mut dest: W, opcode: u8) -> io::Result<()> { // Write the opcode assert!(opcode <= 0xf); let first_byte = 0x80 | opcode; dest.write_all(&[first_byte])?; // Write the length if data.len() >= 65536 { dest.write_all(&[127u8])?; let len = data.len() as u64; assert!(len < 0x8000_0000_0000_0000); dest.write_all(&len.to_be_bytes())?; } else if data.len() >= 126 { dest.write_all(&[126u8])?; let len = data.len() as u16; dest.write_all(&len.to_be_bytes())?; } else { dest.write_all(&[data.len() as u8])?; } // Write the data dest.write_all(data)?; dest.flush()?; Ok(()) } #[cfg(test)] mod tests { use super::*; #[test] fn test_ws_framing_short() { let data: &[u8] = &[0xAB, 0xAB, 0xAB, 0xAB]; let mut buf = Vec::new(); send(data, &mut buf, 0x2).unwrap(); // Expected // 0x82 (FIN = 1 | RSV1/2/3 = 0 | OPCODE = 2) // 0x04 (len = 4 bytes) // 0xABABABAB (payload = 4 bytes) assert_eq!(&buf, &[0x82, 0x04, 0xAB, 0xAB, 0xAB, 0xAB]); } #[test] fn test_ws_framing_medium() { let data: [u8; 125] = [0xAB; 125]; let mut buf = Vec::new(); send(&data, &mut buf, 0x2).unwrap(); // Expected // 0x82 (FIN = 1 | RSV1/2/3 = 0 | OPCODE = 2) // 0x7D (len = 125 bytes) // 0xABABABAB... (payload = 125 bytes) assert_eq!(&buf[0..2], &[0x82, 0x7D]); assert_eq!(&buf[2..], &data[..]); } #[test] fn test_ws_framing_long() { let data: [u8; 65534] = [0xAB; 65534]; let mut buf = Vec::new(); send(&data, &mut buf, 0x2).unwrap(); // Expected // 0x82 (FIN = 1 | RSV1/2/3 = 0 | OPCODE = 2) // 0x7E (len = 126 = extended 7+16) // 0xFFFE (extended_len = 65534 - Network Byte Order) // 0xABABABAB... (payload = 65534 bytes) assert_eq!(&buf[0..4], &[0x82, 0x7E, 0xFF, 0xFE]); assert_eq!(&buf[4..], &data[..]); } #[test] fn test_ws_framing_very_long() { let data: [u8; 0x100FF] = [0xAB; 0x100FF]; // 65791 let mut buf = Vec::new(); send(&data, &mut buf, 0x2).unwrap(); // Expected // 0x82 (FIN = 1 | RSV1/2/3 = 0 | OPCODE = 2) // 0x7F (len = 127 = extended 7+64) // 0x00000000000100FF (extended_len = 65791 - Network Byte Order) // 0xABABABAB... (payload = 65791 bytes) assert_eq!( &buf[0..10], &[0x82, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xFF] ); assert_eq!(&buf[10..], &data[..]); } }
use futures::TryFutureExt; use log::*; use serde::Serialize; use sqlx::pool::PoolConnection; use sqlx::{Connect, Connection}; use tide::{Error, IntoResponse, Request, Response, ResultExt}; use crate::api::model::*; use crate::api::util::*; use crate::db::model::*; use crate::db::Db; #[derive(Serialize)] struct ProfileResponseBody { profile: Profile, } impl From<Profile> for ProfileResponseBody { fn from(profile: Profile) -> Self { ProfileResponseBody { profile } } } /// Retrieve a profile by username /// /// [Get Profile](https://github.com/gothinkster/realworld/tree/master/api#get-profile) pub async fn get_profile( req: Request<impl Db<Conn = PoolConnection<impl Connect + ProvideData>>>, ) -> Response { async move { let authenticated = optionally_auth(&req).transpose()?; let leader_username = req.param::<String>("username").client_err()?; debug!("Searching for profile {}", leader_username); let state = req.state(); let mut tx = state .conn() .and_then(Connection::begin) .await .server_err()?; let leader = tx.get_profile_by_username(&leader_username).await?; debug!("Found profile for {}", leader_username); let is_following = if let Some((follower_id, _)) = authenticated { tx.is_following(leader.user_id, follower_id).await? } else { false }; tx.commit().await.server_err()?; let resp = to_json_response(&ProfileResponseBody { profile: Profile::from(leader).following(is_following), })?; Ok::<_, Error>(resp) } .await .unwrap_or_else(IntoResponse::into_response) } /// Follow a user /// /// [Follow User](https://github.com/gothinkster/realworld/tree/master/api#follow-user) pub async fn follow_user( req: Request<impl Db<Conn = PoolConnection<impl Connect + ProvideData>>>, ) -> Response { should_follow(req, true) .await .unwrap_or_else(IntoResponse::into_response) } /// Stop following a user /// /// [Unfollow User](https://github.com/gothinkster/realworld/tree/master/api#unfollow-user) pub async fn unfollow_user( req: Request<impl Db<Conn = PoolConnection<impl Connect + ProvideData>>>, ) -> Response { should_follow(req, false) .await .unwrap_or_else(IntoResponse::into_response) } /// Adds or removes a following relationship async fn should_follow( req: Request<impl Db<Conn = PoolConnection<impl Connect + ProvideData>>>, should_follow: bool, ) -> tide::Result<Response> { let (user_id, _) = extract_and_validate_token(&req)?; let leader_username = req.param::<String>("username").client_err()?; let state = req.state(); let mut tx = state .conn() .and_then(Connection::begin) .await .server_err()?; let leader_ent = tx.get_profile_by_username(&leader_username).await?; match should_follow { true => { debug!("User {} will now follow {}", user_id, leader_username); tx.add_follower(&leader_username, user_id).await } false => { debug!("User {} will no longer follow {}", user_id, leader_username); tx.delete_follower(&leader_username, user_id).await } }?; tx.commit().await.server_err()?; let profile = Profile::from(leader_ent).following(should_follow); let resp = to_json_response(&ProfileResponseBody::from(profile))?; Ok(resp) }
//! Tests auto-converted from "sass-spec/spec/parser/interpolate/06_space_list_complex" #[allow(unused)] use super::rsass; #[allow(unused)] use rsass::precision; /// From "sass-spec/spec/parser/interpolate/06_space_list_complex/01_inline" #[test] fn t01_inline() { assert_eq!( rsass( ".result {\n output: gamme \"\'\"delta\"\'\";\n output: #{gamme \"\'\"delta\"\'\"};\n output: \"[#{gamme \"\'\"delta\"\'\"}]\";\n output: \"#{gamme \"\'\"delta\"\'\"}\";\n output: \'#{gamme \"\'\"delta\"\'\"}\';\n output: \"[\'#{gamme \"\'\"delta\"\'\"}\']\";\n}\n" ) .unwrap(), ".result {\n output: gamme \"\'\" delta \"\'\";\n output: gamme \' delta \';\n output: \"[gamme \' delta \']\";\n output: \"gamme \' delta \'\";\n output: \"gamme \' delta \'\";\n output: \"[\'gamme \' delta \'\']\";\n}\n" ); } /// From "sass-spec/spec/parser/interpolate/06_space_list_complex/02_variable" #[test] fn t02_variable() { assert_eq!( rsass( "$input: gamme \"\'\"delta\"\'\";\n.result {\n output: $input;\n output: #{$input};\n output: \"[#{$input}]\";\n output: \"#{$input}\";\n output: \'#{$input}\';\n output: \"[\'#{$input}\']\";\n}\n" ) .unwrap(), ".result {\n output: gamme \"\'\" delta \"\'\";\n output: gamme \' delta \';\n output: \"[gamme \' delta \']\";\n output: \"gamme \' delta \'\";\n output: \"gamme \' delta \'\";\n output: \"[\'gamme \' delta \'\']\";\n}\n" ); } /// From "sass-spec/spec/parser/interpolate/06_space_list_complex/03_inline_double" #[test] fn t03_inline_double() { assert_eq!( rsass( ".result {\n output: #{#{gamme \"\'\"delta\"\'\"}};\n output: #{\"[#{gamme \"\'\"delta\"\'\"}]\"};\n output: #{\"#{gamme \"\'\"delta\"\'\"}\"};\n output: #{\'#{gamme \"\'\"delta\"\'\"}\'};\n output: #{\"[\'#{gamme \"\'\"delta\"\'\"}\']\"};\n}\n" ) .unwrap(), ".result {\n output: gamme \' delta \';\n output: [gamme \' delta \'];\n output: gamme \' delta \';\n output: gamme \' delta \';\n output: [\'gamme \' delta \'\'];\n}\n" ); } /// From "sass-spec/spec/parser/interpolate/06_space_list_complex/04_variable_double" #[test] fn t04_variable_double() { assert_eq!( rsass( "$input: gamme \"\'\"delta\"\'\";\n.result {\n output: #{#{$input}};\n output: #{\"[#{$input}]\"};\n output: #{\"#{$input}\"};\n output: #{\'#{$input}\'};\n output: #{\"[\'#{$input}\']\"};\n}\n" ) .unwrap(), ".result {\n output: gamme \' delta \';\n output: [gamme \' delta \'];\n output: gamme \' delta \';\n output: gamme \' delta \';\n output: [\'gamme \' delta \'\'];\n}\n" ); } /// From "sass-spec/spec/parser/interpolate/06_space_list_complex/05_variable_quoted_double" #[test] fn t05_variable_quoted_double() { assert_eq!( rsass( "$input: gamme \"\'\"delta\"\'\";\n.result {\n dquoted: \"#{#{$input}}\";\n dquoted: \"#{\"[#{$input}]\"}\";\n dquoted: \"#{\"#{$input}\"}\";\n dquoted: \"#{\'#{$input}\'}\";\n dquoted: \"#{\"[\'#{$input}\']\"}\";\n squoted: \'#{#{$input}}\';\n squoted: \'#{\"[#{$input}]\"}\';\n squoted: \'#{\"#{$input}\"}\';\n squoted: \'#{\'#{$input}\'}\';\n squoted: \'#{\"[\'#{$input}\']\"}\';\n}\n" ) .unwrap(), ".result {\n dquoted: \"gamme \' delta \'\";\n dquoted: \"[gamme \' delta \']\";\n dquoted: \"gamme \' delta \'\";\n dquoted: \"gamme \' delta \'\";\n dquoted: \"[\'gamme \' delta \'\']\";\n squoted: \"gamme \' delta \'\";\n squoted: \"[gamme \' delta \']\";\n squoted: \"gamme \' delta \'\";\n squoted: \"gamme \' delta \'\";\n squoted: \"[\'gamme \' delta \'\']\";\n}\n" ); } /// From "sass-spec/spec/parser/interpolate/06_space_list_complex/06_escape_interpolation" #[test] fn t06_escape_interpolation() { assert_eq!( rsass( "$input: gamme \"\'\"delta\"\'\";\n.result {\n output: \"[\\#{gamme \"\'\"delta\"\'\"}]\";\n output: \"\\#{gamme \"\'\"delta\"\'\"}\";\n output: \'\\#{gamme \"\'\"delta\"\'\"}\';\n output: \"[\'\\#{gamme \"\'\"delta\"\'\"}\']\";\n}\n" ) .unwrap(), ".result {\n output: \"[#{gamme \" \'\"delta\"\' \"}]\";\n output: \"#{gamme \" \'\"delta\"\' \"}\";\n output: \'#{gamme \"\' \"delta\" \'\"}\';\n output: \"[\'#{gamme \" \'\"delta\"\' \"}\']\";\n}\n" ); }
//use: cargo run --example rpi extern crate linux_embedded_hal as hal; extern crate pi_rmf69; use hal::spidev::SpidevOptions; use hal::Spidev; use hal::Pin; use hal::sysfs_gpio::Direction; use hal::Delay; use pi_rmf69::{radio, FreqencyBand}; fn main() { let cs = Pin::new(8); cs.export().unwrap(); cs.set_direction(Direction::Out).unwrap(); let mut spi = Spidev::open("/dev/spidev0.1").unwrap(); let options = SpidevOptions::new() .max_speed_hz(pi_rmf69::SPI_SPEED) .mode(hal::spidev::SPI_MODE_0) .build(); spi.configure(&options).unwrap(); let mut radio = radio(spi, cs, Delay) .adress(0) .freqency_band(FreqencyBand::ISM433mhz) .build(); radio.init().unwrap(); println!("radio init without problems!"); radio.send_blocking(5, &[1,2,3]).unwrap(); println!("radio send done!"); }
use join::Join; use proconio::input; fn main() { input! { n: usize, m: usize, edges: [(usize, usize); m], }; let mut adj = vec![vec![]; n + 1]; for (a, b) in edges { adj[a].push(b); adj[b].push(a); } for i in 1..=n { adj[i].sort(); if adj[i].is_empty() { println!("0"); } else { println!("{} {}", adj[i].len(), adj[i].iter().join(" ")); } } }
use crate::{Manager, Batteries, Battery}; /// Creates new batteries manager instance. /// /// Returns opaque pointer to it. Caller is required to call [battery_manager_free](fn.battery_manager_free.html) /// to properly free memory. #[no_mangle] pub extern fn battery_manager_new() -> *mut Manager { Box::into_raw(Box::new(Manager::new())) } /// Creates an iterator over batteries from manager instance. /// /// See [iterator_next](fn.battery_iterator_next.html) function for iterating over batteries. /// /// # Panics /// /// This function will panic if passed pointer is `NULL` #[no_mangle] pub unsafe extern fn battery_manager_iter(ptr: *mut Manager) -> *mut Batteries { assert!(!ptr.is_null()); let manager = &*ptr; Box::into_raw(Box::new(manager.iter())) } /// Refreshes battery information. /// /// # Panics /// /// This function will panic if any passed pointer is `NULL` /// /// # Returns /// /// `0` if everything is okay, `1` if refresh failed and `battery_ptr` contains stale information. pub unsafe extern fn battery_manager_refresh(manager_ptr: *mut Manager, battery_ptr: *mut Battery) -> libc::c_int { assert!(!manager_ptr.is_null()); let manager = &mut *manager_ptr; assert!(!battery_ptr.is_null()); let mut battery = &mut *battery_ptr; // TODO: Should there be better error handling? match manager.refresh(&mut battery) { Ok(_) => 0, Err(_) => 1, } } /// Frees manager instance. #[no_mangle] pub unsafe extern fn battery_manager_free(ptr: *mut Manager) { if ptr.is_null() { return; } Box::from_raw(ptr); }
use crate::compiling::v1::assemble::prelude::*; /// Compile an expression. impl Assemble for ast::ExprIndex { fn assemble(&self, c: &mut Compiler<'_>, needs: Needs) -> CompileResult<Asm> { let span = self.span(); log::trace!("ExprIndex => {:?}", c.source.source(span)); let guard = c.scopes.push_child(span)?; let target = self.target.assemble(c, Needs::Value)?.apply_targeted(c)?; let index = self.index.assemble(c, Needs::Value)?.apply_targeted(c)?; c.asm.push(Inst::IndexGet { index, target }, span); // NB: we still need to perform the operation since it might have side // effects, but pop the result in case a value is not needed. if !needs.value() { c.asm.push(Inst::Pop, span); } c.scopes.pop(guard, span)?; Ok(Asm::top(span)) } }
#![allow(clippy::derive_partial_eq_without_eq)] #![allow(clippy::needless_late_init)] #[doc(hidden)] #[macro_use] pub mod macros; #[doc(hidden)] pub mod gen_params_in; #[doc(hidden)] pub mod to_token_fn; #[doc(hidden)] pub mod datastructure; #[doc(hidden)] pub mod utils; #[doc(hidden)] pub mod parse_utils; #[doc(hidden)] pub use crate::to_token_fn::ToTokenFnMut; #[cfg(feature = "testing")] #[doc(hidden)] pub mod test_framework;
pub mod command; pub mod deploy; pub mod ls_stages;pub mod run_stage;
// Copyright 2017 Dasein Phaos aka. Luxko // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. //! a continous GPU memory region. pub mod description; pub use self::description::*; pub mod raw; pub use self::raw::*; pub mod traits; pub use self::traits::*; use device::Device; use error::WinError; /// a safe heap with all properties set to default #[derive(Debug, Clone)] pub struct DefaultHeap { pub(crate) raw: RawHeap } impl DefaultHeap { #[inline] pub fn new(device: &mut Device, size: u64) -> Result<Self, WinError> { let desc = HeapDesc::new( size, HeapProperties::new(HeapType::DEFAULT), Default::default() ); let raw = device.create_heap(&desc)?; Ok(DefaultHeap{raw}) } } /// an upload heap with all properties set to default #[derive(Debug, Clone)] pub struct UploadHeap { pub(crate) raw: RawHeap } impl UploadHeap { #[inline] pub fn new(device: &mut Device, size: u64) -> Result<Self, WinError> { let desc = HeapDesc::new( size, HeapProperties::new(HeapType::UPLOAD), Default::default() ); let raw = device.create_heap(&desc)?; Ok(UploadHeap{raw}) } } /// an readback heap with all properties set to default #[derive(Debug, Clone)] pub struct ReadbackHeap { pub(crate) raw: RawHeap } impl ReadbackHeap { #[inline] pub fn new(device: &mut Device, size: u64) -> Result<Self, WinError> { let desc = HeapDesc::new( size, HeapProperties::new(HeapType::READBACK), Default::default() ); let raw = device.create_heap(&desc)?; Ok(ReadbackHeap{raw}) } }
mod audio; use audio::{Audio, Msg}; extern crate gl; extern crate glfw; extern crate gouache; extern crate nfd; extern crate portaudio; extern crate sendai; use gouache::*; use sendai::*; use std::rc::Rc; #[derive(Clone)] pub struct Song { tracks: usize, length: usize, samples: Vec<Vec<f32>>, notes: Vec<Note>, } #[derive(Copy, Clone, Debug)] pub enum Note { On([i32; 4]), Off, None, } impl Default for Song { fn default() -> Song { Song { tracks: 8, length: 8, samples: vec![vec![0.0; 1]; 8], notes: vec![Note::None; 8 * 8], } } } struct Editor { rect: Rect, font: Rc<Font<'static>>, play: Button, textbox: Textbox, song: Song, cursor: (usize, usize), playing: bool, audio: Audio, } impl Default for Editor { fn default() -> Editor { let font = Rc::new(Font::from_bytes(include_bytes!("../res/SourceSansPro-Regular.ttf")).unwrap()); let mut textbox = Textbox::new(font.clone()); *textbox.text_mut() = String::from("text"); Editor { rect: Rect::new(0.0, 0.0, 0.0, 0.0), font, play: Button::new(PathBuilder::new() .move_to(4.0, 3.0) .line_to(4.0, 13.0) .line_to(12.0, 8.0) .build()), textbox, song: Song::default(), cursor: (0, 0), playing: false, audio: Audio::start().unwrap(), } } } impl Component for Editor { fn layout(&mut self, rect: Rect) -> Rect { self.rect = rect; self.play.layout(Rect::new(0.0, 0.0, 16.0, 16.0)); self.textbox.layout(Rect::new(20.0, 0.0, 128.0, 16.0)); self.rect } fn render(&self, frame: &mut Frame) { self.play.render(frame); self.textbox.render(frame); let (cell_w, cell_h) = self.font.measure("00", 14.0); let (cell_w, cell_h) = (cell_w.ceil(), cell_h.ceil()); let cell_spacing = 2.0; let toolbar_height = 24.0; let offset = Vec2::new(0.0, toolbar_height); for t in 0..self.song.tracks { for r in 0..self.song.length { let offset = offset + Vec2::new(4.0 * t as f32 * (cell_w + cell_spacing), r as f32 * (cell_h + cell_spacing)); if self.cursor == (t, r) { frame.draw_rect( offset, Vec2::new(4.0 * cell_w + 3.0 * cell_spacing, cell_h), Mat2x2::id(), Color::rgba(0.141, 0.44, 0.77, 1.0), ); } let note = self.song.notes[t * self.song.tracks + r]; for f in 0..4 { let text = match note { Note::On(value) => format!("{:02}", value[f]), Note::Off => "--".to_string(), Note::None => ". .".to_string(), }; frame.draw_text( &self.font, 14.0, &text, offset + Vec2::new(f as f32 * (cell_w + cell_spacing), 0.0), Mat2x2::id(), Color::rgba(1.0, 1.0, 1.0, 1.0), ); } } } } fn handle(&mut self, event: Event, context: &mut Context) -> bool { match event { Event::KeyDown(key) => { match key { Key::Left => { self.cursor.0 = self.cursor.0.saturating_sub(1) } Key::Right => { self.cursor.0 = (self.cursor.0 + 1).min(self.song.tracks - 1) } Key::Up => { self.cursor.1 = self.cursor.1.saturating_sub(1) } Key::Down => { self.cursor.1 = (self.cursor.1 + 1).min(self.song.length - 1) } Key::Key1 | Key::Key2 | Key::Key3 | Key::Key4 => { let note = &mut self.song.notes[self.cursor.0 * self.song.length + self.cursor.1]; let mut value = if let Note::On(value) = note { *value } else { [0; 4] }; let inc = if context.modifiers.shift { -1 } else { 1 }; match key { Key::Key1 => { value[0] += inc } Key::Key2 => { value[1] += inc } Key::Key3 => { value[2] += inc } Key::Key4 => { value[3] += inc } _ => {} }; *note = Note::On(value); self.audio.send(Msg::Song(self.song.clone())); } Key::GraveAccent => { self.song.notes[self.cursor.0 * self.song.length + self.cursor.1] = Note::Off; self.audio.send(Msg::Song(self.song.clone())); } Key::Backspace | Key::Delete => { self.song.notes[self.cursor.0 * self.song.length + self.cursor.1] = Note::None; self.audio.send(Msg::Song(self.song.clone())); } Key::I => { if let Ok(nfd::Response::Okay(path)) = nfd::open_file_dialog(Some("wav"), None) { if let Ok(mut reader) = hound::WavReader::open(path) { self.song.samples[self.cursor.0] = match reader.spec().sample_format { hound::SampleFormat::Float => { reader.samples::<f32>().map(|s| s.unwrap() as f32).collect() } hound::SampleFormat::Int => { reader.samples::<i32>().map(|s| s.unwrap() as f32 / 32768.0).collect() } }; self.audio.send(Msg::Song(self.song.clone())); } } } Key::Space => { if self.playing { self.playing = false; self.audio.send(Msg::Stop); } else { self.playing = true; self.audio.send(Msg::Play); } } _ => {} } } _ => {} } if self.play.handle(event, context) { self.playing = true; self.audio.send(Msg::Play); } self.textbox.handle(event, context); false } } fn main() { let mut editor = Editor::default(); backends::glfw::run(&mut editor); }
use futures::Future; use influxdb_iox_client::connection::Connection; use snafu::prelude::*; mod build_catalog; mod parquet_to_lp; mod print_cpu; mod schema; mod skipped_compactions; mod wal; #[derive(Debug, Snafu)] pub enum Error { #[snafu(context(false))] #[snafu(display("Error in schema subcommand: {}", source))] Schema { source: schema::Error }, #[snafu(context(false))] #[snafu(display("Error in build_catalog subcommand: {}", source))] BuildCatalog { source: build_catalog::Error }, #[snafu(context(false))] #[snafu(display("Error in parquet_to_lp subcommand: {}", source))] ParquetToLp { source: parquet_to_lp::Error }, #[snafu(context(false))] #[snafu(display("Error in skipped-compactions subcommand: {}", source))] SkippedCompactions { source: skipped_compactions::Error }, #[snafu(context(false))] #[snafu(display("Error in wal subcommand: {}", source))] Wal { source: wal::Error }, } pub type Result<T, E = Error> = std::result::Result<T, E>; /// Debugging commands #[derive(Debug, clap::Parser)] pub struct Config { #[clap(subcommand)] command: Command, } #[derive(Debug, clap::Parser)] enum Command { /// Prints what CPU features are used by the compiler by default. PrintCpu, /// Interrogate the schema of a namespace Schema(schema::Config), // NB: The example formatting below is weird so Clap make a nice help text /// Build a local catalog from the output of `remote store get-table`. /// /// For example: /// ```text /// # download contents of table_name into a directory named 'table_name' /// influxdb_iox remote store get-table <namespace> <table_name> /// /// # Create a catalog and object_store in /tmp/data_dir /// influxdb_iox debug build-catalog <table_dir> /tmp/data_dir /// /// # Start iox using this data directory (you can now query `table_name` locally): /// influxdb_iox --data-dir /tmp/data_dir /// ``` #[clap(verbatim_doc_comment)] BuildCatalog(build_catalog::Config), /// Convert IOx Parquet files back into line protocol format ParquetToLp(parquet_to_lp::Config), /// Interrogate skipped compactions SkippedCompactions(skipped_compactions::Config), /// Subcommands for debugging the WAL Wal(wal::Config), } pub async fn command<C, CFut>(connection: C, config: Config) -> Result<()> where C: Send + FnOnce() -> CFut, CFut: Send + Future<Output = Connection>, { match config.command { Command::PrintCpu => print_cpu::main(), Command::Schema(config) => { let connection = connection().await; schema::command(connection, config).await? } Command::BuildCatalog(config) => build_catalog::command(config).await?, Command::ParquetToLp(config) => parquet_to_lp::command(config).await?, Command::SkippedCompactions(config) => { let connection = connection().await; skipped_compactions::command(connection, config).await? } Command::Wal(config) => wal::command(connection, config).await?, } Ok(()) }
pub use VkImageCreateFlags::*; #[repr(u32)] #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum VkImageCreateFlags { VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x0000_0001, VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x0000_0002, VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x0000_0004, VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x0000_0008, VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x0000_0010, VK_IMAGE_CREATE_ALIAS_BIT = 0x0000_0400, VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT = 0x0000_0040, VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT = 0x0000_0020, VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT = 0x0000_0080, VK_IMAGE_CREATE_EXTENDED_USAGE_BIT = 0x0000_0100, VK_IMAGE_CREATE_PROTECTED_BIT = 0x0000_0800, VK_IMAGE_CREATE_DISJOINT_BIT = 0x0000_0200, VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV = 0x0000_2000, VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = 0x0000_1000, VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT = 0x0000_4000, } use crate::SetupVkFlags; #[repr(C)] #[derive(Clone, Copy, Eq, PartialEq, Hash)] pub struct VkImageCreateFlagBits(u32); SetupVkFlags!(VkImageCreateFlags, VkImageCreateFlagBits);
use glium::Surface; use glium::backend::glutin::glutin::event::{Event, WindowEvent}; fn main() { println!("SuperLuminal Performance Enabled: {}", superluminal_perf::enabled()); // Set name of current thread for superluminal profiler superluminal_perf::set_current_thread_name("Main Thread"); superluminal_perf::begin_event("initialization"); let event_loop = glium::glutin::event_loop::EventLoop::new(); let wb = glium::glutin::window::WindowBuilder::new() .with_title("3D Model"); let cb = glium::glutin::ContextBuilder::new() .with_double_buffer(Some(true)) .with_hardware_acceleration(Some(true)) .with_depth_buffer(24); let display = glium::Display::new(wb, cb, &event_loop) .expect("failed to create opengl display"); superluminal_perf::end_event(); superluminal_perf::begin_event("load_model_data"); let path= util::core::get_relative_path_file("./model/RubyRose/untitled.obj") .expect("failed to get relative path"); let models = util::core::load_wavefront_obj(&display, std::path::Path::new(path.as_str()), false); superluminal_perf::end_event(); superluminal_perf::begin_event("load_texture_image"); let mut diffuse_textures = Vec::new(); let mut normal_textures = Vec::new(); let path = util::core::get_relative_path("./model/RubyRose"); for index in 0..models.len(){ let texture = models[index] .texture .as_ref() .unwrap(); if !texture.diffuse_texture.is_empty() { let absolute_diffuse_path = format!("{}//{}", path, texture.diffuse_texture); let texture_path = std::path::Path::new(absolute_diffuse_path.as_str()); let image = image::open(texture_path) .unwrap() .to_rgba16(); let image_dimensions = image.dimensions(); let image = glium::texture::RawImage2d::from_raw_rgba_reversed(&image.into_raw(), image_dimensions); diffuse_textures .push(glium::texture::SrgbTexture2d::new(&display, image).unwrap()); } if !texture.normal_texture.is_empty(){ let absolute_normal_path = format!("{}//{}", path, texture.normal_texture); let texture_path = std::path::Path::new(absolute_normal_path.as_str()); let image = image::open(texture_path) .unwrap() .to_rgba16(); let image_dimensions = image.dimensions(); let image = glium::texture::RawImage2d::from_raw_rgba_reversed(&image.into_raw(), image_dimensions); normal_textures.push(glium::texture::Texture2d::new(&display, image).unwrap()); } } superluminal_perf::end_event(); superluminal_perf::begin_event("creating_vertex_shader"); let vertex_shader = util::shader::read_shader("shader/model/model.vert") .expect("failed to load vertex shader"); superluminal_perf::end_event(); superluminal_perf::begin_event("crating_fragment_shader"); let fragment_shader = util::shader::read_shader("shader/model/model.frag") .expect("failed to load fragment shader"); superluminal_perf::end_event(); superluminal_perf::begin_event("creating_program"); let program = glium::Program::from_source(&display,vertex_shader.as_str(), fragment_shader.as_str(), None) .expect("failed to create program"); superluminal_perf::end_event(); let matrix = [ [1., 0.0, 0.0, 0.0], [0.0, 1., 0.0, 0.0], [0.0, 0.0, 1., 0.0], [0.0, -1.0, -7.0, 1.0f32] ]; let light = [-0.5, -0.4, 0.5f32]; event_loop.run(move |evt, _, control_flow|{ superluminal_perf::begin_event("depth_test"); let params = glium::DrawParameters{ depth: glium::Depth{ test: glium::DepthTest::IfLess, write: true, ..Default::default() }, backface_culling : glium::BackfaceCullingMode::CullClockwise, ..Default::default() }; superluminal_perf::end_event(); superluminal_perf::begin_event("draw_call"); let mut frame = display.draw(); frame.clear_color_and_depth((0.3, 0.2, 0.1, 1.0), 1.0); let aspect_ratio = frame.get_dimensions(); let perspective = { let (width, height) = frame.get_dimensions(); let aspect_ratio = width as f32 / height as f32; let fov : f32 = std::f32::consts::PI / 3.0; //60 fov let zfar = 1024.0; let znear = 0.1; let f = 1.0 / (fov / 2.0).tan(); let perspective_matrix = nalgebra_glm::perspective(aspect_ratio, fov,znear,zfar); perspective_matrix.data.0 }; let view = { let v = nalgebra_glm::make_vec3(&[0.,0.0, 0.1f32]); let view_matrix = nalgebra_glm::translation(&v); [ view_matrix.data.0[0], view_matrix.data.0[1], view_matrix.data.0[2], view_matrix.data.0[3] ] }; for index in 0..models.len() { //some model might not have a diffuse texture, so we clamp the index to the maximum diffuse_textures length - 1 let texture_index = util::math::clamp(index as f32, 0., (diffuse_textures.len() - 1) as f32) as usize; frame.draw(&models[index].vertex, &glium::index::NoIndices(glium::index::PrimitiveType::TrianglesList), &program, &glium::uniform! { matrix : matrix, perspective: perspective, view: view, u_light: light, diffuse_tex: &diffuse_textures[texture_index], normal_tex : &normal_textures[texture_index] }, &params) .unwrap(); } frame.finish(); superluminal_perf::end_event(); let next_frame_time = std::time::Instant::now() + std::time::Duration::from_nanos(1_666_667); superluminal_perf::begin_event("window_handle"); *control_flow = glium::glutin::event_loop::ControlFlow::WaitUntil(next_frame_time); match evt{ Event::WindowEvent { event, .. } => { match event{ WindowEvent::CloseRequested => { *control_flow = glium::glutin::event_loop::ControlFlow::Exit; }, _=>{} }; }, _ => {} } superluminal_perf::end_event(); }); }
#[macro_use] extern crate log; extern crate structopt; use structopt::StructOpt; extern crate humantime; extern crate embedded_spi; use embedded_spi::hal::{HalInst, HalDelay}; extern crate radio; use radio::{State as _}; extern crate radio_sx128x; use radio_sx128x::prelude::*; extern crate pcap_file; mod options; use options::*; mod operations; use operations::*; fn main() { // Load options let opts = Options::from_args(); // Setup logging opts.log.init(); debug!("Connecting to SPI device"); let HalInst{base: _, spi, pins} = opts.spi_config.load().unwrap(); let rf_config = opts.rf_config(); debug!("Config: {:?}", rf_config); info!("Initialising Radio"); let mut radio = Sx128x::spi(spi, pins.cs, pins.busy, pins.reset, HalDelay{}, &rf_config).expect("error creating device"); let operation = opts.command.operation(); info!("Executing command"); match &opts.command { Command::FirmwareVersion => { let version = radio.firmware_version().expect("error fetching chip version"); info!("Silicon version: 0x{:X}", version); return }, _ => { do_command(&mut radio, operation.unwrap()).expect("error executing command"); } } let _ = radio.set_state(State::Sleep); }
use scanner_proc_macro::insert_scanner; #[insert_scanner] fn main() { let (n, m) = scan!((usize, usize)); let mut a = scan!(u32; n); let b = scan!(u32; m); for b in b { if let Some(index) = a.iter().position(|&a| a == b) { a.swap_remove(index); } else { println!("No"); return; } } println!("Yes"); }
#[doc = "Reader of register DC3"] pub type R = crate::R<u32, super::DC3>; #[doc = "Reader of field `PWM0`"] pub type PWM0_R = crate::R<bool, bool>; #[doc = "Reader of field `PWM1`"] pub type PWM1_R = crate::R<bool, bool>; #[doc = "Reader of field `PWM2`"] pub type PWM2_R = crate::R<bool, bool>; #[doc = "Reader of field `PWM3`"] pub type PWM3_R = crate::R<bool, bool>; #[doc = "Reader of field `PWM4`"] pub type PWM4_R = crate::R<bool, bool>; #[doc = "Reader of field `PWM5`"] pub type PWM5_R = crate::R<bool, bool>; #[doc = "Reader of field `C0MINUS`"] pub type C0MINUS_R = crate::R<bool, bool>; #[doc = "Reader of field `C0PLUS`"] pub type C0PLUS_R = crate::R<bool, bool>; #[doc = "Reader of field `C0O`"] pub type C0O_R = crate::R<bool, bool>; #[doc = "Reader of field `C1MINUS`"] pub type C1MINUS_R = crate::R<bool, bool>; #[doc = "Reader of field `C1PLUS`"] pub type C1PLUS_R = crate::R<bool, bool>; #[doc = "Reader of field `C1O`"] pub type C1O_R = crate::R<bool, bool>; #[doc = "Reader of field `C2MINUS`"] pub type C2MINUS_R = crate::R<bool, bool>; #[doc = "Reader of field `C2PLUS`"] pub type C2PLUS_R = crate::R<bool, bool>; #[doc = "Reader of field `C2O`"] pub type C2O_R = crate::R<bool, bool>; #[doc = "Reader of field `PWMFAULT`"] pub type PWMFAULT_R = crate::R<bool, bool>; #[doc = "Reader of field `ADC0AIN0`"] pub type ADC0AIN0_R = crate::R<bool, bool>; #[doc = "Reader of field `ADC0AIN1`"] pub type ADC0AIN1_R = crate::R<bool, bool>; #[doc = "Reader of field `ADC0AIN2`"] pub type ADC0AIN2_R = crate::R<bool, bool>; #[doc = "Reader of field `ADC0AIN3`"] pub type ADC0AIN3_R = crate::R<bool, bool>; #[doc = "Reader of field `ADC0AIN4`"] pub type ADC0AIN4_R = crate::R<bool, bool>; #[doc = "Reader of field `ADC0AIN5`"] pub type ADC0AIN5_R = crate::R<bool, bool>; #[doc = "Reader of field `ADC0AIN6`"] pub type ADC0AIN6_R = crate::R<bool, bool>; #[doc = "Reader of field `ADC0AIN7`"] pub type ADC0AIN7_R = crate::R<bool, bool>; #[doc = "Reader of field `CCP0`"] pub type CCP0_R = crate::R<bool, bool>; #[doc = "Reader of field `CCP1`"] pub type CCP1_R = crate::R<bool, bool>; #[doc = "Reader of field `CCP2`"] pub type CCP2_R = crate::R<bool, bool>; #[doc = "Reader of field `CCP3`"] pub type CCP3_R = crate::R<bool, bool>; #[doc = "Reader of field `CCP4`"] pub type CCP4_R = crate::R<bool, bool>; #[doc = "Reader of field `CCP5`"] pub type CCP5_R = crate::R<bool, bool>; #[doc = "Reader of field `_32KHZ`"] pub type _32KHZ_R = crate::R<bool, bool>; impl R { #[doc = "Bit 0 - PWM0 Pin Present"] #[inline(always)] pub fn pwm0(&self) -> PWM0_R { PWM0_R::new((self.bits & 0x01) != 0) } #[doc = "Bit 1 - PWM1 Pin Present"] #[inline(always)] pub fn pwm1(&self) -> PWM1_R { PWM1_R::new(((self.bits >> 1) & 0x01) != 0) } #[doc = "Bit 2 - PWM2 Pin Present"] #[inline(always)] pub fn pwm2(&self) -> PWM2_R { PWM2_R::new(((self.bits >> 2) & 0x01) != 0) } #[doc = "Bit 3 - PWM3 Pin Present"] #[inline(always)] pub fn pwm3(&self) -> PWM3_R { PWM3_R::new(((self.bits >> 3) & 0x01) != 0) } #[doc = "Bit 4 - PWM4 Pin Present"] #[inline(always)] pub fn pwm4(&self) -> PWM4_R { PWM4_R::new(((self.bits >> 4) & 0x01) != 0) } #[doc = "Bit 5 - PWM5 Pin Present"] #[inline(always)] pub fn pwm5(&self) -> PWM5_R { PWM5_R::new(((self.bits >> 5) & 0x01) != 0) } #[doc = "Bit 6 - C0- Pin Present"] #[inline(always)] pub fn c0minus(&self) -> C0MINUS_R { C0MINUS_R::new(((self.bits >> 6) & 0x01) != 0) } #[doc = "Bit 7 - C0+ Pin Present"] #[inline(always)] pub fn c0plus(&self) -> C0PLUS_R { C0PLUS_R::new(((self.bits >> 7) & 0x01) != 0) } #[doc = "Bit 8 - C0o Pin Present"] #[inline(always)] pub fn c0o(&self) -> C0O_R { C0O_R::new(((self.bits >> 8) & 0x01) != 0) } #[doc = "Bit 9 - C1- Pin Present"] #[inline(always)] pub fn c1minus(&self) -> C1MINUS_R { C1MINUS_R::new(((self.bits >> 9) & 0x01) != 0) } #[doc = "Bit 10 - C1+ Pin Present"] #[inline(always)] pub fn c1plus(&self) -> C1PLUS_R { C1PLUS_R::new(((self.bits >> 10) & 0x01) != 0) } #[doc = "Bit 11 - C1o Pin Present"] #[inline(always)] pub fn c1o(&self) -> C1O_R { C1O_R::new(((self.bits >> 11) & 0x01) != 0) } #[doc = "Bit 12 - C2- Pin Present"] #[inline(always)] pub fn c2minus(&self) -> C2MINUS_R { C2MINUS_R::new(((self.bits >> 12) & 0x01) != 0) } #[doc = "Bit 13 - C2+ Pin Present"] #[inline(always)] pub fn c2plus(&self) -> C2PLUS_R { C2PLUS_R::new(((self.bits >> 13) & 0x01) != 0) } #[doc = "Bit 14 - C2o Pin Present"] #[inline(always)] pub fn c2o(&self) -> C2O_R { C2O_R::new(((self.bits >> 14) & 0x01) != 0) } #[doc = "Bit 15 - PWM Fault Pin Present"] #[inline(always)] pub fn pwmfault(&self) -> PWMFAULT_R { PWMFAULT_R::new(((self.bits >> 15) & 0x01) != 0) } #[doc = "Bit 16 - ADC Module 0 AIN0 Pin Present"] #[inline(always)] pub fn adc0ain0(&self) -> ADC0AIN0_R { ADC0AIN0_R::new(((self.bits >> 16) & 0x01) != 0) } #[doc = "Bit 17 - ADC Module 0 AIN1 Pin Present"] #[inline(always)] pub fn adc0ain1(&self) -> ADC0AIN1_R { ADC0AIN1_R::new(((self.bits >> 17) & 0x01) != 0) } #[doc = "Bit 18 - ADC Module 0 AIN2 Pin Present"] #[inline(always)] pub fn adc0ain2(&self) -> ADC0AIN2_R { ADC0AIN2_R::new(((self.bits >> 18) & 0x01) != 0) } #[doc = "Bit 19 - ADC Module 0 AIN3 Pin Present"] #[inline(always)] pub fn adc0ain3(&self) -> ADC0AIN3_R { ADC0AIN3_R::new(((self.bits >> 19) & 0x01) != 0) } #[doc = "Bit 20 - ADC Module 0 AIN4 Pin Present"] #[inline(always)] pub fn adc0ain4(&self) -> ADC0AIN4_R { ADC0AIN4_R::new(((self.bits >> 20) & 0x01) != 0) } #[doc = "Bit 21 - ADC Module 0 AIN5 Pin Present"] #[inline(always)] pub fn adc0ain5(&self) -> ADC0AIN5_R { ADC0AIN5_R::new(((self.bits >> 21) & 0x01) != 0) } #[doc = "Bit 22 - ADC Module 0 AIN6 Pin Present"] #[inline(always)] pub fn adc0ain6(&self) -> ADC0AIN6_R { ADC0AIN6_R::new(((self.bits >> 22) & 0x01) != 0) } #[doc = "Bit 23 - ADC Module 0 AIN7 Pin Present"] #[inline(always)] pub fn adc0ain7(&self) -> ADC0AIN7_R { ADC0AIN7_R::new(((self.bits >> 23) & 0x01) != 0) } #[doc = "Bit 24 - T0CCP0 Pin Present"] #[inline(always)] pub fn ccp0(&self) -> CCP0_R { CCP0_R::new(((self.bits >> 24) & 0x01) != 0) } #[doc = "Bit 25 - T0CCP1 Pin Present"] #[inline(always)] pub fn ccp1(&self) -> CCP1_R { CCP1_R::new(((self.bits >> 25) & 0x01) != 0) } #[doc = "Bit 26 - T1CCP0 Pin Present"] #[inline(always)] pub fn ccp2(&self) -> CCP2_R { CCP2_R::new(((self.bits >> 26) & 0x01) != 0) } #[doc = "Bit 27 - T1CCP1 Pin Present"] #[inline(always)] pub fn ccp3(&self) -> CCP3_R { CCP3_R::new(((self.bits >> 27) & 0x01) != 0) } #[doc = "Bit 28 - T2CCP0 Pin Present"] #[inline(always)] pub fn ccp4(&self) -> CCP4_R { CCP4_R::new(((self.bits >> 28) & 0x01) != 0) } #[doc = "Bit 29 - T2CCP1 Pin Present"] #[inline(always)] pub fn ccp5(&self) -> CCP5_R { CCP5_R::new(((self.bits >> 29) & 0x01) != 0) } #[doc = "Bit 31 - 32KHz Input Clock Available"] #[inline(always)] pub fn _32khz(&self) -> _32KHZ_R { _32KHZ_R::new(((self.bits >> 31) & 0x01) != 0) } }
use crate::*; pub fn load_program(state: &mut State, path: &str) { let f = std::fs::read(path).expect("Couldn't read file"); let mut i = 0; while i < f.len() { state.memory[i + 0x200] = f[i]; state.memory[i + 0x201] = f[i + 1]; i += 2; } }
use std::fmt::Debug; use async_trait::async_trait; use crate::{ cache::Cacheable, errors::CheckedError, event_status::EventStatus, }; #[derive(Default)] pub struct CompletedEvents { pub identities: Vec<(Vec<u8>, EventStatus)>, } impl CompletedEvents { pub fn clear(&mut self) { self.identities.clear(); } pub fn is_empty(&self) -> bool { self.identities.is_empty() } pub fn len(&self) -> usize { self.identities.len() } pub fn add_identity(&mut self, identity: impl Cacheable, r: impl Into<EventStatus>) { self.identities.push((identity.identity(), r.into())); } } #[async_trait] pub trait EventHandler { type InputEvent; type OutputEvent: Clone + Send + Sync + 'static; type Error: Debug + CheckedError + Send + Sync + 'static; async fn handle_event( &mut self, input: Self::InputEvent, identities: &mut CompletedEvents, ) -> Result<Self::OutputEvent, Result<(Self::OutputEvent, Self::Error), Self::Error>>; }
use super::code::ExternCode; use crate::ast; use crate::code::{CodeData, DataFromIR}; use crate::context::CloneSafe; use crate::error::Result; use crate::graph::RefGraph; use crate::seed::Seed; use crate::tensor::IRData; use crate::variable::CloneValue; #[derive(Debug, PartialEq)] pub struct ExternIR { pub ty: ast::ExternNodeType, pub data: IRData, pub shapes: ExternIRShapes, } #[derive(Debug, PartialEq)] pub struct ExternIRShapes { pub input: Option<ast::Shapes>, pub output: Option<ast::Shapes>, } impl<'a> From<&'a IRData> for ExternIRShapes { fn from(data: &'a IRData) -> Self { Self { input: Some(ast::Shapes::new( data.input.keys().map(|x| (x.clone(), None)).collect(), )), output: Some(ast::Shapes::new( data.output.keys().map(|x| (x.clone(), None)).collect(), )), } } } impl ExternIR { pub fn new_first( ty: ast::ExternNodeType, name: String, graph: RefGraph, input: Option<ast::Shapes>, output: Option<ast::Shapes>, ) -> Self { Self { ty, data: IRData::with_shapes(name, graph, input.as_ref(), output.as_ref()), shapes: ExternIRShapes { input, output }, } } pub fn get_input_shapes(&self) -> Option<&ast::Shapes> { self.shapes.input.as_ref() } pub fn get_output_shapes(&self) -> Option<&ast::Shapes> { self.shapes.output.as_ref() } pub fn build(self) -> Result<ExternCode> { Ok(ExternCode { ty: self.ty, data: CodeData::from_ir(self.data), }) } } impl CloneSafe for ExternIR { fn clone_safe(&self, seed: &Seed, variables: &mut Vec<ast::RefVariable>) -> Self { // note: ordered (data -> shapes) Self { ty: self.ty, data: self.data.clone_safe(seed, variables), shapes: self.shapes.clone_safe(seed, variables), } } } impl CloneSafe for ExternIRShapes { fn clone_safe(&self, _: &Seed, variables: &mut Vec<ast::RefVariable>) -> Self { Self { input: self.input.as_ref().map(|x| x.clone_value(variables)), output: self.output.as_ref().map(|x| x.clone_value(variables)), } } }
#![allow(dead_code)] /// Buat latihan tapi masih error saat dikompile /// /// agar bisa dikompile maka pake pattern matching pada /// parameter function pd kasus ini adalah `xs` /// /// macro `#![allow(dead_code)]` mengijinkan kode yang tidak digunakan tanpa peringatan /// struct NonCopy; // kode lama: // `fn head(xs: [NonCopy; 1]) -> NonCopy {` // kode baru dan fixed fn head([xs]: [NonCopy; 1]) -> NonCopy { // `xs[0]` adalah syntactic sugar dari *container.index(index) // atau *NonCopy.index(index) // kode lama: `xs[0]` // kode baru: xs } fn main() { }
//! Interrupt description and set-up code. use core::fmt; use bits64::segmentation::SegmentSelector; use shared::descriptor::*; use shared::paging::VAddr; use shared::PrivilegeLevel; /// An interrupt gate descriptor. /// /// See Intel manual 3a for details, specifically section "6.14.1 64-Bit Mode /// IDT" and "Figure 6-7. 64-Bit IDT Gate Descriptors". #[derive(Debug, Clone, Copy)] #[repr(C, packed)] pub struct IdtEntry { /// Lower 16 bits of ISR. pub base_lo: u16, /// Segment selector. pub selector: SegmentSelector, /// This must always be zero. pub ist_index: u8, /// Flags. pub flags: Flags, /// The upper 48 bits of ISR (the last 16 bits must be zero). pub base_hi: u64, /// Must be zero. pub reserved1: u16, } pub enum Type { InterruptGate, TrapGate, } impl Type { pub fn pack(self) -> Flags { match self { Type::InterruptGate => FLAGS_TYPE_SYS_NATIVE_INTERRUPT_GATE, Type::TrapGate => FLAGS_TYPE_SYS_NATIVE_TRAP_GATE, } } } impl IdtEntry { /// A "missing" IdtEntry. /// /// If the CPU tries to invoke a missing interrupt, it will instead /// send a General Protection fault (13), with the interrupt number and /// some other data stored in the error code. pub const MISSING: IdtEntry = IdtEntry { base_lo: 0, selector: SegmentSelector::from_raw(0), ist_index: 0, flags: Flags::BLANK, base_hi: 0, reserved1: 0, }; /// Create a new IdtEntry pointing at `handler`, which must be a function /// with interrupt calling conventions. (This must be currently defined in /// assembly language.) The `gdt_code_selector` value must be the offset of /// code segment entry in the GDT. /// /// The "Present" flag set, which is the most common case. If you need /// something else, you can construct it manually. pub fn new(handler: VAddr, gdt_code_selector: SegmentSelector, dpl: PrivilegeLevel, ty: Type, ist_index: u8) -> IdtEntry { assert!(ist_index < 0b1000); IdtEntry { base_lo: ((handler.as_usize() as u64) & 0xFFFF) as u16, base_hi: handler.as_usize() as u64 >> 16, selector: gdt_code_selector, ist_index: ist_index, flags: Flags::from_priv(dpl) | ty.pack() | FLAGS_PRESENT, reserved1: 0, } } } bitflags!{ // Taken from Intel Manual Section 4.7 Page-Fault Exceptions. pub flags PageFaultError: u32 { /// 0: The fault was caused by a non-present page. /// 1: The fault was caused by a page-level protection violation const PFAULT_ERROR_P = bit!(0), /// 0: The access causing the fault was a read. /// 1: The access causing the fault was a write. const PFAULT_ERROR_WR = bit!(1), /// 0: The access causing the fault originated when the processor /// was executing in supervisor mode. /// 1: The access causing the fault originated when the processor /// was executing in user mode. const PFAULT_ERROR_US = bit!(2), /// 0: The fault was not caused by reserved bit violation. /// 1: The fault was caused by reserved bits set to 1 in a page directory. const PFAULT_ERROR_RSVD = bit!(3), /// 0: The fault was not caused by an instruction fetch. /// 1: The fault was caused by an instruction fetch. const PFAULT_ERROR_ID = bit!(4), /// 0: The fault was not by protection keys. /// 1: There was a protection key violation. const PFAULT_ERROR_PK = bit!(5), } } impl fmt::Display for PageFaultError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let p = match self.contains(PFAULT_ERROR_P) { false => "The fault was caused by a non-present page.", true => "The fault was caused by a page-level protection violation.", }; let wr = match self.contains(PFAULT_ERROR_WR) { false => "The access causing the fault was a read.", true => "The access causing the fault was a write.", }; let us = match self.contains(PFAULT_ERROR_US) { false => { "The access causing the fault originated when the processor was executing in \ supervisor mode." } true => { "The access causing the fault originated when the processor was executing in user \ mode." } }; let rsvd = match self.contains(PFAULT_ERROR_RSVD) { false => "The fault was not caused by reserved bit violation.", true => "The fault was caused by reserved bits set to 1 in a page directory.", }; let id = match self.contains(PFAULT_ERROR_ID) { false => "The fault was not caused by an instruction fetch.", true => "The fault was caused by an instruction fetch.", }; write!(f, "{}\n{}\n{}\n{}\n{}", p, wr, us, rsvd, id) } } #[test] fn bit_macro() { assert!(PFAULT_ERROR_PK.bits() == 0b100000); assert!(PFAULT_ERROR_ID.bits() == 0b10000); assert!(PFAULT_ERROR_RSVD.bits() == 0b1000); assert!(PFAULT_ERROR_US.bits() == 0b100); assert!(PFAULT_ERROR_WR.bits() == 0b10); assert!(PFAULT_ERROR_P.bits() == 0b1); }
//! Type definitions and `dodrio::Render` implementation for a collection of //! todo items. use crate::controller::Controller; use crate::todo::{Todo, TodoActions}; use crate::visibility::Visibility; use crate::{keys, utils}; use fxhash::FxHashMap; use dodrio::{bumpalo, Node, Render, RenderContext, RootRender, VdomWeak}; use serde::{Deserialize, Serialize}; use std::marker::PhantomData; use std::mem; use wasm_bindgen::{prelude::*, JsCast}; /// A collection of todos. #[derive(Default, Serialize, Deserialize)] #[serde(rename = "todos-dodrio", bound = "")] pub struct Todos<C = Controller> { todos: FxHashMap<usize, Todo<C>>, todos_next_id: usize, #[serde(skip)] draft: String, #[serde(skip)] visibility: Visibility, #[serde(skip)] _controller: PhantomData<C>, } /// Actions for `Todos` that can be triggered by UI interactions. pub trait TodosActions: 'static + TodoActions { /// Toggle the completion state of all todo items. fn toggle_all(root: &mut dyn RootRender, vdom: VdomWeak); /// Update the draft todo item's text. fn update_draft(root: &mut dyn RootRender, vdom: VdomWeak, draft: String); /// Finish the current draft todo item and add it to the collection of /// todos. fn finish_draft(root: &mut dyn RootRender, vdom: VdomWeak); /// Change the todo item visibility filtering to the given `Visibility`. fn change_visibility(root: &mut dyn RootRender, vdom: VdomWeak, vis: Visibility); /// Delete all completed todo items. fn delete_completed(root: &mut dyn RootRender, vdom: VdomWeak); } impl<C> Todos<C> { /// Construct a new todos set. /// /// If an existing set is available in local storage, then use that, /// otherwise create a new set. pub fn new() -> Self where C: Default, { Todos::default() // Self::from_local_storage().unwrap_or_default() } // /// Deserialize a set of todos from local storage. // pub fn from_local_storage() -> Option<Self> { // utils::local_storage() // .get_item("todomvc-dodrio") // .ok() // .filter(|x| !x.is_empty()) // .and_then(|json| serde_json::from_str(&json).ok()) // } // /// Serialize this set of todos to local storage. // pub fn save_to_local_storage(&self) { // let serialized = serde_json::to_string(self).unwrap_throw(); // utils::local_storage() // .set_item("todomvc-dodrio", &serialized) // .unwrap_throw(); // } /// Add a new todo item to this collection. pub fn add_todo(&mut self, title: &str) { let id = self.todos_next_id; self.todos_next_id += 1; let new = Todo::new(id, title); self.todos.insert(id, new); } /// Delete the todo with the given id. pub fn delete_todo(&mut self, id: usize) { self.todos.remove(&id); } /// Delete all completed todo items. pub fn delete_completed(&mut self) { self.todos.retain(|_, t| !t.is_complete()); } /// Get a shared slice of the underlying set of todo items. pub fn todos(&self) -> &FxHashMap<usize, Todo<C>> { &self.todos } /// Get an exclusive slice of the underlying set of todo items. pub fn todos_mut(&mut self) -> &mut FxHashMap<usize, Todo<C>> { &mut self.todos } /// Set the draft todo item text. pub fn set_draft<S: Into<String>>(&mut self, draft: S) { self.draft = draft.into(); } /// Take the current draft text and replace it with an empty string. pub fn take_draft(&mut self) -> String { mem::replace(&mut self.draft, String::new()) } /// Get the current visibility for these todos. pub fn visibility(&self) -> Visibility { self.visibility } /// Set the visibility for these todoS. pub fn set_visibility(&mut self, vis: Visibility) { self.visibility = vis; } } /// Rendering helpers. impl<C: TodosActions> Todos<C> { fn header<'a>(&self, cx: &mut RenderContext<'a>) -> Node<'a> { use dodrio::builder::*; header(&cx) .attr("class", "header") .children([ h1(&cx).children([text("todos")]).finish(), input(&cx) .on("input", |root, vdom, event| { let input = event .target() .unwrap_throw() .unchecked_into::<web_sys::HtmlInputElement>(); C::update_draft(root, vdom, input.value()); }) .on("keydown", |root, vdom, event| { let event = event.unchecked_into::<web_sys::KeyboardEvent>(); if event.key_code() == keys::ENTER { C::finish_draft(root, vdom); } }) .attr("class", "new-todo") .attr("placeholder", "What needs to be done?") .attr("autofocus", "") .attr( "value", bumpalo::format!(in cx.bump, "{}", self.draft).into_bump_str(), ) .finish(), ]) .finish() } fn todos_list<'a>(&self, cx: &mut RenderContext<'a>) -> Node<'a> { use dodrio::{builder::*, bumpalo::collections::Vec}; let mut todos = Vec::with_capacity_in(self.todos.len(), cx.bump); todos.extend( self.todos .values() .filter(|t| match self.visibility { Visibility::All => true, Visibility::Active => !t.is_complete(), Visibility::Completed => t.is_complete(), }) .map(|t| t.render(cx)), ); section(&cx) .attr("class", "main") .attr( "visibility", if self.todos.is_empty() { "hidden" } else { "visible" }, ) .children([ input(&cx) .attr("class", "toggle-all") .attr("id", "toggle-all") .attr("type", "checkbox") .attr("name", "toggle") .bool_attr("checked", self.todos.values().all(|t| t.is_complete())) .on("click", |root, vdom, _event| { C::toggle_all(root, vdom); }) .finish(), label(&cx) .attr("for", "toggle-all") .children([text("Mark all as complete")]) .finish(), ul(&cx).attr("class", "todo-list").children(todos).finish(), ]) .finish() } fn footer<'a>(&self, cx: &mut RenderContext<'a>) -> Node<'a> { use dodrio::builder::*; let completed_count = self.todos.values().filter(|t| t.is_complete()).count(); let incomplete_count = self.todos.len() - completed_count; let items_left = if incomplete_count == 1 { " item left" } else { " items left" }; let incomplete_count = bumpalo::format!(in cx.bump, "{}", incomplete_count); let clear_completed_text = bumpalo::format!( in cx.bump, "Clear completed ({})", self.todos.values().filter(|t| t.is_complete()).count() ); footer(&cx) .attr("class", "footer") .bool_attr("hidden", self.todos.is_empty()) .children([ span(&cx) .attr("class", "todo-count") .children([ strong(&cx) .children([text(incomplete_count.into_bump_str())]) .finish(), text(items_left), ]) .finish(), ul(&cx) .attr("class", "filters") .children([ self.visibility_swap(cx, "#/", Visibility::All), self.visibility_swap(cx, "#/active", Visibility::Active), self.visibility_swap(cx, "#/completed", Visibility::Completed), ]) .finish(), button(&cx) .on("click", |root, vdom, _event| { C::delete_completed(root, vdom); }) .attr("class", "clear-completed") .bool_attr("hidden", completed_count == 0) .children([text(clear_completed_text.into_bump_str())]) .finish(), ]) .finish() } fn visibility_swap<'a>( &self, cx: &mut RenderContext<'a>, url: &'static str, target_vis: Visibility, ) -> Node<'a> { use dodrio::builder::*; li(&cx) .on("click", move |root, vdom, _event| { C::change_visibility(root, vdom, target_vis); }) .children([a(&cx) .attr("href", url) .attr( "class", if self.visibility == target_vis { "selected" } else { "" }, ) .children([text(target_vis.label())]) .finish()]) .finish() } } impl<'a, C: TodosActions> Render<'a> for Todos<C> { fn render(&self, cx: &mut RenderContext<'a>) -> Node<'a> { use dodrio::builder::*; div(&cx) .children([self.header(cx), self.todos_list(cx), self.footer(cx)]) .finish() } }
use http::header::HeaderName; use structopt::StructOpt; use tonic::body::BoxBody; use tonic::client::GrpcService; use tonic::transport::Server; use tonic::transport::{Identity, ServerTlsConfig}; use tonic_interop::{server, MergeTrailers}; #[derive(StructOpt)] struct Opts { #[structopt(name = "use_tls", long)] use_tls: bool, } #[tokio::main] async fn main() -> std::result::Result<(), Box<dyn std::error::Error>> { tonic_interop::trace_init(); let matches = Opts::from_args(); let addr = "127.0.0.1:10000".parse().unwrap(); let mut builder = Server::builder().interceptor_fn(|svc, req| { let echo_header = req .headers() .get("x-grpc-test-echo-initial") .map(Clone::clone); let echo_trailer = req .headers() .get("x-grpc-test-echo-trailing-bin") .map(Clone::clone) .map(|v| (HeaderName::from_static("x-grpc-test-echo-trailing-bin"), v)); let call = svc.call(req); async move { let mut res = call.await?; if let Some(echo_header) = echo_header { res.headers_mut() .insert("x-grpc-test-echo-initial", echo_header); } Ok(res .map(|b| MergeTrailers::new(b, echo_trailer)) .map(BoxBody::new)) } }); if matches.use_tls { let cert = tokio::fs::read("interop/data/server1.pem").await?; let key = tokio::fs::read("interop/data/server1.key").await?; let identity = Identity::from_pem(cert, key); builder = builder.tls_config(ServerTlsConfig::new().identity(identity)); } let test_service = server::TestServiceServer::new(server::TestService::default()); let unimplemented_service = server::UnimplementedServiceServer::new(server::UnimplementedService::default()); builder .add_service(test_service) .add_service(unimplemented_service) .serve(addr) .await?; Ok(()) }
use crate::error::{Error, LexerError, LexerErrorKind}; use crate::iter::CharsWithPosition; use crate::position::Position; use std::char; use std::str::Chars; use TokenKind as TK; #[derive(Debug, PartialEq)] pub struct Token { pub kind: TokenKind, pub position: Position, } #[derive(Debug, PartialEq)] pub enum TokenKind { Number(f64), String(String), Identifier(String), True, False, Null, Let, If, Else, While, For, In, Loop, Break, Continue, Return, Throw, Try, Catch, LCurly, RCurly, LParen, RParen, LSquare, RSquare, Period, Semicolon, Colon, Comma, Tilde, Assign, Equal, Bang, NotEqual, LessThan, LessThanEqual, LeftShift, LeftShiftAssign, GreaterThan, GreaterThanEqual, RightShift, RightShiftAssign, Plus, PlusAssign, Minus, MinusAssign, Multiply, MultiplyAssign, Divide, DivideAssign, Modulo, ModuloAssign, Pipe, Or, OrAssign, Ampersand, And, AndAssign, Caret, Xor, XorAssign, } pub struct TokenIterator<'a> { chars: CharsWithPosition<Chars<'a>>, position: Position, } impl<'a> TokenIterator<'a> { pub fn new(script: &'a str) -> TokenIterator<'a> { let mut iter = TokenIterator { chars: CharsWithPosition::new(script.chars()), position: Position { line: 1, column: 0 }, }; // Prepare `next_pos`. iter.munch_whitespace(); iter } // Returns the position of the first character of the next token (or EOF). pub fn next_pos(&self) -> Position { self.chars.next_pos() } fn munch_whitespace(&mut self) { loop { match self.chars.peek(0) { Some(c) if c.is_whitespace() => self.chars.next(), _ => break, }; } } fn inner_next(&mut self) -> Result<Option<TK>, LexerErrorKind> { while let Some(c) = self.chars.next() { self.position = self.chars.prev_pos(); let kind = match c { '0'...'9' => self.number(c)?, 'A'...'Z' | 'a'...'z' | '_' => self.ident(c), '"' => self.string()?, '/' => if let Some(tk) = self.slash() { tk } else { continue }, '{' => TK::LCurly, '}' => TK::RCurly, '(' => TK::LParen, ')' => TK::RParen, '[' => TK::LSquare, ']' => TK::RSquare, '.' => TK::Period, ';' => TK::Semicolon, ':' => TK::Colon, ',' => TK::Comma, '~' => TK::Tilde, '=' => self.eq(TK::Assign, TK::Equal), '!' => self.eq(TK::Bang, TK::NotEqual), '+' => self.eq(TK::Plus, TK::PlusAssign), '-' => self.eq(TK::Minus, TK::MinusAssign), '*' => self.eq(TK::Multiply, TK::MultiplyAssign), '%' => self.eq(TK::Modulo, TK::ModuloAssign), '|' => self.dbl_eq('|', TK::Pipe, TK::Or, TK::OrAssign), '&' => self.dbl_eq('&', TK::Ampersand, TK::And, TK::AndAssign), '^' => self.dbl_eq('^', TK::Caret, TK::Xor, TK::XorAssign), '<' => self.angle('<'), '>' => self.angle('>'), c if c.is_whitespace() => continue, _ => return Err(LexerErrorKind::UnexpectedChar), }; // Peek ahead and consume any whitespace until the next token. This is important so that // `TokenIterator::next_pos()` indicates the position of the start of the next token and // not the next whitespace character. self.munch_whitespace(); return Ok(Some(kind)); } Ok(None) } fn number(&mut self, first_char: char) -> Result<TK, LexerErrorKind> { let mut can_support_radix = first_char == '0'; let mut can_support_decimal = true; let mut can_support_exponent = true; let mut radix: Option<u32> = None; let mut stop = false; let mut string = String::new(); string.push(first_char); while let Some(&c) = self.chars.peek(0) { match c { '0'...'9' => { string.push(c); self.chars.next(); can_support_exponent = true; }, '.' if can_support_decimal => { can_support_decimal = false; match self.chars.peek(1) { Some(&c) if c.is_ascii_digit() => { string.push('.'); self.chars.next(); }, _ => break, } }, 'e' if can_support_exponent => { string.push('e'); self.chars.next(); while let Some(&exp) = self.chars.peek(0) { match exp { '0'...'9' | '-' | '+' => { string.push(exp); self.chars.next(); }, '_' => { self.chars.next(); }, c if c.is_ascii_alphanumeric() => { return Err(LexerErrorKind::MalformedNumber); }, _ => { stop = true; break; }, } } }, '_' => { self.chars.next(); continue; }, 'x' | 'X' | 'o' | 'O' | 'b' | 'B' if can_support_radix => { self.number_radix(c, &mut radix, &mut string)?; stop = true; }, c if c.is_ascii_alphanumeric() => { return Err(LexerErrorKind::MalformedNumber); }, _ => break, } can_support_radix = false; if stop { break; } } if let Some(radix) = radix { if let Ok(val) = u64::from_str_radix(&string, radix) { return Ok(TK::Number(val as f64)); } } else if let Ok(val) = string.parse::<f64>() { return Ok(TK::Number(val)); } Err(LexerErrorKind::MalformedNumber) } fn number_radix( &mut self, indicator: char, out_radix: &mut Option<u32>, string: &mut String, ) -> Result<(), LexerErrorKind> { let radix = match indicator { 'x' | 'X' => 16, 'o' | 'O' => 8, 'b' | 'B' => 2, _ => unreachable!(), }; *out_radix = Some(radix); string.clear(); self.chars.next(); while let Some(&digit) = self.chars.peek(0) { match digit { '_' => { self.chars.next(); }, c if c.is_digit(radix) => { string.push(digit); self.chars.next(); }, c if c.is_ascii_alphanumeric() => return Err(LexerErrorKind::MalformedNumber), _ => break, } } Ok(()) } #[inline] fn string(&mut self) -> Result<TK, LexerErrorKind> { let mut result = String::new(); let mut escape = false; while let Some(c) = self.chars.next() { match c { '\\' if !escape => { escape = true; continue; }, '\\' if escape => result.push('\\'), 't' if escape => result.push('\t'), 'n' if escape => result.push('\n'), 'r' if escape => result.push('\r'), 'x' | 'u' | 'U' if escape => { let mut out_val: u32 = 0; let length = match c { 'x' => 2, 'u' => 4, 'U' => 8, _ => unreachable!(), }; for _ in 0..length { if let Some(c) = self.chars.next() { if let Some(d1) = c.to_digit(16) { out_val *= 16; out_val += d1; } else { return Err(LexerErrorKind::MalformedEscapeSequence); } } else { return Err(LexerErrorKind::MalformedEscapeSequence); } } if let Some(r) = char::from_u32(out_val) { result.push(r); } else { return Err(LexerErrorKind::MalformedEscapeSequence); } }, '\'' if escape => result.push('\''), '"' if escape => result.push('"'), '"' if !escape => break, _ if escape => return Err(LexerErrorKind::MalformedEscapeSequence), c => result.push(c), } escape = false; } Ok(TK::String(result)) } #[inline] fn ident(&mut self, first_char: char) -> TK { let mut result = String::new(); result.push(first_char); loop { match self.chars.peek(0) { Some(&c) if c.is_ascii_alphanumeric() || c == '_' => { self.chars.next(); result.push(c); }, _ => break, } } match result.as_str() { "null" => TK::Null, "true" => TK::True, "false" => TK::False, "let" => TK::Let, "if" => TK::If, "else" => TK::Else, "while" => TK::While, "for" => TK::For, "in" => TK::In, "loop" => TK::Loop, "break" => TK::Break, "continue" => TK::Continue, "return" => TK::Return, "throw" => TK::Throw, "try" => TK::Try, "catch" => TK::Catch, _ => TK::Identifier(result), } } #[inline] fn slash(&mut self) -> Option<TK> { match self.chars.peek(0) { Some('/') => { self.chars.next(); while let Some(c) = self.chars.next() { if c == '\n' { break; } } None }, Some('*') => { let mut depth = 1; self.chars.next(); while let Some(c) = self.chars.next() { match c { '/' => if let Some('*') = self.chars.next() { depth += 1; }, '*' => if let Some('/') = self.chars.next() { depth -= 1; }, _ => (), } if depth == 0 { break; } } None }, Some('=') => { self.chars.next(); Some(TK::DivideAssign) }, _ => Some(TK::Divide), } } #[inline] fn eq(&mut self, bare: TK, eq: TK) -> TK { match self.chars.peek(0) { Some('=') => { self.chars.next(); eq }, _ => bare, } } #[inline] fn dbl_eq(&mut self, c: char, bare: TK, dbl: TK, eq: TK) -> TK { match self.chars.peek(0) { Some(x) if *x == c => { self.chars.next(); dbl }, Some('=') => { self.chars.next(); eq }, _ => bare, } } #[inline] fn angle(&mut self, c: char) -> TK { let (cmp, cmp_eq, dbl, dbl_eq) = match c { '<' => (TK::LessThan, TK::LessThanEqual, TK::LeftShift, TK::LeftShiftAssign), '>' => (TK::GreaterThan, TK::GreaterThanEqual, TK::RightShift, TK::RightShiftAssign), _ => unreachable!(), }; match self.chars.peek(0) { Some(x) if *x == c => { self.chars.next(); self.eq(dbl, dbl_eq) }, Some('=') => { self.chars.next(); cmp_eq }, _ => cmp, } } } impl<'a> Iterator for TokenIterator<'a> { type Item = Result<Token, Error>; fn next(&mut self) -> Option<Self::Item> { match self.inner_next() { Ok(Some(kind)) => Some(Ok(Token { kind, position: self.position, })), Ok(None) => None, Err(kind) => Some(Err(Error::Lexer(LexerError { kind, position: self.position, }))), } } } #[cfg(test)] mod tests { macro_rules! assert_lexer_ok { ($script:expr, $($variant:ident $(($($variant_arg:expr),+ $(,)?))?),* $(,)?) => { let mut tokens = super::TokenIterator::new($script); $( match tokens.next() { Some(Ok(ref t)) if t.kind == super::TokenKind::$variant $(($($variant_arg),+))? => (), None => panic!("unexpected end of token iterator"), token => panic!("unexpected token: {:?}", token), } )* assert!(tokens.next().is_none()); } } macro_rules! assert_lexer_err { ($script:expr, $variant:ident $(($($variant_arg:expr),+ $(,)?))?) => { let mut tokens = super::TokenIterator::new($script); loop { match tokens.next() { Some(Ok(_)) => (), Some(Err(super::Error::Lexer(super::LexerError { kind: super::LexerErrorKind::$variant $(($($variant_arg),+))?, .. }))) => break, None => panic!("unexpected end of token iterator"), token => panic!("unexpected token: {:?}", token), } } } } #[test] fn number() { assert_lexer_ok!("0", Number(0.0)); assert_lexer_ok!("123456", Number(123456.0)); assert_lexer_ok!("18446744073709551615", Number(18446744073709552000.0)); assert_lexer_ok!("18446744073709551616", Number(18446744073709552000.0)); assert_lexer_ok!("123.456", Number(123.456)); assert_lexer_ok!("123.456.", Number(123.456), Period); assert_lexer_ok!("123456.", Number(123456.0), Period); assert_lexer_ok!("123456e1.a", Number(1234560.0), Period, Identifier("a".into())); assert_lexer_ok!("123456e1", Number(1234560.0)); assert_lexer_ok!("123456e123", Number(123456e123)); assert_lexer_ok!("123456e-123", Number(123456e-123)); assert_lexer_ok!("1.7976931348623157e308", Number(1.7976931348623157e308)); assert_lexer_ok!("1.7976931348623157e309", Number(1.0 / 0.0)); assert_lexer_ok!("2.2250738585072014e-308", Number(2.2250738585072014e-308)); assert_lexer_ok!("2.2250738585072014e-350", Number(2.2250738585072014e-350)); assert_lexer_err!("123456a", MalformedNumber); assert_lexer_err!("123456e", MalformedNumber); assert_lexer_ok!("0xFFFFFFFFFFFFFFFF", Number(18446744073709552000.0)); assert_lexer_ok!("0xBEEF", Number(48879.0)); assert_lexer_ok!("0xbeef", Number(48879.0)); assert_lexer_ok!("0XBEEF", Number(48879.0)); assert_lexer_ok!("0XBeEf", Number(48879.0)); assert_lexer_ok!("0o755", Number(493.0)); assert_lexer_ok!("0O755", Number(493.0)); assert_lexer_ok!("0b10101", Number(21.0)); assert_lexer_ok!("0B10101", Number(21.0)); assert_lexer_ok!("0_X_B_e__E_f___", Number(48879.0)); assert_lexer_err!("0xFFFFFFFFFFFFFFFFF", MalformedNumber); assert_lexer_err!("0o7558", MalformedNumber); assert_lexer_err!("0xbeefg1", MalformedNumber); assert_lexer_err!("0b101012", MalformedNumber); assert_lexer_err!("0x", MalformedNumber); assert_lexer_err!("0b", MalformedNumber); assert_lexer_err!("0o", MalformedNumber); assert_lexer_err!("0X", MalformedNumber); assert_lexer_err!("0B", MalformedNumber); assert_lexer_err!("0O", MalformedNumber); } #[test] fn keyword() { assert_lexer_ok!("null", Null); assert_lexer_ok!("true", True); assert_lexer_ok!("false", False); assert_lexer_ok!("let", Let); assert_lexer_ok!("if", If); assert_lexer_ok!("else", Else); assert_lexer_ok!("while", While); assert_lexer_ok!("for", For); assert_lexer_ok!("in", In); assert_lexer_ok!("loop", Loop); assert_lexer_ok!("break", Break); assert_lexer_ok!("continue", Continue); assert_lexer_ok!("return", Return); assert_lexer_ok!("throw", Throw); assert_lexer_ok!("try", Try); assert_lexer_ok!("catch", Catch); assert_lexer_ok!("true false", True, False); } #[test] fn identifier() { assert_lexer_ok!("abc", Identifier("abc".into())); assert_lexer_ok!("a__b_c", Identifier("a__b_c".into())); assert_lexer_ok!("abc123def", Identifier("abc123def".into())); } #[test] fn string() { assert_lexer_ok!("\"abc\"", String("abc".into())); assert_lexer_ok!("\"12漢34\"", String("12漢34".into())); let escapes = "\"\\\\\\t\\n\\r\\x22\\u12ab\\U0010ffff\\\"\\'\""; assert_lexer_ok!(escapes, String("\\\t\n\r\x22\u{12ab}\u{10ffff}\"'".into())); } }
#[doc = "Reader of register PLL1FRACR"] pub type R = crate::R<u32, super::PLL1FRACR>; #[doc = "Writer for register PLL1FRACR"] pub type W = crate::W<u32, super::PLL1FRACR>; #[doc = "Register PLL1FRACR `reset()`'s with value 0"] impl crate::ResetValue for super::PLL1FRACR { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0 } } #[doc = "Reader of field `FRACN1`"] pub type FRACN1_R = crate::R<u16, u16>; #[doc = "Write proxy for field `FRACN1`"] pub struct FRACN1_W<'a> { w: &'a mut W, } impl<'a> FRACN1_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u16) -> &'a mut W { self.w.bits = (self.w.bits & !(0x1fff << 3)) | (((value as u32) & 0x1fff) << 3); self.w } } impl R { #[doc = "Bits 3:15 - Fractional part of the multiplication factor for PLL1 VCO"] #[inline(always)] pub fn fracn1(&self) -> FRACN1_R { FRACN1_R::new(((self.bits >> 3) & 0x1fff) as u16) } } impl W { #[doc = "Bits 3:15 - Fractional part of the multiplication factor for PLL1 VCO"] #[inline(always)] pub fn fracn1(&mut self) -> FRACN1_W { FRACN1_W { w: self } } }
use super::super::super::exec::vm::Inst; #[derive(Debug, Clone)] pub struct AttributeInfo { pub attribute_name_index: u16, pub attribute_length: u32, pub info: Attribute, } #[derive(Debug, Clone)] pub struct CodeAttribute { pub max_stack: u16, pub max_locals: u16, pub code_length: u32, pub code: *mut Vec<u8>, pub exception_table_length: u16, pub exception_table: Vec<Exception>, pub attributes_count: u16, pub attributes: Vec<AttributeInfo>, } #[derive(Debug, Clone)] pub enum Attribute { Code(CodeAttribute), LineNumberTable { line_number_table_length: u16, line_number_table: Vec<LineNumber>, }, SourceFile { sourcefile_index: u16, }, StackMapTable { number_of_entries: u16, entries: Vec<StackMapFrame>, }, Signature { signature_index: u16, }, Exceptions { number_of_exceptions: u16, exception_index_table: Vec<u16>, }, Deprecated, RuntimeVisibleAnnotations { num_annotations: u16, annotations: Vec<Annotation>, }, InnerClasses { number_of_classes: u16, classes: Vec<InnerClassesBody>, }, ConstantValue { constantvalue_index: u16, }, } #[derive(Debug, Clone)] pub struct InnerClassesBody { pub inner_class_info_index: u16, pub outer_class_info_index: u16, pub inner_name_index: u16, pub inner_class_access_flags: u16, } #[derive(Debug, Clone)] pub struct Exception { pub start_pc: u16, pub end_pc: u16, pub handler_pc: u16, pub catch_type: u16, } #[derive(Debug, Clone)] pub struct LineNumber { pub start_pc: u16, pub line_number: u16, } #[derive(Debug, Clone)] pub struct StackMapFrame { pub frame_type: u8, pub body: StackMapFrameBody, } #[derive(Debug, Clone)] pub enum StackMapFrameBody { SameFrame, SameLocals1StackItemFrame { stack: VerificationTypeInfo, }, AppendFrame { offset_delta: u16, locals: Vec<VerificationTypeInfo>, }, ChopFrame { offset_delta: u16, }, SameFrameExtended { offset_delta: u16, }, FullFrame { offset_delta: u16, number_of_locals: u16, locals: Vec<VerificationTypeInfo>, number_of_stack_items: u16, stack: Vec<VerificationTypeInfo>, }, } #[derive(Debug, Clone)] pub enum VerificationTypeInfo { Top, Integer, Float, Long, Double, Null, UninitializedThis, Object { cpool_index: u16 }, Uninitialized, } #[derive(Clone, Debug)] pub struct Annotation { pub type_index: u16, pub num_element_value_pairs: u16, pub element_value_pairs: Vec<ElementValuePair>, } #[derive(Clone, Debug)] pub struct ElementValuePair { pub element_name_index: u16, pub value: ElementValue, } #[derive(Clone, Debug)] pub struct ElementValue { // TODO: Implement } impl CodeAttribute { pub fn read_u8_from_code(&self, start: usize) -> usize { let code = unsafe { &*self.code }; code[start] as usize } pub fn read_u16_from_code(&self, start: usize) -> usize { let code = unsafe { &*self.code }; ((code[start] as usize) << 8) + code[start + 1] as usize } pub fn dump_bytecode(&self) { let code = unsafe { &*self.code }; let mut pc = 0; while pc < code.len() { let cur_code = code[pc]; print!(" {:05}: ", pc); match cur_code { Inst::aconst_null => println!("aconst_null"), Inst::iconst_m1 => println!("iconst_m1"), Inst::iconst_0 => println!("iconst_0"), Inst::iconst_1 => println!("iconst_1"), Inst::iconst_2 => println!("iconst_2"), Inst::iconst_3 => println!("iconst_3"), Inst::iconst_4 => println!("iconst_4"), Inst::iconst_5 => println!("iconst_5"), Inst::dconst_0 => println!("dconst_0"), Inst::dconst_1 => println!("dconst_1"), Inst::bipush => println!("bipush"), Inst::sipush => println!("sipush"), Inst::ldc => println!("ldc"), Inst::ldc2_w => println!("ldc2_w"), Inst::iload => println!("iload"), Inst::dload => println!("dload"), Inst::aload_0 => println!("aload_0"), Inst::aload_1 => println!("aload_1"), Inst::aload_2 => println!("aload_2"), Inst::aload_3 => println!("aload_3"), Inst::istore => println!("istore"), Inst::istore_0 => println!("istore_0"), Inst::istore_1 => println!("istore_1"), Inst::istore_2 => println!("istore_2"), Inst::istore_3 => println!("istore_3"), Inst::aload => println!("aload"), Inst::iload_0 => println!("iload_0"), Inst::iload_1 => println!("iload_1"), Inst::iload_2 => println!("iload_2"), Inst::iload_3 => println!("iload_3"), Inst::dload_0 => println!("dload_0"), Inst::dload_1 => println!("dload_1"), Inst::dload_2 => println!("dload_2"), Inst::dload_3 => println!("dload_3"), Inst::iaload => println!("iaload"), Inst::daload => println!("daload"), Inst::aaload => println!("aaload"), Inst::dstore => println!("dstore"), Inst::astore => println!("astore"), Inst::dstore_0 => println!("dstore_0"), Inst::dstore_1 => println!("dstore_1"), Inst::dstore_2 => println!("dstore_2"), Inst::dstore_3 => println!("dstore_3"), Inst::astore_0 => println!("astore_0"), Inst::astore_1 => println!("astore_1"), Inst::astore_2 => println!("astore_2"), Inst::astore_3 => println!("astore_3"), Inst::iastore => println!("iastore"), Inst::dastore => println!("dastore"), Inst::aastore => println!("aastore"), Inst::pop => println!("pop"), Inst::pop2 => println!("pop2"), Inst::dup => println!("dup"), Inst::dup_x1 => println!("dup_x1"), Inst::dup2 => println!("dup2"), Inst::dup2_x1 => println!("dup2_x1"), Inst::iadd => println!("iadd"), Inst::dadd => println!("dadd"), Inst::isub => println!("isub"), Inst::dsub => println!("dsub"), Inst::imul => println!("imul"), Inst::dmul => println!("dmul"), Inst::idiv => println!("idiv"), Inst::ddiv => println!("ddiv"), Inst::irem => println!("irem"), Inst::dneg => println!("dneg"), Inst::ishl => println!("ishl"), Inst::ishr => println!("ishr"), Inst::iand => println!("iand"), Inst::ixor => println!("ixor"), Inst::iinc => println!("iinc"), Inst::i2d => println!("i2d"), Inst::d2i => println!("d2i"), Inst::i2s => println!("i2s"), Inst::dcmpl => println!("dcmpl"), Inst::dcmpg => println!("dcmpg"), Inst::ifeq => println!("ifeq"), Inst::ifne => println!("ifne"), Inst::iflt => println!("iflt"), Inst::ifge => println!("ifge"), Inst::ifle => println!("ifle"), Inst::if_icmpeq => println!("if_icmpeq"), Inst::if_icmpne => println!("if_icmpne"), Inst::if_icmpge => println!("if_icmpge"), Inst::if_icmpgt => println!("if_icmpgt"), Inst::if_icmplt => println!("if_icmplt"), Inst::if_acmpne => println!("if_acmpne"), Inst::goto => println!("goto"), Inst::ireturn => println!("ireturn"), Inst::dreturn => println!("dreturn"), Inst::areturn => println!("areturn"), Inst::return_ => println!("return_"), Inst::getstatic => println!("getstatic"), Inst::putstatic => println!("putstatic"), Inst::getfield => println!("getfield"), Inst::putfield => println!("putfield"), Inst::invokevirtual => println!("invokevirtual"), Inst::invokespecial => println!("invokespecial"), Inst::invokestatic => println!("invokestatic"), Inst::new => println!("new"), Inst::newarray => println!("newarray"), Inst::anewarray => println!("anewarray"), Inst::arraylength => println!("arraylength"), Inst::monitorenter => println!("monitorenter"), Inst::ifnull => println!("ifnull"), Inst::ifnonnull => println!("ifnonnull"), Inst::getfield_quick => println!("getfield_quick"), Inst::putfield_quick => println!("putfield_quick"), Inst::getfield2_quick => println!("getfield2_quick"), Inst::putfield2_quick => println!("putfield2_quick"), _ => unreachable!(), } pc += Inst::get_inst_size(cur_code); } } }
use serde_json::json; use actix_web::http::StatusCode; mod common; #[actix_rt::test] async fn get_documents_from_unexisting_index_is_error() { let mut server = common::Server::with_uid("test"); let (response, status) = server.get_all_documents().await; assert_eq!(status, StatusCode::NOT_FOUND); assert_eq!(response["errorCode"], "index_not_found"); assert_eq!(response["errorType"], "invalid_request_error"); assert_eq!(response["errorLink"], "https://docs.meilisearch.com/errors#index_not_found"); } #[actix_rt::test] async fn get_empty_documents_list() { let mut server = common::Server::with_uid("test"); server.create_index(json!({ "uid": "test" })).await; let (response, status) = server.get_all_documents().await; assert_eq!(status, StatusCode::OK); assert!(response.as_array().unwrap().is_empty()); }
// Definition for singly-linked list. #[derive(PartialEq, Eq, Clone, Debug)] pub struct ListNode { pub val: i32, pub next: Option<Box<ListNode>> } impl ListNode { #[inline] fn new(val: i32) -> Self { ListNode { next: None, val } } } struct Solution; impl Solution { pub fn add_two_numbers(l1: Option<Box<ListNode>>, l2: Option<Box<ListNode>>) -> Option<Box<ListNode>> { let (mut l1, mut l2) = (l1, l2); let mut ret = Some(Box::new(ListNode::new(0))); let mut tail = &mut ret; loop { // the singly linked list can be seen an iterator which means it can use the method "take()" let adder_one = l1.take().unwrap_or(Box::new(ListNode::new(0))); let adder_two = l2.take().unwrap_or(Box::new(ListNode::new(0))); // as_mut : convert &mut Option<T> -> Option<&mut T> tail = match tail.as_mut() { Some(smart_node) => { // adder_one, adder_two, smart_node auto unwrap let sum = adder_one.val + adder_two.val + smart_node.val; let carry = sum / 10; smart_node.val = sum % 10; if adder_one.next.is_none() && adder_two.next.is_none() && carry == 0 { break ret; } else { smart_node.next = Some(Box::new(ListNode::new(carry))) }; &mut smart_node.next } // better than using just a "{}" _ => unreachable!(), }; l1 = adder_one.next; l2 = adder_two.next; } } }
//! This is used as the `init_fn` for `Scheduler::spawn_module_function_arguments`, as the spawning //! code can only pass at most 1 argument and `erlang:apply/3` takes three arguments use anyhow::anyhow; use liblumen_alloc::erts::exception::{badarity, Exception}; use liblumen_alloc::erts::process::ffi::ErlangResult; use liblumen_alloc::erts::process::trace::Trace; use liblumen_alloc::erts::term::prelude::*; use crate::erlang; use crate::erlang::apply::arguments_term_to_vec; #[export_name = "lumen:apply_apply_3/1"] pub extern "C-unwind" fn apply_apply_3(arguments: Term) -> ErlangResult { let arc_process = crate::runtime::process::current_process(); let argument_vec = match arguments_term_to_vec(arguments) { Ok(args) => args, Err(err) => match err { Exception::Runtime(exception) => { return ErlangResult::error(arc_process.raise(exception)); } Exception::System(ref exception) => { panic!("{}", exception) } }, }; let arguments_len = argument_vec.len(); if arguments_len == 3 { let apply_3_module = argument_vec[0]; let apply_3_function = argument_vec[1]; let apply_3_arguments = argument_vec[2]; // want to call into `erlang:apply/3` `native` and not `result` so that the stack trace // shows `erlang:apply/3`. erlang::apply_3::apply_3(apply_3_module, apply_3_function, apply_3_arguments) } else { let function = arc_process.export_closure( erlang::module(), Atom::from_str("apply"), 3, erlang::apply_3::CLOSURE_NATIVE, ); let exception = badarity( &arc_process, function, arguments, Trace::capture(), Some( anyhow!( "function arguments {} is {} term(s), but should be {}", arguments, arguments_len, 3 ) .into(), ), ); ErlangResult::error(arc_process.raise(exception)) } }
use crate::prelude::*; use std::os::raw::c_void; use std::ptr; #[repr(C)] #[derive(Debug)] pub struct VkDescriptorPoolCreateInfo { pub sType: VkStructureType, pub pNext: *const c_void, pub flags: VkDescriptorPoolCreateFlagBits, pub maxSets: u32, pub poolSizeCount: u32, pub pPoolSizes: *const VkDescriptorPoolSize, } impl VkDescriptorPoolCreateInfo { pub fn new<'a, 'b: 'a, T>( flags: T, max_sets: u32, pool_sizes: &'b [VkDescriptorPoolSize], ) -> Self where T: Into<VkDescriptorPoolCreateFlagBits>, { VkDescriptorPoolCreateInfo { sType: VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, pNext: ptr::null(), flags: flags.into(), maxSets: max_sets, poolSizeCount: pool_sizes.len() as u32, pPoolSizes: pool_sizes.as_ptr(), } } }
use tokio::sync::mpsc; use std::net::SocketAddr; use std::time::Duration; use tokio::time::{Instant, timeout_at}; use super::{Event, SendLANEvent, log_err, log_warn}; use super::frame::{ForwarderFrame, Parser}; struct PeerInner { rx: mpsc::Receiver<Vec<u8>>, addr: SocketAddr, event_send: mpsc::Sender<Event>, } pub struct Peer { sender: mpsc::Sender<Vec<u8>>, } impl Peer { pub fn new(addr: SocketAddr, event_send: mpsc::Sender<Event>) -> Self { let (tx, rx) = mpsc::channel::<Vec<u8>>(10); tokio::spawn(async move { let mut exit_send = event_send.clone(); let _ = Self::do_packet(PeerInner { rx, addr, event_send, }).await.map_err(|e| log::error!("peer task down {:?}", e)); log_err(exit_send.send(Event::Close(addr)).await, "peer task send close failed"); }); Self { sender: tx, } } pub fn on_packet(&self, data: Vec<u8>) { log_warn( self.sender.clone().try_send(data), "failed to send packet" ) } async fn do_packet(inner: PeerInner) -> std::result::Result<(), Box<dyn std::error::Error>> { let PeerInner { mut rx, addr, mut event_send } = inner; loop { let deadline = Instant::now() + Duration::from_secs(30); let packet = match timeout_at(deadline, rx.recv()).await { Ok(Some(packet)) => packet, _ => { log::debug!("Timeout {}", addr); break }, }; let frame = ForwarderFrame::parse(&packet)?; match frame { ForwarderFrame::Keepalive => {}, ForwarderFrame::Ipv4(ipv4) => { event_send.try_send(Event::SendLAN(SendLANEvent{ from: addr, src_ip: ipv4.src_ip(), dst_ip: ipv4.dst_ip(), packet, }))? }, ForwarderFrame::Ipv4Frag(frag) => { event_send.try_send(Event::SendLAN(SendLANEvent{ from: addr, src_ip: frag.src_ip(), dst_ip: frag.dst_ip(), packet, }))? }, _ => (), } } Ok(()) } }
#[cfg(not(target_os = "windows"))] pub use std::os::unix::ffi::OsStrExt; #[cfg(target_os = "windows")] use std::ffi::OsStr; #[cfg(target_os = "windows")] pub trait OsStrExt { fn from_bytes(b: &[u8]) -> &Self; fn as_bytes(&self) -> &[u8]; } #[cfg(target_os = "windows")] impl OsStrExt for OsStr { fn from_bytes(b: &[u8]) -> &Self { use std::mem; unsafe { mem::transmute(b) } } fn as_bytes(&self) -> &[u8] { self.to_str().map(|s| s.as_bytes()).unwrap() } }
pub struct Solution; impl Solution { pub fn is_valid_serialization(preorder: String) -> bool { let mut depth: i32 = 1; for value in preorder.split(',') { if depth == 0 { return false; } if value == "#" { depth -= 1; } else { depth += 1; } } depth == 0 } } #[test] fn test0331() { fn case(preorder: &str, want: bool) { let got = Solution::is_valid_serialization(preorder.to_string()); assert_eq!(got, want); } case("9,3,4,#,#,1,#,#,2,#,6,#,#", true); case("1,#", false); case("9,#,#,1", false); }
use scanner_proc_macro::insert_scanner; #[insert_scanner] fn main() { let (n, k) = scan!((usize, usize)); let a = scan!(usize; n); const B: usize = 40; let mut count = vec![vec![0; n]; B]; for i in 0..n { count[0][i] = a[i]; } for b in 0..(B - 1) { for i in 0..n { count[b + 1][i] = count[b][i] + count[b][(i + count[b][i]) % n]; } } let mut ans = 0; for b in 0..B { if k >> b & 1 == 1 { ans += count[b][ans % n]; } } println!("{}", ans); }
// This file is part of linux-epoll. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/linux-epoll/master/COPYRIGHT. No part of linux-epoll, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file. // Copyright © 2019 The developers of linux-epoll. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/linux-epoll/master/COPYRIGHT. /// Next secure version 3 parameters (`NSEC3PARAM`). #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct NextSecureVersion3Parameters<'a> { /// Hash algorithm number (validated). pub hash_algorithm_number: u8, /// Iteration count. pub iterations: u16, /// Salt. pub salt: &'a [u8], } impl<'a> NextSecureVersion3Parameters<'a> { /// SHA-1 hash algorithm number. pub const Sha1HashAlgorithmNumber: u8 = 1; }
#[doc = r"Value read from the register"] pub struct R { bits: u32, } #[doc = r"Value to write to the register"] pub struct W { bits: u32, } impl super::FAULTVAL { #[doc = r"Modifies the contents of the register"] #[inline(always)] pub fn modify<F>(&self, f: F) where for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, { let bits = self.register.get(); self.register.set(f(&R { bits }, &mut W { bits }).bits); } #[doc = r"Reads the contents of the register"] #[inline(always)] pub fn read(&self) -> R { R { bits: self.register.get(), } } #[doc = r"Writes to the register"] #[inline(always)] pub fn write<F>(&self, f: F) where F: FnOnce(&mut W) -> &mut W, { self.register.set( f(&mut W { bits: Self::reset_value(), }) .bits, ); } #[doc = r"Reset value of the register"] #[inline(always)] pub const fn reset_value() -> u32 { 0 } #[doc = r"Writes the reset value to the register"] #[inline(always)] pub fn reset(&self) { self.register.set(Self::reset_value()) } } #[doc = r"Value of the field"] pub struct PWM_FAULTVAL_PWM0R { bits: bool, } impl PWM_FAULTVAL_PWM0R { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _PWM_FAULTVAL_PWM0W<'a> { w: &'a mut W, } impl<'a> _PWM_FAULTVAL_PWM0W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 0); self.w.bits |= ((value as u32) & 1) << 0; self.w } } #[doc = r"Value of the field"] pub struct PWM_FAULTVAL_PWM1R { bits: bool, } impl PWM_FAULTVAL_PWM1R { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _PWM_FAULTVAL_PWM1W<'a> { w: &'a mut W, } impl<'a> _PWM_FAULTVAL_PWM1W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 1); self.w.bits |= ((value as u32) & 1) << 1; self.w } } #[doc = r"Value of the field"] pub struct PWM_FAULTVAL_PWM2R { bits: bool, } impl PWM_FAULTVAL_PWM2R { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _PWM_FAULTVAL_PWM2W<'a> { w: &'a mut W, } impl<'a> _PWM_FAULTVAL_PWM2W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 2); self.w.bits |= ((value as u32) & 1) << 2; self.w } } #[doc = r"Value of the field"] pub struct PWM_FAULTVAL_PWM3R { bits: bool, } impl PWM_FAULTVAL_PWM3R { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _PWM_FAULTVAL_PWM3W<'a> { w: &'a mut W, } impl<'a> _PWM_FAULTVAL_PWM3W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 3); self.w.bits |= ((value as u32) & 1) << 3; self.w } } #[doc = r"Value of the field"] pub struct PWM_FAULTVAL_PWM4R { bits: bool, } impl PWM_FAULTVAL_PWM4R { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _PWM_FAULTVAL_PWM4W<'a> { w: &'a mut W, } impl<'a> _PWM_FAULTVAL_PWM4W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 4); self.w.bits |= ((value as u32) & 1) << 4; self.w } } #[doc = r"Value of the field"] pub struct PWM_FAULTVAL_PWM5R { bits: bool, } impl PWM_FAULTVAL_PWM5R { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _PWM_FAULTVAL_PWM5W<'a> { w: &'a mut W, } impl<'a> _PWM_FAULTVAL_PWM5W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 5); self.w.bits |= ((value as u32) & 1) << 5; self.w } } #[doc = r"Value of the field"] pub struct PWM_FAULTVAL_PWM6R { bits: bool, } impl PWM_FAULTVAL_PWM6R { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _PWM_FAULTVAL_PWM6W<'a> { w: &'a mut W, } impl<'a> _PWM_FAULTVAL_PWM6W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 6); self.w.bits |= ((value as u32) & 1) << 6; self.w } } #[doc = r"Value of the field"] pub struct PWM_FAULTVAL_PWM7R { bits: bool, } impl PWM_FAULTVAL_PWM7R { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _PWM_FAULTVAL_PWM7W<'a> { w: &'a mut W, } impl<'a> _PWM_FAULTVAL_PWM7W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 7); self.w.bits |= ((value as u32) & 1) << 7; self.w } } impl R { #[doc = r"Value of the register as raw bits"] #[inline(always)] pub fn bits(&self) -> u32 { self.bits } #[doc = "Bit 0 - MnPWM0 Fault Value"] #[inline(always)] pub fn pwm_faultval_pwm0(&self) -> PWM_FAULTVAL_PWM0R { let bits = ((self.bits >> 0) & 1) != 0; PWM_FAULTVAL_PWM0R { bits } } #[doc = "Bit 1 - MnPWM1 Fault Value"] #[inline(always)] pub fn pwm_faultval_pwm1(&self) -> PWM_FAULTVAL_PWM1R { let bits = ((self.bits >> 1) & 1) != 0; PWM_FAULTVAL_PWM1R { bits } } #[doc = "Bit 2 - MnPWM2 Fault Value"] #[inline(always)] pub fn pwm_faultval_pwm2(&self) -> PWM_FAULTVAL_PWM2R { let bits = ((self.bits >> 2) & 1) != 0; PWM_FAULTVAL_PWM2R { bits } } #[doc = "Bit 3 - MnPWM3 Fault Value"] #[inline(always)] pub fn pwm_faultval_pwm3(&self) -> PWM_FAULTVAL_PWM3R { let bits = ((self.bits >> 3) & 1) != 0; PWM_FAULTVAL_PWM3R { bits } } #[doc = "Bit 4 - MnPWM4 Fault Value"] #[inline(always)] pub fn pwm_faultval_pwm4(&self) -> PWM_FAULTVAL_PWM4R { let bits = ((self.bits >> 4) & 1) != 0; PWM_FAULTVAL_PWM4R { bits } } #[doc = "Bit 5 - MnPWM5 Fault Value"] #[inline(always)] pub fn pwm_faultval_pwm5(&self) -> PWM_FAULTVAL_PWM5R { let bits = ((self.bits >> 5) & 1) != 0; PWM_FAULTVAL_PWM5R { bits } } #[doc = "Bit 6 - MnPWM6 Fault Value"] #[inline(always)] pub fn pwm_faultval_pwm6(&self) -> PWM_FAULTVAL_PWM6R { let bits = ((self.bits >> 6) & 1) != 0; PWM_FAULTVAL_PWM6R { bits } } #[doc = "Bit 7 - MnPWM7 Fault Value"] #[inline(always)] pub fn pwm_faultval_pwm7(&self) -> PWM_FAULTVAL_PWM7R { let bits = ((self.bits >> 7) & 1) != 0; PWM_FAULTVAL_PWM7R { bits } } } impl W { #[doc = r"Writes raw bits to the register"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { self.bits = bits; self } #[doc = "Bit 0 - MnPWM0 Fault Value"] #[inline(always)] pub fn pwm_faultval_pwm0(&mut self) -> _PWM_FAULTVAL_PWM0W { _PWM_FAULTVAL_PWM0W { w: self } } #[doc = "Bit 1 - MnPWM1 Fault Value"] #[inline(always)] pub fn pwm_faultval_pwm1(&mut self) -> _PWM_FAULTVAL_PWM1W { _PWM_FAULTVAL_PWM1W { w: self } } #[doc = "Bit 2 - MnPWM2 Fault Value"] #[inline(always)] pub fn pwm_faultval_pwm2(&mut self) -> _PWM_FAULTVAL_PWM2W { _PWM_FAULTVAL_PWM2W { w: self } } #[doc = "Bit 3 - MnPWM3 Fault Value"] #[inline(always)] pub fn pwm_faultval_pwm3(&mut self) -> _PWM_FAULTVAL_PWM3W { _PWM_FAULTVAL_PWM3W { w: self } } #[doc = "Bit 4 - MnPWM4 Fault Value"] #[inline(always)] pub fn pwm_faultval_pwm4(&mut self) -> _PWM_FAULTVAL_PWM4W { _PWM_FAULTVAL_PWM4W { w: self } } #[doc = "Bit 5 - MnPWM5 Fault Value"] #[inline(always)] pub fn pwm_faultval_pwm5(&mut self) -> _PWM_FAULTVAL_PWM5W { _PWM_FAULTVAL_PWM5W { w: self } } #[doc = "Bit 6 - MnPWM6 Fault Value"] #[inline(always)] pub fn pwm_faultval_pwm6(&mut self) -> _PWM_FAULTVAL_PWM6W { _PWM_FAULTVAL_PWM6W { w: self } } #[doc = "Bit 7 - MnPWM7 Fault Value"] #[inline(always)] pub fn pwm_faultval_pwm7(&mut self) -> _PWM_FAULTVAL_PWM7W { _PWM_FAULTVAL_PWM7W { w: self } } }