Why does elm_naviframe_item_style_default_set API required?
This API says that elm_object_style_default_set is also needed.
------------------------------------
-Regards, Hermet-
 
-----Original Message-----
From: "Enlightenment SVN"<[email protected]> 
To: [email protected]
Cc: 
Sent: 12-02-16(목) 01:27:34
Subject: E SVN: tasn trunk/elementary/src/lib
Log:
Elm naviframe: Fix naviframe a little and add item default style set/get
 
 1. items_get is no longer completely broken
 2. default style set/get is used as a replacement for the style NULL
Author: tasn
Date: 2012-02-15 08:27:34 -0800 (Wed, 15 Feb 2012)
New Revision: 67989
Trac: http://trac.enlightenment.org/e/changeset/67989
Modified:
 trunk/elementary/src/lib/elc_naviframe.c 
trunk/elementary/src/lib/elc_naviframe.h 
Modified: trunk/elementary/src/lib/elc_naviframe.c
===================================================================
--- trunk/elementary/src/lib/elc_naviframe.c 2012-02-15 15:33:54 UTC (rev 67988)
+++ trunk/elementary/src/lib/elc_naviframe.c 2012-02-15 16:27:34 UTC (rev 67989)
@@ -13,6 +13,7 @@
 Eina_Bool preserve: 1;
 Eina_Bool auto_pushed: 1;
 Eina_Bool freeze_events: 1;
+ Eina_Stringshare *item_style;
 };
 
 struct _Elm_Naviframe_Content_Item_Pair
@@ -180,6 +181,7 @@
 if (!wd->stack) break;
 }
 }
+ eina_stringshare_del(wd->item_style);
 free(wd);
 }
 
@@ -906,13 +908,14 @@
 Elm_Naviframe_Content_Item_Pair *content_pair;
 Elm_Naviframe_Text_Item_Pair *text_pair;
 Widget_Data *wd;
+ wd = elm_widget_data_get(WIDGET(navi_it));
+ if (!wd) return;
 
 char buf[256];
 
 if (!item_style)
 {
- strcpy(buf, "item/basic");
- eina_stringshare_replace(&navi_it->style, "basic");
+ snprintf(buf, sizeof(buf), "item/%s", wd->item_style);
 }
 else
 {
@@ -950,9 +953,6 @@
 navi_it->title_visible = EINA_TRUE;
 _sizing_eval(WIDGET(navi_it));
 
- wd = elm_widget_data_get(WIDGET(navi_it));
- if (!wd) return;
-
 if (wd->freeze_events)
 evas_object_freeze_events_set(VIEW(navi_it), EINA_FALSE);
 }
@@ -1070,6 +1070,7 @@
 
 wd->auto_pushed = EINA_TRUE;
 wd->freeze_events = EINA_TRUE;
+ wd->item_style = eina_stringshare_add("basic");
 
 return obj;
 }
@@ -1329,11 +1330,11 @@
 Elm_Naviframe_Item *navi_it = (Elm_Naviframe_Item *) it;
 
 //Return if new style is exsiting one.
- if (item_style)
- if (!strcmp(item_style, navi_it->style)) return;
+ if ((item_style && navi_it->style) && (!strcmp(item_style, navi_it->style)))
+ return;
 
- if (!item_style)
- if (!strcmp("basic", navi_it->style)) return;
+ if ((!item_style) && (!navi_it->style))
+ return;
 
 _item_style_set(navi_it, item_style);
 }
@@ -1385,13 +1386,19 @@
 return wd->auto_pushed;
 }
 
-EAPI Eina_Inlist *
+EAPI Eina_List *
 elm_naviframe_items_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->stack;
+ Eina_List *ret = NULL;
+ Elm_Naviframe_Item *itr;
+ EINA_INLIST_FOREACH(wd->stack, itr)
+ {
+ ret = eina_list_append(ret, itr);
+ }
+ return ret;
 }
 
 EAPI void
@@ -1413,3 +1420,22 @@
 if (!wd) return EINA_FALSE;
 return !wd->freeze_events;
 }
+
+EAPI void
+elm_naviframe_item_style_default_set(Evas_Object *obj, const char *style)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ eina_stringshare_replace(&wd->item_style, style);
+ _theme_hook(obj);
+}
+
+EAPI const char *
+elm_naviframe_item_style_default_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->item_style;
+}
Modified: trunk/elementary/src/lib/elc_naviframe.h
===================================================================
--- trunk/elementary/src/lib/elc_naviframe.h 2012-02-15 15:33:54 UTC (rev 67988)
+++ trunk/elementary/src/lib/elc_naviframe.h 2012-02-15 16:27:34 UTC (rev 67989)
@@ -320,12 +320,12 @@
 * @brief Get a list of all the naviframe items.
 *
 * @param obj The naviframe object
- * @return An Eina_Inlist* of naviframe items, #Elm_Object_Item,
+ * @return An Eina_List of naviframe items, #Elm_Object_Item,
 * or @c NULL on failure.
 *
 * @ingroup Naviframe
 */
-EAPI Eina_Inlist *elm_naviframe_items_get(const Evas_Object *obj);
+EAPI Eina_List *elm_naviframe_items_get(const Evas_Object *obj) EINA_MALLOC 
EINA_WARN_UNUSED_RESULT;
 
 /**
 * @brief Set the event enabled when pushing/popping items
@@ -361,5 +361,29 @@
 EAPI Eina_Bool elm_naviframe_event_enabled_get(const Evas_Object *obj);
 
 /**
+ * @brief Set the default item style.
+ *
+ * Default item style will be used with items who's style is NULL
+ *
+ * @param obj The naviframe object
+ * @param style The style
+ *
+ * @ingroup Naviframe
+ */
+EAPI void elm_naviframe_item_style_default_set(Evas_Object *obj, const char 
*style);
+
+/**
+ * @brief Get the default item style
+ *
+ * @param obj The naviframe object
+ * @return the default item style
+ *
+ * @see elm_naviframe_item_style_default_set()
+ *
+ * @ingroup Naviframe
+ */
+EAPI const char *elm_naviframe_item_style_default_get(const Evas_Object *obj);
+
+/**
 * @}
 */
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
enlightenment-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to