Add Additional Method for ColorSelector 47/114947/3
authorjh5.cho <jh5.cho@samsung.com>
Thu, 16 Feb 2017 01:21:35 +0000 (10:21 +0900)
committerjh5.cho <jh5.cho@samsung.com>
Mon, 20 Feb 2017 09:19:49 +0000 (18:19 +0900)
    - 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

ElmSharp/ElmSharp.csproj
ElmSharp/ElmSharp/ColorSelector.cs [changed mode: 0644->0755]
ElmSharp/ElmSharp/ColorSelectorItem.cs [new file with mode: 0755]
ElmSharp/Interop/Interop.Elementary.ColorPicker.cs [changed mode: 0644->0755]

index 463f68a..cc0f20c 100755 (executable)
@@ -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" />
old mode 100644 (file)
new mode 100755 (executable)
index 1b0d251..524a96f
@@ -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 (executable)
index 0000000..4ee5f7a
--- /dev/null
@@ -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);
+                }
+            }
+        }
+    }
+}
old mode 100644 (file)
new mode 100755 (executable)
index b61c98b..231fc9d
@@ -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);