From 915d0c39bd165a1e4871ac414f22c52cf44b7590 Mon Sep 17 00:00:00 2001 From: "an87.li" Date: Mon, 20 Mar 2017 06:42:12 +0800 Subject: [PATCH] Add comments for ElmSharp APIs. 1. Includes EcoreAnimator/EcoreMainloop/EcoreSynchronizationContext/Spinner/Table/Toolbar/ToolbarItem/Widget/Window Change-Id: If9e7fe5c19454208def4457985ff70e57881a1b3 Signed-off-by: an87.li --- src/ElmSharp/ElmSharp/EcoreAnimator.cs | 16 +++ src/ElmSharp/ElmSharp/EcoreMainloop.cs | 35 ++++++ .../ElmSharp/EcoreSynchronizationContext.cs | 3 +- src/ElmSharp/ElmSharp/Spinner.cs | 65 +++++++++- src/ElmSharp/ElmSharp/Table.cs | 46 ++++++- src/ElmSharp/ElmSharp/Toolbar.cs | 135 +++++++++++++++++++++ src/ElmSharp/ElmSharp/ToolbarItem.cs | 34 ++++++ src/ElmSharp/ElmSharp/Widget.cs | 133 ++++++++++++++++++++ src/ElmSharp/ElmSharp/Window.cs | 42 ++++++- 9 files changed, 503 insertions(+), 6 deletions(-) mode change 100644 => 100755 src/ElmSharp/ElmSharp/EcoreAnimator.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/EcoreMainloop.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/EcoreSynchronizationContext.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/Spinner.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/Table.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/Toolbar.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/ToolbarItem.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/Widget.cs diff --git a/src/ElmSharp/ElmSharp/EcoreAnimator.cs b/src/ElmSharp/ElmSharp/EcoreAnimator.cs old mode 100644 new mode 100755 index 200155f..a6b7992 --- a/src/ElmSharp/ElmSharp/EcoreAnimator.cs +++ b/src/ElmSharp/ElmSharp/EcoreAnimator.cs @@ -19,6 +19,9 @@ using System.Collections.Generic; namespace ElmSharp { + /// + /// EcoreAnimator is a helper class, it provides functions to manager animations. + /// public static class EcoreAnimator { static readonly Dictionary> _taskMap = new Dictionary>(); @@ -32,17 +35,30 @@ namespace ElmSharp _nativeHandler = NativeHandler; } + /// + /// Gets current system time as a floating point value in seconds. + /// + /// Current system time public static double GetCurrentTime() { return Interop.Ecore.ecore_time_get(); } + /// + /// Adds an animator to call at every animation tick during main loop execution. + /// + /// The function to call when it ticks off + /// A handle to the new animator public static IntPtr AddAmimator(Func handler) { int id = RegistHandler(handler); return Interop.Ecore.ecore_animator_add(_nativeHandler, (IntPtr)id); } + /// + /// Removes the specified animator from the animator list. + /// + /// The specified animator handle public static void RemoveAnimator(IntPtr anim) { int taskId = (int)Interop.Ecore.ecore_animator_del(anim); diff --git a/src/ElmSharp/ElmSharp/EcoreMainloop.cs b/src/ElmSharp/ElmSharp/EcoreMainloop.cs old mode 100644 new mode 100755 index 4834c75..0e880c0 --- a/src/ElmSharp/ElmSharp/EcoreMainloop.cs +++ b/src/ElmSharp/ElmSharp/EcoreMainloop.cs @@ -19,6 +19,9 @@ using System.Collections.Generic; namespace ElmSharp { + /// + /// EcoreMainloop is a helper class, it provide functions relative Ecore's main loop. + /// public static class EcoreMainloop { static readonly Dictionary> _taskMap = new Dictionary>(); @@ -34,42 +37,74 @@ namespace ElmSharp _nativeHandler = NativeHandler; } + /// + /// Checks if you are calling this function from the main thread. + /// + /// True is the calling function is the same thread, false otherwise. public static bool IsMainThread => Interop.Eina.eina_main_loop_is(); + /// + /// Runs the application main loop. + /// public static void Begin() { Interop.Ecore.ecore_main_loop_begin(); } + /// + /// Quits the main loop once all the events currently on the queue have been processed. + /// public static void Quit() { Interop.Ecore.ecore_main_loop_quit(); } + /// + /// Adds an idler handler. + /// + /// The action to call when idling public static void Post(Action task) { int id = RegistHandler(() => { task(); return false; }); Interop.Ecore.ecore_idler_add(_nativeHandler, (IntPtr)id); } + /// + /// Calls callback asynchronously in the main loop. + /// + /// The action wanted to be called public static void PostAndWakeUp(Action task) { int id = RegistHandler(() => { task(); return false; }); Interop.Ecore.ecore_main_loop_thread_safe_call_async(_nativeHandler, (IntPtr)id); } + /// + /// Calls callback synchronously in the main loop. + /// + /// The action wanted to be called public static void Send(Action task) { int id = RegistHandler(() => { task(); return false; }); Interop.Ecore.ecore_main_loop_thread_safe_call_sync(_nativeHandler, (IntPtr)id); } + /// + /// Creates a timer to call the given function in the given period of time. + /// + /// The interval in seconds. + /// The given function. + /// A timer object handler on success, NULL on failure. public static IntPtr AddTimer(double interval, Func handler) { int id = RegistHandler(handler); return Interop.Ecore.ecore_timer_add(interval, _nativeHandler, (IntPtr)id); } + /// + /// Removes the specified timer from the timer list. + /// + /// The specified timer handler public static void RemoveTimer(IntPtr id) { int taskId = (int)Interop.Ecore.ecore_timer_del(id); diff --git a/src/ElmSharp/ElmSharp/EcoreSynchronizationContext.cs b/src/ElmSharp/ElmSharp/EcoreSynchronizationContext.cs old mode 100644 new mode 100755 index a7618c4..0fa013b --- a/src/ElmSharp/ElmSharp/EcoreSynchronizationContext.cs +++ b/src/ElmSharp/ElmSharp/EcoreSynchronizationContext.cs @@ -50,8 +50,7 @@ namespace ElmSharp /// /// The SendOrPostCallback delegate to call. /// The object passed to the delegate. - /// - /// The Post method starts an asynchronous request to post a message. + /// The Post method starts an asynchronous request to post a message. public override void Post(SendOrPostCallback d, object state) { EcoreMainloop.PostAndWakeUp(() => diff --git a/src/ElmSharp/ElmSharp/Spinner.cs b/src/ElmSharp/ElmSharp/Spinner.cs old mode 100644 new mode 100755 index cc852bf..e6a12e6 --- a/src/ElmSharp/ElmSharp/Spinner.cs +++ b/src/ElmSharp/ElmSharp/Spinner.cs @@ -18,6 +18,10 @@ using System; namespace ElmSharp { + /// + /// The Spinner is a widget that increase or decrease numeric values using arrow buttons, or edit values directly. + /// Inherits . + /// public class Spinner : Layout { double _minimum = 0.0; @@ -26,6 +30,10 @@ namespace ElmSharp SmartEvent _changed; SmartEvent _delayedChanged; + /// + /// Creates and initializes a new instance of the Spinner class. + /// + /// The parent of new Spinner instance public Spinner(EvasObject parent) : base(parent) { _changed = new SmartEvent(this, this.RealHandle, "changed"); @@ -35,10 +43,19 @@ namespace ElmSharp _delayedChanged.On += (s, e) => DelayedValueChanged?.Invoke(this, EventArgs.Empty); } + /// + /// ValueChanged will be triggered whenever the spinner value is changed. + /// public event EventHandler ValueChanged; + /// + /// DelayedValueChanged will be triggered after a short time when the value is changed. + /// public event EventHandler DelayedValueChanged; + /// + /// Sets or gets the label format of the spinner. + /// public string LabelFormat { get @@ -51,6 +68,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the minimum value for the spinner. + /// public double Minimum { get @@ -64,6 +84,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the maximum value for the spinner. + /// public double Maximum { get @@ -77,6 +100,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the step that used to increment or decrement the spinner value. + /// public double Step { get @@ -89,6 +115,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the value displayed by the spinner. + /// public double Value { get @@ -101,6 +130,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the interval on time updates for an user mouse button hold on spinner widgets' arrows. + /// public double Interval { get @@ -113,6 +145,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the base for rounding. + /// public double RoundBase { get @@ -125,6 +160,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the round value for rounding. + /// public int RoundValue { get @@ -137,6 +175,14 @@ namespace ElmSharp } } + /// + /// Sets or gets the wrap of a given spinner widget. + /// + /// + /// If wrap is disabled, when the user tries to increment the value, but displayed value plus step value is bigger than maximum value, the new value will be the maximum value. + /// If wrap is enabled, when the user tries to increment the value, but displayed value plus step value is bigger than maximum value, the new value will be the minimum value. + /// By default it's disabled. + /// public bool IsWrapEnabled { get @@ -149,6 +195,10 @@ namespace ElmSharp } } + /// + /// Sets or gets whether the spinner can be directly edited by the user or not. + /// + /// By default it is enabled public bool IsEditable { get @@ -161,17 +211,30 @@ namespace ElmSharp } } - + /// + /// Set a special string to display in the place of the numerical value. + /// + /// The numerical value to be replaced + /// The label to be used public void AddSpecialValue(double value, string label) { Interop.Elementary.elm_spinner_special_value_add(RealHandle, value, label); } + /// + /// Remove a previously added special value, After this, the spinner will display the value itself instead of a label. + /// + /// The replaced numerical value public void RemoveSpecialValue(double value) { Interop.Elementary.elm_spinner_special_value_del(RealHandle, value); } + /// + /// Get the special string display in the place of the numerical value. + /// + /// The replaced numerical value. + /// The value of the spinner which replaced numerical value with special string public string GetSpecialValue(double value) { return Interop.Elementary.elm_spinner_special_value_get(RealHandle, value); diff --git a/src/ElmSharp/ElmSharp/Table.cs b/src/ElmSharp/ElmSharp/Table.cs old mode 100644 new mode 100755 index 5e14162..707a34b --- a/src/ElmSharp/ElmSharp/Table.cs +++ b/src/ElmSharp/ElmSharp/Table.cs @@ -18,15 +18,29 @@ using System; namespace ElmSharp { + /// + /// The Table is a container widget to arrange other widgets in a table where items can span multiple columns or rows . + /// Inherits . + /// public class Table : Container { int _paddingX = 0; int _paddingY = 0; + /// + /// Creates and initializes a new instance of the Table class. + /// + /// + /// A to which the new Table instance will be attached. + /// public Table(EvasObject parent) : base(parent) { } + /// + /// Sets or gets whether the layout of this table is homogeneous. + /// + /// True for homogeneous, False for no homogeneous public bool Homogeneous { get @@ -39,6 +53,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the horizontal padding between the cells. + /// public int PaddingX { get @@ -52,6 +69,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the vertical padding between the cells. + /// public int PaddingY { get @@ -64,7 +84,14 @@ namespace ElmSharp Interop.Elementary.elm_table_padding_set(RealHandle, _paddingX, _paddingY); } } - + /// + /// Adds a subobject on the table with the coordinates passed. + /// + /// The subobject to be added to the table + /// The column number + /// The row number + /// The column span + /// The row span public void Pack(EvasObject obj, int col, int row, int colspan, int rowspan) { if (obj == null) @@ -73,6 +100,10 @@ namespace ElmSharp AddChild(obj); } + /// + /// Removes the child from the table. + /// + /// The subobject public void Unpack(EvasObject obj) { if (obj == null) @@ -81,12 +112,20 @@ namespace ElmSharp RemoveChild(obj); } + /// + /// Removes all child objects from a table object. + /// public void Clear() { Interop.Elementary.elm_table_clear(RealHandle, false); ClearChildren(); } + /// + /// Sets the color for particular part of the table. + /// + /// The name of part class + /// The color public override void SetPartColor(string part, Color color) { Interop.Elementary.elm_object_color_class_color_set(Handle, part, color.R * color.A / 255, @@ -95,6 +134,11 @@ namespace ElmSharp color.A); } + /// + /// Gets the color of particular part of the table. + /// + /// The name of part class, it could be 'bg', 'elm.swllow.content' + /// The color of the particular part public override Color GetPartColor(string part) { int r, g, b, a; diff --git a/src/ElmSharp/ElmSharp/Toolbar.cs b/src/ElmSharp/ElmSharp/Toolbar.cs old mode 100644 new mode 100755 index b6424a5..63ebd93 --- a/src/ElmSharp/ElmSharp/Toolbar.cs +++ b/src/ElmSharp/ElmSharp/Toolbar.cs @@ -18,25 +18,74 @@ using System; namespace ElmSharp { + /// + /// Enumeration for the selection mode of Toolbar. + /// public enum ToolbarSelectionMode { + /// + /// Default select mode. + /// Default = 0, + + /// + /// Always select mode. + /// Always, + + /// + /// No select mode. + /// None, + + /// + /// No select mode with no finger size rule. + /// DisplayOnly, } + /// + /// Enumeration that sets the toolbar items display behavior, it can be scrollable, can show a menu with exceeding items, or simply hide them. + /// public enum ToolbarShrinkMode { + /// + /// Sets minimum toolbar size to fit all the items. + /// None = 0, + + /// + /// Hides exceeding items. + /// Hide, + + /// + /// Allows accessing exceeding items through a scroller. + /// Scroll, + + /// + /// Inserts a button to pop up a menu with exceeding items. + /// Menu, + + /// + /// Expands all items according to the size of the toolbar. + /// Expand } + /// + /// Event arguments for events of . + /// + /// + /// Inherits EventArgs. + /// public class ToolbarItemEventArgs : EventArgs { + /// + /// Gets the ToolbarItem. + /// public ToolbarItem Item { get; private set; } internal static ToolbarItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) @@ -46,11 +95,21 @@ namespace ElmSharp } } + /// + /// The Toolbar is a widget that displays a list of items inside a box. + /// public class Toolbar : Widget { SmartEvent _clicked; SmartEvent _selected; SmartEvent _longpressed; + + /// + /// Creates and initializes a new instance of the Toolbar class. + /// + /// + /// A EvasObject to which the new Table instance will be attached. + /// public Toolbar(EvasObject parent) : base(parent) { _selected = new SmartEvent(this, this.RealHandle, "selected", ToolbarItemEventArgs.CreateFromSmartEvent); @@ -74,8 +133,15 @@ namespace ElmSharp }; } + /// + /// Selected will be triggered when toolbar have been selected. + /// public event EventHandler Selected; + /// + /// Sets or gets whether the layout of this toolbar is homogeneous. + /// + /// True for homogeneous, False for no homogeneous public bool Homogeneous { get @@ -88,6 +154,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the slection mode of a given Toolbar widget. + /// public ToolbarSelectionMode SelectionMode { get @@ -100,6 +169,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the shrink mode of a given Toolbar widget. + /// public ToolbarShrinkMode ShrinkMode { get @@ -112,6 +184,10 @@ namespace ElmSharp } } + /// + /// Sets or gets the alignment of the items. + /// + /// The toolbar items alignment, a float between 0.0 and 1.0 public double ItemAlignment { get @@ -124,6 +200,13 @@ namespace ElmSharp } } + /// + /// Sets or gets the item's transverse expansion of a given toolbar widget. + /// + /// + /// The transverse expansion of the item, true for on and false for off. + /// By default it's false. + /// public bool TransverseExpansion { get @@ -136,10 +219,27 @@ namespace ElmSharp } } + /// + /// Appends ToolbarItem which just contains label to the toolbar. + /// + /// The label of the item + /// The new ToolbarItem which appended to the toolbar + /// + /// public ToolbarItem Append(string label) { return Append(label, null); } + + /// + /// Appends ToolbarItem which contains label and icon to the toolbar. + /// + /// The label of the item + /// A string with the icon name or the absolute path of an image file + /// The new ToolbarItem which appended to the toolbar + /// + /// + /// public ToolbarItem Append(string label, string icon) { ToolbarItem item = new ToolbarItem(label, icon); @@ -147,11 +247,28 @@ namespace ElmSharp return item; } + /// + /// Prepends ToolbarItem which just contains label to the toolbar. + /// + /// The label of the item + /// The new ToolbarItem which prepended to the toolbar + /// + /// + /// public ToolbarItem Prepend(string label) { return Prepend(label, null); } + /// + /// Prepends ToolbarItem which contains label and icon to the toolbar. + /// + /// The label of the item + /// A string with the icon name or the absolute path of an image file + /// The new which prepended to the toolbar + /// + /// + /// public ToolbarItem Prepend(string label, string icon) { ToolbarItem item = new ToolbarItem(label, icon); @@ -159,11 +276,26 @@ namespace ElmSharp return item; } + /// + /// Inserts a new item which just contains label into the toolbar object before item . + /// + /// The toolbar item to insert before + /// The label of the item + /// The new which insert into the toolbar + /// public ToolbarItem InsertBefore(ToolbarItem before, string label) { return InsertBefore(before, label); } + /// + /// Inserts a new item which contains label and icon into the toolbar object before item . + /// + /// The toolbar item to insert before + /// The label of the item + /// A string with the icon name or the absolute path of an image file + /// The new which insert into the toolbar + /// public ToolbarItem InsertBefore(ToolbarItem before, string label, string icon) { ToolbarItem item = new ToolbarItem(label, icon); @@ -171,6 +303,9 @@ namespace ElmSharp return item; } + /// + /// Gets the selected ToolbarItemItem of the toolbar. + /// public ToolbarItem SelectedItem { get diff --git a/src/ElmSharp/ElmSharp/ToolbarItem.cs b/src/ElmSharp/ElmSharp/ToolbarItem.cs old mode 100644 new mode 100755 index 72075dd..8cdc3be --- a/src/ElmSharp/ElmSharp/ToolbarItem.cs +++ b/src/ElmSharp/ElmSharp/ToolbarItem.cs @@ -18,6 +18,9 @@ using System; namespace ElmSharp { + /// + /// The ToolbarItem is a item of Toolbar. + /// public class ToolbarItem : ItemObject { string _icon; @@ -28,6 +31,9 @@ namespace ElmSharp _icon = icon; } + /// + /// Sets or gets the icon path of the item. + /// public string Icon { get @@ -40,6 +46,10 @@ namespace ElmSharp Interop.Elementary.elm_toolbar_item_icon_set(Handle, value); } } + + /// + /// Sets or gets the text string of the item. + /// public string Text { get @@ -52,6 +62,10 @@ namespace ElmSharp SetPartText(null, value); } } + + /// + /// Sets or gets the enable of the item. + /// public bool Enabled { get @@ -63,6 +77,11 @@ namespace ElmSharp Interop.Elementary.elm_object_disabled_set(Handle, !value); } } + + /// + /// Sets or gets whether displaying the item as a separator. + /// + /// Items aren't set as a separator by default. If set as a separator it displays a separator theme, so it won't display icons or labels. public bool IsSeparator { get @@ -74,6 +93,10 @@ namespace ElmSharp Interop.Elementary.elm_toolbar_item_separator_set(Handle, value); } } + + /// + /// Sets or gets whether the item is selected. + /// public bool IsSelected { get @@ -86,8 +109,19 @@ namespace ElmSharp } } + /// + /// Selected will be triggered when the item is selected. + /// public event EventHandler Selected; + + /// + /// LongPressed will be triggered when the item is pressed long time. + /// public event EventHandler LongPressed; + + /// + /// Clicked will be triggered when the item is clicked. + /// public event EventHandler Clicked; internal void SendSelected() diff --git a/src/ElmSharp/ElmSharp/Widget.cs b/src/ElmSharp/ElmSharp/Widget.cs old mode 100644 new mode 100755 index 06df4db..f963191 --- a/src/ElmSharp/ElmSharp/Widget.cs +++ b/src/ElmSharp/ElmSharp/Widget.cs @@ -19,16 +19,41 @@ using System.Collections.Generic; namespace ElmSharp { + /// + /// Enumeration for the focus direction. + /// public enum FocusDirection { + /// + /// Previous direction + /// Previous, + /// + /// Next direction + /// Next, + /// + /// Up direction + /// Up, + /// + /// Down direction + /// Down, + /// + /// Right direction + /// Right, + /// + /// Left direction + /// Left } + /// + /// The Widget is abstract class, it is the parent of other widgets. + /// Inherits from . + /// public abstract class Widget : EvasObject { Dictionary _partContents = new Dictionary(); @@ -43,6 +68,10 @@ namespace ElmSharp { } + /// + /// Creates and initializes a new instance of the Widget class. + /// + /// The parent of new Widget instance protected Widget(EvasObject parent) : base(parent) { _focused = new SmartEvent(this, "focused"); @@ -52,10 +81,19 @@ namespace ElmSharp _unfocused.On += (s, e) => Unfocused?.Invoke(this, EventArgs.Empty); } + /// + /// Focused will be triggered when the widget is focused. + /// public event EventHandler Focused; + /// + /// Unfocused will be triggered when the widget is unfocused. + /// public event EventHandler Unfocused; + /// + /// Sets or gets the state of the widget, which might be enabled or disabled. + /// public bool IsEnabled { get @@ -68,6 +106,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the style of the widget. + /// public string Style { get @@ -80,6 +121,9 @@ namespace ElmSharp } } + /// + /// Gets whether this widget is focused. + /// public bool IsFocused { get @@ -88,6 +132,10 @@ namespace ElmSharp } } + /// + /// Gets whether a widget is focusable or not. + /// + /// Widgets which are meant to be interacted with by input events are created able to be focused, by default public bool IsFocusAllowed { get @@ -96,6 +144,10 @@ namespace ElmSharp } } + /// + /// Sets or gets the text of the widget. + /// + /// It could be override by special child class public virtual string Text { get @@ -108,6 +160,10 @@ namespace ElmSharp } } + /// + /// Sets or gets the background color of the widget. + /// + /// It could be override by special child class public virtual Color BackgroundColor { get @@ -132,6 +188,10 @@ namespace ElmSharp } } + /// + /// Sets or gets the opacity of the widget. + /// + /// It could be override by special child class public virtual int Opacity { get @@ -149,31 +209,61 @@ namespace ElmSharp } } + /// + /// Sets the widget to be focused or not. + /// + /// Weather be focused public void SetFocus(bool isFocus) { Interop.Elementary.elm_object_focus_set(RealHandle, isFocus); } + /// + /// Sets the ability for a widget to be focused. + /// + /// True if the object can be focused, false if not(and on errors) public void AllowFocus(bool isAllowFocus) { Interop.Elementary.elm_object_focus_allow_set(RealHandle, isAllowFocus); } + /// + /// Gives focus to next widget in widget tree. + /// + /// Direction to move the focus public void FocusNext(FocusDirection direction) { Interop.Elementary.elm_object_focus_next(RealHandle, (int)direction); } + /// + /// Set next widget with specific focus direction. + /// + /// Focus next widget + /// Focus direction public void SetNextFocusObject(EvasObject next, FocusDirection direction) { Interop.Elementary.elm_object_focus_next_object_set(RealHandle, next.RealHandle, (int)direction); } + /// + /// Sets content to particular part of the widget, and the preserve old content will not be unset. + /// + /// The name of particular part + /// The content + /// public void SetPartContent(string part, EvasObject content) { SetPartContent(part, content, false); } + /// + /// Sets content to particular part of the widget. + /// + /// The name of particular part + /// The content + /// true, preserve old content will be unset. false, preserve old content will not be unset. + /// public void SetPartContent(string part, EvasObject content, bool preserveOldContent) { if (preserveOldContent) @@ -185,11 +275,22 @@ namespace ElmSharp _partContents[part ?? "__default__"] = content; } + /// + /// Sets content to the widget, and the preserve old content will not be unset. + /// + /// The content + /// public void SetContent(EvasObject content) { SetContent(content, false); } + /// + /// Sets content the widget. + /// + /// The content + /// true, preserve old content will be unset. false, preserve old content will not be unset. + /// public void SetContent(EvasObject content, bool preserveOldContent) { if (preserveOldContent) @@ -201,16 +302,32 @@ namespace ElmSharp _partContents["__default__"] = content; } + /// + /// Sets text to particular part of the widget. + /// + /// The name of particular part + /// The text public void SetPartText(string part, string text) { Interop.Elementary.elm_object_part_text_set(RealHandle, part, text); } + /// + /// Gets text of a particular part of the widget. + /// + /// The name of particular part + /// Text of the particular part of the widget public string GetPartText(string part) { return Interop.Elementary.elm_object_part_text_get(RealHandle, part); } + /// + /// Sets color of a particular part of the widget. + /// + /// The name of particular part + /// The color be set to widget + /// This method is a virtual method, it could be override by special child class public virtual void SetPartColor(string part, Color color) { Interop.Elementary.elm_object_color_class_color_set(RealHandle, part, color.R * color.A / 255, @@ -219,6 +336,12 @@ namespace ElmSharp color.A); } + /// + /// Gets color of the particular part of the widget. + /// + /// The name of particular part + /// The color of the particular part + /// This method is a virtual method, it could be override by special child class public virtual Color GetPartColor(string part) { int r, g, b, a; @@ -226,11 +349,21 @@ namespace ElmSharp return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a); } + /// + /// Sets opacity of the particular part of the widget. + /// + /// The name of particular part + /// The opacity of the particular part public void SetPartOpacity(string part, int opacity) { Interop.Elementary.elm_object_color_class_color_set(Handle, part, 255, 255, 255, opacity); } + /// + /// Gets opacity of the particular part of the widget. + /// + /// The name of particular part + /// Opacity value of the particular part public int GetPartOpacity(string part) { int r, g, b, a; diff --git a/src/ElmSharp/ElmSharp/Window.cs b/src/ElmSharp/ElmSharp/Window.cs index 6c71fcf..3dd0532 100755 --- a/src/ElmSharp/ElmSharp/Window.cs +++ b/src/ElmSharp/ElmSharp/Window.cs @@ -19,12 +19,27 @@ using System.Collections.Generic; namespace ElmSharp { + /// + /// Enumeration for the display rotation of window. + /// [Flags] public enum DisplayRotation { + /// + /// Rotation value of window is 0 degree + /// Degree_0 = 1, + /// + /// Rotation value of window is 90 degree + /// Degree_90 = 2, + /// + /// Rotation value of window is 180 degree + /// Degree_180 = 4, + /// + /// Rotation value of window is 270 degree + /// Degree_270 = 8 }; @@ -152,7 +167,7 @@ namespace ElmSharp } /// - /// Sets or gets value whether rotation is supported. + /// Gets whether window manager supports window rotation or not. /// public bool IsRotationSupported { @@ -206,6 +221,13 @@ namespace ElmSharp } } + /// + /// Sets or gets the alpha channel state of a window. + /// + /// + /// 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. + /// public bool Alpha { get @@ -218,6 +240,12 @@ namespace ElmSharp } } + /// + /// Sets or gets the role of the window. + /// + /// + /// The Role will be invalid if a new role is set or if the window is destroyed. + /// public string Role { get @@ -230,6 +258,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the mode of status bar. + /// public StatusBarMode StatusBarMode { get @@ -273,11 +304,19 @@ namespace ElmSharp } + /// + /// Set the keygrab of the window. + /// + /// keyname string to set keygrab public void KeyGrabEx(string keyname) { Interop.Elementary.eext_win_keygrab_set(RealHandle, keyname); } + /// + /// Unset the keygrab of the window. + /// + /// keyname string to unset keygrab public void KeyUngrabEx(string keyname) { Interop.Elementary.eext_win_keygrab_unset(RealHandle, keyname); @@ -299,7 +338,6 @@ namespace ElmSharp _referenceHolder.Remove(obj); } - /// static int[] ConvertDegreeArray(DisplayRotation value) { List rotations = new List(); -- 2.7.4