Skip to content
theavegePublic

About

Rust bindings for the EFL

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

36 Commits

Folders and files

Repository files navigation

efl-rs

Rust bindings for the Enlightenment Foundation Libraries.

Published crates: efltk and efltk-sys.

Other bindings for EFL

Alternatives

Dependencies

See CONTRIBUTING.md for Linux, macOS, and Windows (MSYS2) setup.

CI build script: .github/workflows/make.sh, workflow.

[dependencies]
efltk = "0.0.8"

First window

Install the native EFL development dependencies for your platform (see CONTRIBUTING.md), then create a window, add a vertical box, and put a label and button inside it. The button callback updates the label:

use efltk::prelude::*;
use efltk::{Box as EflBox, Button, Label, Window};

fn main() {
    run(|| {
        let window = Window::new("first-window", "My first efltk app").with_min_size(320, 160);

        EflBox::new(&window).with_padding(12).inside(|column| {
            let message = Label::new(column).with_text("Welcome to efltk!");
            Button::new(column)
                .with_text("Click me")
                .with_callback(move |_| message.set_text("The callback updated this label."));
        });

        window
    });
}

Run the same example from the repository with:

cargo run -p efltk --example first_window

Examples

cargo run -p efltk --example first_window
cargo run -p efltk --example simple
cargo run -p efltk --example snake
cargo run -p efltk --example floppy_bird

snake and floppy_bird are LÖVE-style loops (load / update / draw / keypressed, plus click-to-flap on Floppy Bird) drawn with GLView.

Work in process

  • Widgets
    • Containers
      • Box - is horizontal/vertical container.
      • NaviFrame - is a container that shows a single child at a time.
      • Frame - allows to provide additional content that is initially hidden.
      • Panes - divides its content area into two panes with a divider in between that the user can adjust.
      • Table - grid of cells (pack col/row/span).
      • Scroller - single-child viewport with scrollbars.
    • Outputs
    • Inputs
    • Extra widgets: Calendar, Clock, ColorSelector, FileSelector, FileEntry, Bg, Panel, Notify, Photo, Datetime, Grid, Flip, Hover, Ctxpopup, Index, Dayselector, Actionslider, Bubble, Photocam, Slideshow, Gengrid, Map, Video, Web, Glview, Conformant, Layout, Multibuttonentry, Combobox

Transition Table

Rough equivalents between common widgets of GTK+ 3 and widgets of EFL.

GTK+ EFL
Gtk.Button Elm.Button
Gtk.CheckButton Elm.Check

Screenshots

enlightenment

@startuml
!theme sunlust
skinparam linetype ortho
left to right direction
package "efl" #line.dashed {
    package containers #line.dotted {
        struct Box {
            -ptr : Pointer
        }
        struct Naviframe {
            -ptr : Pointer
        }
        struct Frame {
            -ptr : Pointer
        }
        struct Panes {
            -ptr : Pointer
        }
        struct Table {
            -ptr : Pointer
        }
        struct Scroller {
            -ptr : Pointer
        }
    }
    package outputs #line.dotted {
        struct Label {
            -ptr : Pointer
        }
        struct ProgressBar {
            -ptr : Pointer
        }
        struct Separator {
            -ptr : Pointer
        }
        struct Image {
            -ptr : Pointer
        }
    }
    package inputs #line.dotted {
        struct Button {
            -ptr : Pointer
        }
        struct Check {
            -ptr : Pointer
        }
        struct Entry {
            -ptr : Pointer
        }
        struct List {
            -ptr : Pointer
        }
        struct Radio {
            -ptr : Pointer
        }
        struct Slider {
            -ptr : Pointer
        }
        struct Spinner {
            -ptr : Pointer
        }
        struct SegmentControl {
            -ptr : Pointer
        }
    }
    package prelude #line.dotted {
        interface WidgetExt {
            #ptr as_raw()
            #from_raw(ptr)
            #is_set()
            #del()
            #show()
            +set_disabled(bool)
            +Self with_tooltip()
            +Self with_cursor()
        }
        interface TextExt {
            +str text()
            +set_text(str)
        }
        interface ContainerExt {
            #add_item(WidgetExt)
        }
        interface OrientationExt {
            +Self with_horizontal()
        }
        interface InputsExt {
            +do_callback()
            +type value()
            +set_value(type)
            +Self with_callback()
        }
        interface RangerExt {
            +Self with_range(f64, f64)
            +Self with_step(f64)
            +Self with_format(str)
        }
        interface SelectorExt {
            +u32 length()
            +Self with_items([str])
        }
        interface OrientationExt extends WidgetExt
        interface ContainerExt extends WidgetExt
        interface TextExt extends WidgetExt
        interface InputsExt extends WidgetExt
        interface RangerExt extends InputsExt
        interface SelectorExt extends InputsExt
    }
    struct outputs.Label implements prelude.TextExt

    struct outputs.Separator implements prelude.OrientationExt

    struct containers.Box implements prelude.OrientationExt
    struct containers.Box implements prelude.ContainerExt

    struct containers.Frame implements prelude.TextExt
    struct containers.Frame implements prelude.OrientationExt

    struct containers.Panes implements prelude.ContainerExt
    struct containers.Panes implements prelude.OrientationExt

    struct containers.Window implements prelude.ContainerExt
    struct containers.Table implements prelude.ContainerExt
    struct containers.Scroller implements prelude.ContainerExt

    struct inputs.Button implements prelude.TextExt
    struct inputs.Check implements prelude.TextExt
    struct inputs.Radio implements prelude.TextExt
    struct inputs.Button implements prelude.InputsExt

    struct inputs.Entry implements prelude.InputsExt

    struct inputs.Slider implements prelude.RangerExt
    struct inputs.Slider implements prelude.OrientationExt

    struct inputs.Spinner implements prelude.RangerExt

    struct inputs.List implements prelude.SelectorExt
    struct inputs.SegmentControl implements prelude.SelectorExt
}
@enduml

About

Rust bindings for the EFL

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages