diff options
author | jh5.cho <jh5.cho@samsung.com> | 2017-02-16 10:21:35 +0900 |
---|---|---|
committer | jh5.cho <jh5.cho@samsung.com> | 2017-02-20 18:19:49 +0900 |
commit | 02ca327cc3ed22267c8cf5fd7a577a9995607f8e (patch) | |
tree | 70111ec4a8b16334a15de4b554cc36fd05193d3e | |
parent | b71c87c927b186a1630c22e34f8bca09525a2842 (diff) | |
download | elm-sharp-02ca327cc3ed22267c8cf5fd7a577a9995607f8e.tar.gz elm-sharp-02ca327cc3ed22267c8cf5fd7a577a9995607f8e.tar.bz2 elm-sharp-02ca327cc3ed22267c8cf5fd7a577a9995607f8e.zip |
Add Additional Method for ColorSelector
- Following ColorSelector methods are added:
AddPaletteColor(), ClearPalette()
- New methods are added to implement RFC16, ColorPickerControl
http://suprem.sec.samsung.net/confluence/display/SPTDTLC/%5BFormsTizen%5D+RFC+16+-+ColorPickerControl
Change-Id: I224c4fca1f87d2edc68974de4818126f42792f77
-rwxr-xr-x | ElmSharp/ElmSharp.csproj | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | ElmSharp/ElmSharp/ColorSelector.cs | 12 | ||||
-rwxr-xr-x | ElmSharp/ElmSharp/ColorSelectorItem.cs | 44 | ||||
-rwxr-xr-x[-rw-r--r--] | ElmSharp/Interop/Interop.Elementary.ColorPicker.cs | 2 |
4 files changed, 58 insertions, 1 deletions
diff --git a/ElmSharp/ElmSharp.csproj b/ElmSharp/ElmSharp.csproj index 463f68a..cc0f20c 100755 --- a/ElmSharp/ElmSharp.csproj +++ b/ElmSharp/ElmSharp.csproj @@ -56,6 +56,7 @@ <Compile Include="ElmSharp\Conformant.cs" /> <Compile Include="ElmSharp\Container.cs" /> <Compile Include="ElmSharp\ContextPopup.cs" /> + <Compile Include="ElmSharp\ColorSelectorItem.cs" /> <Compile Include="ElmSharp\ContextPopupItem.cs" /> <Compile Include="ElmSharp\DateChangedEventArgs.cs" /> <Compile Include="ElmSharp\DateTimeSelector.cs" /> diff --git a/ElmSharp/ElmSharp/ColorSelector.cs b/ElmSharp/ElmSharp/ColorSelector.cs index 1b0d251..524a96f 100644..100755 --- a/ElmSharp/ElmSharp/ColorSelector.cs +++ b/ElmSharp/ElmSharp/ColorSelector.cs @@ -88,6 +88,18 @@ namespace ElmSharp } } + public ColorSelectorItem AddPaletteColor(Color color) + { + ColorSelectorItem item = new ColorSelectorItem(); + item.Handle = Interop.Elementary.elm_colorselector_palette_color_add(Handle, color.R, color.G, color.B, color.A); + return item; + } + + public void ClearPalette() + { + Interop.Elementary.elm_colorselector_palette_clear(Handle); + } + protected override IntPtr CreateHandle(EvasObject parent) { return Interop.Elementary.elm_colorselector_add(parent.Handle); diff --git a/ElmSharp/ElmSharp/ColorSelectorItem.cs b/ElmSharp/ElmSharp/ColorSelectorItem.cs new file mode 100755 index 0000000..4ee5f7a --- /dev/null +++ b/ElmSharp/ElmSharp/ColorSelectorItem.cs @@ -0,0 +1,44 @@ +/* + * 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; + +namespace ElmSharp +{ + public class ColorSelectorItem : ItemObject + { + internal ColorSelectorItem() : base(IntPtr.Zero) + { + } + + public Color Color + { + get + { + int r, g, b, a; + Interop.Elementary.elm_colorselector_palette_item_color_get(Handle, out r, out g, out b, out a); + return Color.FromRgba(r, g, b, a); + } + set + { + if (Handle != IntPtr.Zero) + { + Interop.Elementary.elm_colorselector_palette_item_color_set(Handle, value.R, value.G, value.B, value.A); + } + } + } + } +} diff --git a/ElmSharp/Interop/Interop.Elementary.ColorPicker.cs b/ElmSharp/Interop/Interop.Elementary.ColorPicker.cs index b61c98b..231fc9d 100644..100755 --- a/ElmSharp/Interop/Interop.Elementary.ColorPicker.cs +++ b/ElmSharp/Interop/Interop.Elementary.ColorPicker.cs @@ -70,7 +70,7 @@ internal static partial class Interop internal static extern void elm_colorselector_palette_item_color_get(IntPtr obj, out int r, out int g, out int b, out int a); [DllImport(Libraries.Elementary)] - internal static extern int elm_colorselector_palette_item_color_set(IntPtr obj, int r, int g, int b, int a); + internal static extern void elm_colorselector_palette_item_color_set(IntPtr obj, int r, int g, int b, int a); [DllImport(Libraries.Elementary)] internal static extern bool elm_colorselector_palette_item_selected_get(IntPtr obj); |