BearLibTerminal FFI for Rust

Overview
Comments
  • Compiling on a Mac?

    Compiling on a Mac?

    Sorry, not sure how to do this. I've got the libBearLibTerminal.dylib and put it in my src. not sure what to do with it from there... cargo run says:

    λ ~/sandbox/rust/bear/ master* cargo run
       Compiling bear v0.1.0 (/Users/justgage/sandbox/rust/bear)
    error: linking with `cc` failed: exit code: 1
      |
      = note: "cc" "-m64" "-L" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/justgage/sandbox/rust/bear/target/debug/deps/bear-f9575ad4cb149f8b.2gkhn179cjec6l3b.rcgu.o" "/Users/justgage/sandbox/rust/bear/target/debug/deps/bear-f9575ad4cb149f8b.2kyead65syd0h408.rcgu.o" "/Users/justgage/sandbox/rust/bear/target/debug/deps/bear-f9575ad4cb149f8b.4ihsln5i6kcoxe74.rcgu.o" "/Users/justgage/sandbox/rust/bear/target/debug/deps/bear-f9575ad4cb149f8b.4qp6saoq8ch4khbi.rcgu.o" "/Users/justgage/sandbox/rust/bear/target/debug/deps/bear-f9575ad4cb149f8b.4tb9vh2tlhjgmdsg.rcgu.o" "-o" "/Users/justgage/sandbox/rust/bear/target/debug/deps/bear-f9575ad4cb149f8b" "/Users/justgage/sandbox/rust/bear/target/debug/deps/bear-f9575ad4cb149f8b.7ldewih2fcza26m.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/justgage/sandbox/rust/bear/target/debug/deps" "-L" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/justgage/sandbox/rust/bear/target/debug/deps/libbear_lib_terminal-52c813dd64cd8b7e.rlib" "/Users/justgage/sandbox/rust/bear/target/debug/deps/libbear_lib_terminal_sys-2507a917265e469a.rlib" "/Users/justgage/sandbox/rust/bear/target/debug/deps/liblibc-83d68bd06eb59687.rlib" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-edeacefc1391b975.rlib" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-661c88e34f871df0.rlib" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-f7c06680fdd716f3.rlib" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-f2e753da53df829c.rlib" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-961b28aeeb5bc8e1.rlib" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-b6f6b59b6a29ec3a.rlib" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-f31526d6d86acb04.rlib" "-lBearLibTerminal" "-lSystem" "-lresolv" "-lc" "-lm"
      = note: ld: library not found for -lBearLibTerminal
              clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    
    error: aborting due to previous error
    
    error: Could not compile `bear`.
    
    To learn more, run the command again with --verbose.
    

    My Cargo.toml file looks like:

    [dependencies]
    bear-lib-terminal = "2.0.0"
    

    main.rs:

    #[link(name = "libBearLibTerminal.dylib")]
    use bear_lib_terminal::terminal;
    
    pub fn main() {
        terminal::open("Test", 80, 30);
        terminal::print_xy(0, 0, "[color=red]asdf[bkcolor=blue]asdf");
        terminal::refresh();
        let _ = terminal::wait_event();
        terminal::close();
    }
    
    question 
    opened by justgage 8
  • Alt key unhandled

    Alt key unhandled

    BearLibTerminal.rs and BearLibTerminal-sys.rs do not handle BearLibTerminal's Alt key pressed event causing the EventIterator to end when the Alt key is pressed.

    https://github.com/nabijaczleweli/BearLibTerminal.rs/blob/4464bb5036485c8d5e0be2e2313843ad6e79c611/src/terminal/mod.rs#L439-L444

    TK_ALT is defined as 0x72 at:

    https://github.com/nabijaczleweli/BearLibTerminal/blob/f353dece2c1e3b6ecc31d4d1e2c2b38163cb6fec/Terminal/Include/C/BearLibTerminal.h#L143

    enhancement 
    opened by mbilker 5
  • Link to BearLibTerminal in README broken

    Link to BearLibTerminal in README broken

    The link to https://bitbucket.org/cfyzium/bearlibterminal is broken, it looks like the repository disappeared.

    I don't know if there is an up-to-date repository by the original author. There's a still somewhat maintained version on github by another author though: https://github.com/tommyettinger/BearLibTerminal

    enhancement 
    opened by vmedea 2
  • Fix in the `Bitmap` documentation

    Fix in the `Bitmap` documentation

    Fixes a small error in the documentation (probably the result of a copy and paste): the documentation of Bitmap was the same as TrueType, while it should refer to the bitmap function instead of true_type.

    enhancement 
    opened by HenryTheCat 2
  • Infinite Event iterator

    Infinite Event iterator

    Returns wait_event() on next().

    while let Some(event) = terminal::wait_event() {
        // ...
    }
    

    Should be equivalent to

    for event in terminal::events() {
        // ...
    }
    

    Increasing readability.

    enhancement 
    opened by nabijaczleweli 0
Owner
наб
наб
Unopinionated low level API bindings focused on soundness, safety, and stronger types over raw FFI.

?? firehazard ?? Create a fire hazard by locking down your (Microsoft) Windows so nobody can escape (your security sandbox.) Unopinionated low level A

null 5 Nov 17, 2022
Nostr protocol implementation, SDK and FFI

Searchnos: an experimental implementation of NIP-50 This is a relay-like bridge server that provides a Nostr full-text search capability by using Elas

SAGE 8 Jul 2, 2023
Rust-advent - Learning Rust by solving advent of code challenges (Streaming live on Twitch every Monday)

Rust advent ?? ?? Learning Rust by implementing solutions for Advent of Code problems. ?? HEY, we are live-streaming our attempts to solve the exercis

Luciano Mammino 20 Nov 11, 2022
Rust-clippy - A bunch of lints to catch common mistakes and improve your Rust code

Clippy A collection of lints to catch common mistakes and improve your Rust code. There are over 450 lints included in this crate! Lints are divided i

The Rust Programming Language 8.7k Dec 31, 2022
Rust-battery - Rust crate providing cross-platform information about the notebook batteries.

battery Rust crate providing cross-platform information about the notebook batteries. Table of contents Overview Supported platforms Install Examples

svartalf 326 Dec 21, 2022
A Rust-based shell script to create a folder structure to use for a single class every semester. Mostly an excuse to use Rust.

A Rust Course Folder Shell Script PROJECT IN PROGRESS (Spring 2022) When completed, script will create a folder structure of the following schema: [ro

Sebastián Romero Cruz 1 Apr 10, 2022
Rust Imaging Library's Python binding: A performant and high-level image processing library for Python written in Rust

ril-py Rust Imaging Library for Python: Python bindings for ril, a performant and high-level image processing library written in Rust. What's this? Th

Cryptex 13 Dec 6, 2022
FTL Rust Demangler is a command-line tool for demangling symbol names that are mangled with the Rust convention

FTL Rust Demangler is a command-line tool for demangling symbol names that are mangled with the Rust convention. It takes a mangled symbol name as input and returns the demangled name

timetravel3 7 Mar 30, 2023
rpm (Rust project manager) is a tool that helps you to manage your rust projects

rpm rpm (Rust project manager) is a open source tool for managing your rust project in an organized way Installation # make sure you have rust install

Dilshad 4 May 4, 2023
auto-rust is an experimental project that aims to automatically generate Rust code with LLM (Large Language Models) during compilation, utilizing procedural macros.

Auto Rust auto-rust is an experimental project that aims to automatically generate Rust code with LLM (Large Language Models) during compilation, util

Minsky 6 May 14, 2023
Rusty Shellcode Reflective DLL Injection (sRDI) - A small reflective loader in Rust 4KB in size for generating position-independent code (PIC) in Rust.

Shellcode Reflective DLL Injection (sRDI) Shellcode reflective DLL injection (sRDI) is a process injection technique that allows us to convert a given

null 242 Jul 5, 2023
This rust compiler backend emmits valid CLR IR, enambling you to use Rust in .NET projects

What is rustc_codegen_clr? NOTE: this project is a very early proof-of-concept This is a compiler backend for rustc which targets the .NET platform an

null 252 Sep 7, 2023
RustGPT is a ChatGPT UI built with Rust + HTMX: the power of Rust coupled with the simplicity of HTMX 💚

RustGPT ??✨ RustGPT.Blog.Post.mp4 Welcome to the RustGPT repository! Here, you'll find a web ChatGPT clone entirely crafted using Rust and HTMX, where

Bitswired 529 Dec 4, 2023
Rust API Server: A versatile template for building RESTful interfaces, designed for simplicity in setup and configuration using the Rust programming language.

RUST API SERVER Introduction Welcome to the Rust API Server! This server provides a simple REST interface for your applications. This README will guid

Harry Nguyen 3 Feb 25, 2024
A full featured, fast Command Line Argument Parser for Rust

clap Command Line Argument Parser for Rust It is a simple-to-use, efficient, and full-featured library for parsing command line arguments and subcomma

null 10.4k Jan 10, 2023
Docopt for Rust (command line argument parser).

THIS CRATE IS UNMAINTAINED This crate is unlikely to see significant future evolution. The primary reason to choose this crate for a new project is if

null 743 Jan 1, 2023
Quickly build cool CLI apps in Rust.

QuiCLI Quickly build cool CLI apps in Rust. Getting started Read the Getting Started guide! Thanks This is only possible because of all the awesome li

Pascal Hertleif 538 Dec 5, 2022
A minimal CLI framework written in Rust

seahorse A minimal CLI framework written in Rust Features Easy to use No dependencies Typed flags(Bool, String, Int, Float) Documentation Here Usage T

Keisuke Toyota 223 Dec 30, 2022
▁▂▆▇▁▄█▁ Sparklines for Rust apps

rspark ▁▂▆▇▁▄█▁ Sparklines for Rust apps. Rust port of https://github.com/holman/spark Usage Add this to your Cargo.toml: [dependencies] rspark = "0.2

Eugene R. 50 Jun 11, 2022