Add ElmSharp theme
authorjh0506.yun <jh0506.yun@DO-JH0506-YUN03>
Thu, 6 Oct 2016 01:18:38 +0000 (10:18 +0900)
committerjh0506.yun <jh0506.yun@DO-JH0506-YUN03>
Thu, 6 Oct 2016 05:02:28 +0000 (14:02 +0900)
Signed-off-by: jh0506.yun <jh0506.yun@samsung.com>
Change-Id: Iaec9141c09206230cb1b6d1b66dc0b86ab7653fa

.gitignore
packaging/elm-sharp.spec
src/ElmSharp/ElmSharp/Elementary.cs [changed mode: 0644->0755]
src/ElmSharp/Interop/Interop.Elementary.cs
src/ElmSharp/theme/mobile/HD-inc.edc [new file with mode: 0644]
src/ElmSharp/theme/mobile/color_classes.edc [new file with mode: 0644]
src/ElmSharp/theme/mobile/elm-sharp-theme-mobile.edc [new file with mode: 0644]
src/ElmSharp/theme/mobile/widgets/colorselector.edc [new file with mode: 0644]

index 46619d5..15405a1 100644 (file)
@@ -5,3 +5,5 @@ obj/
 *.csproj.user
 *.lock.json
 .vs/
+*.edj
+*.sln
index 34f2202..a9817d5 100644 (file)
@@ -20,6 +20,7 @@ BuildRequires: mono-compiler
 BuildRequires: mono-devel
 
 BuildRequires: dotnet-build-tools
+BuildRequires: edje-tools
 
 %description
 C# Binding for Elementary
@@ -40,6 +41,8 @@ find $ASM/*.csproj -exec xbuild {} /p:Configuration=%{BUILDCONF} \;
 nuget pack $ASM/$ASM.nuspec -Version %{version} -Properties Configuration=%{BUILDCONF}
 done
 
+edje_cc ElmSharp/theme/%{profile}/elm-sharp-theme-%{profile}.edc ElmSharp/theme/elm-sharp-theme.edj
+
 %install
 # Runtime Binary
 mkdir -p %{buildroot}%{dotnet_assembly_path}
@@ -53,11 +56,15 @@ done
 # NuGet
 mkdir -p %{buildroot}/nuget
 install -p -m 644 *.nupkg %{buildroot}/nuget
+# Theme
+mkdir %{buildroot}%{_datadir}/edje/elm-sharp -p
+install -m 644 ElmSharp/theme/elm-sharp-theme.edj %{buildroot}%{_datadir}/edje/elm-sharp/
 
 %files
 %manifest %{name}.manifest
 %license LICENSE
 %attr(644,root,root) %{dotnet_assembly_path}/*.dll
+%attr(644,root,root) %{_datadir}/edje/elm-sharp/*.edj
 
 %package nuget
 Summary:   NuGet package for %{name}
old mode 100644 (file)
new mode 100755 (executable)
index f8c2721..6213b3f
@@ -1,12 +1,19 @@
 using System;
+using System.IO;
 
 namespace ElmSharp
 {
     public static class Elementary
     {
+        private static readonly string _themeFilePath = "/usr/share/edje/elm-sharp/elm-sharp-theme.edj";
+
         public static void Initialize()
         {
             Interop.Elementary.elm_init(0, null);
+            if (File.Exists(_themeFilePath))
+            {
+                Interop.Elementary.elm_theme_overlay_add(IntPtr.Zero, _themeFilePath);
+            }
         }
 
         public static void Shutdown()
index fca0aa0..970e4b7 100644 (file)
@@ -192,7 +192,10 @@ internal static partial class Interop
         internal static extern void elm_object_focus_set(IntPtr obj, bool focus);
 
         [DllImport(Libraries.Elementary)]
-        internal static extern void elm_theme_extension_add(IntPtr obj, string path);
+        internal static extern void elm_theme_extension_add(IntPtr theme, string path);
+
+        [DllImport(Libraries.Elementary)]
+        internal static extern void elm_theme_overlay_add(IntPtr theme, string path);
 
         [DllImport(Libraries.Elementary)]
         internal static extern IntPtr elm_theme_new();
diff --git a/src/ElmSharp/theme/mobile/HD-inc.edc b/src/ElmSharp/theme/mobile/HD-inc.edc
new file mode 100644 (file)
index 0000000..c252b92
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   1. Redistributions of source code must retain the above copyright notice, this
+ *      list of conditions and the following disclaimer.
+ *   2. Redistributions in binary form must reproduce the above copyright notice,
+ *      this list of conditions and the following disclaimer in the documentation
+ *      and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+//****************************************************************************//
+// This file defines the width, height (not color!) for each widgets
+// We can define different INC file by Resolution (HD, qHD, WVGA, HVGA)
+//
+// ************* Naming Rule ************ //
+// {WIDGET}_{GROUP}_{PART}_{STATE}_{TYPE}
+//   WIDGET: NAVIFRAME, LIST, DATETIME, POPUP, etc.
+//   GROUP:  INDEX
+//   PART:   TEXT, ICON, BG, PADDING, DIVIDER, ICON, etc.
+//   STATE:  LEFT, RIGHT, TOP, BOTTOM, MIN, MAX,
+//   TYPE:   HEIGHT, WIDTH, SIZE
+// e.g. LIST_PADDING_LEFT_HEIGHT
+//****************************************************************************//
+
+#define BASE_SCALE_INC 2.6
+
+//****************************************************************************//
+// Colorselector
+//****************************************************************************//
+#define COLORSELECTOR_PALETTE_COLORPLANE_HEIGHT_INC 238
+#define COLORSELECTOR_PALETTE_COLORPLANE_WIDTH_INC 678
+#define COLORSELECTOR_PORTRAIT_HOR_PAD_COLORPLANE_INC "8"
+#define COLORSELECTOR_PORTRAIT_VER_PAD_COLORPLANE_INC "8"
+#define COLORSELECTOR_PALETTE_COLORBG_MIN_COLORPLANE_INC 90 90
+#define COLORSELECTOR_TOPBOTTOM_PAD_COLORPLANE_INC 24
diff --git a/src/ElmSharp/theme/mobile/color_classes.edc b/src/ElmSharp/theme/mobile/color_classes.edc
new file mode 100644 (file)
index 0000000..7f458f5
--- /dev/null
@@ -0,0 +1,6 @@
+color_classes {
+   color_class {
+      name: "elm/widget/colorselector/default/bg-default";
+      color: 250 250 250 255;
+   }
+}
diff --git a/src/ElmSharp/theme/mobile/elm-sharp-theme-mobile.edc b/src/ElmSharp/theme/mobile/elm-sharp-theme-mobile.edc
new file mode 100644 (file)
index 0000000..82c7c94
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   1. Redistributions of source code must retain the above copyright notice, this
+ *      list of conditions and the following disclaimer.
+ *   2. Redistributions in binary form must reproduce the above copyright notice,
+ *      this list of conditions and the following disclaimer in the documentation
+ *      and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// LICENSE NOTE:
+// This file (and only this one) is licenses under public-domain. The reason
+// is that this is meant to serve as a template for making your own themes and
+// Elementary's LGPL license is not intended to follow. The images used do come
+// under LGPL, but this file specifically for the structure of your theme is
+// public-domain. This means you can take, use, re-license and otherwise
+// have zero restrictions on using this file as a base for your theme.
+
+//****************************************************************************************//
+// This is theme body including all widget bodys
+// Define shared descriptions (e.g. sound samples, color classes, textblock styles) in here
+// Do not define size(width, height) in here!!!!
+//****************************************************************************************//
+
+// Include INC (e.g. HD-inc.edc, HVGA-inc.edc for each resolution) file
+#include "HD-inc.edc"
+
+externals {
+   external: "elm";
+}
+
+// BUILD_FIX: Add version to edc as 110.
+data.item: "version" "110";
+//
+
+collections {
+   base_scale: BASE_SCALE_INC;
+
+#include "color_classes.edc"
+
+#include "widgets/colorselector.edc"
+
+}
+
diff --git a/src/ElmSharp/theme/mobile/widgets/colorselector.edc b/src/ElmSharp/theme/mobile/widgets/colorselector.edc
new file mode 100644 (file)
index 0000000..8e18487
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *   1. Redistributions of source code must retain the above copyright notice, this
+ *      list of conditions and the following disclaimer.
+ *   2. Redistributions in binary form must reproduce the above copyright notice,
+ *      this list of conditions and the following disclaimer in the documentation
+ *      and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+group {
+   name: "elm/colorselector/palette/colorplane";
+   alias: "elm/colorselector/palette/default";
+   data.item: "horizontal_pad" COLORSELECTOR_PORTRAIT_HOR_PAD_COLORPLANE_INC;
+   data.item: "vertical_pad" COLORSELECTOR_PORTRAIT_VER_PAD_COLORPLANE_INC;
+
+   parts {
+      part { name: "base";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: COLORSELECTOR_PALETTE_COLORPLANE_WIDTH_INC COLORSELECTOR_PALETTE_COLORPLANE_HEIGHT_INC;
+            max: -1 -1;
+         }
+      }
+      part { name: "bg";
+         type: RECT;
+         scale: 1;
+         description { state: "default" 0.0;
+            rel1.to: "base";
+            rel2.to: "base";
+            color_class: "elm/widget/colorselector/default/bg-default"; /// for C#
+         }
+      }
+      part { name: "top_padding";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: 0 COLORSELECTOR_TOPBOTTOM_PAD_COLORPLANE_INC;
+            fixed: 0 1;
+            rel1 {
+               relative: 0.0 0.0;
+               to: "base";
+            }
+            rel2 {
+               relative: 1.0 0.0;
+               to: "base";
+            }
+            align: 0.0 0.0;
+         }
+      }
+      part { name: "palette";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            align: 0.5 0.0;
+            fixed: 0 1;
+            rel1 {
+               relative: 0.0 1.0;
+               to_y: "top_padding";
+            }
+            rel2.to_y: "top_padding";
+         }
+      }
+      part{ name: "palette_bottom_padding";
+         type: SPACER;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: 0 COLORSELECTOR_TOPBOTTOM_PAD_COLORPLANE_INC;
+            fixed: 0 1;
+            rel1 {
+               relative: 0.0 1.0;
+               to: "palette";
+            }
+            rel2.to: "palette";
+            align: 0.0 0.0;
+         }
+      }
+   }
+}