# vani-tty1/memerist architecture

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

- Interactive diagram: https://gitdiagram.com/vani-tty1/memerist
- Repository: https://github.com/vani-tty1/memerist

## Overview

Memerist is a GTK image-meme editor. The user opens or pastes an image, edits a layered composition with canvas, crop, drawing, and template tools, then exports or saves a project. The graph includes the indexed core modules and the distinct dialogs and editing subsystems visible in the tree. Some implementations were not excerpted; their connections are shown only where the source index supports them.

Main entry points: [`src/meme-window.c`](https://github.com/vani-tty1/memerist/blob/main/src/meme-window.c) (Editor window), [`src/meme-application.c`](https://github.com/vani-tty1/memerist/blob/main/src/meme-application.c) (Application actions), [`src/meme-canvas.c`](https://github.com/vani-tty1/memerist/blob/main/src/meme-canvas.c) (Canvas interactions), [`src/meme-fileio.c`](https://github.com/vani-tty1/memerist/blob/main/src/meme-fileio.c) (Image and project I/O)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_entry["Program entry<br/>[main.c]"]
  node_application["Application actions<br/>[meme-application.c]"]
  node_window["Editor window<br/>[meme-window.c]"]
  node_welcome["Welcome dialog"]
  node_preferences["Preferences dialog"]
  node_accent["Accent handling<br/>[meme-accent.c]"]
  node_theme["Theme switcher"]
end

subgraph group_editing["Image Editing"]
  node_canvas["Canvas interactions<br/>[meme-canvas.c]"]
  node_crop["Crop and margins<br/>[meme-window-crop.c]"]
  node_layer["Layer controls"]
  node_templates["Template gallery"]
  node_dragpreview["Drag preview"]
end

subgraph group_render["Composition"]
  node_model["Layer model and effects<br/>[meme-core.c]"]
  node_renderer["Composite renderer<br/>[meme-renderer.c]"]
end

subgraph group_io["Files and Preferences"]
  node_fileio["Image and project I/O<br/>[meme-fileio.c]"]
end

node_user(("Editor user"))
node_externalfiles["Image files"]
node_magick["ImageMagick"]

node_user -->|"launches"| node_entry
node_entry -->|"starts"| node_application
node_application -->|"presents"| node_window
node_application -->|"may show"| node_welcome
node_application -->|"opens"| node_preferences
node_window -->|"delegates I/O"| node_fileio
node_window -->|"uses"| node_theme
node_window -->|"handles edits"| node_canvas
node_canvas -->|"uses layer model"| node_model
node_window -->|"routes crop actions"| node_crop
node_window -.->|"routes layer actions"| node_layer
node_window -->|"routes template actions"| node_templates
node_templates -->|"updates image"| node_canvas
node_canvas -.->|"uses preview"| node_dragpreview
node_renderer -->|"uses effects and layers"| node_model
node_fileio -->|"loads image state"| node_canvas
node_user -->|"opens image"| node_externalfiles
node_fileio -->|"processes GIFs"| node_magick
node_fileio -.->|"reads and writes"| node_externalfiles
node_application -->|"configures accent"| node_accent

click node_entry "https://github.com/vani-tty1/memerist/blob/main/src/main.c"
click node_application "https://github.com/vani-tty1/memerist/blob/main/src/meme-application.c"
click node_window "https://github.com/vani-tty1/memerist/blob/main/src/meme-window.c"
click node_welcome "https://github.com/vani-tty1/memerist/blob/main/src/meme-welcome-dialog.c"
click node_preferences "https://github.com/vani-tty1/memerist/blob/main/src/meme-preferences-dialog.c"
click node_accent "https://github.com/vani-tty1/memerist/blob/main/src/meme-accent.c"
click node_theme "https://github.com/vani-tty1/memerist/blob/main/src/meme-theme-switcher.c"
click node_canvas "https://github.com/vani-tty1/memerist/blob/main/src/meme-canvas.c"
click node_crop "https://github.com/vani-tty1/memerist/blob/main/src/meme-window-crop.c"
click node_layer "https://github.com/vani-tty1/memerist/blob/main/src/meme-window-layers.c"
click node_templates "https://github.com/vani-tty1/memerist/blob/main/src/meme-window-templates.c"
click node_dragpreview "https://github.com/vani-tty1/memerist/blob/main/src/meme-drag-preview.c"
click node_model "https://github.com/vani-tty1/memerist/blob/main/src/meme-core.c"
click node_renderer "https://github.com/vani-tty1/memerist/blob/main/src/meme-renderer.c"
click node_fileio "https://github.com/vani-tty1/memerist/blob/main/src/meme-fileio.c"

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_entry,node_application,node_window,node_welcome,node_preferences,node_accent,node_theme,node_user toneBlue
class node_canvas,node_crop,node_layer,node_templates,node_dragpreview toneAmber
class node_model,node_renderer toneMint
class node_fileio toneRose
class node_externalfiles,node_magick toneIndigo
```

## Components

### Application

- [Program entry](https://github.com/vani-tty1/memerist/blob/main/src/main.c): `src/main.c`
- [Application actions](https://github.com/vani-tty1/memerist/blob/main/src/meme-application.c): `src/meme-application.c`
- [Editor window](https://github.com/vani-tty1/memerist/blob/main/src/meme-window.c): `src/meme-window.c`
- [Welcome dialog](https://github.com/vani-tty1/memerist/blob/main/src/meme-welcome-dialog.c): `src/meme-welcome-dialog.c`
- [Preferences dialog](https://github.com/vani-tty1/memerist/blob/main/src/meme-preferences-dialog.c): `src/meme-preferences-dialog.c`
- [Accent handling](https://github.com/vani-tty1/memerist/blob/main/src/meme-accent.c): `src/meme-accent.c`
- [Theme switcher](https://github.com/vani-tty1/memerist/blob/main/src/meme-theme-switcher.c): `src/meme-theme-switcher.c`

### Image Editing

- [Canvas interactions](https://github.com/vani-tty1/memerist/blob/main/src/meme-canvas.c): `src/meme-canvas.c`
- [Crop and margins](https://github.com/vani-tty1/memerist/blob/main/src/meme-window-crop.c): `src/meme-window-crop.c`
- [Layer controls](https://github.com/vani-tty1/memerist/blob/main/src/meme-window-layers.c): `src/meme-window-layers.c`
- [Template gallery](https://github.com/vani-tty1/memerist/blob/main/src/meme-window-templates.c): `src/meme-window-templates.c`
- [Drag preview](https://github.com/vani-tty1/memerist/blob/main/src/meme-drag-preview.c): `src/meme-drag-preview.c`

### Composition

- [Layer model and effects](https://github.com/vani-tty1/memerist/blob/main/src/meme-core.c): `src/meme-core.c`
- [Composite renderer](https://github.com/vani-tty1/memerist/blob/main/src/meme-renderer.c): `src/meme-renderer.c`

### Files and Preferences

- [Image and project I/O](https://github.com/vani-tty1/memerist/blob/main/src/meme-fileio.c): `src/meme-fileio.c`

### Other components

- **Editor user**
- **Image files**
- **ImageMagick**

## Connections

- Editor user → Program entry: launches (evidence: `src/main.c`)
- Program entry → Application actions: starts (evidence: `src/main.c`)
- Application actions → Editor window: presents (evidence: `src/meme-application.c`)
- Application actions → Welcome dialog: may show (evidence: `src/meme-application.c`)
- Application actions → Preferences dialog: opens (evidence: `src/meme-application.c`)
- Editor window → Image and project I/O: delegates I/O (evidence: `src/meme-window.c`)
- Editor window → Theme switcher: uses (evidence: `src/meme-window.c`)
- Editor window → Canvas interactions: handles edits
- Canvas interactions → Layer model and effects: uses layer model (evidence: `src/meme-canvas.c`)
- Editor window → Crop and margins: routes crop actions (evidence: `src/meme-window.c`)
- Editor window → Layer controls: routes layer actions
- Editor window → Template gallery: routes template actions (evidence: `src/meme-window.c`)
- Template gallery → Canvas interactions: updates image (evidence: `src/meme-window-templates.c`)
- Canvas interactions → Drag preview: uses preview
- Composite renderer → Layer model and effects: uses effects and layers (evidence: `src/meme-renderer.c`)
- Image and project I/O → Canvas interactions: loads image state (evidence: `src/meme-fileio.c`)
- Editor user → Image files: opens image
- Image and project I/O → ImageMagick: processes GIFs (evidence: `src/meme-fileio.c`)
- Image and project I/O → Image files: reads and writes
- Application actions → Accent handling: configures accent (evidence: `src/meme-application.c`)
