[][src]Module bar_config::event

Data models used for sending events to the config.

This module provides everything necessary for sending events from the bar frontend to the configuration. Implementing all of these events is necessary to make sure that all components will function properly.

Examples

Here's a minimal example for sending events to the config:

use bar_config::event::{Event, Point};
use bar_config::Bar;
use std::io::Cursor;

let config_file = Cursor::new(String::from(
    "height: 30\n\
     monitors:\n\
      - { name: \"DVI-1\" }"
));

let mut bar = Bar::load(config_file).unwrap();
bar.notify(Event::MouseMotion(Point { x: 0, y: 0 }));

Structs

ComponentPosition

Exact position of a component on the screen.

Point

Point on the screen.

Enums

Event

Event which can be transmitted to the components.

MouseButton

Button on the mouse.

MouseButtonState

Mouse button states.