Topic: nModules 0.6 released
I just released version 0.6 of my nModules.
You can get them here: http://lsmodules.alurcard2.net/
Requirements
Window Vista, or newer.
The 2013-08-04 0.25.0 LiteStep alpha build, or newer. Latest is recommended.
Note that the latest 0.25.0 alphas require the Visual Studio 2012 C++ Redistributable.
If you get the 32-bit modules, you need the 32-bit LiteStep core, and the 32-bit redistributables (A.K.A. x86). A 32-bit LiteStep core can not load 64-bit modules.
If you get the 64-bit modules, you need the 64-bit LiteStep core, the 64-bit redistributables (A.K.A. x64), and a 64-bit operating system. A 64-bit LiteStep core can not load 32-bit modules.
ChangeLog
Added the Edges scaling mode to brushes.
Fixed how some tasks would not minimize/restore properly with nTask.
Fixed issue where clock hands would not align with the center of the clock.
Fixed issue where images used as clock hands would not render correctly.
Fixed issue where nDesk was not reading the wallpaper style properly, resulting in the wrong style being applied.
Fixed crash in nMediaInfo when trying to extract data from a non-existent mp3 file.
Removed the SolidColor brush's Alpha setting, for performance reasons, sorry Use Color SetAlpha(..., val) instead.
Colors based on DWMColor now automatically update when the DWM color changes.
Fixed nDesk failing to load wallpapers which contain invalid metadata.
Fixed regression where tray icons belonging to dead windows no longer went away on mouseover.
Added an !nTaskTestWindow to nTask, for testing some less-common taskbar features.
Much more efficient rendering.
Automatic tray sizing.
Fixed issues where hovering would not trigger correctly, under some circumstances.
Added JavaScript scripting support.
JavaScript support
Starting with this version, nCore supports executing JavaScript code. You can load .js files by using the *nIncludeScript command in your config, or execute code by using the !nExecScript and !nAlertScript bangs. The difference between them is that !nAlertScript will show the result of the expression in a messagebox.
Currently, there are 2 global objects provided to the JavaScript runtime to allow it to interact with LiteStep. The LiteStep object, which provides core LiteStep functions, and the nCore object, for interacting with nModule windows.
LiteStep
The LiteStep object currently provides the following functions:
LiteStep.Execute(command)
Executes command.
LiteStep.Recycle()
Recycles LiteStep.
LiteStep.Refresh()
Refreshes LiteStep.
LiteStep.Bangs.Add(bang, func)
Registers a !bang command. When the !bang is executed, func is called with the argument of the bang.
Example:
LiteStep.Bangs.Add("!HelloWorld", function(params) {
LiteStep.Bangs.Execute('!Alert', '"' + 'Hello World! ' + params + '"');
});
LiteStep.Bangs.Execute(bang, arg)
Executes the bang bang with the specified argument.
LiteStep.Bangs.Remove(bang)
Removes the specified bang.
LiteStep.Evars.Set(key, value)
Set the specified Evar to the specified value.
LiteStep.Evars.Get(key)
Retrieves the value of the specified Evar.
LiteStep.Evars.GetNumeric(key, default = 0.0)
Gets a numeric version of the specified Evar, or default if the Evar is not a number.
nCore
The nCore object currently provides the following functions:
nCore.Window.Move(name, x, y, time = 0, easing = Linear)
Moves the window with the given name to the specified position, in the specified amount of time using the specified easing.
nCore.Window.Size(name, width, height, time = 0, easing = Linear)
Sizes the window with the given name to the specified size, in the specified amount of time using the specified easing.
nCore.Window.Position(name, x, y, width, height, time = 0, easing = Linear)
Moves and sizes the window with the given name to the specified size, in the specified amount of time using the specified easing.
nCore.Window.Hide(name)
Hides the window with the specified name.
nCore.Window.Show(name)
Show the window with the specified name.
nCore.Window.GetX(name)
Returns the X coordinate of the window with the specified name.
nCore.Window.GetY(name)
Returns the Y coordinate of the window with the specified name.
nCore.Window.GetWidth(name)
Returns the width of the window with the specified name.
nCore.Window.GetHeight(name)
Returns the height of the window with the specified name.
Here are some samples from my own theme:
//
// Sizes the elements of the taskbar, as necessary.
//
LiteStep.Evars.Set('SystemTrayOnResize', '!nExecScript SizeTaskbarElements()');
function SizeTaskbarElements()
{
var taskbarWidth =
nCore.Window.GetWidth('MainTaskbar')
- nCore.Window.GetX("Taskbar")
- nCore.Window.GetWidth("SystemTray")
- nCore.Window.GetWidth("MainTaskbarClock");
nCore.Window.Size('Taskbar', taskbarWidth, nCore.Window.GetHeight('Taskbar'));
}
//
// Tests simultanious animations
//
function Test()
{
if (Test.Reverse)
{
nCore.Window.Move('DesktopMediaInfo',
LiteStep.Evars.GetNumeric("DesktopMediaInfoX"),
LiteStep.Evars.GetNumeric("DesktopMediaInfoY"),
10000);
nCore.Window.Move('HoverTestCenterTest', 200, 0, 10000);
nCore.Window.Move('HoverTest',
LiteStep.Evars.GetNumeric("HoverTestX"),
LiteStep.Evars.GetNumeric("HoverTestY"),
10000);
}
else
{
nCore.Window.Move('DesktopMediaInfo', 0, 0, 10000);
nCore.Window.Move('HoverTestCenterTest', 0, 200, 10000);
nCore.Window.Move('HoverTest',
1920*2 - LiteStep.Evars.GetNumeric('HoverTestWidth'),
100,
10000);
}
Test.Reverse = !Test.Reverse;
}
Test.Reverse = false;
//
// Prints the contents of an object.
// Try !nAlertScript dump(dump) and !nAlertScript dump(LiteStep).
//
function dump(arr, level)
{
var text = "";
if (typeof(level) == 'undefined')
{
level = 0;
}
//The padding given at the beginning of the line.
var padding = "";
for (var j = 0; j < level + 1; j++)
{
padding += " ";
}
if (typeof(arr) == 'object') //Array/Hashes/Objects
{
for (var item in arr)
{
var value = arr[item];
if (typeof(value) == 'object') //If it is an array,
{
text += padding + "'" + item + "' ...\n";
text += dump(value, level + 1);
}
else
{
text += padding + "'" + item + "' => \"" + value + "\"\n";
}
}
}
else //Stings/Chars/Numbers etc.
{
text = "===>" + arr + "<===(" + typeof(arr) + ")";
}
return text;
}
I'm planning to have a proper complete documentation and a lot more scripting support in 0.7 Please let me know of any bugs you find.