Overview

The Desktop class provides a graphical desktop environment for FreeWorld OS, similar to KDE, GNOME, and Windows. It manages the desktop window, taskbar, and application windows.

Desktop Class

Constructor

constructor()

Properties

Property Type Description
windowManager WindowManager Window manager instance
background object|null Desktop background (future)
taskbar Window|null Taskbar window

Methods

init()

Initializes the desktop environment. Creates desktop window and taskbar.

initTaskbar()

Initializes the taskbar at the bottom of the screen.

Taskbar Dimensions: 1920x40 pixels, positioned at (0, 1040)

createApplicationWindow(title, width, height)

Creates a new application window on the desktop.

Desktop Dimensions

Component Width Height Position
Desktop Window 1920 1080 (0, 0)
Taskbar 1920 40 (0, 1040)

Initialization Process

  1. Create WindowManager instance
  2. Create desktop window (1920x1080)
  3. Show desktop window
  4. Initialize taskbar
  5. Desktop environment ready

Usage Example

const Desktop = require('./desktop');

const desktop = new Desktop();
desktop.init();

// Create application window
const appWindow = desktop.createApplicationWindow('My App', 800, 600);
appWindow.show();