diff --git a/docs/api/QUICK_REFERENCE.md b/docs/api/QUICK_REFERENCE.md new file mode 100644 index 0000000..e616556 --- /dev/null +++ b/docs/api/QUICK_REFERENCE.md @@ -0,0 +1,511 @@ +# Prong API Quick Reference + +Condensed reference for all Prong APIs. See individual files for detailed documentation. + +## Core Classes + +### Component +Base class for all UI elements. +```cpp +class Component { + virtual void update(double deltaTime) = 0; + virtual void render() = 0; + void setPosition(int x, int y); + void setSize(int width, int height); + void addChild(std::unique_ptr child); + bool handleEvent(const Event& event); + void setResizeBehavior(ResizeBehavior behavior); +}; +``` + +### Scene +Root container and event coordinator. +```cpp +class Scene : public Component { + Scene(IWindow* window, IRenderer* renderer); + void attach(); // Start receiving events + void detach(); // Stop receiving events + void handleResize(int newWidth, int newHeight); +}; +``` + +### ComponentBuilder +Fluent API for component construction. +```cpp +auto component = create(/* constructor args */) + .withSize(width, height) + .withPosition(x, y) + .withVisible(bool) + .build(); +``` + +### Event +Unified event structure. +```cpp +struct Event { + enum class Type { MOUSE_PRESS, MOUSE_RELEASE, MOUSE_MOVE, MOUSE_SCROLL, KEY_PRESS, KEY_RELEASE, CHAR_INPUT }; + Type type; + int localX, localY; // Mouse position in local coordinates + int button; // Mouse button + int key, mods; // Keyboard + unsigned int codepoint; // Character input + double scrollX, scrollY; // Scroll delta +}; +``` + +## UI Components + +### Button +```cpp +auto button = create