C# Класс 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
Показать файл Открыть проект

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

ActivateWindow() публичный статический Метод

ActivateWindow() This function will show/present/activate the window specified
public static ActivateWindow ( int windowId ) : void
windowId int
Результат void

ActivateWindow() публичный статический Метод

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
Результат void

ActivateWindow() публичный статический Метод

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
Результат void

ActivateWindow() публичный статический Метод

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
Результат void

ActivateWindow() публичный статический Метод

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
Результат void

Add() публичный статический Метод

Add new window to the window manager
public static Add ( GUIWindow &Window ) : void
Window GUIWindow new window to add
Результат void

Clear() публичный статический Метод

Removes all windows
public static Clear ( ) : void
Результат void

CloseCurrentWindow() публичный статический Метод

Close current window. When MediaPortal closes we need to close current window
public static CloseCurrentWindow ( ) : void
Результат void

DispatchThreadMessages() публичный статический Метод

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
Результат void

Dispose() публичный статический Метод

Asks all windows to cleanup their resources
public static Dispose ( ) : void
Результат void

GetPreviousActiveWindow() публичный статический Метод

public static GetPreviousActiveWindow ( ) : int
Результат int

GetWindow() публичный статический Метод

GetWindow() returns the window with the specified ID
public static GetWindow ( int dwID ) : GUIWindow
dwID int id of window
Результат GUIWindow

HasPreviousWindow() публичный статический Метод

Checks if ShowPreviousWindow could activate a previous window. If no, then there is no previous window.
public static HasPreviousWindow ( ) : bool
Результат bool

Initialize() публичный статический Метод

Initialize the window manager
public static Initialize ( ) : void
Результат void

MadVrProcess() публичный статический Метод

public static MadVrProcess ( ) : void
Результат void

MyInterfaceFilter() публичный статический Метод

public static MyInterfaceFilter ( Type typeObj, Object criteriaObj ) : bool
typeObj System.Type
criteriaObj Object
Результат bool

NeedRefresh() публичный статический Метод

returns true if current window wants to refresh/redraw itself other wise false
public static NeedRefresh ( ) : bool
Результат bool

OnAction() публичный статический Метод

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
Результат void

OnDeviceRestored() публичный статический Метод

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
Результат void

OnResize() публичный статический Метод

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
Результат void

PreInit() публичный статический Метод

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
Результат void

Process() публичный статический Метод

public static Process ( ) : void
Результат void

ProcessWindows() публичный статический Метод

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
Результат void

Render() публичный статический Метод

Render() ask the current active window to render itself
public static Render ( float timePassed ) : void
timePassed float
Результат void

Replace() публичный статический Метод

public static Replace ( int windowId, GUIWindow window ) : void
windowId int
window GUIWindow
Результат void

ReplaceWindow() публичный статический Метод

ReplaceWindow() This function will replace current window with specified window
public static ReplaceWindow ( int windowId ) : void
windowId int
Результат void

ResetAllControls() публичный статический Метод

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
Результат void

ResetWindowsHistory() публичный статический Метод

public static ResetWindowsHistory ( ) : void
Результат void

RouteToWindow() публичный статический Метод

public static RouteToWindow ( int dialogId ) : void
dialogId int
Результат void

SendMessage() публичный статический Метод

Send message to a window/control
public static SendMessage ( GUIMessage message ) : void
message GUIMessage message to send
Результат void

SendThreadCallback() публичный статический Метод

public static SendThreadCallback ( Callback callback, int param1, int param2, object data ) : void
callback Callback
param1 int
param2 int
data object
Результат void

SendThreadCallbackAndWait() публичный статический Метод

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
Результат int

SendThreadCallbackSkin() публичный статический Метод

public static SendThreadCallbackSkin ( Callback callback, int param1, int param2, object data ) : int
callback Callback
param1 int
param2 int
data object
Результат int

SendThreadMessage() публичный статический Метод

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
Результат void

ShowPreviousWindow() публичный статический Метод

Show previous window. When user goes back (ESC) this function will show the previous active window
public static ShowPreviousWindow ( ) : void
Результат void

ShowWarning() публичный статический Метод

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
Результат void

UnRoute() публичный статический Метод

tell the window manager to unroute the current routing
public static UnRoute ( ) : void
Результат void