summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ElmSharp.Test/TC/GenGridTest1.cs10
-rw-r--r--ElmSharp/ElmSharp/GenGrid.cs156
-rw-r--r--[-rwxr-xr-x]ElmSharp/ElmSharp/GenGridItem.cs132
-rw-r--r--[-rwxr-xr-x]ElmSharp/ElmSharp/GenItem.cs67
-rw-r--r--[-rwxr-xr-x]ElmSharp/ElmSharp/GenItemClass.cs60
-rw-r--r--[-rwxr-xr-x]ElmSharp/ElmSharp/GenList.cs196
-rw-r--r--ElmSharp/ElmSharp/GenListItem.cs171
-rw-r--r--[-rwxr-xr-x]ElmSharp/ElmSharp/ItemObject.cs7
-rw-r--r--ElmSharp/Interop/Interop.Elementary.GenGridView.cs55
-rw-r--r--ElmSharp/Interop/Interop.Elementary.GenListView.cs75
-rw-r--r--[-rwxr-xr-x]ElmSharp/Interop/Interop.Elementary.Index.cs3
-rw-r--r--ElmSharp/Interop/Interop.Elementary.Item.cs116
-rwxr-xr-xElmSharp/Interop/Interop.Elementary.cs84
13 files changed, 956 insertions, 176 deletions
diff --git a/ElmSharp.Test/TC/GenGridTest1.cs b/ElmSharp.Test/TC/GenGridTest1.cs
index cbfc18e..da4752e 100644
--- a/ElmSharp.Test/TC/GenGridTest1.cs
+++ b/ElmSharp.Test/TC/GenGridTest1.cs
@@ -66,14 +66,20 @@ namespace ElmSharp.Test
};
var rnd = new Random();
- for (int i = 0; i < 102; i++)
+ for (int i = 0; i < 10; i++)
{
int r = rnd.Next(255);
int g = rnd.Next(255);
int b = rnd.Next(255);
Color color = Color.FromRgb(r, g, b);
- grid.Append(defaultClass, color);
+ var griditem = grid.Append(defaultClass, color);
+ griditem.SetTooltipText("AAAAAA");
+ //griditem.TooltipStyle = "transparent";
+
+ griditem.TooltipContentDelegate = () => { return new Button(window); };
+
}
+
grid.Show();
conformant.SetContent(grid);
}
diff --git a/ElmSharp/ElmSharp/GenGrid.cs b/ElmSharp/ElmSharp/GenGrid.cs
index 4566fb4..b5effb0 100644
--- a/ElmSharp/ElmSharp/GenGrid.cs
+++ b/ElmSharp/ElmSharp/GenGrid.cs
@@ -20,36 +20,6 @@ using System.Collections.Generic;
namespace ElmSharp
{
/// <summary>
- /// Enumeration for setting selection mode for GenGird.
- /// </summary>
- public enum GenGridSelectionMode
- {
- /// <summary>
- /// The item will only call their selection func and callback when first becoming selected.
- /// Any further clicks will do nothing, unless you set Always select mode.
- /// </summary>
- Default = 0,
-
- /// <summary>
- /// This means that, even if selected, every click will make the selected callbacks be called.
- /// </summary>
- Always,
-
- /// <summary>
- /// This will turn off the ability to select the item entirely and they will neither appear selected nor call selected callback functions.
- /// </summary>
- None,
-
- /// <summary>
- /// This will apply no-finger-size rule with DisplayOnly.
- /// No-finger-size rule makes an item can be smaller than lower limit.
- /// Clickable objects should be bigger than human touch point device (your finger) for some touch or small screen devices.
- /// So it is enabled, the item can be shrink than predefined finger-size value. And the item will be updated.
- /// </summary>
- DisplayOnly,
- }
-
- /// <summary>
/// It inherits System.EventArgs.
/// It contains Item which is <see cref="GenGridItem"/> type.
/// All events of GenGrid contain GenGridItemEventArgs as a parameter.
@@ -274,11 +244,11 @@ namespace ElmSharp
/// <summary>
/// Gets or sets the gengrid select mode by <see cref="GenGridSelectionMode"/>.
/// </summary>
- public GenGridSelectionMode SelectionMode
+ public GenItemSelectionMode SelectionMode
{
get
{
- return (GenGridSelectionMode)Interop.Elementary.elm_gengrid_select_mode_get(RealHandle);
+ return (GenItemSelectionMode)Interop.Elementary.elm_gengrid_select_mode_get(RealHandle);
}
set
{
@@ -365,6 +335,68 @@ namespace ElmSharp
}
/// <summary>
+ /// Gets the first item in a given gengrid widget.
+ /// </summary>
+ public GenGridItem FirstItem
+ {
+ get
+ {
+ IntPtr handle = Interop.Elementary.elm_gengrid_first_item_get(RealHandle);
+ return ItemObject.GetItemByHandle(handle) as GenGridItem;
+ }
+ }
+
+ /// <summary>
+ /// Gets the last item in a given gengrid widget.
+ /// </summary>
+ public GenGridItem LastItem
+ {
+ get
+ {
+ IntPtr handle = Interop.Elementary.elm_gengrid_last_item_get(RealHandle);
+ return ItemObject.GetItemByHandle(handle) as GenGridItem;
+ }
+ }
+
+ /// <summary>
+ /// Gets the items count in a given gengrid widget.
+ /// </summary>
+ public uint ItemCount
+ {
+ get
+ {
+ return Interop.Elementary.elm_gengrid_items_count(RealHandle);
+ }
+ }
+
+ /// <summary>
+ /// Gets the selected item in a given gengrid widget.
+ /// </summary>
+ public GenGridItem SelectedItem
+ {
+ get
+ {
+ IntPtr handle = Interop.Elementary.elm_gengrid_selected_item_get(RealHandle);
+ return ItemObject.GetItemByHandle(handle) as GenGridItem;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets whether a given gengrid widget is or not able have items reordered.
+ /// </summary>
+ public bool ReorderMode
+ {
+ get
+ {
+ return Interop.Elementary.elm_gengrid_reorder_mode_get(RealHandle);
+ }
+ set
+ {
+ Interop.Elementary.elm_gengrid_reorder_mode_set(RealHandle, value);
+ }
+ }
+
+ /// <summary>
/// Appends a new item to a given gengrid widget. This adds an item to the end of the gengrid.
/// </summary>
/// <param name="itemClass">The itemClass defines how to display the data.</param>
@@ -417,6 +449,48 @@ namespace ElmSharp
}
/// <summary>
+ /// Inserts an item before another in a gengrid widget. This inserts an item after another in the gengrid.
+ /// </summary>
+ /// <param name="itemClass">The itemClass defines how to display the data.</param>
+ /// <param name="data">The item data.</param>
+ /// <param name="after">The item after which to place this new one.</param>
+ /// <returns>Return a gengrid item that contains data and itemClass.</returns>
+ /// <seealso cref="GenItemClass"/>
+ /// <seealso cref="GenGridItem"/>
+ public GenGridItem InsertAfter(GenItemClass itemClass, object data, GenGridItem after)
+ {
+ GenGridItem item = new GenGridItem(data, itemClass);
+ IntPtr handle = Interop.Elementary.elm_gengrid_item_insert_after(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, after, null, (IntPtr)item.Id);
+ item.Handle = handle;
+ AddInternal(item);
+ return item;
+ }
+
+ /// <summary>
+ /// Insert an item in a gengrid widget using a user-defined sort function.
+ /// </summary>
+ /// <param name="itemClass">The itemClass defines how to display the data.</param>
+ /// <param name="data">The item data.</param>
+ /// <param name="func">User defined comparison function that defines the sort order based on gengrid item and its data.</param>
+ /// <returns>Return a gengrid item that contains data and itemClass.</returns>
+ public GenGridItem InsertSorted(GenItemClass itemClass, object data, Comparison<GenGridItem> comparison)
+ {
+ Interop.Elementary.Eina_Compare_Cb compareCallback = (handle1, handle2) =>
+ {
+ GenGridItem item1 = ItemObject.GetItemByHandle(handle1) as GenGridItem;
+ GenGridItem item2 = ItemObject.GetItemByHandle(handle2) as GenGridItem;
+ return comparison(item1, item2);
+ };
+
+ GenGridItem item = new GenGridItem(data, itemClass);
+
+ IntPtr handle = Interop.Elementary.elm_gengrid_item_sorted_insert(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, compareCallback, null, (IntPtr)item.Id);
+ item.Handle = handle;
+ AddInternal(item);
+ return item;
+ }
+
+ /// <summary>
/// Shows a given item to the visible area of a gengrid.
/// </summary>
/// <param name="item">The gengrid item to display.</param>
@@ -464,6 +538,24 @@ namespace ElmSharp
Interop.Elementary.elm_gengrid_clear(RealHandle);
}
+ /// <summary>
+ /// Get the item that is at the x, y canvas coords.
+ /// </summary>
+ /// <param name="x">The input x coordinate</param>
+ /// <param name="y">The input y coordinate</param>
+ /// <param name="positionX">The position relative to the item returned here.
+ /// -1, 0 or 1, depending if the coordinate is on the left portion of that item(-1), on the middle section(0) or on the right part(1).
+ /// </param>
+ /// <param name="positionY">The position relative to the item returned here
+ /// -1, 0 or 1, depending if the coordinate is on the upper portion of that item (-1), on the middle section (0) or on the lower part (1).
+ /// </param>
+ /// <returns></returns>
+ public GenGridItem GetItemByPosition(int x, int y, out int portionX, out int portionY)
+ {
+ IntPtr handle = Interop.Elementary.elm_gengrid_at_xy_item_get(RealHandle, x, y, out portionX, out portionY);
+ return ItemObject.GetItemByHandle(handle) as GenGridItem;
+ }
+
protected override IntPtr CreateHandle(EvasObject parent)
{
IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
diff --git a/ElmSharp/ElmSharp/GenGridItem.cs b/ElmSharp/ElmSharp/GenGridItem.cs
index 1ce34cd..66b451f 100755..100644
--- a/ElmSharp/ElmSharp/GenGridItem.cs
+++ b/ElmSharp/ElmSharp/GenGridItem.cs
@@ -15,6 +15,7 @@
*/
using System;
+using System.ComponentModel;
namespace ElmSharp
{
@@ -50,6 +51,127 @@ namespace ElmSharp
}
/// <summary>
+ /// Gets or sets the type of mouse pointer/cursor decoration to be shown, when the mouse pointer is over the given gengrid widget item.
+ /// <remarks>
+ /// The cursor's changing area is restricted to the item's area, and not the whole widget's. Note that that item cursors have precedence over widget cursors, so that a mouse over item will always show cursor type.
+ /// </remarks>>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override string Cursor
+ {
+ get
+ {
+ return Interop.Elementary.elm_gengrid_item_cursor_get(Handle);
+ }
+ set
+ {
+ if (!string.IsNullOrEmpty(value))
+ {
+ Interop.Elementary.elm_gengrid_item_cursor_set(Handle, value);
+ }
+ else
+ {
+ Interop.Elementary.elm_gengrid_item_cursor_unset(Handle);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets custom cursor for gengrid item.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override string CursorStyle
+ {
+ get
+ {
+ return Interop.Elementary.elm_gengrid_item_cursor_style_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_gengrid_item_cursor_style_set(Handle, value);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets whether to rely on the rendering engine.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool IsUseEngineCursor
+ {
+ get
+ {
+ return Interop.Elementary.elm_gengrid_item_cursor_engine_only_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_gengrid_item_cursor_engine_only_set(Handle, value);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the style of given gengrid item's tooltip.
+ /// </summary>
+ public override string TooltipStyle
+ {
+ get
+ {
+ return Interop.Elementary.elm_gengrid_item_tooltip_style_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_gengrid_item_tooltip_style_set(Handle, value);
+ }
+ }
+
+ public override GenItemSelectionMode SelectionMode
+ {
+ get
+ {
+ return (GenItemSelectionMode)Interop.Elementary.elm_gengrid_item_select_mode_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_gengrid_item_select_mode_set(Handle, (Interop.Elementary.Elm_Object_Select_Mode)value);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets gengrid item's row position, relative to the whole gengrid's grid area.
+ /// </summary>
+ public int Row
+ {
+ get
+ {
+ int row, column;
+ Interop.Elementary.elm_gengrid_item_pos_get(Handle, out row, out column);
+ return row;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets gengrid item's column position, relative to the whole gengrid's grid area.
+ /// </summary>
+ public int Column
+ {
+ get
+ {
+ int row, column;
+ Interop.Elementary.elm_gengrid_item_pos_get(Handle, out row, out column);
+ return column;
+ }
+ }
+
+ public override void SetTooltipText(string tooltip)
+ {
+ Interop.Elementary.elm_gengrid_item_tooltip_text_set(Handle, tooltip);
+ }
+
+ public override void UnsetTooltip()
+ {
+ Interop.Elementary.elm_gengrid_item_tooltip_unset(Handle);
+ }
+
+ /// <summary>
/// Updates the content of a given gengrid item.
/// This updates an item by calling all the genitem class functions again to get the content, text, and states.
/// Use this when the original item data has changed and you want the changes to reflect.
@@ -61,5 +183,13 @@ namespace ElmSharp
{
Interop.Elementary.elm_gengrid_item_update(Handle);
}
+
+ protected override void UpdateTooltipDelegate()
+ {
+ Interop.Elementary.elm_gengrid_item_tooltip_content_cb_set(Handle,
+ TooltipContentDelegate != null ? _tooltipCb : null,
+ IntPtr.Zero,
+ null);
+ }
}
-}
+} \ No newline at end of file
diff --git a/ElmSharp/ElmSharp/GenItem.cs b/ElmSharp/ElmSharp/GenItem.cs
index 3ac0335..ac609b0 100755..100644
--- a/ElmSharp/ElmSharp/GenItem.cs
+++ b/ElmSharp/ElmSharp/GenItem.cs
@@ -18,6 +18,29 @@ using System;
namespace ElmSharp
{
+ public enum GenItemSelectionMode
+ {
+ /// <summary>
+ /// Default select mode.
+ /// </summary>
+ Default,
+
+ /// <summary>
+ /// Always select mode.
+ /// </summary>
+ Always,
+
+ /// <summary>
+ /// No select mode.
+ /// </summary>
+ None,
+
+ /// <summary>
+ /// No select mode with no finger size rule.
+ /// </summary>
+ DisplayOnly
+ }
+
/// <summary>
/// It inherits <see cref="ItemObject"/>.
/// A base class for <see cref="GenGridItem"/> and <see cref="GenListItem"/>.
@@ -25,10 +48,19 @@ namespace ElmSharp
/// </summary>
public abstract class GenItem : ItemObject
{
+ internal Interop.Elementary.Elm_Tooltip_Item_Content_Cb _tooltipCb;
+ GetTooltipContentDelegate _tooltipContentDelegate = null;
+
+ /// <summary>
+ /// The delegate returning the tooltip contents.
+ /// </summary>
+ public delegate EvasObject GetTooltipContentDelegate();
+
internal GenItem(object data, GenItemClass itemClass) : base(IntPtr.Zero)
{
Data = data;
ItemClass = itemClass;
+ _tooltipCb = (d, obj, tooltip, item) => { return TooltipContentDelegate(); };
}
/// <summary>
@@ -37,6 +69,29 @@ namespace ElmSharp
public GenItemClass ItemClass { get; protected set; }
/// <summary>
+ /// It's a abstract property. It's implemented by <see cref="GenGridItem.TooltipContent"/> and <see cref="GenListItem.TooltipContent"/>.
+ /// </summary>
+ public GetTooltipContentDelegate TooltipContentDelegate
+ {
+ get
+ {
+ return _tooltipContentDelegate;
+ }
+ set
+ {
+ _tooltipContentDelegate = value;
+ UpdateTooltipDelegate();
+ }
+ }
+
+ public abstract GenItemSelectionMode SelectionMode { get; set; }
+
+ public abstract string Cursor { get; set; }
+ public abstract string CursorStyle { get; set; }
+
+ public abstract bool IsUseEngineCursor { get; set; }
+
+ /// <summary>
/// Gets item data that is added through calling <see cref="GenGrid.Append(GenItemClass, object)"/>, <see cref="GenGrid.Prepend(GenItemClass, object)"/> or <see cref="GenGrid.InsertBefore(GenItemClass, object, GenGridItem)"/> methods.
/// </summary>
public object Data { get; protected set; }
@@ -47,6 +102,14 @@ namespace ElmSharp
public abstract bool IsSelected { get; set; }
/// <summary>
+ /// It's a abstract property. It's implemented by <see cref="GenGridItem.TooltipStyle"/> and <see cref="GenListItem.TooltipStyle"/>.
+ /// </summary>
+ public abstract string TooltipStyle { get; set; }
+
+ public abstract void SetTooltipText(string tooltip);
+ public abstract void UnsetTooltip();
+
+ /// <summary>
/// It's a abstract method. It's implemented by <see cref="GenGridItem.Update"/> and <see cref="GenListItem.Update"/>.
/// </summary>
public abstract void Update();
@@ -60,5 +123,7 @@ namespace ElmSharp
Data = null;
ItemClass = null;
}
+
+ protected abstract void UpdateTooltipDelegate();
}
-}
+} \ No newline at end of file
diff --git a/ElmSharp/ElmSharp/GenItemClass.cs b/ElmSharp/ElmSharp/GenItemClass.cs
index d0343cb..17fe11a 100755..100644
--- a/ElmSharp/ElmSharp/GenItemClass.cs
+++ b/ElmSharp/ElmSharp/GenItemClass.cs
@@ -26,7 +26,7 @@ namespace ElmSharp
/// </summary>
public class GenItemClass : IDisposable
{
- private static Dictionary<IntPtr, EvasObject> s_HandleToEvasObject = new Dictionary<IntPtr, EvasObject>();
+ static Dictionary<IntPtr, EvasObject> s_HandleToEvasObject = new Dictionary<IntPtr, EvasObject>();
/// <summary>
/// The delegate to define <see cref="GetTextHandler"/>.
@@ -59,9 +59,9 @@ namespace ElmSharp
/// <returns>Return content that should be shown.</returns>
public delegate EvasObject GetReusableContentDelegate(object data, string part, EvasObject old);
- private ItemClass _itemClass;
- private IntPtr _unmanagedPtr = IntPtr.Zero;
- private string _style;
+ ItemClass _itemClass;
+ IntPtr _unmanagedPtr = IntPtr.Zero;
+ string _style;
/// <summary>
/// Creates and initializes a new instance of the GenItemClass.
@@ -70,7 +70,8 @@ namespace ElmSharp
public GenItemClass(string style)
{
_style = style;
- IntPtr unmanaged = Interop.Elementary.elm_genlist_item_class_new();
+ IntPtr unmanaged = CreateItemClass();
+
_itemClass = Marshal.PtrToStructure<ItemClass>(unmanaged);
_itemClass.itemStyle = style;
_itemClass.textCallback = GetTextCallback;
@@ -79,7 +80,7 @@ namespace ElmSharp
_itemClass.delCallback = DelCallback;
_itemClass.reusableContentCallback = GetReusableContentCallback;
- Interop.Elementary.elm_genlist_item_class_free(unmanaged);
+ ReleaseItemClass(unmanaged);
}
~GenItemClass()
@@ -150,12 +151,23 @@ namespace ElmSharp
DeleteHandler?.Invoke(data);
}
- private string GetTextCallback(IntPtr data, IntPtr obj, IntPtr part)
+ protected virtual IntPtr CreateItemClass()
+ {
+ return Interop.Elementary.elm_genlist_item_class_new();
+ }
+
+ protected virtual void ReleaseItemClass(IntPtr unmanagedPtr)
+ {
+ Interop.Elementary.elm_genlist_item_class_free(unmanagedPtr);
+ }
+
+ string GetTextCallback(IntPtr data, IntPtr obj, IntPtr part)
{
GenItem item = ItemObject.GetItemById((int)data) as GenItem;
return GetTextHandler?.Invoke(item?.Data, Marshal.PtrToStringAnsi(part));
}
- private IntPtr GetContentCallback(IntPtr data, IntPtr obj, IntPtr part)
+
+ IntPtr GetContentCallback(IntPtr data, IntPtr obj, IntPtr part)
{
GenItem item = ItemObject.GetItemById((int)data) as GenItem;
EvasObject evasObject = GetContentHandler?.Invoke(item?.Data, Marshal.PtrToStringAnsi(part));
@@ -167,13 +179,13 @@ namespace ElmSharp
return evasObject;
}
- private void EvasObjectDeleted(object sender, EventArgs e)
+ void EvasObjectDeleted(object sender, EventArgs e)
{
IntPtr handle = (sender as EvasObject).Handle;
s_HandleToEvasObject.Remove(handle);
}
- private IntPtr GetReusableContentCallback(IntPtr data, IntPtr obj, IntPtr part, IntPtr old)
+ IntPtr GetReusableContentCallback(IntPtr data, IntPtr obj, IntPtr part, IntPtr old)
{
IntPtr reusedHandle = IntPtr.Zero;
GenItem item = ItemObject.GetItemById((int)data) as GenItem;
@@ -183,7 +195,8 @@ namespace ElmSharp
}
return reusedHandle;
}
- private void DelCallback(IntPtr data, IntPtr obj)
+
+ void DelCallback(IntPtr data, IntPtr obj)
{
// We can't use this callback
// because, when item was deleted
@@ -194,14 +207,36 @@ namespace ElmSharp
}
}
+ public class GenGridItemClass : GenItemClass
+ {
+ public GenGridItemClass(string style) : base(style)
+ {
+ }
+
+ protected override IntPtr CreateItemClass()
+ {
+ return Interop.Elementary.elm_gengrid_item_class_new();
+ }
+
+ protected override void ReleaseItemClass(IntPtr unmanagedPtr)
+ {
+ Interop.Elementary.elm_gengrid_item_class_free(unmanagedPtr);
+ }
+ }
+
[StructLayout(LayoutKind.Sequential)]
internal class ItemClass
{
public delegate string GetTextCallback(IntPtr data, IntPtr obj, IntPtr part);
+
public delegate IntPtr GetContentCallback(IntPtr data, IntPtr obj, IntPtr part);
+
public delegate int GetStateCallback(IntPtr data, IntPtr obj, IntPtr part);
+
public delegate void DelCallback(IntPtr data, IntPtr obj);
+
public delegate int FilterCallback(IntPtr data, IntPtr obj, IntPtr key);
+
public delegate IntPtr GetReusableContentCallback(IntPtr data, IntPtr obj, IntPtr part, IntPtr old);
public int version;
@@ -217,5 +252,4 @@ namespace ElmSharp
public FilterCallback filterCallback;
public GetReusableContentCallback reusableContentCallback;
}
-
-}
+} \ No newline at end of file
diff --git a/ElmSharp/ElmSharp/GenList.cs b/ElmSharp/ElmSharp/GenList.cs
index 929b0af..74b7202 100755..100644
--- a/ElmSharp/ElmSharp/GenList.cs
+++ b/ElmSharp/ElmSharp/GenList.cs
@@ -28,10 +28,12 @@ namespace ElmSharp
/// if Normal is set then this item is normal item.
/// </summary>
Normal = 0,
+
/// <summary>
/// If tree is set then this item is displayed as an item that is able to expand and have child items.
/// </summary>
Tree = (1 << 0),
+
/// <summary>
/// if Group is set then this item is group index item that is displayed at the top until the next group comes.
/// </summary>
@@ -49,16 +51,19 @@ namespace ElmSharp
/// The genlist will respect the container's geometry and, if any of its items won't fit into its transverse axis, one won't be able to scroll it in that direction.
/// </summary>
Compress = 0,
+
/// <summary>
/// This is the same as Compress, with the exception that if any of its items won't fit into its transverse axis, one will be able to scroll it in that direction.
/// </summary>
Scroll,
+
/// <summary>
/// Sets a minimum size hint on the genlist object, so that containers may respect it (and resize itself to fit the child properly).
/// More specifically, a minimum size hint will be set for its transverse axis, so that the largest item in that direction fits well.
/// This is naturally bound by the genlist object's maximum size hints, set externally.
/// </summary>
Limit,
+
/// <summary>
/// Besides setting a minimum size on the transverse axis, just like on Limit, the genlist will set a minimum size on th longitudinal axis, trying to reserve space to all its children to be visible at a time.
/// This is naturally bound by the genlist object's maximum size hints, set externally.
@@ -94,18 +99,22 @@ namespace ElmSharp
/// Scrolls to nowhere.
/// </summary>
None = 0,
+
/// <summary>
/// Scrolls to the nearest viewport.
/// </summary>
In = (1 << 0),
+
/// <summary>
/// Scrolls to the top of the viewport.
/// </summary>
Top = (1 << 1),
+
/// <summary>
/// Scrolls to the middle of the viewport.
/// </summary>
Middle = (1 << 2),
+
/// <summary>
/// Scrolls to the bottom of the viewport.
/// </summary>
@@ -235,6 +244,104 @@ namespace ElmSharp
}
/// <summary>
+ /// Gets or set the maximum number of items within an item block.
+ /// </summary>
+ public int BlockCount
+ {
+ get
+ {
+ return Interop.Elementary.elm_genlist_block_count_get(RealHandle);
+ }
+ set
+ {
+ Interop.Elementary.elm_genlist_block_count_set(RealHandle, value);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets whether the genlist items should be highlighted when an item is selected.
+ /// </summary>
+ public bool IsHighlight
+ {
+ get
+ {
+ return Interop.Elementary.elm_genlist_highlight_mode_get(RealHandle);
+ }
+ set
+ {
+ Interop.Elementary.elm_genlist_highlight_mode_set(RealHandle, value);
+ }
+ }
+
+ /// <summary>
+ /// Gets the depth of expanded item.
+ /// </summary>
+ public int ExpandedItemDepth
+ {
+ get
+ {
+ return Interop.Elementary.elm_genlist_item_expanded_depth_get(RealHandle);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the timeout in seconds for the longpress event.
+ /// </summary>
+ public double LongPressTimeout
+ {
+ get
+ {
+ return Interop.Elementary.elm_genlist_longpress_timeout_get(RealHandle);
+ }
+ set
+ {
+ Interop.Elementary.elm_genlist_longpress_timeout_set(RealHandle, value);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets whether enable multi-selection in the genlist.
+ /// </summary>
+ public bool IsMultiSelection
+ {
+ get
+ {
+ return Interop.Elementary.elm_genlist_multi_select_get(RealHandle);
+ }
+ set
+ {
+ Interop.Elementary.elm_genlist_multi_select_set(RealHandle, value);
+ }
+ }
+
+ /// <summary>
+ /// Gets the selected item in a given genlist widget.
+ /// </summary>
+ public GenListItem SelectedItem
+ {
+ get
+ {
+ IntPtr handle = Interop.Elementary.elm_genlist_selected_item_get(RealHandle);
+ return ItemObject.GetItemByHandle(handle) as GenListItem;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the genlist select mode by <see cref="GenItemSelectionMode"/>.
+ /// </summary>
+ public GenItemSelectionMode SelectionMode
+ {
+ get
+ {
+ return (GenItemSelectionMode)Interop.Elementary.elm_genlist_select_mode_get(RealHandle);
+ }
+ set
+ {
+ Interop.Elementary.elm_genlist_select_mode_set(RealHandle, (int)value);
+ }
+ }
+
+ /// <summary>
/// ItemSelected is raised when a new genlist item is selected.
/// </summary>
public event EventHandler<GenListItemEventArgs> ItemSelected;
@@ -467,6 +574,67 @@ namespace ElmSharp
}
/// <summary>
+ /// Inserts an item with <see cref="GenListItemType"/> after another item under a parent in a genlist widget.
+ /// </summary>
+ /// <param name="itemClass">The itemClass defines how to display the data.</param>
+ /// <param name="data">The item data.</param>
+ /// <param name="before">The item after which to place this new one.</param>
+ /// <param name="type">The genlist item type.</param>
+ /// <param name="parent">The parent item, otherwise null if there is no parent item.</param>
+ /// <returns>Return a new added genlist item that contains data and itemClass.</returns>
+ public GenListItem InsertAfter(GenItemClass itemClass, object data, GenListItem after, GenListItemType type, GenListItem parent)
+ {
+ GenListItem item = new GenListItem(data, itemClass);
+ // insert before the `before` list item
+ IntPtr handle = Interop.Elementary.elm_genlist_item_insert_before(
+ RealHandle, // genlist handle
+ itemClass.UnmanagedPtr, // item class
+ (IntPtr)item.Id, // data
+ parent, // parent
+ after, // after
+ (int)type, // item type
+ null, // select callback
+ (IntPtr)item.Id); // callback data
+ item.Handle = handle;
+ AddInternal(item);
+ return item;
+ }
+
+ /// <summary>
+ /// Insert an item in a genlist widget using a user-defined sort function.
+ /// </summary>
+ /// <param name="itemClass">The itemClass defines how to display the data.</param>
+ /// <param name="data">The item data.</param>
+ /// <param name="func">User defined comparison function that defines the sort order based on genlist item and its data.</param>
+ /// <param name="type">The genlist item type.</param>
+ /// <param name="parent">The parent item, otherwise null if there is no parent item.</param>
+ /// <returns>Return a genlist item that contains data and itemClass.</returns>
+ public GenListItem InsertSorted(GenItemClass itemClass, object data, Comparison<GenListItem> comparison, GenListItemType type, GenListItem parent)
+ {
+ Interop.Elementary.Eina_Compare_Cb compareCallback = (handle1, handle2) =>
+ {
+ GenListItem item1 = ItemObject.GetItemByHandle(handle1) as GenListItem;
+ GenListItem item2 = ItemObject.GetItemByHandle(handle2) as GenListItem;
+ return comparison(item1, item2);
+ };
+
+ GenListItem item = new GenListItem(data, itemClass);
+
+ IntPtr handle = Interop.Elementary.elm_genlist_item_sorted_insert(
+ RealHandle, // genlist handle
+ itemClass.UnmanagedPtr, // item clas
+ (IntPtr)item.Id, // data
+ parent, // parent
+ (int)type, // item type
+ compareCallback, // compare callback
+ null, //select callback
+ (IntPtr)item.Id); // callback data
+ item.Handle = handle;
+ AddInternal(item);
+ return item;
+ }
+
+ /// <summary>
/// Shows the given item with position type in a genlist.
/// When animated is true, genlist will jump to the given item and display it (by animatedly scrolling), if it is not fully visible. This may use animation and may take some time.
/// When animated is false, genlist will jump to the given item and display it (by jumping to that position), if it is not fully visible.
@@ -509,6 +677,32 @@ namespace ElmSharp
Interop.Elementary.elm_genlist_clear(RealHandle);
}
+ /// <summary>
+ /// Get the item that is at the x, y canvas coords.
+ /// </summary>
+ /// <param name="x">The input x coordinate</param>
+ /// <param name="y">The input y coordinate</param>
+ /// <param name="pos">The position relative to the item returned here
+ /// -1, 0, or 1, depending on whether the coordinate is on the upper portion of that item (-1), in the middle section (0), or on the lower part (1).
+ /// </param>
+ /// <returns></returns>
+ public GenListItem GetItemByPosition(int x, int y, out int pos)
+ {
+ IntPtr handle = Interop.Elementary.elm_genlist_at_xy_item_get(RealHandle, x, y, out pos);
+ return ItemObject.GetItemByHandle(handle) as GenListItem;
+ }
+
+ /// <summary>
+ /// Gets the nth item in a given genlist widget, placed at position nth, in its internal items list.
+ /// </summary>
+ /// <param name="index">The number of the item to grab (0 being the first)</param>
+ /// <returns></returns>
+ public GenListItem GetItemByIndex(int index)
+ {
+ IntPtr handle = Interop.Elementary.elm_genlist_nth_item_get(RealHandle, index);
+ return ItemObject.GetItemByHandle(handle) as GenListItem;
+ }
+
protected override IntPtr CreateHandle(EvasObject parent)
{
IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle);
@@ -565,4 +759,4 @@ namespace ElmSharp
_children.Remove((GenListItem)sender);
}
}
-}
+} \ No newline at end of file
diff --git a/ElmSharp/ElmSharp/GenListItem.cs b/ElmSharp/ElmSharp/GenListItem.cs
index 33ee199..f019a25 100644
--- a/ElmSharp/ElmSharp/GenListItem.cs
+++ b/ElmSharp/ElmSharp/GenListItem.cs
@@ -15,34 +15,10 @@
*/
using System;
+using System.ComponentModel;
namespace ElmSharp
{
- /// <summary>
- /// Enumeration for setting genlist selection mode.
- /// </summary>
- public enum GenListSelectionMode
- {
- /// <summary>
- /// Default select mode.
- /// </summary>
- Default,
-
- /// <summary>
- /// Always select mode.
- /// </summary>
- Always,
-
- /// <summary>
- /// No select mode.
- /// </summary>
- None,
-
- /// <summary>
- /// No select mode with no finger size rule.
- /// </summary>
- DisplayOnly
- }
/// <summary>
/// The type of item's part type.
@@ -83,8 +59,7 @@ namespace ElmSharp
/// </summary>
public class GenListItem : GenItem
{
- internal GenListItem(object data, GenItemClass itemClass)
- : base(data, itemClass)
+ internal GenListItem(object data, GenItemClass itemClass) : base(data, itemClass)
{
}
@@ -145,13 +120,22 @@ namespace ElmSharp
}
/// <summary>
+ /// Demote an item to the end of the list.
+ /// </summary>
+ /// <param name="item">The genlistitem object</param>
+ public void DemoteItem()
+ {
+ Interop.Elementary.elm_genlist_item_demote(Handle);
+ }
+
+ /// <summary>
/// Gets or sets the genlist item's select mode.
/// </summary>
- public GenListSelectionMode SelectionMode
+ public override GenItemSelectionMode SelectionMode
{
get
{
- return (GenListSelectionMode)Interop.Elementary.elm_genlist_item_select_mode_get(Handle);
+ return (GenItemSelectionMode)Interop.Elementary.elm_genlist_item_select_mode_get(Handle);
}
set
{
@@ -192,6 +176,126 @@ namespace ElmSharp
}
/// <summary>
+ /// Gets or sets the type of mouse pointer/cursor decoration to be shown, when the mouse pointer is over the given genlist widget item.
+ /// <remarks>
+ /// The cursor's changing area is restricted to the item's area, and not the whole widget's. Note that that item cursors have precedence over widget cursors, so that a mouse over item will always show cursor type.
+ /// </remarks>>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override string Cursor
+ {
+ get
+ {
+ return Interop.Elementary.elm_genlist_item_cursor_get(Handle);
+ }
+ set
+ {
+ if (!string.IsNullOrEmpty(value))
+ {
+ Interop.Elementary.elm_genlist_item_cursor_set(Handle, value);
+ }
+ else
+ {
+ Interop.Elementary.elm_genlist_item_cursor_unset(Handle);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets custom cursor for genlist item.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override string CursorStyle
+ {
+ get
+ {
+ return Interop.Elementary.elm_genlist_item_cursor_style_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_genlist_item_cursor_style_set(Handle, value);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets whether to rely on the rendering engine.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool IsUseEngineCursor
+ {
+ get
+ {
+ return Interop.Elementary.elm_genlist_item_cursor_engine_only_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_genlist_item_cursor_engine_only_set(Handle, value);
+ }
+ }
+
+ public override void SetTooltipText(string tooltip)
+ {
+ Interop.Elementary.elm_genlist_item_tooltip_text_set(Handle, tooltip);
+ }
+
+ public override void UnsetTooltip()
+ {
+ Interop.Elementary.elm_genlist_item_tooltip_unset(Handle);
+ }
+
+ /// <summary>
+ /// Gets or sets the style of given genlist item's tooltip.
+ /// </summary>
+ public override string TooltipStyle
+ {
+ get
+ {
+ return Interop.Elementary.elm_genlist_item_tooltip_style_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_genlist_item_tooltip_style_set(Handle, value);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets whether disable size restrictions on an object's tooltip.
+ /// </summary>
+ public bool IsTooltipWindowMode
+ {
+ get
+ {
+ return Interop.Elementary.elm_genlist_item_tooltip_window_mode_get(Handle);
+ }
+ set
+ {
+ Interop.Elementary.elm_genlist_item_tooltip_window_mode_set(Handle, value);
+ }
+ }
+
+ /// <summary>
+ /// Gets the index of the item. It is only valid once displayed.
+ /// </summary>
+ public int Index
+ {
+ get
+ {
+ return Interop.Elementary.elm_genlist_item_index_get(Handle);
+ }
+ }
+
+ /// <summary>
+ /// Remove all sub-items (children) of the given item.
+ /// </summary>
+ /// <remark>
+ /// This removes all items that are children (and their descendants) of the given item it.
+ /// </remark>
+ public void ClearSubitems()
+ {
+ Interop.Elementary.elm_genlist_item_subitems_clear(Handle);
+ }
+
+ /// <summary>
/// Update the item class of an item.
/// This sets another class of the item, changing the way that it is displayed. After changing the item class, <see cref="Update"/> is called on the item.
/// </summary>
@@ -203,5 +307,14 @@ namespace ElmSharp
ItemClass = itemClass;
Interop.Elementary.elm_genlist_item_item_class_update((IntPtr)Handle, itemClass.UnmanagedPtr);
}
+
+ protected override void UpdateTooltipDelegate()
+ {
+ Interop.Elementary.elm_genlist_item_tooltip_content_cb_set(Handle,
+ TooltipContentDelegate != null ? _tooltipCb : null,
+ IntPtr.Zero,
+ null);
+ }
+
}
} \ No newline at end of file
diff --git a/ElmSharp/ElmSharp/ItemObject.cs b/ElmSharp/ElmSharp/ItemObject.cs
index 7e402a7..84a1b5e 100755..100644
--- a/ElmSharp/ElmSharp/ItemObject.cs
+++ b/ElmSharp/ElmSharp/ItemObject.cs
@@ -208,8 +208,13 @@ namespace ElmSharp
internal static ItemObject GetItemByHandle(IntPtr handle)
{
- ItemObject value;
+ ItemObject value = null;
s_HandleToItemTable.TryGetValue(handle, out value);
+ if (value == null)
+ {
+ int id = (int)Interop.Elementary.elm_object_item_data_get(handle);
+ return GetItemById(id);
+ }
return value;
}
diff --git a/ElmSharp/Interop/Interop.Elementary.GenGridView.cs b/ElmSharp/Interop/Interop.Elementary.GenGridView.cs
index 6f1e3ed..d4bfebb 100644
--- a/ElmSharp/Interop/Interop.Elementary.GenGridView.cs
+++ b/ElmSharp/Interop/Interop.Elementary.GenGridView.cs
@@ -58,6 +58,9 @@ internal static partial class Interop
internal static extern IntPtr elm_gengrid_item_insert_before(IntPtr obj, IntPtr itc, IntPtr data, IntPtr before, Evas.SmartCallback func, IntPtr func_data);
[DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_gengrid_item_insert_after(IntPtr obj, IntPtr itc, IntPtr data, IntPtr after, Evas.SmartCallback func, IntPtr func_data);
+
+ [DllImport(Libraries.Elementary)]
internal static extern IntPtr elm_gengrid_item_class_new();
[DllImport(Libraries.Elementary)]
@@ -106,10 +109,10 @@ internal static partial class Interop
internal static extern void elm_gengrid_item_bring_in(IntPtr obj, int type);
[DllImport(Libraries.Elementary)]
- internal static extern void elm_gengrid_item_select_mode_set(IntPtr it, int mode);
+ internal static extern void elm_gengrid_item_select_mode_set(IntPtr it, Elm_Object_Select_Mode mode);
[DllImport(Libraries.Elementary)]
- internal static extern int elm_gengrid_item_select_mode_get(IntPtr it);
+ internal static extern Elm_Object_Select_Mode elm_gengrid_item_select_mode_get(IntPtr it);
[DllImport(Libraries.Elementary)]
internal static extern void elm_gengrid_select_mode_set(IntPtr it, int mode);
@@ -137,5 +140,53 @@ internal static partial class Interop
[DllImport(Libraries.Elementary)]
internal static extern IntPtr elm_gengrid_last_item_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern string elm_gengrid_item_cursor_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_cursor_set(IntPtr obj, string cursor);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_cursor_unset(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern string elm_gengrid_item_cursor_style_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_cursor_style_set(IntPtr obj, string cursor);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_gengrid_item_cursor_engine_only_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_cursor_engine_only_set(IntPtr obj, bool engine);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_tooltip_text_set(IntPtr obj, string text);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_tooltip_unset(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern string elm_gengrid_item_tooltip_style_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_tooltip_style_set(IntPtr obj, string style);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_gengrid_reorder_mode_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_reorder_mode_set(IntPtr obj, bool mode);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_pos_get(IntPtr obj, out int row, out int column);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_gengrid_item_sorted_insert(IntPtr obj, IntPtr itc, IntPtr data, Eina_Compare_Cb compare, Evas.SmartCallback func, IntPtr funcData);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_gengrid_item_tooltip_content_cb_set(IntPtr obj, Elm_Tooltip_Item_Content_Cb func, IntPtr funcData, Evas.SmartCallback deleteFunc);
}
} \ No newline at end of file
diff --git a/ElmSharp/Interop/Interop.Elementary.GenListView.cs b/ElmSharp/Interop/Interop.Elementary.GenListView.cs
index 2149808..2205899 100644
--- a/ElmSharp/Interop/Interop.Elementary.GenListView.cs
+++ b/ElmSharp/Interop/Interop.Elementary.GenListView.cs
@@ -40,13 +40,8 @@ internal static partial class Interop
// Scrolls to the bottom of the viewport
}
- internal enum Elm_Object_Select_Mode
- {
- ELM_OBJECT_SELECT_MODE_DEFAULT,
- ELM_OBJECT_SELECT_MODE_ALWAYS,
- ELM_OBJECT_SELECT_MODE_NONE,
- ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY
- }
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate void Evas_Smart_Cb(IntPtr data, IntPtr obj, IntPtr eventInfo);
[DllImport(Libraries.Elementary)]
internal static extern IntPtr elm_genlist_add(IntPtr parent);
@@ -163,21 +158,30 @@ internal static partial class Interop
internal static extern bool elm_genlist_item_expanded_get(IntPtr obj);
[DllImport(Libraries.Elementary)]
+ internal static extern bool elm_genlist_highlight_mode_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
internal static extern void elm_genlist_highlight_mode_set(IntPtr obj, bool highlight);
[DllImport(Libraries.Elementary)]
internal static extern IntPtr elm_genlist_at_xy_item_get(IntPtr obj, int x, int y, out int posret);
[DllImport(Libraries.Elementary)]
- internal static extern IntPtr elm_genlist_item_insert_after(IntPtr obj, IntPtr itc, IntPtr data, IntPtr parent, IntPtr after, int type, Evas_Smart_Cb func, IntPtr func_data);
+ internal static extern IntPtr elm_genlist_item_insert_after(IntPtr obj, IntPtr itc, IntPtr data, IntPtr parent, IntPtr after, int type, Evas.SmartCallback func, IntPtr func_data);
[DllImport(Libraries.Elementary)]
internal static extern IntPtr elm_genlist_item_item_class_get(IntPtr obj);
[DllImport(Libraries.Elementary)]
+ internal static extern double elm_genlist_longpress_timeout_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
internal static extern void elm_genlist_longpress_timeout_set(IntPtr obj, double timeout);
[DllImport(Libraries.Elementary)]
+ internal static extern bool elm_genlist_multi_select_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
internal static extern void elm_genlist_multi_select_set(IntPtr obj, bool multi);
[DllImport(Libraries.Elementary)]
@@ -186,7 +190,58 @@ internal static partial class Interop
[DllImport(Libraries.Elementary)]
internal static extern IntPtr elm_genlist_selected_item_get(IntPtr obj);
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate void Evas_Smart_Cb(IntPtr data, IntPtr obj, IntPtr eventInfo);
+ [DllImport(Libraries.Elementary)]
+ internal static extern string elm_genlist_item_cursor_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_item_cursor_set(IntPtr obj, string cursor);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_item_cursor_unset(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_genlist_item_cursor_engine_only_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_item_cursor_engine_only_set(IntPtr obj, bool engineOnly);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern string elm_genlist_item_cursor_style_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_item_cursor_style_set(IntPtr obj, string style);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_item_demote(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern int elm_genlist_item_expanded_depth_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_item_subitems_clear(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_item_tooltip_text_set(IntPtr obj, string text);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_item_tooltip_unset(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern string elm_genlist_item_tooltip_style_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_item_tooltip_style_set(IntPtr obj, string style);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_genlist_item_tooltip_window_mode_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_genlist_item_tooltip_window_mode_set(IntPtr obj, bool disable);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_genlist_item_sorted_insert(IntPtr obj, IntPtr itc, IntPtr data, IntPtr parent, int type, Eina_Compare_Cb compare, Evas.SmartCallback func, IntPtr funcData);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_genlist_item_tooltip_content_cb_set(IntPtr obj, Elm_Tooltip_Item_Content_Cb func, IntPtr funcData, Evas.SmartCallback deleteFunc);
}
} \ No newline at end of file
diff --git a/ElmSharp/Interop/Interop.Elementary.Index.cs b/ElmSharp/Interop/Interop.Elementary.Index.cs
index b1470b2..f2ecacd 100755..100644
--- a/ElmSharp/Interop/Interop.Elementary.Index.cs
+++ b/ElmSharp/Interop/Interop.Elementary.Index.cs
@@ -73,9 +73,6 @@ internal static partial class Interop
[DllImport(Libraries.Elementary)]
internal static extern IntPtr elm_index_item_sorted_insert(IntPtr obj, string letter, Evas_Smart_Cb func, IntPtr data, Eina_Compare_Cb cmpFunc, Eina_Compare_Cb cmpDataFunc);
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate int Eina_Compare_Cb(IntPtr data1, IntPtr data2);
-
[DllImport(Libraries.Elementary)]
internal static extern void elm_index_delay_change_time_set(IntPtr obj, double time);
diff --git a/ElmSharp/Interop/Interop.Elementary.Item.cs b/ElmSharp/Interop/Interop.Elementary.Item.cs
new file mode 100644
index 0000000..063fc4b
--- /dev/null
+++ b/ElmSharp/Interop/Interop.Elementary.Item.cs
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+ internal static partial class Elementary
+ {
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_part_content_set(IntPtr obj, string part, IntPtr content);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_object_item_part_content_unset(IntPtr obj, string part);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_part_content_set(IntPtr obj, IntPtr part, IntPtr content);
+
+ [DllImport(Libraries.Elementary, EntryPoint = "elm_object_item_part_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ internal static extern IntPtr _elm_object_item_part_text_get(IntPtr obj, string part);
+
+ internal static string elm_object_item_part_text_get(IntPtr obj, string part)
+ {
+ var text = _elm_object_item_part_text_get(obj, part);
+ return Marshal.PtrToStringAnsi(text);
+ }
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_color_class_color_set(IntPtr it, string part, int r, int g, int b, int a);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_color_class_color_get(IntPtr obj, string part, out int r, out int g, out int b, out int a);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_color_class_del(IntPtr obj, string part);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_part_text_set(IntPtr obj, string part, string label);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_part_text_set(IntPtr obj, IntPtr part, string label);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_object_item_data_get(IntPtr it);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_data_set(IntPtr it, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_del(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_del_cb_set(IntPtr obj, Interop.Evas.SmartCallback callback);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_disabled_set(IntPtr obj, bool disable);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern bool elm_object_item_disabled_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_object_item_part_content_get(IntPtr obj, string part);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_object_item_access_object_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_access_unregister(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_object_item_track(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_untrack(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_object_item_widget_get(IntPtr obj);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_signal_emit(IntPtr obj, string emission, string source);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern void elm_object_item_signal_callback_add(IntPtr obj, string emission, string source, Elm_Object_Item_Signal_Cb func, IntPtr data);
+
+ [DllImport(Libraries.Elementary)]
+ internal static extern IntPtr elm_object_item_signal_callback_del(IntPtr obj, string emission, string source, Elm_Object_Item_Signal_Cb func, IntPtr data);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate bool Elm_Object_Item_Signal_Cb(IntPtr data, IntPtr item, string emission, string source);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate IntPtr Elm_Tooltip_Item_Content_Cb(IntPtr data, IntPtr obj, IntPtr tooltip, IntPtr item);
+
+ internal enum Elm_Object_Select_Mode
+ {
+ ELM_OBJECT_SELECT_MODE_DEFAULT,
+ ELM_OBJECT_SELECT_MODE_ALWAYS,
+ ELM_OBJECT_SELECT_MODE_NONE,
+ ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY
+ }
+ }
+} \ No newline at end of file
diff --git a/ElmSharp/Interop/Interop.Elementary.cs b/ElmSharp/Interop/Interop.Elementary.cs
index da07a4a..30e7bbb 100755
--- a/ElmSharp/Interop/Interop.Elementary.cs
+++ b/ElmSharp/Interop/Interop.Elementary.cs
@@ -195,15 +195,6 @@ internal static partial class Interop
}
[DllImport(Libraries.Elementary)]
- internal static extern void elm_object_item_part_content_set(IntPtr obj, string part, IntPtr content);
-
- [DllImport(Libraries.Elementary)]
- internal static extern IntPtr elm_object_item_part_content_unset(IntPtr obj, string part);
-
- [DllImport(Libraries.Elementary)]
- internal static extern void elm_object_item_part_content_set(IntPtr obj, IntPtr part, IntPtr content);
-
- [DllImport(Libraries.Elementary)]
internal static extern IntPtr elm_object_part_content_get(IntPtr obj, string part);
[DllImport(Libraries.Elementary)]
@@ -336,78 +327,6 @@ internal static partial class Interop
[DllImport(Libraries.Elementary)]
internal static extern void elm_object_part_text_set(IntPtr obj, IntPtr part, string text);
- [DllImport(Libraries.Elementary, EntryPoint = "elm_object_item_part_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
- internal static extern IntPtr _elm_object_item_part_text_get(IntPtr obj, string part);
-
- internal static string elm_object_item_part_text_get(IntPtr obj, string part)
- {
- var text = _elm_object_item_part_text_get(obj, part);
- return Marshal.PtrToStringAnsi(text);
- }
-
- [DllImport(Libraries.Elementary)]
- internal static extern void elm_object_item_color_class_color_set(IntPtr it, string part, int r, int g, int b, int a);
-
- [DllImport(Libraries.Elementary)]
- internal static extern void elm_object_item_color_class_color_get(IntPtr obj, string part, out int r, out int g, out int b, out int a);
-
- [DllImport(Libraries.Elementary)]
- internal static extern void elm_object_item_color_class_del(IntPtr obj, string part);
-
- [DllImport(Libraries.Elementary)]
- internal static extern void elm_object_item_part_text_set(IntPtr obj, string part, string label);
-
- [DllImport(Libraries.Elementary)]
- internal static extern void elm_object_item_part_text_set(IntPtr obj, IntPtr part, string label);
-
- [DllImport(Libraries.Elementary)]
- internal static extern IntPtr elm_object_item_data_get(IntPtr it);
-
- [DllImport(Libraries.Elementary)]
- internal static extern void elm_object_item_data_set(IntPtr it, IntPtr data);
-
- [DllImport(Libraries.Elementary)]
- internal static extern void elm_object_item_del(IntPtr obj);
-
- [DllImport(Libraries.Elementary)]
- internal static extern void elm_object_item_del_cb_set(IntPtr obj, Interop.Evas.SmartCallback callback);
-
- [DllImport(Libraries.Elementary)]
- internal static extern void elm_object_item_disabled_set(IntPtr obj, bool disable);
-
- [DllImport(Libraries.Elementary)]
- internal static extern bool elm_object_item_disabled_get(IntPtr obj);
-
- [DllImport(Libraries.Elementary)]
- internal static extern IntPtr elm_object_item_part_content_get(IntPtr obj, string part);
-
- [DllImport(Libraries.Elementary)]
- internal static extern IntPtr elm_object_item_access_object_get(IntPtr obj);
-
- [DllImport(Libraries.Elementary)]
- internal static extern void elm_object_item_access_unregister(IntPtr obj);
-
- [DllImport(Libraries.Elementary)]
- internal static extern IntPtr elm_object_item_track(IntPtr obj);
-
- [DllImport(Libraries.Elementary)]
- internal static extern void elm_object_item_untrack(IntPtr obj);
-
- [DllImport(Libraries.Elementary)]
- internal static extern IntPtr elm_object_item_widget_get(IntPtr obj);
-
- [DllImport(Libraries.Elementary)]
- internal static extern void elm_object_item_signal_emit(IntPtr obj, string emission, string source);
-
- [DllImport(Libraries.Elementary)]
- internal static extern void elm_object_item_signal_callback_add(IntPtr obj, string emission, string source, Elm_Object_Item_Signal_Cb func, IntPtr data);
-
- [DllImport(Libraries.Elementary)]
- internal static extern IntPtr elm_object_item_signal_callback_del(IntPtr obj, string emission, string source, Elm_Object_Item_Signal_Cb func, IntPtr data);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate bool Elm_Object_Item_Signal_Cb(IntPtr data, IntPtr item, string emission, string source);
-
[DllImport(Libraries.Elementary)]
internal static extern void elm_config_focus_highlight_animate_set(bool animate);
@@ -749,6 +668,9 @@ internal static partial class Interop
internal static extern IntPtr elm_transit_effect_image_animation_add(IntPtr transit, IntPtr images);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ internal delegate int Eina_Compare_Cb(IntPtr data1, IntPtr data2);
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void Elm_Transit_Effect_Transition_Cb(IntPtr effect, IntPtr transit, double progress);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]