rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=86a2167005f78b148f86f17f35e2d7c801422c41

commit 86a2167005f78b148f86f17f35e2d7c801422c41
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Wed Nov 11 16:02:24 2015 +0200

    demo: add module demo
    
    This module develop for show the demo view on workspace for editing
    group.
    
    Change-Id: I4c7beca4a9845c9fe913688b515c804230ab19ee
---
 src/bin/Makefile.am         |  1 +
 src/bin/ui/live_view/demo.c | 54 +++++++++++++++++++++++++++++++++++++++++++++
 src/bin/ui/live_view/demo.h | 41 ++++++++++++++++++++++++++++++++++
 3 files changed, 96 insertions(+)

diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index b27071d..934fe95 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -73,6 +73,7 @@ libete_a_SOURCES = \
 ../../src/bin/ui/workspace/groupedit.c \
 ../../src/bin/ui/workspace/groupedit_box_layouts.c \
 ../../src/bin/ui/workspace/highlight.c \
+../../src/bin/ui/live_view/demo.c \
 ../../src/bin/ui/live_view/live_view_prop.c \
 ../../src/bin/ui/live_view/live_view.c \
 ../../src/bin/ui/live_view/live_widget.c \
diff --git a/src/bin/ui/live_view/demo.c b/src/bin/ui/live_view/demo.c
new file mode 100644
index 0000000..83b2f6d
--- /dev/null
+++ b/src/bin/ui/live_view/demo.c
@@ -0,0 +1,54 @@
+/*
+ * Edje Theme Editor
+ * Copyright (C) 2013-2015 Samsung Electronics.
+ *
+ * This file is part of Edje Theme Editor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; If not, see www.gnu.org/licenses/lgpl.html.
+ */
+
+#include "live_view.h"
+#include "live_view_prop.h"
+
+Evas_Object *
+demo_add(Evas_Object *parent, Group *group)
+{
+   Evas_Object *obj;
+
+   if (group->widget)
+     {
+        obj = live_widget_create(group, parent);
+        if (!obj)
+           ERR(N_("Widget live view isn't implemented yet. Using fallback to 
layout"))
+        else
+        {
+           Elm_Theme *theme = elm_theme_new();
+           elm_theme_set(theme, ap.project->dev);
+           elm_object_theme_set(obj, theme);
+           elm_theme_free(theme);
+           return obj;
+        }
+     }
+   /* if widget is not created, need use the layout */
+   obj = elm_layout_add(parent);
+   if (!elm_layout_file_set(obj, ap.project->dev, group->name))
+     {
+        ERR(N_("Could not load group '%s' from mapped file '%s'."), 
group->name, ap.project->dev)
+        evas_object_del(obj);
+        obj = NULL;
+        TODO("Add frame to container with info that need this state is 
unstable"
+             "and need to restart Eflete.");
+     }
+
+   return obj;
+}
diff --git a/src/bin/ui/live_view/demo.h b/src/bin/ui/live_view/demo.h
new file mode 100644
index 0000000..c23e737
--- /dev/null
+++ b/src/bin/ui/live_view/demo.h
@@ -0,0 +1,41 @@
+/*
+ * Edje Theme Editor
+ * Copyright (C) 2013-2015 Samsung Electronics.
+ *
+ * This file is part of Edje Theme Editor.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; If not, see www.gnu.org/licenses/lgpl.html.
+ */
+
+#include "eflete.h"
+
+/**
+ * @defgroup Demo Demo
+ *
+ * A Demo is responsible for showing widgets with contexts.
+ * After user manipulations with parts, states or programs and saving
+ * into a file, this space will show the resulted widget
+ * by using user's theme (already saved one).
+ */
+
+/**
+ * Create a object accordingly to given group.
+ *
+ * @param parent The parent object
+ * @param group The group for create widget
+ * @return The widget or layout with contexts
+ *
+ * @ingroup Demo
+ */
+Evas_Object *
+demo_add(Evas_Object *parent, Group *group);

-- 


Reply via email to