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/system/view_clock.c
src/view/system/view_sleep_timer.c
src/view/system/view_wakeup_timer.c
void settings_picture_set_picture_mode(settings_picture_mode mode_to_set);
void settings_picture_set_contrast(int val);
void settings_picture_set_brightness(int val);
+void settings_picture_set_sharpness(int val);
+
settings_picture_mode settings_picture_get_picture_mode(void);
int settings_picture_get_contrast(void);
int settings_picture_get_brightness(void);
int settings_picture_get_max_brightness(void);
+int settings_picture_get_sharpness(void);
#endif /* __AIR_SETTINGS_PICTURE_H__ */
#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"
/* View ID - System */
#define VIEW_CLOCK "VIEW_CLOCK"
#define STR_PICTURE_MODE "Picture Mode"
#define STR_CONTRAST "Contrast"
#define STR_BRIGHTNESS "Brightness"
+#define STR_SHARPNESS "Sharpness"
#define STR_LANGUAGE "Language"
#define STR_LOCATION "Location"
--- /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"
+
+view_class *view_picture_sharpness_get_vclass(void);
+
+#endif /* __AIR_SETTINGS_VIEW_PICTURE_SHARPNESS_H__ */
/* Temporary - until real API is known */
static settings_picture_mode temp_mode = PICTURE_MODE_STANDARD;
static int temp_contrast = 50;
+static int temp_sharpness = 50;
void settings_picture_set_picture_mode(settings_picture_mode mode_to_set)
{
_ERR("Failed to set brightness: %s", get_error_message(ret));
}
+void settings_picture_set_sharpness(int val)
+{
+ //@TODO: set sharpness
+ temp_sharpness = val;
+}
+
settings_picture_mode settings_picture_get_picture_mode(void)
{
//@TODO: get picture mode
return max;
}
+
+int settings_picture_get_sharpness(void)
+{
+ //@TODO: get sharpness
+ return temp_sharpness;
+}
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_screen_adj(void *data, int id);
static void _selected(void *data, int id);
},
{
.id = MENU_SHARPNESS,
- .title = "Sharpness",
+ .title = STR_SHARPNESS,
.style = STYLE_STATUS_BTN,
- .disabled = EINA_TRUE,
- .status = _get_status,
+ .disabled = EINA_FALSE,
+ .status = _get_sharpness,
.selected = _selected,
},
{
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_screen_adj(void *data, int id)
{
SETTING_TRACE_BEGIN;
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;
}
}
#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/system/view_clock.h"
#include "view/system/view_sleep_timer.h"
#include "view/system/view_wakeup_timer.h"
return false;
}
+ if (!viewmgr_add_view(view_picture_sharpness_get_vclass(), NULL)) {
+ _ERR("Adding picture sharpness view failed.");
+ return false;
+ }
return true;
}
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.");
}
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_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;
+
+ 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");
+ 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;
+}