Desktop Environment
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
- Create WindowManager instance
- Create desktop window (1920x1080)
- Show desktop window
- Initialize taskbar
- 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();