evas_object_size_hint_weight_set(bt, 1.0, 1.0);
evas_object_size_hint_align_set(bt, -1.0, -1.0);
evas_object_show(bt);
-elm_panes_content_left_set(panes, bt);
+elm_object_content_part_set(panes, ELM_PANES_CONTENT_LEFT, bt);
bt = elm_button_add(win);
elm_object_text_set(bt, "Right");
evas_object_size_hint_weight_set(bt, 1.0, 1.0);
evas_object_size_hint_align_set(bt, -1.0, -1.0);
evas_object_show(bt);
-elm_panes_content_right_set(panes, bt);
+elm_object_content_part_set(panes, ELM_PANES_CONTENT_RIGHT, bt);
#include "widget_preview_tmpl_foot.c"
evas_object_size_hint_weight_set(bt, 1.0, 1.0);
evas_object_size_hint_align_set(bt, -1.0, -1.0);
evas_object_show(bt);
- elm_panes_content_left_set(panes, bt);
+ elm_object_content_part_set(panes, ELM_PANES_CONTENT_LEFT, bt);
//
//
evas_object_smart_callback_add(panes_h, "press", _press, panes_h);
evas_object_smart_callback_add(panes_h, "unpress", _unpress, panes_h);
- elm_panes_content_right_set(panes, panes_h);
+ elm_object_content_part_set(panes, ELM_PANES_CONTENT_RIGHT, panes_h);
//
//
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(bt);
- elm_panes_content_left_set(panes_h, bt);
+ elm_object_content_part_set(panes_h, ELM_PANES_CONTENT_LEFT, bt);
//
//
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(bt);
- elm_panes_content_right_set(panes_h, bt);
+ elm_object_content_part_set(panes_h, ELM_PANES_CONTENT_RIGHT, bt);
//
else return;
if (p->content_left)
- elm_panes_content_left_set(obj, p->content_left);
+ elm_object_content_part_set(obj, ELM_PANES_CONTENT_LEFT, p->content_left);
if (p->content_right)
- elm_panes_content_right_set(obj, p->content_right);
+ elm_object_content_part_set(obj, ELM_PANES_CONTENT_RIGHT, p->content_right);
if (p->is_left_size)
elm_panes_content_left_size_set(obj, p->left_size);
Evas_Object *content = external_common_param_edje_object_get(obj, param);
if ((strcmp(param->s, "")) && (!content))
return EINA_FALSE;
- elm_panes_content_left_set(obj, content);
+ elm_object_content_part_set(obj, ELM_PANES_CONTENT_LEFT, content);
return EINA_TRUE;
}
else if ((!strcmp(param->name, "content right"))
Evas_Object *content = external_common_param_edje_object_get(obj, param);
if ((strcmp(param->s, "")) && (!content))
return EINA_FALSE;
- elm_panes_content_right_set(obj, content);
+ elm_object_content_part_set(obj, ELM_PANES_CONTENT_RIGHT, content);
return EINA_TRUE;
}
else if ((!strcmp(param->name, "horizontal"))
const char *content)
{
if (!strcmp(content, "left"))
- return elm_panes_content_left_get(obj);
+ return elm_object_content_part_get(obj, ELM_PANES_CONTENT_LEFT);
else if (!strcmp(content, "right"))
- return elm_panes_content_right_get(obj);
+ return elm_object_content_part_get(obj, ELM_PANES_CONTENT_RIGHT);
ERR("unknown content '%s'", content);
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(bt);
- elm_panes_content_left_set(panes, bt);
+ elm_object_content_part_set(panes, ELM_PANES_CONTENT_LEFT, bt);
panes_h = elm_panes_add(win);
elm_panes_horizontal_set(panes_h, EINA_TRUE);
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(panes_h, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(panes_h);
- elm_panes_content_right_set(panes, panes_h);
+ elm_object_content_part_set(panes, ELM_PANES_CONTENT_RIGHT, panes_h);
bt = elm_button_add(win);
elm_object_text_set(bt, "Up");
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(bt);
- elm_panes_content_left_set(panes_h, bt);
+ elm_object_content_part_set(panes_h, ELM_PANES_CONTENT_LEFT, bt);
bt = elm_button_add(win);
elm_object_text_set(bt, "Down");
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(bt);
- elm_panes_content_right_set(panes_h, bt);
+ elm_object_content_part_set(panes_h, ELM_PANES_CONTENT_RIGHT bt);
evas_object_smart_callback_add(panes, "clicked", _clicked, panes);
evas_object_smart_callback_add(panes, "clicked,double", _clicked_double,
* @li ELM_PANEL_ORIENT_LEFT
* @li ELM_PANEL_ORIENT_RIGHT
*
- * To set/get/unset the contetn of the panel, you can use
+ * To set/get/unset the content of the panel, you can use
* elm_object_content_set/get/unset APIs.
* Once the content object is set, a previously set one will be deleted.
* If you want to keep that old content object, use the
* Available styles for it:
* - @c "default"
*
+ * Default contents parts of the panes widget that you can use for are:
+ * @li "elm.swallow.left" - A leftside content of the panes
+ * @li "elm.swallow.right" - A rightside content of the panes
+ *
+ * If panes is displayed vertically, left content will be displayed at
+ * top.
+ *
* Here is an example on its usage:
* @li @ref panes_example
*/
+#define ELM_PANES_CONTENT_LEFT "elm.swallow.left"
+#define ELM_PANES_CONTENT_RIGHT "elm.swallow.right"
+
/**
* @addtogroup Panes
* @{
*
* @ingroup Panes
*/
- EAPI void elm_panes_content_left_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1);
+ EINA_DEPRECATED EAPI void elm_panes_content_left_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1);
/**
* Set the right content of the panes widget.
*
* @ingroup Panes
*/
- EAPI void elm_panes_content_right_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1);
+ EINA_DEPRECATED EAPI void elm_panes_content_right_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1);
/**
* Get the left content of the panes.
*
* @ingroup Panes
*/
- EAPI Evas_Object *elm_panes_content_left_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+ EINA_DEPRECATED EAPI Evas_Object *elm_panes_content_left_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
* Get the right content of the panes.
*
* @ingroup Panes
*/
- EAPI Evas_Object *elm_panes_content_right_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+ EINA_DEPRECATED EAPI Evas_Object *elm_panes_content_right_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
* Unset the left content used for the panes.
*
* @ingroup Panes
*/
- EAPI Evas_Object *elm_panes_content_left_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
+ EINA_DEPRECATED EAPI Evas_Object *elm_panes_content_left_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
* Unset the right content used for the panes.
* - @c "default"
*
* Default contents parts of the conformant widget that you can use for are:
- *
* @li "elm.swallow.content" - A content of the conformant
*
* See how to use this widget in this example:
* @ref tutorial_naviframe gives a good overview of the usage of the API.
*/
+#define ELM_NAVIFRAME_ITEM_PREV_BTN "elm.swallow.prev_btn"
+#define ELM_NAVIFRAME_ITEM_NEXT_BTN "elm.swallow.next_btn"
+
/**
* @addtogroup Naviframe
* @{
}
}
+static void
+_content_left_set(Evas_Object *obj, Evas_Object *content)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (wd->contents.left)
+ {
+ evas_object_del(wd->contents.left);
+ wd->contents.left = NULL;
+ }
+ if (content)
+ {
+ wd->contents.left = content;
+ elm_widget_sub_object_add(obj, content);
+ edje_object_part_swallow(wd->panes, "elm.swallow.left", content);
+ }
+}
+
+static void
+_content_right_set(Evas_Object *obj, Evas_Object *content)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (wd->contents.right)
+ {
+ evas_object_del(wd->contents.right);
+ wd->contents.right = NULL;
+ }
+ if (content)
+ {
+ wd->contents.right = content;
+ elm_widget_sub_object_add(obj, content);
+ edje_object_part_swallow(wd->panes, "elm.swallow.right", content);
+ }
+}
+
+static Evas_Object *
+_content_left_unset(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd->contents.left) return NULL;
+ Evas_Object *content = wd->contents.left;
+ elm_widget_sub_object_del(obj, content);
+ edje_object_part_unswallow(wd->panes, content);
+ wd->contents.left = NULL;
+ return content;
+}
+
+static Evas_Object *
+_content_right_unset(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd->contents.right) return NULL;
+ Evas_Object *content = wd->contents.right;
+ elm_widget_sub_object_del(obj, content);
+ edje_object_part_unswallow(wd->panes, content);
+ wd->contents.right = NULL;
+ return content;
+}
+
+static void
+_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+
+ if ((!part) || (!strcmp(part, "elm.swallow.right")))
+ _content_right_set(obj, content);
+ else if(!strcmp(part, "elm.swallow.left"))
+ _content_left_set(obj, content);
+}
+
+static Evas_Object *
+_content_get_hook(const Evas_Object *obj, const char *part)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
+ if ((!part) || (!strcmp(part, "elm.swallow.right")))
+ return wd->contents.left;
+ else if (!strcmp(part, "elm.swallow.left"))
+ return wd->contents.right;
+ return NULL;
+}
+
+static Evas_Object *
+_content_unset_hook(Evas_Object *obj, const char *part)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
+
+ if ((!part) || (!strcmp(part, "elm.swallow.right")))
+ _content_right_unset(obj);
+ else if (!strcmp(part, "elm.swallow.left"))
+ _content_left_unset(obj);
+
+ return NULL;
+}
+
EAPI Evas_Object *
elm_panes_add(Evas_Object *parent)
{
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
elm_widget_focus_next_hook_set(obj, _elm_panes_focus_next_hook);
+ elm_widget_content_set_hook_set(obj, _content_set_hook);
+ elm_widget_content_get_hook_set(obj, _content_get_hook);
+ elm_widget_content_unset_hook_set(obj, _content_unset_hook);
elm_widget_can_focus_set(obj, EINA_FALSE);
wd->panes = edje_object_add(e);
return obj;
}
-
EAPI void
elm_panes_content_left_set(Evas_Object *obj, Evas_Object *content)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
- if (wd->contents.left)
- {
- evas_object_del(wd->contents.left);
- wd->contents.left = NULL;
- }
- if (content)
- {
- wd->contents.left = content;
- elm_widget_sub_object_add(obj, content);
- edje_object_part_swallow(wd->panes, "elm.swallow.left", content);
- }
+ _content_set_hook(obj, "elm.swallow.left", content);
}
EAPI void
elm_panes_content_right_set(Evas_Object *obj, Evas_Object *content)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
- if (wd->contents.right)
- {
- evas_object_del(wd->contents.right);
- wd->contents.right = NULL;
- }
- if (content)
- {
- wd->contents.right = content;
- elm_widget_sub_object_add(obj, content);
- edje_object_part_swallow(wd->panes, "elm.swallow.right", content);
- }
+ _content_set_hook(obj, NULL, content);
}
EAPI Evas_Object *
elm_panes_content_left_get(const Evas_Object *obj)
{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return NULL;
- return wd->contents.left;
+ return _content_get_hook(obj, "elm.swallow.left");
}
EAPI Evas_Object *
elm_panes_content_right_get(const Evas_Object *obj)
{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- Widget_Data *wd = elm_widget_data_get(obj);
- return wd->contents.right;
+ return _content_get_hook(obj, NULL);
}
EAPI Evas_Object *
elm_panes_content_left_unset(Evas_Object *obj)
{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return NULL;
- if (!wd->contents.left) return NULL;
- Evas_Object *content = wd->contents.left;
- elm_widget_sub_object_del(obj, content);
- edje_object_part_unswallow(wd->panes, content);
- wd->contents.left = NULL;
- return content;
+ return _content_unset_hook(obj, "elm.swallow.left");
}
EAPI Evas_Object *
elm_panes_content_right_unset(Evas_Object *obj)
{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return NULL;
- if (!wd->contents.right) return NULL;
- Evas_Object *content = wd->contents.right;
- elm_widget_sub_object_del(obj, content);
- edje_object_part_unswallow(wd->panes, content);
- wd->contents.right = NULL;
- return content;
+ return _content_unset_hook(obj, "elm.swallow.right");
}
EAPI double