Class Window

Definition

Namespace:
ElmSharp
Assembly:
ElmSharp.dll
API Level:
preview

The Window is a container that contains the graphical user interface of a program.

C#
Copy
public class Window : Widget, IAccessibleObject
Inheritance
Derived
ElmSharp.PreloadedWindow
Implements

Constructors

View Source

Window()

Creates and initializes a new instance of the Window class.

Declaration
C#
Copy
protected Window()
API Level: preview
View Source

Window(Window, String)

Creates and initializes a new instance of the Window class.

Declaration
C#
Copy
public Window(Window parent, string name)
Parameters
Type Name Description
Window parent

Parent widget which this window is created on.

System.String name

Window name.

Remarks

Window constructor.show window indicator, set callback when closing the window in any way outside the program control, and set callback when window rotation is changed.

API Level: preview
View Source

Window(Window, String, WindowType)

Creates and initializes a new instance of the Window class.

Declaration
C#
Copy
public Window(Window parent, string name, WindowType type)
Parameters
Type Name Description
Window parent

Parent widget which this window is created on.

System.String name

Window name.

WindowType type

Window type.

Remarks

Window constructor.show window indicator, set callback when closing the window in any way outside the program control, and set callback when window rotation is changed.

API Level: preview
View Source

Window(String)

Creates and initializes a new instance of the Window class.

Declaration
C#
Copy
public Window(string name)
Parameters
Type Name Description
System.String name

Window name.

API Level: preview

Properties

View Source

AavailableRotations

Sets or gets the available rotation degree.

Declaration
C#
Copy
[Obsolete("Sorry, it's error typo of AvailableRotations, please use AvailableRotations")] public DisplayRotation AavailableRotations { get; set; }
Property Value
Type Description
DisplayRotation
API Level: preview
View Source

Alpha

Sets or gets the alpha channel state of the window.

Declaration
C#
Copy
public bool Alpha { get; set; }
Property Value
Type Description
Boolean
Remarks

true if the window alpha channel is enabled, false otherwise. If alpha is true, the alpha channel of the canvas will be enabled possibly making parts of the window completely or partially transparent.

API Level: preview
View Source

Aspect

Gets or sets the aspect ratio of the window.

Declaration
C#
Copy
public double Aspect { get; set; }
Property Value
Type Description
Double
API Level: preview
View Source

AutoDeletion

Sets or gets whether the auto deletion function is enabled.

Declaration
C#
Copy
public bool AutoDeletion { get; set; }
Property Value
Type Description
Boolean
Remarks

If you enable auto deletion, the window is automatically destroyed after the signal is emitted. If auto deletion is disabled, the window is not destroyed and the program has to handle it.

API Level: preview
View Source

AutoHide

Window's autohide state.

Declaration
C#
Copy
public bool AutoHide { get; set; }
Property Value
Type Description
Boolean
API Level: preview
View Source

AvailableRotations

Sets or gets the available rotation degree.

Declaration
C#
Copy
public DisplayRotation AvailableRotations { get; set; }
Property Value
Type Description
DisplayRotation
API Level: preview
View Source

BaseSize

Gets or sets the base size of the window.

Declaration
C#
Copy
public Size BaseSize { get; set; }
Property Value
Type Description
Size
API Level: preview
View Source

Borderless

Gets the borderless state of the window. This function requests the Window Manager to not draw any decoration around the window.

Declaration
C#
Copy
public bool Borderless { get; set; }
Property Value
Type Description
Boolean
API Level: preview
View Source

DemandAttention

Gets or sets the demand attention state of the window.

Declaration
C#
Copy
public bool DemandAttention { get; set; }
Property Value
Type Description
Boolean
API Level: preview
View Source

FloatingMode

Gets or sets the floating mode of the window.

Declaration
C#
Copy
public bool FloatingMode { get; set; }
Property Value
Type Description
Boolean
API Level: preview
View Source

FocusHighlightAnimation

Gets or sets the animate status for the focus highlight for this window. This function will enable or disable the animation of focus highlight only for the given window, regardless of the global setting for it.

Declaration
C#
Copy
public bool FocusHighlightAnimation { get; set; }
Property Value
Type Description
Boolean
API Level: preview
View Source

FocusHighlightEnabled

Gets or sets the enabled status for the focus highlight in the window. This function will enable or disable the focus highlight only for the given window, regardless of the global setting for it.

Declaration
C#
Copy
public bool FocusHighlightEnabled { get; set; }
Property Value
Type Description
Boolean
API Level: preview
View Source

FocusHighlightStyle

Gets or sets the style for the focus highlight on this window. Sets the style to use for theming the highlight of focused objects on the given window. If style is NULL, the default will be used.

Declaration
C#
Copy
public string FocusHighlightStyle { get; set; }
Property Value
Type Description
System.String
API Level: preview
View Source

IndicatorMode

Gets or sets the window's indicator mode.

Declaration
C#
Copy
public IndicatorMode IndicatorMode { get; set; }
Property Value
Type Description
IndicatorMode

The indicator mode.

API Level: preview
View Source

IsRotationSupported

Gets whether the window manager supports window rotation or not.

Declaration
C#
Copy
public bool IsRotationSupported { get; }
Property Value
Type Description
Boolean
API Level: preview
View Source

KeyboardMode

Gets the keyboard mode of the window.

Declaration
C#
Copy
public KeyboardMode KeyboardMode { get; set; }
Property Value
Type Description
KeyboardMode
API Level: preview
View Source

Layer

Gets or sets the layer of the window. What this means exactly will depend on the underlying engine used. In the case of X11 backed engines, the value in layer has the following meanings: less than 3 means that the window will be placed below all others, more than 5 means that the window will be placed above all others, and anything else means that the window will be placed in the default layer.

Declaration
C#
Copy
public override int Layer { get; set; }
Property Value
Type Description
System.Int32
Overrides
API Level: preview
View Source

Modal

Gets or sets the modal state of the window.

Declaration
C#
Copy
public bool Modal { get; set; }
Property Value
Type Description
Boolean
API Level: preview
View Source

Name

Sets or gets the window name.

Declaration
C#
Copy
public string Name { get; set; }
Property Value
Type Description
System.String
API Level: preview
View Source

NoBlank

Gets or sets the noblank property of the window. This is a way to request the display on which the window is shown is not blank, screensave, or otherwise hidden or obscure. It is intended for use such as media playback on a television where a user may not want to be interrupted by an idle screen. The noblank property may have no effect if the window is iconified/minimized or hidden.

Declaration
C#
Copy
public bool NoBlank { get; set; }
Property Value
Type Description
Boolean
API Level: preview
View Source

Profile

Gets the profile of the window.

Declaration
C#
Copy
public string Profile { get; set; }
Property Value
Type Description
System.String
API Level: preview
View Source

Role

Sets or gets the role of the window.

Declaration
C#
Copy
public string Role { get; set; }
Property Value
Type Description
System.String
Remarks

The Role will be invalid if a new role is set or if the window is destroyed.

API Level: preview
View Source

Rotation

Gets the rotation of the window. The rotation of the window in degrees (0-360).

Declaration
C#
Copy
public int Rotation { get; }
Property Value
Type Description
System.Int32
API Level: preview
View Source

ScreenConstrain

Gets the constraints on the maximum width and height of the window relative to the width and height of its screen. When this function returns true, object will never resize larger than the screen.

Declaration
C#
Copy
public bool ScreenConstrain { get; set; }
Property Value
Type Description
Boolean
API Level: preview
View Source

ScreenDpi

Gets the screen dpi for the screen that the window is on.

Declaration
C#
Copy
public Point ScreenDpi { get; }
Property Value
Type Description
Point
API Level: preview
View Source

ScreenPositionX

Gets the screen position X of a window.

Declaration
C#
Copy
public int ScreenPositionX { get; }
Property Value
Type Description
System.Int32
API Level: preview
View Source

ScreenPositionY

Gets the screen position Y of a window.

Declaration
C#
Copy
public int ScreenPositionY { get; }
Property Value
Type Description
System.Int32
API Level: preview
View Source

ScreenSize

Gets the window size with Size value(w,h)

Declaration
C#
Copy
public Size ScreenSize { get; }
Property Value
Type Description
Size
API Level: preview
View Source

StatusBarMode

Sets or gets the mode of the status bar.

Declaration
C#
Copy
public StatusBarMode StatusBarMode { get; set; }
Property Value
Type Description
StatusBarMode
API Level: preview
View Source

StepSize

Gets or sets the step size of the window.

Declaration
C#
Copy
public Size StepSize { get; set; }
Property Value
Type Description
Size
API Level: preview
View Source

Title

Gets or sets the title of the window.

Declaration
C#
Copy
public string Title { get; set; }
Property Value
Type Description
System.String
API Level: preview
View Source

Type

Gets the window type.

Declaration
C#
Copy
public WindowType Type { get; }
Property Value
Type Description
WindowType
API Level: preview
View Source

Urgent

Gets or sets the urgent state of the window.

Declaration
C#
Copy
public bool Urgent { get; set; }
Property Value
Type Description
Boolean
API Level: preview
View Source

Withdrawn

Gets or sets the withdrawn state of the window.

Declaration
C#
Copy
public bool Withdrawn { get; set; }
Property Value
Type Description
Boolean
API Level: preview

Methods

View Source

Active()

This function sends a request to the Windows Manager to activate the window. If honored by the Windows Manager, the window receives the keyboard focus.

Declaration
C#
Copy
public void Active()
Remarks

This is just a request that the Windows Manager may ignore, so calling this function does not ensure in any way that the window is going to be the active one after it.

API Level: preview
View Source

AddResizeObject(EvasObject)

Adds an object as a resize object of the window.

Declaration
C#
Copy
public void AddResizeObject(EvasObject obj)
Parameters
Type Name Description
EvasObject obj

Resize object.

Remarks

Setting an object as a resize object of the window means that the object child's size and position is controlled by the window directly. That is, the object is resized to match the window size and should never be moved or resized manually by the developer. In addition, resize objects of the window control the minimum size of it as well as whether it can or cannot be resized by the user.

API Level: preview
View Source

BringDown()

Brings down the window object. Places the window pointed by object at the bottom of the stack, so that no other window is covered by it.

Declaration
C#
Copy
public void BringDown()
API Level: preview
View Source

CreateHandle(EvasObject)

Creates a widget handle.

Declaration
C#
Copy
protected override IntPtr CreateHandle(EvasObject parent)
Parameters
Type Name Description
EvasObject parent

Parent EvasObject.

Returns
Type Description
IntPtr

Handle IntPtr.

Overrides
API Level: preview
View Source

CreateServiceSocket(String, Int32, Boolean)

Creates a socket to provide the service for the Plug widget.

Declaration
C#
Copy
public bool CreateServiceSocket(string name, int number, bool systemWide)
Parameters
Type Name Description
System.String name

A service name.

System.Int32 number

A number (any value, 0 being the common default) to differentiate multiple instances of services with the same name.

Boolean systemWide

A boolean that if true, specifies to create a system-wide service all users can connect to, otherwise the service is private to the user ID that created the service.

Returns
Type Description
Boolean

If true creates successful, otherwise false.

API Level: preview
View Source

DeleteResizeObject(EvasObject)

Deletes the subobj as a resize object of the window object. This function removes the object subobj from the resize objects of the window object. It will not delete the object itself, which will be left unmanaged and should be deleted by the developer, manually handled, or set as child of some other container.

Declaration
C#
Copy
public void DeleteResizeObject(EvasObject obj)
Parameters
Type Name Description
EvasObject obj

Resize object.

API Level: preview
View Source

FocusSkip(Boolean)

Sets the window to be skipped by focus. This sets the window to be skipped by normal input. This means the Windows Manager will be asked to not focus this window as well as omit it from things like the taskbar, pager etc. Call this and enable it on the window BEFORE you show it for the first time, otherwise it may have no effect. Use this for windows that have only output information or might only be interacted with by the mouse or fingers, and never for typing input. Be careful that this may have side-effects like making the window non-accessible in some cases unless the window is specially handled. Use this with care.

Declaration
C#
Copy
public void FocusSkip(bool skip)
Parameters
Type Name Description
Boolean skip
API Level: preview
View Source

KeyGrabEx(String)

Sets the keygrab of the window.

Declaration
C#
Copy
public void KeyGrabEx(string keyname)
Parameters
Type Name Description
System.String keyname

The keyname string to set keygrab.

API Level: preview
View Source

KeyUngrabEx(String)

Unsets the keygrab of the window.

Declaration
C#
Copy
public void KeyUngrabEx(string keyname)
Parameters
Type Name Description
System.String keyname

The keyname string to unset keygrab.

API Level: preview
View Source

PullUp()

Pulls up the window object. Places the window pointed by object at the top of the stack, so that it's not covered by any other window.

Declaration
C#
Copy
public void PullUp()
API Level: preview
View Source

SetRotation(Int32, Boolean)

Sets the rotation of the window.

Declaration
C#
Copy
public void SetRotation(int degree, bool resize)
Parameters
Type Name Description
System.Int32 degree

The rotation of the window, in degrees (0-360), counter-clockwise.

Boolean resize

Resizes the window's contents so that they fit inside the current window geometry.

API Level: preview

Events

View Source

CloseRequested

CloseRequested will be triggered when window is closed.

Declaration
C#
Copy
public event EventHandler CloseRequested
Event Type
Type Description
System.EventHandler
API Level: preview
View Source

RotationChanged

RotationChanged will be triggered when window is rotated.

Declaration
C#
Copy
public event EventHandler RotationChanged
Event Type
Type Description
System.EventHandler
API Level: preview

Implements

Extension Methods