Files
imhex/lib/libimhex-rs/src/lib.rs
jam1garner 57e1f7ee10 Rework libimhex-rs to use autocxx (#451)
* Rework libimhex-rs to use autocxx

* Remove Bookmarks::add overload

* Remove manual usage of cxx-rs
2022-02-20 19:14:11 -05:00

43 lines
868 B
Rust

use autocxx::prelude::*;
include_cpp! {
#include "hex/api/imhex_api.hpp"
safety!(unsafe)
generate!("hex::ImHexApi::Common::closeImHex")
generate!("hex::ImHexApi::Common::restartImHex")
generate!("hex::ImHexApi::Bookmarks::add")
}
//pub use crate::ffi::*;
/// API for working with imhex bookmarks/highlights
pub mod bookmarks;
/// API for working with imhex itself
pub mod imhex;
mod imhex_api;
pub use imgui;
#[doc(inline)]
pub use imhex_api::Color;
/// A macro for declaring the init function for your plugin
///
/// ## Example
///
/// ```
/// #[hex::plugin_setup(
/// /* Display name*/ "Example Rust",
/// /* Author */ "WerWolv",
/// /* Description */ "Example Rust plugin used as template for plugin devs"
/// )]
/// fn init() {
/// // plugin initialization logic here
/// }
/// ```
pub use imhex_macros::plugin_setup;