Commit graph

1 commit

Author SHA1 Message Date
Mike Conley
f39a8015ae
Add: MXP FRAME and DEST tag support for multi-window layouts (#8577)
#### Brief overview of PR changes/additions

Implements MXP `<FRAME>` and `<DEST>` tag support, allowing MUD servers
to create custom windows and redirect output to them. Games can now
define dedicated windows for different content types (chat channels,
combat logs, room descriptions, maps, etc.) and control which window
receives specific output.

**Key additions:**
- `TMxpFrameManager` - manages frame lifecycle and hierarchy
- `TMxpFrameTagHandler` - processes `<FRAME>` tags for window creation
- `TMxpDestTagHandler` - processes `<DEST>` tags for output routing
- Modified `cTelnet::postData()` to route output to destination frames
- Support for floating/docked windows, tabs, and nested frame
hierarchies
- Unit tests covering tag parsing and handler behavior

**Supported features:**
- Frame attributes: name, title, position, size, floating/docking,
scrolling
- Output routing with EOL (clear current line) and EOF (clear buffer)
flags
- Parent-child frame relationships with automatic cleanup
- Maximum 20 frames per profile to prevent resource exhaustion

Documentation: [Area
51](https://wiki.mudlet.org/w/Area_51#MXP_FRAME_and_DEST_Tags.2C_PR_.238577)

#### Motivation for adding to Mudlet

Enables server-controlled multi-window layouts, improving information
organization and readability. Players get dedicated windows for
different game systems without manual configuration. This capability is
standard in other MUD clients (MUSHclient, zMUD) and addresses a
long-standing gap in Mudlet's MXP implementation.

#### Other info (issues closed, discussion etc)

Closes #8573

---

### Architecture Overview

```mermaid
graph TB
    Server[MUD Server] -->|MXP Tags| Telnet[cTelnet]
    Telnet --> MxpProc[TMxpProcessor]
    MxpProc --> TagParser[TMxpTagParser]
    TagParser --> FrameHandler[TMxpFrameTagHandler]
    TagParser --> DestHandler[TMxpDestTagHandler]
    
    FrameHandler --> Client[TMxpMudlet]
    DestHandler --> Client
    
    Client --> FrameMgr[TMxpFrameManager]
    
    FrameMgr -->|Creates| DockWidget[TDockWidget]
    FrameMgr -->|Creates| TabWidget[QTabWidget]
    FrameMgr -->|Creates| Console[TConsole]
    
    FrameMgr -->|Routes Output| ActiveConsole[Active Destination Console]
    
    DockWidget --> MainWindow[QMainWindow]
    TabWidget --> MainWindow
    
    style FrameMgr stroke:#2e7d32,stroke-width:3px
    style Client stroke:#1976d2,stroke-width:3px
    style Server stroke:#c62828,stroke-width:3px
```
---

<img width="1728" height="1013" alt="Screenshot 2025-12-06 at 12 34
24 PM"
src="https://github.com/user-attachments/assets/ed26c581-6b7c-467f-bf35-951586d114b4"
/>
2025-12-28 22:31:42 +00:00