Note: This is the GUI Resource Manager for managing graphical resources (fonts, icons, cursors). For kernel-level resource management (CPU, memory, I/O), see Kernel Resource Manager.

Overview

The GUI Resource Manager provides a centralized registry for GUI resources, preventing memory waste from duplicate loading. It manages fonts, icons, cursors, brushes, pens, and bitmaps.

Resource Types

  • Fonts - Font resources with name, size, and style
  • Icons - Icon resources with name and size variants
  • Cursors - Mouse cursor resources
  • Brushes - Brush resources for filling
  • Pens - Pen resources for drawing
  • Bitmaps - Bitmap image resources

Features

  • Resource Caching: Prevents duplicate loading of same resource
  • Handle Management: Unique handles for each resource
  • Ownership Tracking: Tracks which window owns which resources
  • Automatic Cleanup: Resources cleaned up when window destroyed
  • Resource Sharing: Resources can be shared between windows

API

Font Management

loadFont(name, size, style)  // Load font resource
getFont(name, size, style)   // Get cached font

Icon Management

loadIcon(name, size)         // Load icon resource
getIcon(name, size)          // Get cached icon

Cursor Management

loadCursor(name)             // Load cursor resource
getCursor(name)              // Get cached cursor

Brush and Pen

createBrush(color)           // Create brush
createPen(color, width)      // Create pen

Bitmap Management

loadBitmap(path)             // Load bitmap
getBitmap(id)                // Get bitmap by ID

Integration

The GUI Resource Manager integrates with:

  • Device Context: Provides resources for drawing operations
  • Window System: Manages resources per window
  • Icon System: Provides icon resources
  • Font System: Provides font resources

See Also