From: Hyoyoung Chang <hyoyoung@gmail.com>
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 7 Mar 2012 13:37:18 +0000 (13:37 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 7 Mar 2012 13:37:18 +0000 (13:37 +0000)
Subject: [E-devel] [patch] elm_gen{list, grid} - add
no_highlight_mode_set/get

actually change it to hilight_mode/set/get with the inverse.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@68947 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_gen_common.h
src/lib/elm_gengrid.c
src/lib/elm_gengrid.h
src/lib/elm_genlist.c
src/lib/elm_genlist.h

index eb66d03..ad6c1c1 100644 (file)
@@ -98,6 +98,7 @@ struct _Widget_Data
    Eina_Bool                      on_hold : 1;
    Eina_Bool                      multi : 1; /**< a flag for item multi selection */
    Eina_Bool                      wasselected : 1;
+   Eina_Bool                      no_highlight : 1;
    Eina_Bool                      clear_me : 1; /**< a flag whether genlist is marked as to be cleared or not. if this flag is true, genlist clear was already deferred.  */
    Eina_Bool                      h_bounce : 1;
    Eina_Bool                      v_bounce : 1;
index 0c5794c..66c2ce5 100644 (file)
@@ -916,7 +916,9 @@ _mouse_up(void            *data,
 static void
 _item_highlight(Elm_Gen_Item *it)
 {
-   if ((it->wd->select_mode == ELM_OBJECT_NO_SELECT) || (it->generation < it->wd->generation) || (it->highlighted)) return;
+   if ((it->wd->select_mode == ELM_OBJECT_NO_SELECT) ||
+       (it->wd->no_highlight) || (it->highlighted) ||
+       (it->generation < it->wd->generation)) return;
    edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
    it->highlighted = EINA_TRUE;
 }
@@ -2857,3 +2859,17 @@ elm_gengrid_select_mode_get(const Evas_Object *obj)
 {
    return elm_genlist_select_mode_get(obj);
 }
+
+EAPI void
+elm_gengrid_hilight_mode_set(Evas_Object *obj,
+                             Eina_Bool    hilight)
+{
+   elm_genlist_hilight_mode_set(obj, hilight);
+}
+
+EAPI Eina_Bool
+elm_gengrid_hilight_mode_get(const Evas_Object *obj)
+{
+   return elm_genlist_hilight_mode_get(obj);
+}
+
index 6b3e0e6..8ab0cdb 100644 (file)
@@ -1464,5 +1464,42 @@ EAPI Elm_Object_Select_Mode_Type
 elm_gengrid_select_mode_get(const Evas_Object *obj);
 
 /**
+ * Set whether the gengrid items' should be hilighted when item selected.
+ *
+ * @param obj The gengrid object.
+ * @param hilight @c EINA_TRUE to enable hilight or @c EINA_FALSE to
+ * disable it.
+ *
+ * This will turn on/off the hilight effect when items are selected and
+ * they will or will not be hilighted. The selected and clicked
+ * callback functions will still be called.
+ *
+ * hilight is enabled by default.
+ *
+ * @see elm_gengrid_hilight_mode_get().
+ *
+ * @ingroup Gengrid
+ */
+
+EAPI void
+elm_gengrid_hilight_mode_set(Evas_Object *obj,
+                             Eina_Bool    hilight);
+
+/**
+ * Get whether the gengrid items' should be hilighted when item selected.
+ *
+ * @param obj The gengrid object.
+ * @return @c EINA_TRUE means items can be hilighted. @c EINA_FALSE indicates
+ * they can't. If @p obj is @c NULL, @c EINA_FALSE is returned.
+ *
+ * @see elm_gengrid_hilight_mode_set() for details.
+ *
+ * @ingroup Gengrid
+ */
+
+EAPI Eina_Bool
+elm_gengrid_hilight_mode_get(const Evas_Object *obj);
+
+/**
  * @}
  */
index a936a07..93fc577 100644 (file)
@@ -689,6 +689,7 @@ _item_highlight(Elm_Gen_Item *it)
 {
    const char *selectraise;
    if ((it->wd->select_mode == ELM_OBJECT_NO_SELECT) ||
+       (it->wd->no_highlight) ||
        (it->generation < it->wd->generation) ||
        (it->highlighted) || elm_widget_item_disabled_get(it) ||
        (it->display_only) || (it->item->mode_view))
@@ -5739,6 +5740,26 @@ elm_genlist_select_mode_get(const Evas_Object *obj)
    return wd->select_mode;
 }
 
+EAPI void
+elm_genlist_hilight_mode_set(Evas_Object *obj,
+                             Eina_Bool    hilight)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   hilight = !!hilight;
+   wd->no_highlight = !hilight;
+}
+
+EAPI Eina_Bool
+elm_genlist_hilight_mode_get(const Evas_Object *obj)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return EINA_FALSE;
+   return !wd->no_highlight;
+}
+
 /* for gengrid as of now */
 void
 _elm_genlist_page_relative_set(Evas_Object *obj,
index 5d1e222..b0bc362 100644 (file)
@@ -1891,5 +1891,42 @@ EAPI Elm_Object_Select_Mode_Type
 elm_genlist_select_mode_get(const Evas_Object *obj);
 
 /**
+ * Set whether the genlist items' should be highlighted when item selected.
+ *
+ * @param obj The genlist object.
+ * @param hilight @c EINA_TRUE to enable hilighting or @c EINA_FALSE to
+ * disable it.
+ *
+ * This will turn on/off the highlight effect when item selection and
+ * they will, or will not highlighted. The selected and clicked
+ * callback functions will still be called.
+ *
+ * Highlight is enabled by default.
+ *
+ * @see elm_genlist_hilight_mode_get().
+ *
+ * @ingroup Genlist
+ */
+
+EAPI void
+elm_genlist_hilight_mode_set(Evas_Object *obj,
+                              Eina_Bool    hilight);
+
+/**
+ * Get whether the genlist items' should be hilighted when item selected.
+ *
+ * @param obj The genlist object.
+ * @return @c EINA_TRUE means items can be hilighted. @c EINA_FALSE indicates
+ * they can't. If @p obj is @c NULL, @c EINA_FALSE is returned.
+ *
+ * @see elm_genlist_hilight_mode_set() for details.
+ *
+ * @ingroup Genlist
+ */
+
+EAPI Eina_Bool
+elm_genlist_hilight_mode_get(const Evas_Object *obj);
+
+/**
  * @}
  */