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 color::Color;
pub use cursor::current_cursor_icon;
pub use cursor::reset_cursor_icon;
pub use cursor::set_cursor_icon;
pub use cursor::CursorIcon;
pub use device_scale::device_scale;
pub use device_scale::set_device_scale;
pub use draw_ctx::DrawCtx;
pub use draw_ctx::FillRule;
pub use draw_ctx::GlPaint;
pub use event::Event;
pub use event::EventResult;
pub use event::Key;
pub use event::Modifiers;
pub use event::MouseButton;
pub use font_settings::current_typography_epoch;
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::resolve_fit_or_stretch;
pub use layout_props::HAnchor;
pub use layout_props::Insets;
pub use layout_props::VAnchor;
pub use layout_props::WidgetBase;
pub use platform::current_platform;
pub use platform::platform_from_name;
pub use platform::set_platform;
pub use platform::Platform;
pub use screenshot::ScreenshotHandle;
pub use svg::compare_svg_rgba;
pub use svg::parse_svg;
pub use svg::render_svg;
pub use svg::render_svg_at_size;
pub use svg::render_svg_at_size_with_options;
pub use svg::render_svg_at_size_with_resources;
pub use svg::render_svg_to_framebuffer;
pub use svg::render_svg_to_framebuffer_at_size;
pub use svg::render_svg_to_framebuffer_at_size_with_options;
pub use svg::render_svg_to_framebuffer_at_size_with_resources;
pub use svg::render_svg_to_framebuffer_with_options;
pub use svg::render_svg_to_lcd_buffer;
pub use svg::render_svg_to_lcd_buffer_at_size;
pub use svg::render_svg_to_lcd_buffer_at_size_with_options;
pub use svg::render_svg_to_lcd_buffer_at_size_with_resources;
pub use svg::render_svg_to_lcd_buffer_with_options;
pub use svg::render_svg_tree;
pub use svg::render_svg_tree_at_size;
pub use svg::render_svg_tree_to_framebuffer;
pub use svg::render_svg_tree_to_framebuffer_at_size;
pub use svg::render_svg_tree_to_lcd_buffer;
pub use svg::render_svg_tree_to_lcd_buffer_at_size;
pub use svg::render_svg_with_options;
pub use svg::set_default_svg_parse_options;
pub use svg::svg_fontdb_from_font_data;
pub use svg::SvgCompareResult;
pub use svg::SvgCompareThresholds;
pub use svg::SvgParseOptions;
pub use svg::SvgRenderError;
pub use svg::DEFAULT_ALPHA_TOLERANCE;
pub use svg::DEFAULT_MISMATCH_RATIO;
pub use svg::DEFAULT_OPAQUE_RGB_TOLERANCE;
pub use svg::DEFAULT_TRANSLUCENT_RGB_TOLERANCE;
pub use svg::DEFAULT_VISUAL_RGB_TOLERANCE;
pub use text::measure_text_metrics;
pub use text::Font;
pub use text::TextMetrics;
pub use theme::current_visuals;
pub use theme::current_visuals_epoch;
pub use theme::set_visuals;
pub use theme::AccentColor;
pub use theme::ThemePreference;
pub use theme::Visuals;
pub use timestep::FixedTimestep;
pub use timestep::StepBatch;
pub use timestep::FIXED_DT;
pub use timestep::MAX_STEPS_PER_DRAW;
pub use timestep::SIMULATION_HZ;
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::apply_widget_base_edit;
pub use widget::collect_inspector_nodes;
pub use widget::current_mouse_world;
pub use widget::current_viewport;
pub use widget::find_widget_by_id;
pub use widget::find_widget_by_id_mut;
pub use widget::find_widget_by_type;
pub use widget::App;
pub use widget::BackbufferKind;
pub use widget::BackbufferSpec;
pub use widget::BackbufferState;
pub use widget::InspectorNode;
pub use widget::InspectorOverlay;
pub use widget::Widget;
pub use widget::WidgetBaseEdit;
pub use widget::WidgetBaseField;
pub use widget::apply_inspector_edit;
pub use widget::reflect_fields;
pub use widget::InspectorEdit;
pub use widgets::current_scroll_style;
pub use widgets::current_scroll_visibility;
pub use widgets::set_scroll_style;
pub use widgets::set_scroll_visibility;
pub use widgets::Button;
pub use widgets::Checkbox;
pub use widgets::CollapsingHeader;
pub use widgets::ColorPicker;
pub use widgets::ComboBox;
pub use widgets::Conditional;
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::MenuBar;
pub use widgets::MenuEntry;
pub use widgets::MenuItem;
pub use widgets::MenuResponse;
pub use widgets::MenuSelection;
pub use widgets::MenuShortcut;
pub use widgets::NodeIcon;
pub use widgets::Padding;
pub use widgets::PopupMenu;
pub use widgets::ProgressBar;
pub use widgets::RadioGroup;
pub use widgets::Resize;
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::ShortcutKey;
pub use widgets::SizedBox;
pub use widgets::Slider;
pub use widgets::CellInfo;
pub use widgets::HeaderInfo;
pub use widgets::Spacer;
pub use widgets::Splitter;
pub use widgets::Stack;
pub use widgets::TabView;
pub use widgets::Table;
pub use widgets::TableBuilder;
pub use widgets::TableColumn;
pub use widgets::TableRows;
pub use widgets::TextArea;
pub use widgets::TextField;
pub use widgets::ToggleSwitch;
pub use widgets::Tooltip;
pub use widgets::TopMenu;
pub use widgets::TreeView;
pub use widgets::Window;

Modules§

animation
Thread-local draw-request and invalidation signals.
app_state
OS-window state persistence helpers.
clipboard
Clipboard helpers shared by text widgets and rich Markdown copy.
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.
platform
Runtime platform conventions shared by widgets.
screenshot
Screenshot capture handle for agg-gui apps.
svg
SVG rendering support for agg-gui.
text
Text rendering — font loading, shaping, and glyph rasterization.
theme
Theme system — dark / light mode colour palettes.
timestep
Fixed-timestep scheduler for deterministic time-stepped simulation.
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.