C# Class MediaPortal.GUI.Library.GUIWindowManager

static class which takes care of window management Things done are: - loading and initializing all windows - routing messages, key presses, mouse clicks etc to the currently active window - rendering the currently active window - methods for switching to the previous window - methods to switch to another window
Afficher le fichier Open project: MediaPortal/MediaPortal-1

Méthodes publiques

Méthode Description
ActivateWindow ( int windowId ) : void

ActivateWindow() This function will show/present/activate the window specified

ActivateWindow ( int windowId, String loadParameter ) : void

This function will show/present/activate the window specified and pass a parameter to the window.

ActivateWindow ( int windowId, String loadParameter, bool replaceWindow ) : void

This function will show/present/activate the window specified and pass a parameter to the window.

ActivateWindow ( int windowId, bool replaceWindow ) : void

ActivateWindow() This function will show/present/activate and replace current window with the window specified

ActivateWindow ( int windowId, bool replaceWindow, bool skipAnimation, int focusControlId ) : void

ActivateWindow() This function will show/present/activate and replace current window with the window specified.

Add ( GUIWindow &Window ) : void

Add new window to the window manager

Clear ( ) : void

Removes all windows

CloseCurrentWindow ( ) : void

Close current window. When MediaPortal closes we need to close current window

DispatchThreadMessages ( ) : void

process the thread messages and actions This method gets called by the main thread only and ensures that all messages & actions are handled by 1 thread only

Dispose ( ) : void

Asks all windows to cleanup their resources

GetPreviousActiveWindow ( ) : int
GetWindow ( int dwID ) : GUIWindow

GetWindow() returns the window with the specified ID

HasPreviousWindow ( ) : bool

Checks if ShowPreviousWindow could activate a previous window. If no, then there is no previous window.

Initialize ( ) : void

Initialize the window manager

MadVrProcess ( ) : void

MyInterfaceFilter ( Type typeObj, Object criteriaObj ) : bool
NeedRefresh ( ) : bool

returns true if current window wants to refresh/redraw itself other wise false

OnAction ( Action action ) : void

This method will handle a given action. Its called by the process() function The window manager will give the action to the current active window 2 handle

OnDeviceRestored ( ) : void

called by the runtime when DirectX device has been restored Just let current active window know about this so they can re-allocate their directx resources

OnResize ( ) : void

OnResize() will restore all the positions of all controls of all windows to their original values as specified in the skin files

PreInit ( ) : void

Call preinit for every window This function gets called once by the runtime when everything is up & running directX is now initialized, but before the first window is activated. It gives the window the oppertunity to allocate any (directx) resources it may need

Process ( ) : void

ProcessWindows ( ) : void

This method will call the process() method on the currently active window This method gets calle on a regular basis and allows the window todo some stuff without any user action necessary

Render ( float timePassed ) : void

Render() ask the current active window to render itself

Replace ( int windowId, GUIWindow window ) : void
ReplaceWindow ( int windowId ) : void

ReplaceWindow() This function will replace current window with specified window

ResetAllControls ( ) : void

call ResetallControls() for every window This will cause each control to use the default position, width and size as mentioned in the skin files

ResetWindowsHistory ( ) : void
RouteToWindow ( int dialogId ) : void
SendMessage ( GUIMessage message ) : void

Send message to a window/control

SendThreadCallback ( Callback callback, int param1, int param2, object data ) : void
SendThreadCallbackAndWait ( Callback callback, int param1, int param2, object data ) : int

This function can be used to call a callback within the context of the message processing thread. The function waits until the message thread has picked up and executed the callback. This function is also safe if the current thread is the message processing thread.

SendThreadCallbackSkin ( Callback callback, int param1, int param2, object data ) : int
SendThreadMessage ( GUIMessage message ) : void

send thread message. Same as sendmessage() however message is placed on a queue which is processed later.

ShowPreviousWindow ( ) : void

Show previous window. When user goes back (ESC) this function will show the previous active window

ShowWarning ( int iHeading, int iLine1, int iLine2 ) : void

This method will show a warning dialog onscreen and returns when the user has clicked the dialog away

UnRoute ( ) : void

tell the window manager to unroute the current routing

Private Methods

Méthode Description
ActivateWindow ( int newWindowId, bool replaceWindow, bool skipHistory, String loadParameter ) : void
ActivateWindow ( int newWindowId, bool replaceWindow, bool skipHistory, String loadParameter, bool skipAnimation, int focusControlId ) : void
AddNewWindowToHistory ( int WindowId ) : void
CallbackMsg ( GUIMessage msg ) : void
GUIWindowManager ( ) : System
GetWindow ( int dwID, bool tryRestoreSkin ) : GUIWindow
LockAndDoOnAllRegisteredWindows ( Action toDo ) : void
OnActionReceived ( Action action ) : void

event handler which is called by GUIGraphicsContext when a new action has occurred The method will add the action to a list which is processed later on in the process () function The reason for this is that multiple threads can add new action and they should only be processed by the main thread

RemoveDoubleHistory ( int newWindow ) : void
StartFrameClock ( ) : void
StartMadVrFrameClock ( ) : void
WaitForFrameClock ( ) : void
WaitForMadVrFrameClock ( ) : void

Method Details

ActivateWindow() public static méthode

ActivateWindow() This function will show/present/activate the window specified
public static ActivateWindow ( int windowId ) : void
windowId int
Résultat void

ActivateWindow() public static méthode

This function will show/present/activate the window specified and pass a parameter to the window.
public static ActivateWindow ( int windowId, String loadParameter ) : void
windowId int window id of the window to activate
loadParameter String a parameter string to pass to the new window
Résultat void

ActivateWindow() public static méthode

This function will show/present/activate the window specified and pass a parameter to the window.
public static ActivateWindow ( int windowId, String loadParameter, bool replaceWindow ) : void
windowId int window id of the window to activate
loadParameter String a parameter string to pass to the new window
replaceWindow bool
Résultat void

ActivateWindow() public static méthode

ActivateWindow() This function will show/present/activate and replace current window with the window specified
public static ActivateWindow ( int windowId, bool replaceWindow ) : void
windowId int
replaceWindow bool
Résultat void

ActivateWindow() public static méthode

ActivateWindow() This function will show/present/activate and replace current window with the window specified.
public static ActivateWindow ( int windowId, bool replaceWindow, bool skipAnimation, int focusControlId ) : void
windowId int window id of the window to activate
replaceWindow bool replace current window
skipAnimation bool do not perform open and close animation during this activation
focusControlId int focus on this control rather than the window default
Résultat void

Add() public static méthode

Add new window to the window manager
public static Add ( GUIWindow &Window ) : void
Window GUIWindow new window to add
Résultat void

Clear() public static méthode

Removes all windows
public static Clear ( ) : void
Résultat void

CloseCurrentWindow() public static méthode

Close current window. When MediaPortal closes we need to close current window
public static CloseCurrentWindow ( ) : void
Résultat void

DispatchThreadMessages() public static méthode

process the thread messages and actions This method gets called by the main thread only and ensures that all messages & actions are handled by 1 thread only
public static DispatchThreadMessages ( ) : void
Résultat void

Dispose() public static méthode

Asks all windows to cleanup their resources
public static Dispose ( ) : void
Résultat void

GetPreviousActiveWindow() public static méthode

public static GetPreviousActiveWindow ( ) : int
Résultat int

GetWindow() public static méthode

GetWindow() returns the window with the specified ID
public static GetWindow ( int dwID ) : GUIWindow
dwID int id of window
Résultat GUIWindow

HasPreviousWindow() public static méthode

Checks if ShowPreviousWindow could activate a previous window. If no, then there is no previous window.
public static HasPreviousWindow ( ) : bool
Résultat bool

Initialize() public static méthode

Initialize the window manager
public static Initialize ( ) : void
Résultat void

MadVrProcess() public static méthode

public static MadVrProcess ( ) : void
Résultat void

MyInterfaceFilter() public static méthode

public static MyInterfaceFilter ( Type typeObj, Object criteriaObj ) : bool
typeObj System.Type
criteriaObj Object
Résultat bool

NeedRefresh() public static méthode

returns true if current window wants to refresh/redraw itself other wise false
public static NeedRefresh ( ) : bool
Résultat bool

OnAction() public static méthode

This method will handle a given action. Its called by the process() function The window manager will give the action to the current active window 2 handle
public static OnAction ( Action action ) : void
action Action new action for current active window
Résultat void

OnDeviceRestored() public static méthode

called by the runtime when DirectX device has been restored Just let current active window know about this so they can re-allocate their directx resources
public static OnDeviceRestored ( ) : void
Résultat void

OnResize() public static méthode

OnResize() will restore all the positions of all controls of all windows to their original values as specified in the skin files
public static OnResize ( ) : void
Résultat void

PreInit() public static méthode

Call preinit for every window This function gets called once by the runtime when everything is up & running directX is now initialized, but before the first window is activated. It gives the window the oppertunity to allocate any (directx) resources it may need
public static PreInit ( ) : void
Résultat void

Process() public static méthode

public static Process ( ) : void
Résultat void

ProcessWindows() public static méthode

This method will call the process() method on the currently active window This method gets calle on a regular basis and allows the window todo some stuff without any user action necessary
public static ProcessWindows ( ) : void
Résultat void

Render() public static méthode

Render() ask the current active window to render itself
public static Render ( float timePassed ) : void
timePassed float
Résultat void

Replace() public static méthode

public static Replace ( int windowId, GUIWindow window ) : void
windowId int
window GUIWindow
Résultat void

ReplaceWindow() public static méthode

ReplaceWindow() This function will replace current window with specified window
public static ReplaceWindow ( int windowId ) : void
windowId int
Résultat void

ResetAllControls() public static méthode

call ResetallControls() for every window This will cause each control to use the default position, width and size as mentioned in the skin files
public static ResetAllControls ( ) : void
Résultat void

ResetWindowsHistory() public static méthode

public static ResetWindowsHistory ( ) : void
Résultat void

RouteToWindow() public static méthode

public static RouteToWindow ( int dialogId ) : void
dialogId int
Résultat void

SendMessage() public static méthode

Send message to a window/control
public static SendMessage ( GUIMessage message ) : void
message GUIMessage message to send
Résultat void

SendThreadCallback() public static méthode

public static SendThreadCallback ( Callback callback, int param1, int param2, object data ) : void
callback Callback
param1 int
param2 int
data object
Résultat void

SendThreadCallbackAndWait() public static méthode

This function can be used to call a callback within the context of the message processing thread. The function waits until the message thread has picked up and executed the callback. This function is also safe if the current thread is the message processing thread.
public static SendThreadCallbackAndWait ( Callback callback, int param1, int param2, object data ) : int
callback Callback Callback to be executed
param1 int Param to callback
param2 int Param to callback
data object Param to callback
Résultat int

SendThreadCallbackSkin() public static méthode

public static SendThreadCallbackSkin ( Callback callback, int param1, int param2, object data ) : int
callback Callback
param1 int
param2 int
data object
Résultat int

SendThreadMessage() public static méthode

send thread message. Same as sendmessage() however message is placed on a queue which is processed later.
public static SendThreadMessage ( GUIMessage message ) : void
message GUIMessage new message to send
Résultat void

ShowPreviousWindow() public static méthode

Show previous window. When user goes back (ESC) this function will show the previous active window
public static ShowPreviousWindow ( ) : void
Résultat void

ShowWarning() public static méthode

This method will show a warning dialog onscreen and returns when the user has clicked the dialog away
public static ShowWarning ( int iHeading, int iLine1, int iLine2 ) : void
iHeading int label id for the dialog header
iLine1 int label id for the 1st line in the dialog
iLine2 int label id for the 2nd line in the dialog
Résultat void

UnRoute() public static méthode

tell the window manager to unroute the current routing
public static UnRoute ( ) : void
Résultat void