-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab982e1
commit f789a0d
Showing
8 changed files
with
207 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]> | ||
// SPDX-FileContributor: Andrew Hayzen <[email protected]> | ||
// | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
|
||
#[cxx::bridge] | ||
pub mod ffi { | ||
unsafe extern "C++" { | ||
include!("cxx-qt-lib/qline.h"); | ||
type QLine = crate::QLine; | ||
|
||
include!("cxx-qt-lib/qvector.h"); | ||
type QVector_QLine = crate::QVector<QLine>; | ||
} | ||
|
||
unsafe extern "C++" { | ||
#[rust_name = "cxx_clear"] | ||
fn clear(self: &mut QVector_QLine); | ||
#[rust_name = "cxx_contains"] | ||
fn contains(self: &QVector_QLine, _: &QLine) -> bool; | ||
} | ||
|
||
#[namespace = "rust::cxxqtlib1"] | ||
unsafe extern "C++" { | ||
include!("cxx-qt-lib/common.h"); | ||
|
||
#[rust_name = "qvector_clone_QLine"] | ||
fn construct(_: &QVector_QLine) -> QVector_QLine; | ||
#[rust_name = "qvector_default_QLine"] | ||
fn construct() -> QVector_QLine; | ||
#[rust_name = "qvector_drop_QLine"] | ||
fn drop(_: &mut QVector_QLine); | ||
} | ||
|
||
#[namespace = "rust::cxxqtlib1::qvector"] | ||
unsafe extern "C++" { | ||
#[rust_name = "reserve_QLine"] | ||
fn qvectorReserve(_: &mut QVector_QLine, size: isize); | ||
#[rust_name = "append_QLine"] | ||
fn qvectorAppend(_: &mut QVector_QLine, _: &QLine); | ||
#[rust_name = "get_unchecked_QLine"] | ||
unsafe fn qvectorGetUnchecked(set: &QVector_QLine, pos: isize) -> &QLine; | ||
#[rust_name = "index_of_QLine"] | ||
fn qvectorIndexOf(_: &QVector_QLine, _: &QLine) -> isize; | ||
#[rust_name = "insert_QLine"] | ||
fn qvectorInsert(_: &mut QVector_QLine, _: isize, _: &QLine); | ||
#[rust_name = "remove_QLine"] | ||
fn qvectorRemove(_: &mut QVector_QLine, _: isize); | ||
#[rust_name = "len_QLine"] | ||
fn qvectorLen(_: &QVector_QLine) -> isize; | ||
} | ||
} | ||
|
||
pub(crate) fn append(v: &mut ffi::QVector_QLine, value: &ffi::QLine) { | ||
ffi::append_QLine(v, value); | ||
} | ||
|
||
pub(crate) fn clone(s: &ffi::QVector_QLine) -> ffi::QVector_QLine { | ||
ffi::qvector_clone_QLine(s) | ||
} | ||
|
||
pub(crate) fn reserve(v: &mut ffi::QVector_QLine, size: isize) { | ||
ffi::reserve_QLine(v, size); | ||
} | ||
|
||
pub(crate) fn default() -> ffi::QVector_QLine { | ||
ffi::qvector_default_QLine() | ||
} | ||
|
||
pub(crate) fn drop(s: &mut ffi::QVector_QLine) { | ||
ffi::qvector_drop_QLine(s); | ||
} | ||
|
||
pub(crate) unsafe fn get_unchecked(s: &ffi::QVector_QLine, pos: isize) -> &ffi::QLine { | ||
ffi::get_unchecked_QLine(s, pos) | ||
} | ||
|
||
pub(crate) fn index_of(v: &ffi::QVector_QLine, value: &ffi::QLine) -> isize { | ||
ffi::index_of_QLine(v, value) | ||
} | ||
|
||
pub(crate) fn insert(s: &mut ffi::QVector_QLine, pos: isize, value: &ffi::QLine) { | ||
ffi::insert_QLine(s, pos, value); | ||
} | ||
|
||
pub(crate) fn len(s: &ffi::QVector_QLine) -> isize { | ||
ffi::len_QLine(s) | ||
} | ||
|
||
pub(crate) fn remove(s: &mut ffi::QVector_QLine, pos: isize) { | ||
ffi::remove_QLine(s, pos); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]> | ||
// SPDX-FileContributor: Andrew Hayzen <[email protected]> | ||
// | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
|
||
#[cxx::bridge] | ||
pub mod ffi { | ||
unsafe extern "C++" { | ||
include!("cxx-qt-lib/qlinef.h"); | ||
type QLineF = crate::QLineF; | ||
|
||
include!("cxx-qt-lib/qvector.h"); | ||
type QVector_QLineF = crate::QVector<QLineF>; | ||
} | ||
|
||
unsafe extern "C++" { | ||
#[rust_name = "cxx_clear"] | ||
fn clear(self: &mut QVector_QLineF); | ||
#[rust_name = "cxx_contains"] | ||
fn contains(self: &QVector_QLineF, _: &QLineF) -> bool; | ||
} | ||
|
||
#[namespace = "rust::cxxqtlib1"] | ||
unsafe extern "C++" { | ||
include!("cxx-qt-lib/common.h"); | ||
|
||
#[rust_name = "qvector_clone_QLineF"] | ||
fn construct(_: &QVector_QLineF) -> QVector_QLineF; | ||
#[rust_name = "qvector_default_QLineF"] | ||
fn construct() -> QVector_QLineF; | ||
#[rust_name = "qvector_drop_QLineF"] | ||
fn drop(_: &mut QVector_QLineF); | ||
} | ||
|
||
#[namespace = "rust::cxxqtlib1::qvector"] | ||
unsafe extern "C++" { | ||
#[rust_name = "reserve_QLineF"] | ||
fn qvectorReserve(_: &mut QVector_QLineF, size: isize); | ||
#[rust_name = "append_QLineF"] | ||
fn qvectorAppend(_: &mut QVector_QLineF, _: &QLineF); | ||
#[rust_name = "get_unchecked_QLineF"] | ||
unsafe fn qvectorGetUnchecked(set: &QVector_QLineF, pos: isize) -> &QLineF; | ||
#[rust_name = "index_of_QLineF"] | ||
fn qvectorIndexOf(_: &QVector_QLineF, _: &QLineF) -> isize; | ||
#[rust_name = "insert_QLineF"] | ||
fn qvectorInsert(_: &mut QVector_QLineF, _: isize, _: &QLineF); | ||
#[rust_name = "remove_QLineF"] | ||
fn qvectorRemove(_: &mut QVector_QLineF, _: isize); | ||
#[rust_name = "len_QLineF"] | ||
fn qvectorLen(_: &QVector_QLineF) -> isize; | ||
} | ||
} | ||
|
||
pub(crate) fn append(v: &mut ffi::QVector_QLineF, value: &ffi::QLineF) { | ||
ffi::append_QLineF(v, value); | ||
} | ||
|
||
pub(crate) fn clone(s: &ffi::QVector_QLineF) -> ffi::QVector_QLineF { | ||
ffi::qvector_clone_QLineF(s) | ||
} | ||
|
||
pub(crate) fn reserve(v: &mut ffi::QVector_QLineF, size: isize) { | ||
ffi::reserve_QLineF(v, size); | ||
} | ||
|
||
pub(crate) fn default() -> ffi::QVector_QLineF { | ||
ffi::qvector_default_QLineF() | ||
} | ||
|
||
pub(crate) fn drop(s: &mut ffi::QVector_QLineF) { | ||
ffi::qvector_drop_QLineF(s); | ||
} | ||
|
||
pub(crate) unsafe fn get_unchecked(s: &ffi::QVector_QLineF, pos: isize) -> &ffi::QLineF { | ||
ffi::get_unchecked_QLineF(s, pos) | ||
} | ||
|
||
pub(crate) fn index_of(v: &ffi::QVector_QLineF, value: &ffi::QLineF) -> isize { | ||
ffi::index_of_QLineF(v, value) | ||
} | ||
|
||
pub(crate) fn insert(s: &mut ffi::QVector_QLineF, pos: isize, value: &ffi::QLineF) { | ||
ffi::insert_QLineF(s, pos, value); | ||
} | ||
|
||
pub(crate) fn len(s: &ffi::QVector_QLineF) -> isize { | ||
ffi::len_QLineF(s) | ||
} | ||
|
||
pub(crate) fn remove(s: &mut ffi::QVector_QLineF, pos: isize) { | ||
ffi::remove_QLineF(s, pos); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters