rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=7f0f686de42cdd94ce5e87c3bd411277a6fa4efa

commit 7f0f686de42cdd94ce5e87c3bd411277a6fa4efa
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Tue Nov 3 15:16:57 2015 +0200

    Property: start to implement/move image editor property to property module
---
 src/bin/Makefile.am           |  1 +
 src/bin/ui/property_group.c   |  2 +-
 src/bin/ui/property_image.c   | 93 +++++++++++++++++++++++++++++++++++++++++++
 src/bin/ui/property_private.h | 55 +++++++++++++++++++++++++
 4 files changed, 150 insertions(+), 1 deletion(-)

diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 3fe9cce..6cb509d 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -63,6 +63,7 @@ libete_a_SOURCES = \
 ../../src/bin/ui/blocks/ui_block.c \
 ../../src/bin/ui/property.c \
 ../../src/bin/ui/property_group.c \
+../../src/bin/ui/property_image.c \
 ../../src/bin/ui/blocks/ui_widget_list.c \
 ../../src/bin/ui/blocks/ui_signal_list.c \
 ../../src/bin/ui/blocks/ui_states_list.c \
diff --git a/src/bin/ui/property_group.c b/src/bin/ui/property_group.c
index 1f66c35..3af2071 100644
--- a/src/bin/ui/property_group.c
+++ b/src/bin/ui/property_group.c
@@ -25,7 +25,7 @@
 #define EFL_BETA_API_SUPPORT
 #define EFL_EO_API_SUPPORT
 
-#include "property_group.h"
+#include "property_private.h"
 #include "property_macros.h"
 #include "main_window.h"
 #include "string_common.h"
diff --git a/src/bin/ui/property_image.c b/src/bin/ui/property_image.c
new file mode 100644
index 0000000..51f82ee
--- /dev/null
+++ b/src/bin/ui/property_image.c
@@ -0,0 +1,93 @@
+/*
+ * Edje Theme Editor
+ * Copyright (C) 2013-2014 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 "property_private.h"
+#include "property_macros.h"
+#include "main_window.h"
+#include "string_common.h"
+#include "new_history.h"
+#include "editor.h"
+#include "validator.h"
+
+#include "signals.h"
+
+#define IMAGE_PROP_DATA "image_prop_data"
+
+#define IMAGE_PROP_DATA_GET() \
+   assert(property != NULL); \
+   Image_Prop_Data *pd = evas_object_data_get(property, IMAGE_PROP_DATA); \
+   assert(pd != NULL);
+
+/*
+ * Callback is added for frames at property box to correct scroller
+ * work while each frame would be expanded/collapsed
+ */
+#define FRAME_PROPERTY_ADD(PARENT, FRAME, AUTOCOLLAPSE, TITLE, SCROLLER) \
+FRAME_ADD(PARENT, FRAME, AUTOCOLLAPSE, TITLE) \
+evas_object_smart_callback_add(FRAME, "clicked", _on_frame_click, SCROLLER);
+
+struct _Image_Prop_Data
+{
+   Evas_Object *box;
+   Evas_Object *image_preview;
+
+   Evas_Object *name;
+   Evas_Object *location;
+   Evas_Object *type;
+   Evas_Object *compression;
+   Evas_Object *quality;
+   Evas_Object *size;
+   Evas_Object *usage_list;
+};
+typedef struct _Image_Prop_Data Image_Prop_Data;
+
+static void
+_on_image_selected(void *data __UNUSED__,
+                   Evas_Object *obj __UNUSED__,
+                   void *event_info __UNUSED__)
+{
+}
+
+Evas_Object *
+ui_property_image_add(Evas_Object *parent)
+{
+   Image_Prop_Data *pd;
+
+   assert(parent != NULL);
+
+   pd = mem_calloc(1, sizeof(Image_Prop_Data));
+
+   /* editors */
+   BOX_ADD(parent, pd->box, EINA_FALSE, EINA_FALSE);
+   elm_box_align_set(pd->box, 0.5, 0.0);
+   evas_object_hide(pd->box);
+
+   pd->image_preview = elm_layout_add(parent);
+   elm_layout_theme_set(pd->image_preview, "layout", "image_editor", 
"preview");
+   elm_box_pack_end(pd->box, pd->image_preview);
+   evas_object_size_hint_weight_set(pd->image_preview, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(pd->image_preview, EVAS_HINT_FILL, 
EVAS_HINT_FILL);
+   evas_object_show(pd->image_preview);
+
+   evas_object_data_set(pd->box, IMAGE_PROP_DATA, pd);
+
+   evas_object_smart_callback_add(ap.win, SIGNAL_IMAGE_SELECTED, 
_on_image_selected, pd->box);
+
+   return pd->box;
+}
diff --git a/src/bin/ui/property_private.h b/src/bin/ui/property_private.h
new file mode 100644
index 0000000..86b0fd6
--- /dev/null
+++ b/src/bin/ui/property_private.h
@@ -0,0 +1,55 @@
+/*
+ * Edje Theme Editor
+ * Copyright (C) 2013-2014 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.
+ */
+
+#ifndef UI_PROPERTY_1_H
+#define UI_PROPERTY_1_H
+
+/**
+ * @defgroup Property Property
+ * @ingroup Block
+ *
+ * This widget designed for show group and part details.
+ */
+
+#ifndef HAVE_ENVENTOR
+#include "syntax_color.h"
+#endif
+#include "widget_manager.h"
+#include "workspace.h"
+
+
+Evas_Object *
+ui_property_group_add(Evas_Object *parent);
+
+void
+ui_property_group_set(Evas_Object *parent, Group *group);
+
+void
+ui_property_group_unset(Evas_Object *parent);
+
+void
+ui_property_part_set(Evas_Object *parent, Part_ *part);
+
+void
+ui_property_part_state_set(Evas_Object *parent, Part_ *part);
+
+Evas_Object *
+ui_property_image_add(Evas_Object *parent);
+
+#endif /* UI_PROPERTY_1_H */

-- 


Reply via email to