seoz pushed a commit to branch master.

commit 452b3ec01d96ac147636f045fea3cc6082f2d732
Author: Ryuan Choi <[email protected]>
Date:   Fri Apr 12 16:01:50 2013 +0900

    elm_notify: Added Eo API for elm_notify_align api.
    
    elm_notify_orient api was deprecated and replaced to elm_notify_align api,
    so this patch replaced Eo APIs to newer..
---
 src/lib/elm_notify.c | 55 ++++++++++++++++++++++++++--------------------------
 src/lib/elm_notify.h | 55 ++++++++++++++++++++++++++--------------------------
 2 files changed, 56 insertions(+), 54 deletions(-)

diff --git a/src/lib/elm_notify.c b/src/lib/elm_notify.c
index ccc036a..a454cb6 100644
--- a/src/lib/elm_notify.c
+++ b/src/lib/elm_notify.c
@@ -560,14 +560,6 @@ EINA_DEPRECATED EAPI void
 elm_notify_orient_set(Evas_Object *obj,
                       Elm_Notify_Orient orient)
 {
-   ELM_NOTIFY_CHECK(obj);
-   eo_do(obj, elm_obj_notify_orient_set(orient));
-}
-
-static void
-_orient_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
-{
-   Elm_Notify_Orient orient = va_arg(*list, Elm_Notify_Orient);
    double horizontal = 0, vertical = 0;
 
    switch (orient)
@@ -617,16 +609,6 @@ _orient_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
 EINA_DEPRECATED EAPI Elm_Notify_Orient
 elm_notify_orient_get(const Evas_Object *obj)
 {
-   ELM_NOTIFY_CHECK(obj) - 1;
-   Elm_Notify_Orient ret = - 1;
-   eo_do((Eo *) obj, elm_obj_notify_orient_get(&ret));
-   return ret;
-}
-
-static void
-_orient_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
-{
-   Elm_Notify_Orient *ret = va_arg(*list, Elm_Notify_Orient *);
    Elm_Notify_Orient orient;
    double horizontal, vertical;
 
@@ -652,7 +634,8 @@ _orient_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, 
va_list *list)
      orient = ELM_NOTIFY_ORIENT_BOTTOM_RIGHT;
    else
      orient = ELM_NOTIFY_ORIENT_TOP;
-   *ret = orient;
+
+   return orient;
 }
 
 EAPI void
@@ -740,7 +723,15 @@ EAPI void
 elm_notify_align_set(Evas_Object *obj, double horizontal, double vertical)
 {
    ELM_NOTIFY_CHECK(obj);
-   ELM_NOTIFY_DATA_GET(obj, sd);
+   eo_do(obj, elm_obj_notify_align_set(horizontal, vertical));
+}
+
+static void
+_align_set(Eo *obj, void *_pd, va_list *list)
+{
+   double horizontal = va_arg(*list, double);
+   double vertical = va_arg(*list, double);
+   Elm_Notify_Smart_Data *sd = _pd;
 
    sd->horizontal_align = horizontal;
    sd->vertical_align = vertical;
@@ -753,10 +744,20 @@ EAPI void
 elm_notify_align_get(const Evas_Object *obj, double *horizontal, double 
*vertical)
 {
    ELM_NOTIFY_CHECK(obj);
-   ELM_NOTIFY_DATA_GET(obj, sd);
+   eo_do((Eo *) obj, elm_obj_notify_align_get(horizontal, vertical));
+}
+
+static void
+_align_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+   double *horizontal = va_arg(*list, double *);
+   double *vertical = va_arg(*list, double *);
+   Elm_Notify_Smart_Data *sd = _pd;
 
-   *horizontal = sd->horizontal_align;
-   *vertical = sd->vertical_align;
+   if (horizontal)
+     *horizontal = sd->horizontal_align;
+   if (vertical)
+     *vertical = sd->vertical_align;
 }
 
 static void
@@ -785,12 +786,12 @@ _class_constructor(Eo_Class *klass)
         EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), 
_elm_notify_smart_content_get),
         
EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), 
_elm_notify_smart_content_unset),
 
-        EO_OP_FUNC(ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ORIENT_SET), 
_orient_set),
-        EO_OP_FUNC(ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ORIENT_GET), 
_orient_get),
         EO_OP_FUNC(ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_TIMEOUT_SET), 
_timeout_set),
         EO_OP_FUNC(ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_TIMEOUT_GET), 
_timeout_get),
         EO_OP_FUNC(ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ALLOW_EVENTS_SET), 
_allow_events_set),
         EO_OP_FUNC(ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ALLOW_EVENTS_GET), 
_allow_events_get),
+        EO_OP_FUNC(ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ALIGN_SET), 
_align_set),
+        EO_OP_FUNC(ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ALIGN_GET), 
_align_get),
         EO_OP_FUNC_SENTINEL
    };
    eo_class_funcs_set(klass, func_desc);
@@ -798,12 +799,12 @@ _class_constructor(Eo_Class *klass)
    evas_smart_legacy_type_register(MY_CLASS_NAME, klass);
 }
 static const Eo_Op_Description op_desc[] = {
-     EO_OP_DESCRIPTION(ELM_OBJ_NOTIFY_SUB_ID_ORIENT_SET, "Set the 
orientation."),
-     EO_OP_DESCRIPTION(ELM_OBJ_NOTIFY_SUB_ID_ORIENT_GET, "Return the 
orientation."),
      EO_OP_DESCRIPTION(ELM_OBJ_NOTIFY_SUB_ID_TIMEOUT_SET, "Set the time 
interval after which the notify window is going to be hidden."),
      EO_OP_DESCRIPTION(ELM_OBJ_NOTIFY_SUB_ID_TIMEOUT_GET, "Return the timeout 
value (in seconds)."),
      EO_OP_DESCRIPTION(ELM_OBJ_NOTIFY_SUB_ID_ALLOW_EVENTS_SET, "Sets whether 
events should be passed to by a click outside its area."),
      EO_OP_DESCRIPTION(ELM_OBJ_NOTIFY_SUB_ID_ALLOW_EVENTS_GET, "Return true if 
events are allowed below the notify object."),
+     EO_OP_DESCRIPTION(ELM_OBJ_NOTIFY_SUB_ID_ALIGN_SET, "Set the alignment."),
+     EO_OP_DESCRIPTION(ELM_OBJ_NOTIFY_SUB_ID_ALIGN_GET, "Return the 
alignment."),
      EO_OP_DESCRIPTION_SENTINEL
 };
 static const Eo_Class_Description class_desc = {
diff --git a/src/lib/elm_notify.h b/src/lib/elm_notify.h
index 0cf1001..6842d12 100644
--- a/src/lib/elm_notify.h
+++ b/src/lib/elm_notify.h
@@ -42,42 +42,17 @@ extern EAPI Eo_Op ELM_OBJ_NOTIFY_BASE_ID;
 
 enum
 {
-   ELM_OBJ_NOTIFY_SUB_ID_ORIENT_SET,
-   ELM_OBJ_NOTIFY_SUB_ID_ORIENT_GET,
    ELM_OBJ_NOTIFY_SUB_ID_TIMEOUT_SET,
    ELM_OBJ_NOTIFY_SUB_ID_TIMEOUT_GET,
    ELM_OBJ_NOTIFY_SUB_ID_ALLOW_EVENTS_SET,
    ELM_OBJ_NOTIFY_SUB_ID_ALLOW_EVENTS_GET,
+   ELM_OBJ_NOTIFY_SUB_ID_ALIGN_SET,
+   ELM_OBJ_NOTIFY_SUB_ID_ALIGN_GET,
    ELM_OBJ_NOTIFY_SUB_ID_LAST
 };
 
 #define ELM_OBJ_NOTIFY_ID(sub_id) (ELM_OBJ_NOTIFY_BASE_ID + sub_id)
 
-
-/**
- * @def elm_obj_notify_orient_set
- * @since 1.8
- *
- * No description supplied by the EAPI.
- *
- * @param[in] orient
- *
- * @see elm_notify_orient_set
- */
-#define elm_obj_notify_orient_set(orient) 
ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ORIENT_SET), 
EO_TYPECHECK(Elm_Notify_Orient, orient)
-
-/**
- * @def elm_obj_notify_orient_get
- * @since 1.8
- *
- * No description supplied by the EAPI.
- *
- * @param[out] ret
- *
- * @see elm_notify_orient_get
- */
-#define elm_obj_notify_orient_get(ret) 
ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ORIENT_GET), 
EO_TYPECHECK(Elm_Notify_Orient *, ret)
-
 /**
  * @def elm_obj_notify_timeout_set
  * @since 1.8
@@ -127,6 +102,32 @@ enum
 #define elm_obj_notify_allow_events_get(ret) 
ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ALLOW_EVENTS_GET), 
EO_TYPECHECK(Eina_Bool *, ret)
 
 /**
+ * @def elm_obj_notify_align_set
+ * @since 1.8
+ *
+ * @brief Set the alignment of the notify object
+ *
+ * @param[in] horizontal
+ * @param[in] vertical
+ *
+ * @see elm_notify_align_set
+ */
+#define elm_obj_notify_align_set(horizontal, vertical) 
ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ALIGN_SET), EO_TYPECHECK(double, 
horizontal), EO_TYPECHECK(double, vertical)
+
+/**
+ * @def elm_obj_notify_align_get
+ * @since 1.8
+ *
+ * @brief Return the alignment of the notify object
+ *
+ * @param[out] horizontal
+ * @param[out] vertical
+ *
+ * @see elm_notify_align_get
+ */
+#define elm_obj_notify_align_get(horizontal, vertical) 
ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ALIGN_GET), EO_TYPECHECK(double *, 
horizontal), EO_TYPECHECK(double *, vertical)
+
+/**
  * @brief Add a new notify to the parent
  *
  * @param parent The parent object

-- 

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter

Reply via email to