hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=fe41adaa2820224e5f5765fe949d069ec86e3ce0

commit fe41adaa2820224e5f5765fe949d069ec86e3ce0
Author: Hermet Park <her...@hermet.pe.kr>
Date:   Tue Feb 9 17:50:34 2016 +0900

    support a guide text for editor ctxpopup.
    
    introduce a new smart callback "ctxpopup,activated"
    
    @feature
---
 src/bin/main.c             | 10 ++++++++++
 src/lib/Enventor_Legacy.h  |  8 ++++++++
 src/lib/ctxpopup.c         | 12 +++++++++++-
 src/lib/edc_editor.c       | 10 +++++++++-
 src/lib/enventor_main.c    |  1 +
 src/lib/enventor_object.eo |  1 +
 src/lib/enventor_private.h |  3 ++-
 src/lib/enventor_smart.c   |  1 +
 8 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/src/bin/main.c b/src/bin/main.c
index a2803c0..68233e8 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -453,6 +453,14 @@ enventor_program_run_cb(void *data EINA_UNUSED, 
Evas_Object *obj EINA_UNUSED,
 }
 
 static void
+enventor_ctxpopup_activated_cb(void *data, Evas_Object *obj, void *event_info)
+{
+   Enventor_Ctxpopup_Type type = (Enventor_Ctxpopup_Type) event_info;
+   if (type != ENVENTOR_CTXPOPUP_TYPE_SLIDER) return;
+   stats_info_msg_update("You could use a mouse wheel to change values 
elaborately.");
+}
+
+static void
 enventor_ctxpopup_changed_cb(void *data, Evas_Object *obj,
                              void *event_info EINA_UNUSED)
 {
@@ -520,6 +528,8 @@ enventor_setup(app_data *ad)
                                   enventor_live_view_updated_cb, ad);
    evas_object_smart_callback_add(enventor, "program,run",
                                   enventor_program_run_cb, ad);
+   evas_object_smart_callback_add(enventor, "ctxpopup,activated",
+                                  enventor_ctxpopup_activated_cb, ad);
    evas_object_smart_callback_add(enventor, "ctxpopup,changed",
                                   enventor_ctxpopup_changed_cb, ad);
    evas_object_smart_callback_add(enventor, "ctxpopup,dismissed",
diff --git a/src/lib/Enventor_Legacy.h b/src/lib/Enventor_Legacy.h
index d582a6f..829f93c 100644
--- a/src/lib/Enventor_Legacy.h
+++ b/src/lib/Enventor_Legacy.h
@@ -18,6 +18,14 @@
 
 typedef enum
 {
+   ENVENTOR_CTXPOPUP_TYPE_SLIDER = 0,
+   ENVENTOR_CTXPOPUP_TYPE_LIST,
+   ENVENTOR_CTXPOPUP_TYPE_TOGGLE,
+   ENVENTOR_CTXPOPUP_TYPE_IMAGE
+} Enventor_Ctxpopup_Type;
+
+typedef enum
+{
    ENVENTOR_PATH_TYPE_EDJ = 0,
    ENVENTOR_PATH_TYPE_IMAGE,
    ENVENTOR_PATH_TYPE_SOUND,
diff --git a/src/lib/ctxpopup.c b/src/lib/ctxpopup.c
index 768afa5..b9ad36d 100644
--- a/src/lib/ctxpopup.c
+++ b/src/lib/ctxpopup.c
@@ -532,7 +532,8 @@ ctxpopup_img_preview_create(edit_data *ed,
 Evas_Object *
 ctxpopup_candidate_list_create(edit_data *ed, attr_value *attr,
                                Evas_Smart_Cb ctxpopup_dismiss_cb,
-                               Evas_Smart_Cb ctxpopup_changed_cb)
+                               Evas_Smart_Cb ctxpopup_changed_cb,
+                               Enventor_Ctxpopup_Type *type)
 {
    //create ctxpopup
    Evas_Object *ctxpopup = elm_ctxpopup_add(edit_obj_get(ed));
@@ -562,43 +563,51 @@ ctxpopup_candidate_list_create(edit_data *ed, attr_value 
*attr,
         case ATTR_VALUE_BOOLEAN:
           {
              toggle_layout_set(ctxpopup, ctxdata);
+             *type = ENVENTOR_CTXPOPUP_TYPE_TOGGLE;
              break;
           }
         case ATTR_VALUE_INTEGER:
           {
              ctxdata->integer = EINA_TRUE;
              slider_layout_set(ctxpopup, ctxdata);
+             *type = ENVENTOR_CTXPOPUP_TYPE_SLIDER;
              break;
           }
         case ATTR_VALUE_FLOAT:
           {
              ctxdata->integer = EINA_FALSE;
              slider_layout_set(ctxpopup, ctxdata);
+             *type = ENVENTOR_CTXPOPUP_TYPE_SLIDER;
              break;
           }
         case ATTR_VALUE_CONSTANT:
           {
              constant_candidate_set(ctxpopup, ctxdata);
+             *type = ENVENTOR_CTXPOPUP_TYPE_LIST;
              break;
           }
         case ATTR_VALUE_PART:
           {
              if (!part_candidate_set(ctxpopup, ctxdata)) goto err;
+             *type = ENVENTOR_CTXPOPUP_TYPE_LIST;
              break;
           }
         case ATTR_VALUE_STATE:
           {
              if (!state_candidate_set(ctxpopup, ctxdata, ed)) goto err;
+             *type = ENVENTOR_CTXPOPUP_TYPE_LIST;
              break;
           }
         case ATTR_VALUE_IMAGE:
           {
              if (!image_candidate_set(ctxpopup, ctxdata)) goto err;
+             *type = ENVENTOR_CTXPOPUP_TYPE_IMAGE;
              break;
           }
         case ATTR_VALUE_PROGRAM:
           {
              if (!program_candidate_set(ctxpopup, ctxdata)) goto err;
+             *type = ENVENTOR_CTXPOPUP_TYPE_LIST;
              break;
           }
    }
@@ -606,6 +615,7 @@ ctxpopup_candidate_list_create(edit_data *ed, attr_value 
*attr,
                                   ctxdata);
    evas_object_smart_callback_add(ctxpopup, "dismissed", ctxpopup_dismiss_cb,
                                   ed);
+
    return ctxpopup;
 
 err:
diff --git a/src/lib/edc_editor.c b/src/lib/edc_editor.c
index 1736b6a..98e9e0a 100644
--- a/src/lib/edc_editor.c
+++ b/src/lib/edc_editor.c
@@ -673,6 +673,9 @@ image_preview_show(edit_data *ed, char *cur, Evas_Coord x, 
Evas_Coord y)
 
         evas_object_move(ed->ctxpopup, x, y);
         evas_object_show(ed->ctxpopup);
+        Enventor_Ctxpopup_Type type = ENVENTOR_CTXPOPUP_TYPE_IMAGE;
+        evas_object_smart_callback_call(ed->enventor, SIG_CTXPOPUP_ACTIVATED,
+                                        (void *) type);
         elm_object_tree_focus_allow_set(ed->layout, EINA_FALSE);
         succeed = EINA_TRUE;
      }
@@ -695,16 +698,21 @@ candidate_list_show(edit_data *ed, char *text, char *cur, 
char *selected)
    parser_attribute_value_set(attr, cur);
 
    //Show up the list of the types
+   Enventor_Ctxpopup_Type type;
    Evas_Object *ctxpopup =
       ctxpopup_candidate_list_create(ed, attr,
                                      ctxpopup_candidate_dismiss_cb,
-                                     ctxpopup_candidate_changed_cb);
+                                     ctxpopup_candidate_changed_cb,
+                                     &type);
    if (!ctxpopup) return;
 
    int x, y;
    evas_pointer_output_xy_get(evas_object_evas_get(ed->en_edit), &x, &y);
    evas_object_move(ctxpopup, x, y);
    evas_object_show(ctxpopup);
+   evas_object_smart_callback_call(ed->enventor, SIG_CTXPOPUP_ACTIVATED,
+                                   (void *) type);
+
    evas_object_event_callback_add(ctxpopup, EVAS_CALLBACK_DEL, 
ctxpopup_del_cb, ed);
    ed->ctxpopup = ctxpopup;
    elm_object_tree_focus_allow_set(ed->layout, EINA_FALSE);
diff --git a/src/lib/enventor_main.c b/src/lib/enventor_main.c
index eb7926c..e5e4a79 100644
--- a/src/lib/enventor_main.c
+++ b/src/lib/enventor_main.c
@@ -19,6 +19,7 @@ const char SIG_COMPILE_ERROR[] = "compile,error";
 const char SIG_PROGRAM_RUN[] = "program,run";
 const char SIG_CTXPOPUP_CHANGED[] = "ctxpopup,changed";
 const char SIG_CTXPOPUP_DISMISSED[] = "ctxpopup,dismissed";
+const char SIG_CTXPOPUP_ACTIVATED[] = "ctxpopup,activated";
 const char SIG_EDC_MODIFIED[] = "edc,modified";
 const char SIG_FOCUSED[] = "focused";
 
diff --git a/src/lib/enventor_object.eo b/src/lib/enventor_object.eo
index d2df9a1..e56796a 100644
--- a/src/lib/enventor_object.eo
+++ b/src/lib/enventor_object.eo
@@ -269,6 +269,7 @@ class Enventor.Object (Elm.Widget, Efl.File) {
       max_line,changed;
       compile,error;
       program,run;
+      ctxpopup,activated;
       ctxpopup,changed;
       ctxpopup,dismissed;
       edc,modified;
diff --git a/src/lib/enventor_private.h b/src/lib/enventor_private.h
index 0202109..f71a473 100644
--- a/src/lib/enventor_private.h
+++ b/src/lib/enventor_private.h
@@ -51,6 +51,7 @@ extern const char SIG_LIVE_VIEW_RESIZED[];
 extern const char SIG_PROGRAM_RUN[];
 extern const char SIG_CTXPOPUP_CHANGED[];
 extern const char SIG_CTXPOPUP_DISMISSED[];
+extern const char SIG_CTXPOPUP_ACTIVATED[];
 extern const char SIG_EDC_MODIFIED[];
 extern const char SIG_FOCUSED[];
 
@@ -233,7 +234,7 @@ Eina_Bool template_insert(edit_data *ed, 
Enventor_Template_Insert_Type insert_ty
 
 
 /* ctxpopup */
-Evas_Object *ctxpopup_candidate_list_create(edit_data *ed, attr_value *attr, 
Evas_Smart_Cb ctxpopup_dismiss_cb, Evas_Smart_Cb ctxpopup_changed_cb);
+Evas_Object *ctxpopup_candidate_list_create(edit_data *ed, attr_value *attr, 
Evas_Smart_Cb ctxpopup_dismiss_cb, Evas_Smart_Cb ctxpopup_changed_cb, 
Enventor_Ctxpopup_Type *type);
 Evas_Object *ctxpopup_img_preview_create(edit_data*ed, const char *imgpath, 
Evas_Smart_Cb ctxpopup_dismiss_cb, Evas_Smart_Cb ctxpopup_relay_cb);
 void ctxpopup_img_preview_reload(Evas_Object *ctxpopup, const char *imgpath);
 
diff --git a/src/lib/enventor_smart.c b/src/lib/enventor_smart.c
index fa2c97c..b580482 100644
--- a/src/lib/enventor_smart.c
+++ b/src/lib/enventor_smart.c
@@ -46,6 +46,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
    {SIG_PROGRAM_RUN, ""},
    {SIG_CTXPOPUP_CHANGED, ""},
    {SIG_CTXPOPUP_DISMISSED, ""},
+   {SIG_CTXPOPUP_ACTIVATED, ""},
    {SIG_EDC_MODIFIED, ""},
    {SIG_FOCUSED, ""},
    {NULL, NULL}

-- 


Reply via email to