summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjin0.kim <jin0.kim@samsung.com>2017-05-17 16:16:02 +0830
committerjin0.kim <jin0.kim@samsung.com>2017-05-18 12:12:38 +0830
commit81973fa2de69f4e928c8ea844cf00a7ae03b4fd5 (patch)
tree12b9b900d267a1ad91b2f6298958f2a7d8404087 /src
parent8f0a44f2ec722a24010584fbb473a305d99e7666 (diff)
downloadw3-home-81973fa2de69f4e928c8ea844cf00a7ae03b4fd5.tar.gz
w3-home-81973fa2de69f4e928c8ea844cf00a7ae03b4fd5.tar.bz2
w3-home-81973fa2de69f4e928c8ea844cf00a7ae03b4fd5.zip
Add group_feature_moments_controls_view
Change-Id: I7ab3d27f7d27fd2db8efc20d4e7cc4c6be80910c
Diffstat (limited to 'src')
-rwxr-xr-xsrc/moments/moments_control_view.c98
-rwxr-xr-xsrc/moments/moments_view.c63
2 files changed, 119 insertions, 42 deletions
diff --git a/src/moments/moments_control_view.c b/src/moments/moments_control_view.c
new file mode 100755
index 0000000..d6fa414
--- /dev/null
+++ b/src/moments/moments_control_view.c
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Flora License, Version 1.1 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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.
+ */
+
+#include <app.h>
+#include <Elementary.h>
+
+#include "log.h"
+#include "util.h"
+#include "common_conf.h"
+
+#include "moments/moments.h"
+#include "moments/moments_view_conf.h"
+#include "moments/moments_view_edje_conf.h"
+#include "moments/moments_control_view.h"
+
+#include "app_log.h"
+
+#define CONTROL_BUTTON_LAYOUT_EDJE EDJE_DIR"/circle/moments_control_button_layout.edj"
+
+
+
+static struct __control_view_s {
+ Evas_Object *control_layout;
+ Eina_List *button_list;
+} s_info = {
+ .control_layout = NULL,
+ .button_list = NULL,
+};
+
+Evas_Object *moments_control_view_create(Evas_Object *base_layout)
+{
+ Evas_Object * control_layout = elm_grid_add(base_layout);
+ if (!control_layout) {
+ _E("Failed to create grid object");
+ return NULL;
+ }
+
+ evas_object_size_hint_min_set(control_layout, WINDOW_W, WINDOW_H);
+ evas_object_size_hint_weight_set(control_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(control_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_grid_size_set(control_layout, WINDOW_W, WINDOW_H);
+
+ evas_object_color_set(control_layout, 255, 255, 255, 0);
+
+ elm_layout_content_set(base_layout, BUTTON_LAYOUT, control_layout);
+ evas_object_show(control_layout);
+
+ s_info.control_layout = control_layout;
+
+ return control_layout;
+}
+
+void moments_control_view_destroy(void)
+{
+ if (s_info.control_layout) {
+ /*FIXME : unset*/
+ evas_object_del(s_info.control_layout);
+ }
+}
+
+const char *__get_icon_image_file (const char *label)
+{
+ return NULL;
+}
+
+control_info_t *moments_control_create_control_button(const char * label)
+{
+ control_info_t *button = (control_info_t *)malloc(sizeof(control_info_t));
+ button->label = strdup(label);
+ button->icon_image = __get_icon_image_file(label);
+ button->volume_text = strdup("0");
+ button->btn_type = MOMENTS_CONTROLS_BTN_TYPE_ICON_ONLY;
+ button->icon_status = 0;
+
+ return button;
+}
+
+
+#include "test.h"
+#if TEST_MODE
+Eina_List *__t__get_moments_control_button_list()
+{
+ return s_info.button_list;
+}
+#endif
diff --git a/src/moments/moments_view.c b/src/moments/moments_view.c
index 2d1c3aa..7d87b21 100755
--- a/src/moments/moments_view.c
+++ b/src/moments/moments_view.c
@@ -28,6 +28,7 @@
#include "moments/moments_status_view.h"
#include "moments/moments_view_conf.h"
#include "moments/moments_view_edje_conf.h"
+#include "moments/moments_control_view.h"
#include "layout.h"
#include "app_log.h"
@@ -42,7 +43,7 @@ static struct __view_s {
Evas_Object *background_layout;
Evas_Object *size_setter;
Evas_Object *center_layout;
- Evas_Object *button_grid;
+ Evas_Object *control_layout;
Evas_Object *button_object;
bool is_freeze;
bool is_drawing_up;
@@ -54,7 +55,7 @@ static struct __view_s {
.background_layout = NULL,
.size_setter = NULL,
.center_layout = NULL,
- .button_grid = NULL,
+ .control_layout = NULL,
.button_object = NULL,
.is_freeze = true,
.is_drawing_up = false,
@@ -78,7 +79,7 @@ const char *controls_btn_group_name[MOMENTS_CONTROLS_BTN_TYPE_MAX] = {
};
-controls_info_t controls_list[MOMENTS_CONTROLS_MAX] = {
+control_info_t controls_list[MOMENTS_CONTROLS_MAX] = {
{MOMENTS_CONTROLS_DO_NOT_DISTRUB, MOMENTS_CONTROLS_BTN_TYPE_ICON_AND_BAR, "do not distrub", "donotdisturb.png", 0, NULL, 0, NULL},
{MOMENTS_CONTROLS_VOLUME, MOMENTS_CONTROLS_BTN_TYPE_ICON_AND_TEXT, "volume", "multimedia.png", 0, "10", 0, NULL},
{MOMENTS_CONTROLS_FIGHT_MODE, MOMENTS_CONTROLS_BTN_TYPE_ICON_AND_BAR, "fight mode", "flight_mode.png", 0, NULL, 0, NULL},
@@ -96,9 +97,8 @@ extern void moments_view_animator_move(Evas_Object *layout[2], MOVEMENT info[2],
static Evas_Object *__create_base_layout(Evas_Object *parent);
static Evas_Object *__create_base_size_setter(Evas_Object *base_layout);
static Evas_Object *__create_center_layout(Evas_Object *base_layout);
-static Evas_Object *__create_button_grid(Evas_Object *base_layout);
static Evas_Object *__create_button_object(Evas_Object *base_layout);
-static Evas_Object *__create_controls_button(Evas_Object * base_layout, controls_info_t btn_info);
+static Evas_Object *__create_controls_button(Evas_Object * base_layout, control_info_t btn_info);
static void __set_controls_icon(void);
static void __adjust_content_alpha(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void __set_center_contents(void);
@@ -126,10 +126,10 @@ Evas_Object *moments_create_ui(Evas_Object *base_win)
s_info.center_layout = __create_center_layout(s_info.background_layout);
- s_info.button_grid = __create_button_grid(s_info.background_layout);
+ s_info.control_layout = moments_control_view_create(s_info.background_layout);
-// s_info.button_object = __create_button_object(s_info.button_grid);
-// elm_grid_pack(s_info.button_grid, s_info.button_object, MOMENTS_BUTTON_1_X, MOMENTS_BUTTON_1_Y, MOMENTS_BUTTON_W, MOMENTS_BUTTON_H);
+// s_info.button_object = __create_button_object(s_info.control_layout);
+// elm_grid_pack(s_info.control_layout, s_info.button_object, MOMENTS_BUTTON_1_X, MOMENTS_BUTTON_1_Y, MOMENTS_BUTTON_W, MOMENTS_BUTTON_H);
__set_controls_icon();
evas_object_event_callback_add(s_info.background_layout, EVAS_CALLBACK_MOUSE_DOWN, __down_cb, NULL);
@@ -148,10 +148,10 @@ void moments_destroy_ui(void)
{
_D("%s", __func__);
- if (s_info.button_grid) {
- elm_grid_unpack(s_info.button_grid, s_info.button_object);
+ if (s_info.control_layout) {
+ elm_grid_unpack(s_info.control_layout, s_info.button_object);
evas_object_del(s_info.button_object);
- evas_object_del(s_info.button_grid);
+ evas_object_del(s_info.control_layout);
}
evas_object_event_callback_del(s_info.background_layout, EVAS_CALLBACK_MOUSE_UP, __up_cb);
@@ -332,27 +332,6 @@ static void __set_center_contents()
//elm_object_part_text_set(center_layout, CENTER_PLMN_TEXT, "PLMN/SPN");
}
-static Evas_Object *__create_button_grid(Evas_Object *base_layout)
-{
- Evas_Object * button_grid = elm_grid_add(base_layout);
- if (!button_grid) {
- _E("Failed to create grid object");
- return NULL;
- }
-
- evas_object_size_hint_min_set(button_grid, WINDOW_W, WINDOW_H);
- evas_object_size_hint_weight_set(button_grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(button_grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_grid_size_set(button_grid, WINDOW_W, WINDOW_H);
-
- evas_object_color_set(button_grid, 255, 255, 255, 0);
-
- elm_layout_content_set(base_layout, BUTTON_LAYOUT, button_grid);
- evas_object_show(button_grid);
-
- return button_grid;
-}
-
static Evas_Object *__create_button_object(Evas_Object *base_layout)
{
Evas_Object *button_layout = elm_layout_add(base_layout);
@@ -389,13 +368,13 @@ static void __set_controls_icon()
{
int i = 0;
for (i = 0; i < MOMENTS_CONTROLS_MAX; i++) {
- Evas_Object * btn = __create_controls_button(s_info.button_grid, controls_list[i]);
- elm_grid_pack(s_info.button_grid, btn, controls_btn_pos[i][0], controls_btn_pos[i][1], MOMENTS_BUTTON_W, MOMENTS_BUTTON_H);
+ Evas_Object * btn = __create_controls_button(s_info.control_layout, controls_list[i]);
+ elm_grid_pack(s_info.control_layout, btn, controls_btn_pos[i][0], controls_btn_pos[i][1], MOMENTS_BUTTON_W, MOMENTS_BUTTON_H);
}
}
-static Evas_Object *__create_controls_button(Evas_Object * base_layout, controls_info_t btn_info)
+static Evas_Object *__create_controls_button(Evas_Object * base_layout, control_info_t btn_info)
{
Evas_Object *button_layout = elm_layout_add(base_layout);
@@ -430,7 +409,7 @@ __fail:
return NULL;
}
-static int __get_button_grid_alpha(int layout_bottom)
+static int __get_control_layout_alpha(int layout_bottom)
{
double button_grid_alpha = 0;
if (layout_bottom < MOMENT_BUTTON_VI_START_Y) button_grid_alpha = 0;
@@ -456,7 +435,7 @@ static void __adjust_content_alpha(void *data, Evas *e, Evas_Object *obj, void *
evas_object_geometry_get(s_info.background_layout, &x, &y, &w, &h);
- evas_object_color_set(s_info.button_grid, 255, 255, 255, __get_button_grid_alpha(y + WINDOW_H));
+ evas_object_color_set(s_info.control_layout, 255, 255, 255, __get_control_layout_alpha(y + WINDOW_H));
evas_object_color_set(s_info.center_layout, 255, 255, 255, __get_center_layout_alpha(y + WINDOW_H));
}
@@ -530,7 +509,7 @@ static void __hide_complete_cb(void)
evas_object_hide(get_moments_status_layout());
evas_object_move(get_moments_status_layout(), OUTSIDE_X, OUTSIDE_Y);
- evas_object_color_set(s_info.button_grid, 255, 255, 255, 0);
+ evas_object_color_set(s_info.control_layout, 255, 255, 255, 0);
}
static void __pull_down_complete_cb(void)
@@ -696,9 +675,9 @@ Evas_Object * __t__get_moments_size_setter(void)
return s_info.size_setter;
}
-Evas_Object * __t__get_moments_button_grid(void)
+Evas_Object * __t__get_moments_control_layout(void)
{
- return s_info.button_grid;
+ return s_info.control_layout;
}
Evas_Object * __t__get_moments_button_object(void)
@@ -706,9 +685,9 @@ Evas_Object * __t__get_moments_button_object(void)
return s_info.button_object;
}
-int __t__get_button_grid_alpha(int layout_bottom)
+int __t__get_control_layout_alpha(int layout_bottom)
{
- return __get_button_grid_alpha(layout_bottom);
+ return __get_control_layout_alpha(layout_bottom);
}
int __t__get_center_layout_alpha(int layout_bottom)