# flafydev/fantasy_rice architecture

> Architecture diagram of the GitHub repository flafydev/fantasy_rice, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/flafydev/fantasy_rice
- Repository: https://github.com/flafydev/fantasy_rice

## Overview

The repository contains a Hyprland window-border plugin and two Linux Flutter runner variants of a screen-capture/display application. In the plugin, Hyprland loads the plugin, which registers configuration and attaches a decoration to windows; the decoration queues a render-pass element. The runners start Flutter and reference a get-buffer-test component, whose indexed helper code covers Wayland capture and Flutter texture display. The README is absent, and the capture test entry header is not in the tree, so some runtime links remain unverified.

Main entry points: [`fantasy_rice/linux/runner/my_application.cc`](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice/linux/runner/my_application.cc) (Runner Application), [`fantasy_rice_bottom/linux/runner/my_application.cc`](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice_bottom/linux/runner/my_application.cc) (Runner Application), [`fantasy_rice/linux/runner/get-buffer-test/grim.hpp`](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice/linux/runner/get-buffer-test/grim.hpp) (Wayland Capture), [`fantasy_rice_bottom/linux/runner/get-buffer-test/grim.hpp`](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice_bottom/linux/runner/get-buffer-test/grim.hpp) (Wayland Capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_borders["Hyprland Borders"]
  node_plugin["Plugin Entry<br/>[main.cpp]"]
  node_decoration["Window Decoration<br/>[borderDeco.cpp]"]
  node_pass["Render Pass Element"]
end

subgraph group_rice["Fantasy Rice"]
  node_rice_runner["Flutter Runner<br/>[main.cc]"]
  node_rice_app["Runner Application<br/>[my_application.cc]"]
  node_rice_capture["Capture Component"]
  node_rice_grim["Wayland Capture<br/>[grim.hpp]"]
  node_rice_texture["Display Texture<br/>[texture.cpp]"]
  node_rice_buffer["Capture Buffer<br/>[buffer.cpp]"]
  node_rice_protocols["Wayland Protocols"]
  node_rice_flutter["Flutter Plugins"]
end

subgraph group_ricebottom["Fantasy Rice Bottom"]
  node_bottom_runner["Flutter Runner<br/>[main.cc]"]
  node_bottom_app["Runner Application<br/>[my_application.cc]"]
  node_bottom_capture["Capture Component"]
  node_bottom_grim["Wayland Capture<br/>[grim.hpp]"]
  node_bottom_texture["Display Texture<br/>[texture.cpp]"]
  node_bottom_buffer["Capture Buffer<br/>[buffer.cpp]"]
  node_bottom_protocols["Wayland Protocols"]
  node_bottom_flutter["Flutter Plugins"]
end

node_hyprland(("Hyprland"))
node_rice_user(("App User"))
node_wayland(("Wayland Compositor"))

node_hyprland -->|"loads plugin"| node_plugin
node_plugin -->|"attaches decoration"| node_decoration
node_decoration -->|"queues render"| node_pass
node_rice_user -.->|"starts app"| node_rice_runner
node_rice_runner -->|"creates application"| node_rice_app
node_rice_app -->|"references capture"| node_rice_capture
node_rice_grim -.->|"uses protocol bindings"| node_rice_protocols
node_rice_grim -.->|"uses texture interface"| node_rice_texture
node_rice_texture -->|"uses buffer type"| node_rice_buffer
node_wayland -.->|"provides capture"| node_rice_grim
node_rice_app -.->|"registers plugins"| node_rice_flutter
node_rice_user -.->|"starts app"| node_bottom_runner
node_bottom_runner -->|"creates application"| node_bottom_app
node_bottom_app -->|"references capture"| node_bottom_capture
node_bottom_grim -.->|"uses protocol bindings"| node_bottom_protocols
node_bottom_grim -.->|"uses texture interface"| node_bottom_texture
node_bottom_texture -->|"uses buffer type"| node_bottom_buffer
node_wayland -.->|"provides capture"| node_bottom_grim
node_bottom_app -.->|"registers plugins"| node_bottom_flutter

click node_plugin "https://github.com/flafydev/fantasy_rice/blob/main/fantasy_borders/src/main.cpp"
click node_decoration "https://github.com/flafydev/fantasy_rice/blob/main/fantasy_borders/src/borderDeco.cpp"
click node_pass "https://github.com/flafydev/fantasy_rice/blob/main/fantasy_borders/src/BorderppPassElement.cpp"
click node_rice_runner "https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice/linux/runner/main.cc"
click node_rice_app "https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice/linux/runner/my_application.cc"
click node_rice_capture "https://github.com/flafydev/fantasy_rice/tree/main/fantasy_rice/linux/runner/get-buffer-test"
click node_rice_grim "https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice/linux/runner/get-buffer-test/grim.hpp"
click node_rice_texture "https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice/linux/runner/get-buffer-test/display/texture.cpp"
click node_rice_buffer "https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice/linux/runner/get-buffer-test/buffer.cpp"
click node_rice_protocols "https://github.com/flafydev/fantasy_rice/tree/main/fantasy_rice/linux/runner/get-buffer-test/protocols"
click node_rice_flutter "https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice/linux/flutter/generated_plugin_registrant.cc"
click node_bottom_runner "https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice_bottom/linux/runner/main.cc"
click node_bottom_app "https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice_bottom/linux/runner/my_application.cc"
click node_bottom_capture "https://github.com/flafydev/fantasy_rice/tree/main/fantasy_rice_bottom/linux/runner/get-buffer-test"
click node_bottom_grim "https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice_bottom/linux/runner/get-buffer-test/grim.hpp"
click node_bottom_texture "https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice_bottom/linux/runner/get-buffer-test/display/texture.cpp"
click node_bottom_buffer "https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice_bottom/linux/runner/get-buffer-test/buffer.cpp"
click node_bottom_protocols "https://github.com/flafydev/fantasy_rice/tree/main/fantasy_rice_bottom/linux/runner/get-buffer-test/protocols"
click node_bottom_flutter "https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice_bottom/linux/flutter/generated_plugin_registrant.cc"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_plugin,node_decoration,node_pass,node_rice_user toneBlue
class node_rice_runner,node_rice_app,node_rice_capture,node_rice_grim,node_rice_texture,node_rice_buffer,node_rice_protocols,node_rice_flutter toneAmber
class node_bottom_runner,node_bottom_app,node_bottom_capture,node_bottom_grim,node_bottom_texture,node_bottom_buffer,node_bottom_protocols,node_bottom_flutter toneMint
class node_hyprland,node_wayland toneIndigo
```

## Components

### Hyprland Borders

- [Plugin Entry](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_borders/src/main.cpp): `fantasy_borders/src/main.cpp`
- [Window Decoration](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_borders/src/borderDeco.cpp): `fantasy_borders/src/borderDeco.cpp`
- [Render Pass Element](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_borders/src/BorderppPassElement.cpp): `fantasy_borders/src/BorderppPassElement.cpp`

### Fantasy Rice

- [Flutter Runner](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice/linux/runner/main.cc): `fantasy_rice/linux/runner/main.cc`
- [Runner Application](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice/linux/runner/my_application.cc): `fantasy_rice/linux/runner/my_application.cc`
- [Capture Component](https://github.com/flafydev/fantasy_rice/tree/main/fantasy_rice/linux/runner/get-buffer-test): `fantasy_rice/linux/runner/get-buffer-test`
- [Wayland Capture](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice/linux/runner/get-buffer-test/grim.hpp): `fantasy_rice/linux/runner/get-buffer-test/grim.hpp`
- [Display Texture](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice/linux/runner/get-buffer-test/display/texture.cpp): `fantasy_rice/linux/runner/get-buffer-test/display/texture.cpp`
- [Capture Buffer](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice/linux/runner/get-buffer-test/buffer.cpp): `fantasy_rice/linux/runner/get-buffer-test/buffer.cpp`
- [Wayland Protocols](https://github.com/flafydev/fantasy_rice/tree/main/fantasy_rice/linux/runner/get-buffer-test/protocols): `fantasy_rice/linux/runner/get-buffer-test/protocols`
- [Flutter Plugins](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice/linux/flutter/generated_plugin_registrant.cc): `fantasy_rice/linux/flutter/generated_plugin_registrant.cc`

### Fantasy Rice Bottom

- [Flutter Runner](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice_bottom/linux/runner/main.cc): `fantasy_rice_bottom/linux/runner/main.cc`
- [Runner Application](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice_bottom/linux/runner/my_application.cc): `fantasy_rice_bottom/linux/runner/my_application.cc`
- [Capture Component](https://github.com/flafydev/fantasy_rice/tree/main/fantasy_rice_bottom/linux/runner/get-buffer-test): `fantasy_rice_bottom/linux/runner/get-buffer-test`
- [Wayland Capture](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice_bottom/linux/runner/get-buffer-test/grim.hpp): `fantasy_rice_bottom/linux/runner/get-buffer-test/grim.hpp`
- [Display Texture](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice_bottom/linux/runner/get-buffer-test/display/texture.cpp): `fantasy_rice_bottom/linux/runner/get-buffer-test/display/texture.cpp`
- [Capture Buffer](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice_bottom/linux/runner/get-buffer-test/buffer.cpp): `fantasy_rice_bottom/linux/runner/get-buffer-test/buffer.cpp`
- [Wayland Protocols](https://github.com/flafydev/fantasy_rice/tree/main/fantasy_rice_bottom/linux/runner/get-buffer-test/protocols): `fantasy_rice_bottom/linux/runner/get-buffer-test/protocols`
- [Flutter Plugins](https://github.com/flafydev/fantasy_rice/blob/main/fantasy_rice_bottom/linux/flutter/generated_plugin_registrant.cc): `fantasy_rice_bottom/linux/flutter/generated_plugin_registrant.cc`

### Other components

- **Hyprland**
- **App User**
- **Wayland Compositor**

## Connections

- Hyprland → Plugin Entry: loads plugin (evidence: `fantasy_borders/src/main.cpp`)
- Plugin Entry → Window Decoration: attaches decoration (evidence: `fantasy_borders/src/main.cpp`)
- Window Decoration → Render Pass Element: queues render (evidence: `fantasy_borders/src/borderDeco.cpp`)
- App User → Flutter Runner: starts app
- Flutter Runner → Runner Application: creates application (evidence: `fantasy_rice/linux/runner/main.cc`)
- Runner Application → Capture Component: references capture (evidence: `fantasy_rice/linux/runner/my_application.cc`)
- Wayland Capture → Wayland Protocols: uses protocol bindings (evidence: `fantasy_rice/linux/runner/get-buffer-test/grim.hpp`)
- Wayland Capture → Display Texture: uses texture interface
- Display Texture → Capture Buffer: uses buffer type
- Wayland Compositor → Wayland Capture: provides capture
- Runner Application → Flutter Plugins: registers plugins
- App User → Flutter Runner: starts app
- Flutter Runner → Runner Application: creates application (evidence: `fantasy_rice_bottom/linux/runner/main.cc`)
- Runner Application → Capture Component: references capture (evidence: `fantasy_rice_bottom/linux/runner/my_application.cc`)
- Wayland Capture → Wayland Protocols: uses protocol bindings (evidence: `fantasy_rice_bottom/linux/runner/get-buffer-test/grim.hpp`)
- Wayland Capture → Display Texture: uses texture interface
- Display Texture → Capture Buffer: uses buffer type
- Wayland Compositor → Wayland Capture: provides capture
- Runner Application → Flutter Plugins: registers plugins
