aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/Desktop.cs
diff options
context:
space:
mode:
authorwilliam341 <[email protected]>2017-05-28 12:37:00 -0700
committerGitHub <[email protected]>2017-05-28 12:37:00 -0700
commit771c20cfb3a703e0f1550fdcf9eb07b78298c944 (patch)
tree59cb532e15ebff313fdba2be264d78ec0033f407 /ShiftOS_TheReturn/Desktop.cs
parent496b0cbf8659c99203f48210fd39c572400ae623 (diff)
parentc7ba7d733c756d196f98dd4533289a1ef4db715f (diff)
downloadshiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.tar.gz
shiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.tar.bz2
shiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.zip
Merge pull request #1 from shiftos-game/master
welp, no longer a dev.
Diffstat (limited to 'ShiftOS_TheReturn/Desktop.cs')
-rw-r--r--ShiftOS_TheReturn/Desktop.cs126
1 files changed, 123 insertions, 3 deletions
diff --git a/ShiftOS_TheReturn/Desktop.cs b/ShiftOS_TheReturn/Desktop.cs
index 19be5f4..a5e7f43 100644
--- a/ShiftOS_TheReturn/Desktop.cs
+++ b/ShiftOS_TheReturn/Desktop.cs
@@ -37,6 +37,10 @@ using static ShiftOS.Engine.SkinEngine;
namespace ShiftOS.Engine
{
+ /// <summary>
+ /// Denotes that this class is launchable from the App Launcher.
+ /// </summary>
+ [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class LauncherAttribute : Attribute
{
/// <summary>
@@ -54,10 +58,29 @@ namespace ShiftOS.Engine
ID = upgradeID;
}
+ /// <summary>
+ /// Gets or sets the name of the launcher item
+ /// </summary>
public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets whether this entry requires a Shiftorium upgrade.
+ /// </summary>
public bool RequiresUpgrade { get; set; }
+
+ /// <summary>
+ /// Gets or sets the ID of the required upgrade.
+ /// </summary>
public string ID { get; set; }
+
+ /// <summary>
+ /// Gets or sets this item's category.
+ /// </summary>
public string Category { get; private set; }
+
+ /// <summary>
+ /// Gets whether or not the required upgrade is installed.
+ /// </summary>
public bool UpgradeInstalled
{
get
@@ -70,33 +93,117 @@ namespace ShiftOS.Engine
}
}
-
+ /// <summary>
+ /// Provides core functionality for a typical ShiftOS desktop.
+ /// </summary>
public interface IDesktop
{
+ /// <summary>
+ /// Gets the name of the desktop.
+ /// </summary>
string DesktopName { get; }
-
+
+ /// <summary>
+ /// Show a notification on the desktop.
+ /// </summary>
+ /// <param name="app">An application ID (for determining what system icon to show the notification alongside)</param>
+ /// <param name="title">The title of the notification.</param>
+ /// <param name="message">Isn't this.... self explanatory?</param>
+ void PushNotification(string app, string title, string message);
+
+ /// <summary>
+ /// Performs most of the skinning and layout handling for the desktop.
+ /// </summary>
void SetupDesktop();
+
+ /// <summary>
+ /// Hides the currently-opened app launcher menu.
+ /// </summary>
+ void HideAppLauncher();
+
+
+ /// <summary>
+ /// Populates the app launcher menu.
+ /// </summary>
+ /// <param name="items">All items to be placed in the menu.</param>
void PopulateAppLauncher(LauncherItem[] items);
+
+ /// <summary>
+ /// Handles desktop-specific routines for showing ShiftOS windows.
+ /// </summary>
+ /// <param name="border">The calling window.</param>
void ShowWindow(IWindowBorder border);
+
+ /// <summary>
+ /// Handles desktop-specific routines for closing ShiftOS windows.
+ /// </summary>
+ /// <param name="border">The calling window.</param>
void KillWindow(IWindowBorder border);
+
+ /// <summary>
+ /// Populates the panel button list with all open windows.
+ /// </summary>
void PopulatePanelButtons();
+
+ /// <summary>
+ /// Performs desktop-specific routines for minimizing a window.
+ /// </summary>
+ /// <param name="brdr">The calling window.</param>
void MinimizeWindow(IWindowBorder brdr);
+
+
+ /// <summary>
+ /// Performs desktop-specific routines for maximizing a window.
+ /// </summary>
+ /// <param name="brdr">The calling window.</param>
void MaximizeWindow(IWindowBorder brdr);
+
+
+ /// <summary>
+ /// Performs desktop-specific routines for restoring a window to its default state.
+ /// </summary>
+ /// <param name="brdr">The calling window.</param>
void RestoreWindow(IWindowBorder brdr);
+
+ /// <summary>
+ /// Invokes an action on the UI thread.
+ /// </summary>
+ /// <param name="act">The action to invoke.</param>
void InvokeOnWorkerThread(Action act);
+
+ /// <summary>
+ /// Calculates the screen size of the desktop.
+ /// </summary>
+ /// <returns>The desktop's screen size.</returns>
Size GetSize();
+ /// <summary>
+ /// Opens the app launcher at a specific point.
+ /// </summary>
+ /// <param name="loc">Where the app launcher should be opened.</param>
void OpenAppLauncher(Point loc);
+ /// <summary>
+ /// Opens the desktop.
+ /// </summary>
void Show();
+
+ /// <summary>
+ /// Closes the desktop.
+ /// </summary>
void Close();
}
public static class Desktop
{
+ /// <summary>
+ /// The underlying desktop object.
+ /// </summary>
private static IDesktop _desktop = null;
- public static Size Size { get
+ public static Size Size
+ {
+ get
{
return _desktop.GetSize();
}
@@ -161,6 +268,19 @@ namespace ShiftOS.Engine
{
_desktop.OpenAppLauncher(loc);
}
+
+ public static void HideAppLauncher()
+ {
+ _desktop.HideAppLauncher();
+ }
+
+ public static void PushNotification(string app, string title, string msg)
+ {
+ InvokeOnWorkerThread(() =>
+ {
+ _desktop.PushNotification(app, title, msg);
+ });
+ }
}
// sorry i almost killed everything :P
}