跳转至

Graphics Widget Documentation Summary


Introduction to Graphics Widgets

    • This document summarizes comprehensive Doxygen documentation enhancements
  • made to the Graphics Widget subsystem, complementing the core Graphics Device
  • abstraction with reusable UI components.

* *

Widget Module Hierarchy\n

*

\n
 * Graphics\n
 * ├── Graphics_Widget (Main Widget Module)\n
 * │   ├── Graphics_Image (Bitmap widget)\n
 * │   ├── Graphics_Menu (Menu widget with subcomponents)\n
 * │   │   ├── Graphics_MenuItem (Individual menu items)\n
 * │   │   ├── Graphics_MenuIndicator (Selection indicator)\n
 * │   │   └── Graphics_MenuConfig (Compile-time configuration)\n
 * │   └── Graphics_ProgressBar (Progress visualization)\n
 * └── [existing Graphics_Device, Graphics_Animation, etc.]\n
 * ```



 *
* 



# Graphics_Image Module\n

*


* **Location**: [lib/graphic/widget/base_support/image.h](Files/image_8h.md#file-image.h)

 *
* **Purpose**: Bitmap image rendering at arbitrary positions

 *
* **Key Components**:
* - `[CCGraphic_Image](Classes/structCCGraphic__Image.md)` - Image structure (point, size, bitmap pointer)
* - `[CFBDGraphic_InitImage()](Files/image_8c.md#function-cfbdgraphic-initimage)` - Initialize image with data
* - `[CFBDGraphic_DrawImage()](Files/image_8c.md#function-cfbdgraphic-drawimage)` - Render image to graphics device

 *
* **Features**:
* - Flexible bitmap data ownership (caller owned)
* - No size restrictions (limited by device resolution)
* - Respects device drawing mode (immediate/deferred)

 *
* **Usage Pattern**:
* 

```cpp
\n
* 1. Create bitmap data array\n
* 2. Call CFBDGraphic_InitImage() with position and size\n
* 3. Call CFBDGraphic_DrawImage() to render\n
* 4. Update device if in deferred mode\n
* 

* *

Graphics_Menu Module\n

*

* * Purpose: Interactive menu system with navigation and selection

* * Submodules:

* *

Graphics_MenuIndicator\n

*

  • Purpose: Visual selection indicator bar

* * Components: * - CFBD_MenuIndicator - Configuration (width, x position) * - [CFBD_InitDefaultMenuIndicator()](Files/menu__indicator_8c.md#function-cfbd-initdefaultmenuindicator) - Initialize from config macros * - [CFBD_DrawMenuIndicator()](Files/menu__indicator_8c.md#function-cfbd-drawmenuindicator) - Render indicator

* * Configuration: * - Width: 0-8 pixels (0 = disabled) * - X position: Left edge in pixels

* *

Graphics_MenuItem\n

*

  • Purpose: Individual menu items with labels and callbacks

* * Components: * - CFBD_MenuItem - Single item structure * - CFBD_MenuItemGroup - Array container * - CFBD_MenuItemCallback - Callback function type * - [CFBD_MenuItemCallbackPack](Classes/structCFBD__MenuItemCallbackPack.md) - Callback + user data wrapper * - [CFBD_MenuItemInit()](Files/menu__item_8c.md#function-cfbd-menuiteminit) - Initialize item

* * Features: * - Zero-terminated string labels (caller owned) * - Optional selection callback with user data * - Configurable text rendering properties

* *

Graphics_MenuConfig\n

*

  • Purpose: Compile-time menu appearance configuration

* * Configuration Macros: * - CFBD_MENU_INDICATOR_WIDTH - Default indicator width (4px) * - CFBD_MENU_INDICATOR_POSX - Default indicator X position (0) * - CFBD_MENU_INDICATOR_MAX_WIDTH_PX - Maximum width (8px) * - CFBD_MENU_INDICATOR_MAX_HEIGHT_PX - Maximum height (16px) * - CFBD_MENU_INDICATOR_GAP - Gap between indicator and items (4px) * - CFBD_MENU_ITEM_Y_GAP - Vertical spacing between items (0px)

* *

Graphics_Menu (Main)\n

*

  • Key Components:
    • CFBD_Menu - Main menu structure
    • [CFBD_MenuOps](Classes/structCFBD__MenuOps.md) - Operation table with 8 callbacks
    • [CFBD_InitMenu()](Files/menu_8c.md#function-cfbd-initmenu) - Initialize menu
    • [OLED_Menu_SelectNext()](Files/menu_8h.md#function-oled-menu-selectnext) - Navigate down (inline)
    • [OLED_Menu_SelectPrev()](Files/menu_8h.md#function-oled-menu-selectprev) - Navigate up (inline)

* * Operations: * - bind_item_groups_contains() - Associate items array * - add_item() - Add item dynamically * - set_indicator_property() - Configure indicator * - set_animation() - Set transition animation * - immediate_draw() - Render complete menu * - select_index() - Change selection * - activate_current() - Invoke item callback * - reset_tl_points() - Reposition menu

* *

Graphics_ProgressBar Module\n

*

* * Purpose: Progress visualization with fill animation

* * Key Components: * - CFBD_ProgressBar - Main structure * - [CFBD_ProgressBarOps](Classes/structCFBD__ProgressBarOps.md) - Operation table * - [CFBD_ProgressBar_Init()](Files/progressbar_8c.md#function-cfbd-progressbar-init) - Initialize progress bar

* * Operations: * - immediate_draw() - Render current progress * - set_value() - Update progress value * - set_property() - Configure visual properties

* * Configuration: * - "border" (uint8_t) - Border enabled/disabled * - "padding" (uint8_t) - Inner padding (0-8px) * - "animation" (CFBD_BaseAnimation*) - Transition timing

* *

Documentation Enhancements\n

*

File-Level Documentation\n

*

  • Every widget header enhanced with:


Updated on 2026-02-03 at 13:21:55 +0000