src/layout/layout_voice.c
src/view/common/view_generic_popup.c
src/view/picture/view_picture_slider_generic.c
- src/view/picture/view_picture_mode.c
src/view/picture/view_picture_contrast.c
src/view/picture/view_picture_brightness.c
- src/view/picture/view_picture_sharpness.c
src/view/picture/view_picture_color.c
src/view/picture/view_picture_tint.c
- src/view/picture/view_picture_screen_adj.c
src/view/system/view_clock.c
src/view/system/view_language.c
src/view/system/view_location.c
#include "common/menumgr.h"
-#define PICTURE_MODE_STANDARD_STR "Standard"
-#define PICTURE_MODE_MOVIE_STR "Movie"
-
-#define SCREEN_ADJ_16_9_STR "16:9"
-#define SCREEN_ADJ_4_3_STR "4:3"
-#define SCREEN_ADJ_AUTO_STR "Auto Wide"
-#define SCREEN_ADJ_WIDE_ZOOM_STR "Wide Zoom"
-#define SCREEN_ADJ_FIT_STR "Screen Fit"
-
-/**
-* @brief
-*/
-typedef enum _picture_mode {
- PICTURE_MODE_STANDARD = 0,
- PICTURE_MODE_MOVIE,
- PICTURE_MODE_MAX
-} settings_picture_mode;
-
-#define SCREEN_ADJ_OPTS_COUNT 5
-
-extern const char *screen_adj_names[SCREEN_ADJ_OPTS_COUNT];
-
-/**
-* @brief Sets system picture mode.
-*
-* @param mode_to_set Picture mode to set
-*/
-void settings_picture_set_picture_mode(settings_picture_mode mode_to_set);
-
/**
* @brief Sets contrast of the picture.
*
void settings_picture_set_brightness(int val);
/**
-* @brief Sets sharpness of the picture.
-*
-* @param val New sharpness value
-*/
-void settings_picture_set_sharpness(int val);
-
-/**
* @brief Sets color of the picture.
*
* @param val New color value
*/
void settings_picture_set_tint_g(int val);
-
-/**
-* @brief Gets picture mode.
-*
-* @return Picture mode
-*/
-settings_picture_mode settings_picture_get_picture_mode(void);
-
/**
* @brief Gets picture contrast value.
*
int settings_picture_get_max_brightness(void);
/**
-* @brief Gets picture sharpness value.
-*
-* @return Picture sharpness value
-*/
-int settings_picture_get_sharpness(void);
-
-/**
-* @brief Gets picture sharpness relative value.
-*
-* @return Picture sharpness relative value
-*/
-float settings_picture_get_sharpness_relative(void);
-
-/**
* @brief Gets picture color value.
*
* @return Picture color value
float settings_picture_get_tint_relative(void);
/**
-* @brief Sets screen adjust
-*
-* @param adj
-*/
-void settings_picture_set_screen_adjust(int adj);
-
-/**
-* @brief Gets picture screen adjust
-*
-* @return Picture screen adjust
-*/
-int settings_picture_get_screen_adjust(void);
-
-/**
-* @brief Gets picture screen adjust in string
-*
-* @return String with picture screen adjust
-*/
-const char *settings_picture_get_screen_adjust_str(void);
-
-/**
-* @brief Sets picture mode update callback
-*
-* @param data Data to be passed to the handler callbacks.
-*/
-void settings_picture_set_picture_mode_update_callbacks(void *data);
-
-/**
* @brief Sets picture contrast update callback
*
* @param data Data to be passed to the handler callbacks.
void settings_picture_set_brightness_update_callbacks(void *data);
/**
-* @brief Sets picture sharpness update callback
-*
-* @param data Data to be passed to the handler callbacks.
-*/
-void settings_picture_set_sharpness_update_callbacks(void *data);
-
-/**
* @brief Sets picture color update callback
*
* @param data Data to be passed to the handler callbacks.
*/
void settings_picture_set_tint_update_callbacks(void *data);
-/**
-* @brief Sets picture screen adjust update callback
-*
-* @param data Data to be passed to the handler callbacks.
-*/
-void settings_picture_set_screen_adj_update_callbacks(void *data);
-
#endif /* __AIR_SETTINGS_PICTURE_H__ */
#define VIEW_ACTION_MENU "VIEW_ACTION_MENU"
/* View ID - Picture */
-#define VIEW_PICTURE_MODE "VIEW_PICTURE_MODE"
#define VIEW_PICTURE_CONTRAST "VIEW_PICTURE_CONTRAST"
#define VIEW_PICTURE_BRIGHTNESS "VIEW_PICTURE_BRIGHTNESS"
-#define VIEW_PICTURE_SHARPNESS "VIEW_PICTURE_SHARPNESS"
#define VIEW_PICTURE_COLOR "VIEW_PICTURE_COLOR"
#define VIEW_PICTURE_TINT "VIEW_PICTURE_TINT"
-#define VIEW_PICTURE_SCREEN_ADJ "VIEW_PICTURE_SCREEN_ADJ"
/* View ID - System */
#define VIEW_CLOCK "VIEW_CLOCK"
#define STR_VOLUME "Volume"
#define STR_SOURCE "Source"
-#define STR_PICTURE_MODE "Picture Mode"
#define STR_CONTRAST "Contrast"
#define STR_BRIGHTNESS "Brightness"
-#define STR_SHARPNESS "Sharpness"
#define STR_COLOR "Color"
#define STR_TINT "Tint"
#define STR_SCR_ADJ "Screen Adjustment"
#define PICT_MODE_TUT "Picture mode tutorial"
#define PICT_CONTR_TUT "Picture contrast tutorial"
#define PICT_BRIGHT_TUT "Picture brightness tutorial"
-#define PICT_SHARP_TUT "Picture sharpness tutorial"
#define PICT_COLOR_TUT "Picture color tutorial"
#define PICT_TINT_TUT "Picture tint tutorial"
#define PICT_SCR_ADJ_TUT "Picture screen adjustment tutorial"
+++ /dev/null
-/*
- * 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.
- */
-
-#ifndef __AIR_SETTINGS_VIEW_PICTURE_MODE_H__
-#define __AIR_SETTINGS_VIEW_PICTURE_MODE_H__
-
-#include "common/viewmgr.h"
-
-/**
-* @brief Get the pointer to the view_class object of picture mode view.
-*
-* @return The pointer to picture mode view_class object.
-*/
-view_class *view_picture_mode_get_vclass(void);
-
-#endif /* __AIR_SETTINGS_VIEW_PICTURE_MODE_H__ */
+++ /dev/null
-/*
- * 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.
- */
-
-#ifndef VIEW_PICTURE_SCREEN_ADJ_H_
-#define VIEW_PICTURE_SCREEN_ADJ_H_
-
-#include "view/common/view_generic_popup.h"
-
-/**
-* @brief Get the pointer to the view_class object of picture screen adjustment view.
-*
-* @return The pointer to picture screen adjustment view_class object.
-*/
-view_class *view_picture_screen_adj_get_vclass(void);
-
-#endif /* VIEW_PICTURE_SCREEN_ADJ_H_ */
+++ /dev/null
-/*
- * 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.
- */
-
-#ifndef __AIR_SETTINGS_VIEW_PICTURE_SHARPNESS_H__
-#define __AIR_SETTINGS_VIEW_PICTURE_SHARPNESS_H__
-
-#include "common/viewmgr.h"
-
-/**
-* @brief Get the pointer to the view_class object of picture sharpness view.
-*
-* @return The pointer to picture sharpness view_class object.
-*/
-view_class *view_picture_sharpness_get_vclass(void);
-
-#endif /* __AIR_SETTINGS_VIEW_PICTURE_SHARPNESS_H__ */
#include "view/base.edc"
#include "view/common/generic_slider_view.edc"
#include "view/common/popup_2btns.edc"
- #include "view/common/popup_screen_adj.edc"
#include "view/system/clock.edc"
#include "view/system/location.edc"
#include "view/system/pin.edc"
+++ /dev/null
-/*
- * Copyright (c) 2015 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.
- */
-
-group {
- name, GRP_VIEW_POPUP_BUTTONS_LIST;
- parts {
- part {
- name, "area";
- type, RECT;
- scale, 1;
- description {
- state, "default" 0.0;
- visible, 0;
- }
- }
-
- part {
- name, PART_POPUP_NAME;
- type, TEXT;
- scale, 1;
- description {
- state, "default" 0.0;
- min, 0 32;
- rel1 {
- relative, 0.0 0.0;
- }
- rel2 {
- relative, 1.0 0.2;
- }
- fixed, 0 1;
- color, COLOR_TEXT_POPUP;
- text {
- font, FONT_LIGHT;
- align, 0.5 0.2;
- size, 32;
- }
- }
- }
-
- part {
- name, PART_POPUP_BTN_BOX;
- type, SWALLOW;
- scale, 1;
- description {
- state, "default" 0.0;
- rel1 {
- to_y, PART_POPUP_NAME;
- relative, 0.02 1.05;
- }
- rel2 {
- relative, 0.98 0.95;
- }
- color, 0 0 0 255;
- }
- }
- }
-}
#define DISPLAY_MAIN 0
#define DEFAULT_MAX_BRIGHTNESS 100
#define DEFAULT_CONTRAST 100
-#define DEFAULT_SHARPNESS 100
#define DEFAULT_COLOR 100
#define DEFAULT_TINT_G 50
#define CONTRAST_MIN_VALUE 0
#define CONTRAST_MAX_VALUE 100
#define BRIGHTNESS_MIN_VALUE 0
-#define SHARPNESS_MIN_VALUE 0
-#define SHARPNESS_MAX_VALUE 100
#define COLOR_MIN_VALUE 0
#define COLOR_MAX_VALUE 100
#define TINT_MIN_VALUE 0
That's why all device_display_* functions invoked here don't work */
/* Temporary - until real API is known */
-static settings_picture_mode temp_mode = PICTURE_MODE_STANDARD;
static int temp_contrast = DEFAULT_CONTRAST;
-static int temp_sharpness = DEFAULT_SHARPNESS;
static int temp_color = DEFAULT_COLOR;
static int temp_tint_g = DEFAULT_TINT_G;
-static int screen_adj = 0;
-
-const char *screen_adj_names[SCREEN_ADJ_OPTS_COUNT] = {
- SCREEN_ADJ_16_9_STR,
- SCREEN_ADJ_4_3_STR,
- SCREEN_ADJ_AUTO_STR,
- SCREEN_ADJ_WIDE_ZOOM_STR,
- SCREEN_ADJ_FIT_STR
-};
-
-void settings_picture_set_picture_mode(settings_picture_mode mode_to_set)
-{
- //@TODO: set picture mode
- temp_mode = mode_to_set;
-}
void settings_picture_set_contrast(int val)
{
_ERR("Failed to set brightness: %s", get_error_message(ret));
}
-void settings_picture_set_sharpness(int val)
-{
- //@TODO: set sharpness
- temp_sharpness = val;
-}
-
void settings_picture_set_color(int val)
{
//@TODO: set color
temp_tint_g = val;
}
-settings_picture_mode settings_picture_get_picture_mode(void)
-{
- //@TODO: get picture mode
- return temp_mode;
-}
-
int settings_picture_get_contrast(void)
{
//@TODO: get contrast value
return (float)curr/(max - BRIGHTNESS_MIN_VALUE);
}
-int settings_picture_get_sharpness(void)
-{
- //@TODO: get sharpness
- return temp_sharpness;
-}
-
-float settings_picture_get_sharpness_relative(void)
-{
- if (SHARPNESS_MAX_VALUE == SHARPNESS_MIN_VALUE) {
- _ERR("Sharpness max and min values are equal");
- return .0;
- }
- return (float)(settings_picture_get_sharpness() - SHARPNESS_MIN_VALUE)
- / (SHARPNESS_MAX_VALUE - SHARPNESS_MIN_VALUE);
-}
-
int settings_picture_get_color(void)
{
//@TODO: get color
/ (TINT_MAX_VALUE - TINT_MIN_VALUE);
}
-void settings_picture_set_screen_adjust(int adj)
-{
- screen_adj = adj;
-}
-
-int settings_picture_get_screen_adjust(void)
-{
- return screen_adj;
-}
-
-const char *settings_picture_get_screen_adjust_str(void)
-{
- return screen_adj_names[screen_adj];
-}
-
-void settings_picture_set_picture_mode_update_callbacks(void *data)
-{
- if (data) {
- //@TODO: set needed callbacks
- } else {
- //@TODO: unset previously set callbacks
- }
-}
-
void settings_picture_set_contrast_update_callbacks(void *data)
{
if (data) {
}
}
-void settings_picture_set_sharpness_update_callbacks(void *data)
-{
- if (data) {
- //@TODO: set needed callbacks
- } else {
- //@TODO: unset previously set callbacks
- }
-}
-
void settings_picture_set_color_update_callbacks(void *data)
{
if (data) {
//@TODO: unset previously set callbacks
}
}
-
-void settings_picture_set_screen_adj_update_callbacks(void *data)
-{
- if (data) {
- //@TODO: set needed callbacks
- } else {
- //@TODO: unset previously set callbacks
- }
-}
};
enum {
- MENU_PICTURE_MODE,
MENU_CONTRAST,
MENU_BRIGHTNESS,
- MENU_SHARPNESS,
MENU_COLOR,
MENU_TINT,
- MENU_SCREEN_ADJ
};
-static char *_get_picture_mode(void *data, int id);
static char *_get_contrast(void *data, int id);
static char *_get_brightness(void *data, int id);
-static char *_get_sharpness(void *data, int id);
static char *_get_color(void *data, int id);
static char *_get_tint(void *data, int id);
-static char *_get_screen_adj(void *data, int id);
static void _selected(void *data, int id);
static void _focused(void *data, int id);
static void _selected_menu(void *data, int id);
static void _update(void *layout_data, int update_type, void *data);
static struct menumgr_info menu_info[] = {
-/* {
- .id = MENU_PICTURE_MODE,
- .title = STR_PICTURE_MODE,
- .style = STYLE_STATUS_BTN,
- .disabled = EINA_FALSE,
- .status = _get_picture_mode,
- .progress_value = NULL,
- .progress_evas = NULL,
- .selected = _selected,
- .focused = _focused,
- .selected_menu = _selected_menu,
- .update_cb = settings_picture_set_picture_mode_update_callbacks
- },*/
{
.id = MENU_CONTRAST,
.title = STR_CONTRAST,
.selected_menu = _selected_menu,
.update_cb = settings_picture_set_brightness_update_callbacks
},
-/* {
- .id = MENU_SHARPNESS,
- .title = STR_SHARPNESS,
- .style = STYLE_PROGRESS_BTN,
- .disabled = EINA_FALSE,
- .status = _get_sharpness,
- .progress_value = settings_picture_get_sharpness_relative,
- .progress_evas = NULL,
- .selected = _selected,
- .focused = _focused,
- .selected_menu = _selected_menu,
- .update_cb = settings_picture_set_sharpness_update_callbacks
- },*/
{
.id = MENU_COLOR,
.title = STR_COLOR,
.selected_menu = _selected_menu,
.update_cb = settings_picture_set_tint_update_callbacks
},
-/* {
- .id = MENU_SCREEN_ADJ,
- .title = STR_SCR_ADJ,
- .style = STYLE_STATUS_BTN,
- .disabled = EINA_FALSE,
- .status = _get_screen_adj,
- .progress_value = NULL,
- .progress_evas = NULL,
- .selected = _selected,
- .focused = _focused,
- .selected_menu = _selected_menu,
- .update_cb = settings_picture_set_screen_adj_update_callbacks
- },*/
};
static layout_class _lclass = {
return &_lclass;
}
-static char *_get_picture_mode(void *data, int id)
-{
- if(settings_picture_get_picture_mode() == PICTURE_MODE_STANDARD) {
- return strdup(PICTURE_MODE_STANDARD_STR);
- } else {
- return strdup(PICTURE_MODE_MOVIE_STR);
- }
-}
-
static char *_get_contrast(void *data, int id)
{
char con_str[5] = {0, };
return strdup(b_str);
}
-static char *_get_sharpness(void *data, int id)
-{
- char sharp_str[5] = {0, };
- int sharp_val = settings_picture_get_sharpness();
-
- snprintf(sharp_str, sizeof(sharp_str), "%d", sharp_val);
-
- return strdup(sharp_str);
-}
-
static char *_get_color(void *data, int id)
{
char color_str[5] = {0, };
return strdup(tint_str);
}
-static char *_get_screen_adj(void *data, int id)
-{
- return strdup(settings_picture_get_screen_adjust_str());
-}
-
static void _selected(void *data, int id)
{
switch (id)
{
- case MENU_PICTURE_MODE:
- if (!viewmgr_show_view(VIEW_PICTURE_MODE))
- _ERR("Push Picture mode view failed.");
- break;
case MENU_CONTRAST:
if (!viewmgr_push_view(VIEW_PICTURE_CONTRAST))
_ERR("Push Picture contrast view failed.");
if (!viewmgr_push_view(VIEW_PICTURE_BRIGHTNESS))
_ERR("Push Picture brightness view failed.");
break;
- case MENU_SHARPNESS:
- if (!viewmgr_push_view(VIEW_PICTURE_SHARPNESS))
- _ERR("Push Picture sharpness view failed.");
- break;
case MENU_COLOR:
if (!viewmgr_push_view(VIEW_PICTURE_COLOR))
_ERR("Push Picture color view failed.");
if (!viewmgr_push_view(VIEW_PICTURE_TINT))
_ERR("Push Picture tint view failed.");
break;
- case MENU_SCREEN_ADJ:
- if (!viewmgr_show_view(VIEW_PICTURE_SCREEN_ADJ))
- _ERR("Push Picture screen adjustment view failed.");
- break;
default:
break;
}
switch (id)
{
- case MENU_PICTURE_MODE:
- am_param.layout_subitem_id = VIEW_PICTURE_MODE;
- break;
case MENU_CONTRAST:
am_param.layout_subitem_id = VIEW_PICTURE_CONTRAST;
break;
case MENU_BRIGHTNESS:
am_param.layout_subitem_id = VIEW_PICTURE_BRIGHTNESS;
break;
- case MENU_SHARPNESS:
- am_param.layout_subitem_id = VIEW_PICTURE_SHARPNESS;
- break;
case MENU_COLOR:
am_param.layout_subitem_id = VIEW_PICTURE_COLOR;
break;
case MENU_TINT:
am_param.layout_subitem_id = VIEW_PICTURE_TINT;
break;
- case MENU_SCREEN_ADJ:
- am_param.layout_subitem_id = VIEW_PICTURE_SCREEN_ADJ;
- break;
default:
return;
}
#include "define.h"
#include "view/view_base.h"
#include "view/view_action_menu.h"
-#include "view/picture/view_picture_mode.h"
#include "view/picture/view_picture_contrast.h"
#include "view/picture/view_picture_brightness.h"
-#include "view/picture/view_picture_sharpness.h"
#include "view/picture/view_picture_color.h"
#include "view/picture/view_picture_tint.h"
-#include "view/picture/view_picture_screen_adj.h"
#include "view/system/view_clock.h"
#include "view/system/view_sleep_timer.h"
#include "view/system/view_wakeup_timer.h"
static bool _create_picture_ui(void)
{
- if (!viewmgr_add_view(view_picture_mode_get_vclass(), NULL)) {
- _ERR("Adding picture mode view failed.");
- return false;
- }
-
if (!viewmgr_add_view(view_picture_contrast_get_vclass(), NULL)) {
_ERR("Adding picture contrast view failed.");
return false;
return false;
}
- if (!viewmgr_add_view(view_picture_sharpness_get_vclass(), NULL)) {
- _ERR("Adding picture sharpness view failed.");
- return false;
- }
-
if (!viewmgr_add_view(view_picture_color_get_vclass(), NULL)) {
_ERR("Adding picture sharpness view failed.");
return false;
return false;
}
- if (!viewmgr_add_view(view_picture_screen_adj_get_vclass(), NULL)) {
- _ERR("Adding picture screen adjustment view failed.");
- return false;
- }
-
return true;
}
static void _destroy_picture_ui(void)
{
- if (!viewmgr_remove_view(VIEW_PICTURE_MODE))
- _ERR("Remove picture mode view failed.");
-
if (!viewmgr_remove_view(VIEW_PICTURE_CONTRAST))
_ERR("Remove picture contrast view failed.");
if (!viewmgr_remove_view(VIEW_PICTURE_BRIGHTNESS))
_ERR("Remove picture brightness view failed.");
- if (!viewmgr_remove_view(VIEW_PICTURE_SHARPNESS))
- _ERR("Remove picture sharpness view failed.");
-
if (!viewmgr_remove_view(VIEW_PICTURE_COLOR))
_ERR("Remove picture sharpness view failed.");
if (!viewmgr_remove_view(VIEW_PICTURE_TINT))
_ERR("Remove picture tint view failed.");
-
- if (!viewmgr_remove_view(VIEW_PICTURE_SCREEN_ADJ))
- _ERR("Remove picture screen adjustment view failed.");
}
static void _destroy_system_ui(void)
+++ /dev/null
-/*
- * 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.
- */
-
-#include "view/picture/view_picture_mode.h"
-
-#include <app.h>
-#include <Elementary.h>
-
-#include "app_debug.h"
-#include "define.h"
-#include "common/viewmgr.h"
-#include "common/inputmgr.h"
-#include "common/utils.h"
-#include "data/settings_picture.h"
-
-#define STR_PICTURE_MODE_DES "Select Picture Mode."
-
-struct _priv {
- Evas_Object *base;
- Evas_Object *popup_btn[PICTURE_MODE_MAX];
-};
-
-enum picture_mode_eo_type {
- EO_BTN_MODE_STANDARD = 0,
- EO_BTN_MODE_MOVIE
-};
-
-static void _clicked_cb(int id, void *data, Evas_Object *obj);
-static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
- Evas_Event_Key_Down *ev);
-
-static char *picture_mode[PICTURE_MODE_MAX] = {PICTURE_MODE_STANDARD_STR, PICTURE_MODE_MOVIE_STR};
-
-static input_handler handler = {
- .key_down = _key_down_cb,
- .clicked = _clicked_cb
-};
-
-static bool _fill_popup_btns(struct _priv *priv, Evas_Object *layout,
- int btn_count, char *btn_part_x, char **btn_text, int first_btn_eo)
-{
- Evas_Object *btn = NULL;
- int i;
-
- for(i = 0; i < btn_count; i++) {
- char part_name[PART_POPUP_BUTTON_STR_MAX_L] = {0, };
- snprintf(part_name, sizeof(part_name), btn_part_x, i);
-
- btn = utils_add_button(layout, part_name, NULL, btn_text[i]);
- if (!btn) {
- _ERR("Add button failed.");
- return false;
- }
-
- priv->popup_btn[i] = btn;
-
- inputmgr_add_callback(btn, first_btn_eo+i, &handler, priv);
- }
-
- return true;
-}
-
-static Evas_Object *_create(Evas_Object *win, void *data)
-{
- struct _priv *priv = NULL;
- Evas_Object *ly = NULL;
-
- if (!win) {
- _ERR("Get window object failed.");
- return NULL;
- }
-
- priv = calloc(1, sizeof(struct _priv));
- if (!priv) {
- _ERR("Calloc failed.");
- return NULL;
- }
-
- priv->base = utils_add_popup(win, NULL, STR_PICTURE_MODE, NULL);
- if (!priv->base) {
- _ERR("Add popup failed");
- free(priv);
- return NULL;
- }
-
- /* Use language popup layout - they are the same (for now) */
- ly = utils_add_layout(priv->base, GRP_VIEW_POPUP_2BTNS, EINA_FALSE);
- if (!ly) {
- _ERR("Add layout failed.");
- evas_object_del(priv->base);
- free(priv);
- return NULL;
- }
-
- elm_object_part_text_set(ly, PART_POPUP_NAME, STR_PICTURE_MODE_DES);
-
- if (!_fill_popup_btns(priv, ly, PICTURE_MODE_MAX, PART_POPUP_BUTTON_X,
- picture_mode, EO_BTN_MODE_STANDARD)) {
- evas_object_del(priv->base);
- free(priv);
- return NULL;
- }
-
- elm_object_content_set(priv->base, ly);
-
- if (!viewmgr_set_view_data(VIEW_PICTURE_MODE, priv)) {
- _ERR("Set view data failed.");
- evas_object_del(priv->base);
- free(priv);
- return NULL;
- }
-
- return priv->base;
-}
-
-static void _show(void *data)
-{
- struct _priv *priv = (struct _priv *)data;
- int pict_mode = 0;
-
- if (!priv) {
- _ERR("Invalid parameter.");
- return;
- }
-
- evas_object_show(priv->base);
-
- /* Set Focus */
- pict_mode = settings_picture_get_picture_mode();
-
- if(pict_mode != PICTURE_MODE_MAX)
- elm_object_focus_set(priv->popup_btn[pict_mode], EINA_TRUE);
-}
-
-static void _hide(void *data)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!priv) {
- _ERR("Invalid parameter.");
- return;
- }
-
- evas_object_hide(priv->base);
-}
-
-static void _destroy(void *data)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!priv) {
- _ERR("Invalid parameter.");
- return;
- }
-
- evas_object_del(priv->base);
-
- free(priv);
-}
-
-static view_class _vclass = {
- .view_id = VIEW_PICTURE_MODE,
- .create = _create,
- .show = _show,
- .hide = _hide,
- .destroy = _destroy
-};
-
-view_class *view_picture_mode_get_vclass(void)
-{
- return &_vclass;
-}
-
-static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
- Evas_Event_Key_Down *ev)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!ev || !priv) {
- _ERR("Invalid argument.");
- return;
- }
-
- if (!strcmp(ev->keyname, KEY_BACK) || !strcmp(ev->keyname, KEY_BACK_WAY))
- viewmgr_pop_view();
-}
-
-static void _clicked_cb(int id, void *data, Evas_Object *obj)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!priv || !obj) {
- _ERR("Invalid argument.");
- return;
- }
-
- switch (id) {
- case EO_BTN_MODE_STANDARD:
- settings_picture_set_picture_mode(PICTURE_MODE_STANDARD);
- break;
- case EO_BTN_MODE_MOVIE:
- settings_picture_set_picture_mode(PICTURE_MODE_MOVIE);
- break;
- default:
- _ERR("Unhandled object type.");
- }
-
- viewmgr_pop_view();
-}
+++ /dev/null
-/*
- * 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.
- */
-
-#include "view/picture/view_picture_screen_adj.h"
-#include <app.h>
-#include <Elementary.h>
-#include "app_debug.h"
-#include "define.h"
-#include "common/utils.h"
-#include "view/common/view_generic_popup.h"
-#include "data/settings_picture.h"
-
-struct _priv {
- Evas_Object *popup;
- void *base_popup_data;
- const view_class *base_popup_class;
-};
-
-/* View class functions: */
-static Evas_Object *_create(Evas_Object *win, void *data);
-static void _destroy(void *view_data);
-static void _show(void *view_data);
-static void _hide(void *view_data);
-
-/* Enter button: */
-static void _clicked_cb(int id, void *data, Evas_Object *obj);
-/* */
-static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
- Evas_Event_Key_Down *ev);
-
-const char *title = "Screen Adjustment";
-const char *description = "Select Screen Adjustment.";
-
-static view_class _vclass = {
- .view_id = VIEW_PICTURE_SCREEN_ADJ,
- .create = _create,
- .show = _show,
- .hide = _hide,
- .destroy = _destroy
-};
-
-static input_handler handler = {
- .key_down = _key_down_cb,
- .clicked = _clicked_cb
-};
-
-
-view_class *view_picture_screen_adj_get_vclass(void)
-{
- return &_vclass;
-}
-
-static Evas_Object *_create(Evas_Object *win, void *data)
-{
- struct _priv *priv = NULL;
- generic_popup_attr constructor_param = {0,};
-
- constructor_param.buttns_count = SCREEN_ADJ_OPTS_COUNT;
- constructor_param.popup_title = title;
- constructor_param.popup_description = description;
- constructor_param.btn_texts = screen_adj_names;
- constructor_param.popup_layout_group = GRP_VIEW_POPUP_BUTTONS_LIST;
- constructor_param.handler = &handler;
- constructor_param.ui_id_on_show_focus = &settings_picture_get_screen_adjust;
-
- if (!win) {
- _ERR("Get window object failed.");
- return NULL;
- }
-
- priv = calloc(1, sizeof(struct _priv));
- if (!priv) {
- _ERR("Calloc failed.");
- return NULL;
- }
-
- priv->base_popup_class = view_generic_popup_get_vclass();
-
- if (!priv->base_popup_class || ! priv->base_popup_class->create) {
- free(priv);
- return NULL;
- }
-
- priv->popup = priv->base_popup_class->create(win, &constructor_param);
-
- if (!priv->popup) {
- free(priv);
- return NULL;
- }
-
- priv->base_popup_data = constructor_param.generic_popup_data;
-
- if (!viewmgr_set_view_data(VIEW_PICTURE_SCREEN_ADJ, priv)) {
- _ERR("Set view data failed.");
- _destroy(priv);
- free(priv);
- return NULL;
- }
-
- return priv->popup;
-}
-
-static void _show(void *data)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!priv
- || !priv->base_popup_class
- || !priv->base_popup_class->show
- || !priv->base_popup_data) {
- _ERR("Invalid parameter.");
- return;
- }
-
- priv->base_popup_class->show(priv->base_popup_data);
-}
-
-static void _hide(void *data)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!priv
- || !priv->base_popup_class
- || !priv->base_popup_class->hide
- || !priv->base_popup_data) {
- _ERR("Invalid parameter.");
- return;
- }
- priv->base_popup_class->hide(priv->base_popup_data);
-}
-
-static void _destroy(void *data)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!priv
- || !priv->base_popup_class
- || !priv->base_popup_class->destroy
- || !priv->base_popup_data) {
- _ERR("Invalid parameter.");
- return;
- }
- priv->base_popup_class->destroy(priv->base_popup_data);
- free(priv);
-}
-
-static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
- Evas_Event_Key_Down *ev)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!ev || !priv) {
- _ERR("Invalid argument.");
- return;
- }
-
- if (!strcmp(ev->keyname, KEY_BACK) || !strcmp(ev->keyname, KEY_BACK_WAY))
- viewmgr_pop_view();
-}
-
-static void _clicked_cb(int id, void *data, Evas_Object *obj)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!priv || !obj) {
- _ERR("Invalid argument.");
- return;
- }
-
- settings_picture_set_screen_adjust(id);
- viewmgr_pop_view();
-}
+++ /dev/null
-/*
- * 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.
- */
-
-#include "view/picture/view_picture_sharpness.h"
-
-#include <app.h>
-
-#include "app_debug.h"
-#include "define.h"
-#include "common/inputmgr.h"
-#include "common/utils.h"
-#include "view/picture/view_picture_slider_generic.h"
-#include "data/settings_picture.h"
-
-struct _priv {
- Evas_Object *base;
- void *base_view_data;
- const view_class *base_view_class;
-};
-
-static Evas_Object *_create(Evas_Object *win, void *data)
-{
- struct _priv *priv = NULL;
- generic_slider_attr g_slider_attr = {0, };
-
- if (!win) {
- _ERR("Get window object failed.");
- return NULL;
- }
-
- priv = calloc(1, sizeof(struct _priv));
- if (!priv) {
- _ERR("Calloc failed.");
- return NULL;
- }
-
- g_slider_attr.slider_title = STR_SHARPNESS;
- g_slider_attr.slider_min_val = 0;
- g_slider_attr.slider_max_val = 100;
- g_slider_attr.slider_cur_val = 100;
- g_slider_attr.set_setting_value = settings_picture_set_sharpness;
- g_slider_attr.get_setting_value = settings_picture_get_sharpness;
- g_slider_attr.slider_step = 0.01;
-
- priv->base_view_class = view_picture_slider_generic_get_vclass();
-
- if (!priv->base_view_class || !priv->base_view_class->create) {
- _ERR("Failed to create generic slider view class.");
- free(priv);
- return NULL;
- }
-
- priv->base = priv->base_view_class->create(win, &g_slider_attr);
- if (!priv->base) {
- _ERR("Failed to create sharpness view");
- free(priv);
- return NULL;
- }
-
- priv->base_view_data = g_slider_attr.generic_slider_data;
-
- if (!viewmgr_set_view_data(VIEW_PICTURE_SHARPNESS, priv)) {
- _ERR("Set view data failed.");
- priv->base_view_class->destroy(priv->base_view_data);
- free(priv);
- return NULL;
- }
-
- return priv->base;
-}
-
-static void _show(void *data)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!priv || !priv->base_view_class || !priv->base_view_class->show
- || !priv->base_view_data) {
- _ERR("Invalid parameter.");
- return;
- }
-
- priv->base_view_class->show(priv->base_view_data);
-}
-
-static void _hide(void *data)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!priv || !priv->base_view_class || !priv->base_view_class->hide
- || !priv->base_view_data) {
- _ERR("Invalid parameter.");
- return;
- }
-
- priv->base_view_class->hide(priv->base_view_data);
-}
-
-static void _destroy(void *data)
-{
- struct _priv *priv = (struct _priv *)data;
-
- if (!priv || !priv->base_view_class || !priv->base_view_class->destroy
- || !priv->base_view_data) {
- _ERR("Invalid parameter.");
- return;
- }
-
- priv->base_view_class->destroy(priv->base_view_data);
-
- free(priv);
-}
-
-static view_class _vclass = {
- .view_id = VIEW_PICTURE_SHARPNESS,
- .create = _create,
- .show = _show,
- .hide = _hide,
- .destroy = _destroy
-};
-
-view_class *view_picture_sharpness_get_vclass(void)
-{
- return &_vclass;
-}
PICT_MODE_TUT_IX = 0,
PICT_CONTR_TUT_IX,
PICT_BRIGHT_TUT_IX,
- PICT_SHARP_TUT_IX,
PICT_COLOR_TUT_IX,
PICT_TINT_TUT_IX,
PICT_SCR_ADJ_TUT_IX,
[PICT_MODE_TUT_IX] = PICT_MODE_TUT,
[PICT_CONTR_TUT_IX] = PICT_CONTR_TUT,
[PICT_BRIGHT_TUT_IX] = PICT_BRIGHT_TUT,
- [PICT_SHARP_TUT_IX] = PICT_SHARP_TUT,
[PICT_COLOR_TUT_IX] = PICT_COLOR_TUT,
[PICT_TINT_TUT_IX] = PICT_TINT_TUT,
[PICT_SCR_ADJ_TUT_IX] = PICT_SCR_ADJ_TUT,
{
Eina_Bool res = EINA_TRUE;
- res &= eina_hash_add(hash, VIEW_PICTURE_MODE, (void *)tuts_txts[PICT_MODE_TUT_IX]);
res &= eina_hash_add(hash, VIEW_PICTURE_CONTRAST, (void *)tuts_txts[PICT_CONTR_TUT_IX]);
res &= eina_hash_add(hash, VIEW_PICTURE_BRIGHTNESS, (void *)tuts_txts[PICT_BRIGHT_TUT_IX]);
- res &= eina_hash_add(hash, VIEW_PICTURE_SHARPNESS, (void *)tuts_txts[PICT_SHARP_TUT_IX]);
res &= eina_hash_add(hash, VIEW_PICTURE_COLOR, (void *)tuts_txts[PICT_COLOR_TUT_IX]);
res &= eina_hash_add(hash, VIEW_PICTURE_TINT, (void *)tuts_txts[PICT_TINT_TUT_IX]);
- res &= eina_hash_add(hash, VIEW_PICTURE_SCREEN_ADJ, (void *)tuts_txts[PICT_SCR_ADJ_TUT_IX]);
res &= eina_hash_add(hash, VIEW_CLOCK, (void *)tuts_txts[CLOCK_TUT_IX]);
res &= eina_hash_add(hash, VIEW_SLEEP_TIMER, (void *)tuts_txts[SLEEP_TIM_TUT_IX]);
res &= eina_hash_add(hash, VIEW_WAKEUP_TIMER, (void *)tuts_txts[WAKE_UP_TUT_IX]);
elm_object_focus_next_object_set(vd->more_fav_btn, vd->fav_btn, ELM_FOCUS_UP);
}
} else {
- if (!strcmp(vd->caller_layout_subitem_id, VIEW_PICTURE_MODE) ||
- !strcmp(vd->caller_layout_subitem_id, VIEW_PICTURE_CONTRAST) ||
+ if (!strcmp(vd->caller_layout_subitem_id, VIEW_PICTURE_CONTRAST) ||
!strcmp(vd->caller_layout_subitem_id, VIEW_PICTURE_BRIGHTNESS) ||
- !strcmp(vd->caller_layout_subitem_id, VIEW_PICTURE_SHARPNESS) ||
!strcmp(vd->caller_layout_subitem_id, VIEW_PICTURE_COLOR) ||
!strcmp(vd->caller_layout_subitem_id, VIEW_PICTURE_TINT) ||
- !strcmp(vd->caller_layout_subitem_id, VIEW_PICTURE_SCREEN_ADJ) ||
!strcmp(vd->caller_layout_subitem_id, VIEW_CLOCK) ||
!strcmp(vd->caller_layout_subitem_id, VIEW_SLEEP_TIMER) ||
!strcmp(vd->caller_layout_subitem_id, VIEW_WAKEUP_TIMER) ||