Skip to main content

Crate agg_gui

Crate agg_gui 

Source
Expand description

§agg-gui

A Rust GUI framework built on AGG (Anti-Grain Geometry).

§Architecture

Application / Widgets
  │
GfxCtx (Cairo-style stateful 2D drawing API)
  │
AGG (rasterization) + Clipper2 (boolean geometry)
  │
Framebuffer (RGBA8, bottom-up Y-up row order)
  │
Platform (WGL native / WebGL WASM)

§Coordinate system

The entire framework uses first-quadrant (Y-up) coordinates throughout. Origin is the bottom-left corner of the window. Positive Y goes upward. This is a non-negotiable architectural invariant — see the dev plan for the rationale.

Re-exports§

pub use app_state::OsWindowHandle;
pub use app_state::OsWindowState;
pub use screenshot::ScreenshotHandle;
pub use color::Color;
pub use cursor::CursorIcon;
pub use cursor::current_cursor_icon;
pub use cursor::set_cursor_icon;
pub use cursor::reset_cursor_icon;
pub use device_scale::device_scale;
pub use device_scale::set_device_scale;
pub use draw_ctx::DrawCtx;
pub use draw_ctx::GlPaint;
pub use theme::ThemePreference;
pub use theme::Visuals;
pub use theme::current_visuals;
pub use theme::current_visuals_epoch;
pub use theme::set_visuals;
pub use font_settings::current_typography_epoch;
pub use event::Event;
pub use event::EventResult;
pub use event::Key;
pub use event::Modifiers;
pub use event::MouseButton;
pub use framebuffer::Framebuffer;
pub use geometry::Point;
pub use geometry::Rect;
pub use geometry::Size;
pub use gfx_ctx::GfxCtx;
pub use layout_props::HAnchor;
pub use layout_props::Insets;
pub use layout_props::VAnchor;
pub use layout_props::WidgetBase;
pub use layout_props::resolve_fit_or_stretch;
pub use text::Font;
pub use text::TextMetrics;
pub use text::measure_text_metrics;
pub use touch_state::current_multi_touch;
pub use touch_state::MultiTouchInfo;
pub use touch_state::TouchDeviceId;
pub use touch_state::TouchId;
pub use touch_state::TouchPhase;
pub use undo::DoUndoActions;
pub use undo::UndoBuffer;
pub use undo::UndoRedoCommand;
pub use widget::App;
pub use widget::InspectorNode;
pub use widget::Widget;
pub use widget::collect_inspector_nodes;
pub use widgets::Button;
pub use widgets::Checkbox;
pub use widgets::ColorPicker;
pub use widgets::CollapsingHeader;
pub use widgets::ComboBox;
pub use widgets::Container;
pub use widgets::DragValue;
pub use widgets::FlexColumn;
pub use widgets::FlexRow;
pub use widgets::ImageView;
pub use widgets::InspectorPanel;
pub use widgets::InspectorSavedState;
pub use widgets::Label;
pub use widgets::LabelAlign;
pub use widgets::MarkdownView;
pub use widgets::NodeIcon;
pub use widgets::Padding;
pub use widgets::ProgressBar;
pub use widgets::RadioGroup;
pub use widgets::ScrollBarColor;
pub use widgets::ScrollBarKind;
pub use widgets::ScrollBarStyle;
pub use widgets::ScrollBarVisibility;
pub use widgets::ScrollView;
pub use widgets::Separator;
pub use widgets::SizedBox;
pub use widgets::Slider;
pub use widgets::Spacer;
pub use widgets::Splitter;
pub use widgets::Stack;
pub use widgets::TabView;
pub use widgets::TextField;
pub use widgets::ToggleSwitch;
pub use widgets::Tooltip;
pub use widgets::TreeView;
pub use widgets::Window;
pub use widgets::current_scroll_style;
pub use widgets::current_scroll_visibility;
pub use widgets::set_scroll_style;
pub use widgets::set_scroll_visibility;

Modules§

animation
Thread-local repaint-request signals.
app_state
OS-window state persistence helpers.
color
Color type for agg-gui.
cursor
Cursor icon type and global cursor state.
device_scale
Global device-pixel-ratio (DPI) scale factor.
draw_ctx
DrawCtx — the unified drawing interface shared by the software (GfxCtx) and hardware (GlGfxCtx) rendering paths.
event
Event types for the widget system.
font_settings
System-wide font / text rendering settings.
framebuffer
RGBA framebuffer — the rendering target for the entire widget tree.
geometry
Basic 2D geometry types.
gfx_ctx
Graphics context — the primary drawing API for widget painting.
gl_renderer
GL renderer infrastructure — tess2 bridge + GL command buffer.
layout_props
Layout property types: Insets, HAnchor, VAnchor, WidgetBase.
lcd_coverage
LCD subpixel text as a per-channel coverage mask that composites onto arbitrary backgrounds — no bg pre-fill, no destination-color knowledge required at rasterization time.
lcd_gfx_ctx
LcdGfxCtx — a DrawCtx implementation whose render target is an LcdBuffer (3 bytes/pixel coverage store) instead of a regular RGBA [Framebuffer]. All paint primitives flow through the LCD pipeline (3× horizontal supersample → 5-tap filter → per-channel src-over) so the buffer accumulates the same per-channel coverage representation regardless of whether each call originated from a text raster, a path fill, or a future image blit.
persistence
Small persistence helpers shared across platform harnesses.
pixel_bounds
Pixel-alignment policy for widget bounds and draw-time translation.
screenshot
Screenshot capture handle for agg-gui apps.
text
Text rendering — font loading, shaping, and glyph rasterization.
theme
Theme system — dark / light mode colour palettes.
touch_state
Multi-touch gesture recogniser.
undo
Shared undo / redo infrastructure.
widget
Widget trait, tree traversal, and the top-level App struct.
widgets

Structs§

TransAffine
2D affine transformation matrix.

Enums§

CompOp
SVG compositing operation.
LineCap
Line cap style for path endpoints.
LineJoin
Line join style at path corners.