Scarpe

Shoes in modern Ruby and Webview

View the Project on GitHub scarpe-team/scarpe

Lacci: The Shoes4 Compatibility Layer

Overview

Lacci (Italian for “laces”) serves as the compatibility layer between Shoes4 applications and Scarpe’s display services. Think of it as the translator that allows your classic Shoes4 code to work seamlessly with modern display backends.

Core Concepts

1. Event Handling and Drawing Model

Lacci implements the Shoes4 drawing model, which includes:

2. Display Service Abstraction

Lacci abstracts away the details of different display services (like Webview or Qt) by:

3. Test Infrastructure

The test infrastructure in Lacci uses Niente (Italian for “nothing”), a null display service that:

Key Components

MarginHelper

Handles margin calculations with support for:

FontHelper

Manages font parsing and styling with support for:

DrawContext

Manages the drawing context inheritance system:

Usage Examples

# Basic Shoes4 App
Shoes.app do
  stack do
    para "Hello from Lacci!"
    button "Click me" do
      alert "Button clicked!"
    end
  end
end

Error Handling

Lacci provides rich error handling through the Shoes::Errors module:

Display Service Requirements

For a display service to be compatible with Lacci, it must:

  1. Implement the basic drawing primitives
  2. Support parent-child relationships
  3. Handle event propagation
  4. Manage drawing contexts
  5. Support style inheritance

Testing

Lacci uses a comprehensive test suite with:

Future Development

Areas for future enhancement include:

Contributing

When contributing to Lacci:

  1. Ensure tests pass with Niente
  2. Maintain backward compatibility
  3. Follow the existing error handling patterns
  4. Document new features and changes