forked from ProjectMoon/MetaDesktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WindowManager.js
executable file
·46 lines (39 loc) · 1.51 KB
/
WindowManager.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* WindowManager.js
* This source file is part of the MetaDesktop Lightweight Webtop Environment (LWE).
* MetaDesktop is free software, licensed under the GNU GPL (General Public License).
* You are free to modify, redistribute, and change this program in any way.
*/
/*
* WindowManager.js is a collection of mostly procedural functions that deal with managing the graphical interface.
* Examples include minimizing and destroying windows. Note that these functions are called by the convience methods
* in the MetaWindow class.
*/
function GetTaskBarById(windowId) {
barEntry = document.getElementById(windowId + "_Taskbar");
if (barEntry)
return barEntry.parentNode;
else
return null;
}
function DestroyWindowById(windowId) {
//retrieve all the necessary information for a raw destroy
windows = document.getElementById("windows");
wind = document.getElementById(windowId);
taskbarEntry = document.getElementById(windowId + "_Taskbar");
taskbar = GetTaskBarById(windowId);
//perform the raw destroy
windows.removeChild(wind);
taskbar.removeChild(taskbarEntry);
}
function ResizeWindowById(windowId, newXSize, newYSize) {
}
function SetWindowTransparency(windowId, amt) {
windows = document.getElementById("windows");
wind = document.getElementById(windowId + "_Window");
titlebar = document.getElementById(windowId + "_Titlebar");
wind.style.filter = "alpha\(opacity=." + amt + "\)";
wind.style.opacity = "." + amt;
titlebar.style.filter = "alpha\(opacity=." + amt + "\)";
titlebar.style.opacity = "." + amt;
}