win: Add a API, elm_win_type_get.
authorJaehwan Kim <jae.hwan.kim@samsung.com>
Thu, 6 Feb 2014 10:28:39 +0000 (19:28 +0900)
committerJaehwan Kim <jae.hwan.kim@samsung.com>
Thu, 6 Feb 2014 10:28:39 +0000 (19:28 +0900)
legacy/elementary/src/lib/elm_win.c
legacy/elementary/src/lib/elm_win_common.h
legacy/elementary/src/lib/elm_win_eo.h
legacy/elementary/src/lib/elm_win_legacy.h

index 2f02652..72f64d3 100644 (file)
@@ -3236,6 +3236,23 @@ _constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
    ERR("only custom constructor can be used with '%s' class", MY_CLASS_NAME);
 }
 
+EAPI Elm_Win_Type
+elm_win_type_get(const Evas_Object *obj)
+{
+   ELM_WIN_CHECK(obj) ELM_WIN_UNKNOWN;
+   Elm_Win_Type ret = ELM_WIN_UNKNOWN;
+   eo_do((Eo *) obj, elm_obj_win_type_get(&ret));
+   return ret;
+}
+
+static void
+_type_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+   Elm_Win_Type *ret = va_arg(*list, Elm_Win_Type *);
+   Elm_Win_Smart_Data *sd = _pd;
+   *ret = sd->type;
+}
+
 EAPI Evas_Object *
 elm_win_util_standard_add(const char *name,
                           const char *title)
@@ -5623,6 +5640,7 @@ _class_constructor(Eo_Class *klass)
         EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WIN_CONSTRUCTOR), _win_constructor),
         EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_ADD), _resize_object_add),
         EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_DEL), _resize_object_del),
+        EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TYPE_GET), _type_get),
         EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TITLE_SET), _title_set),
         EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TITLE_GET), _title_get),
         EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_NAME_SET), _icon_name_set),
@@ -5726,6 +5744,7 @@ static const Eo_Op_Description op_desc[] = {
      EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WIN_CONSTRUCTOR, "Adds a window object."),
      EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_ADD, "Add subobj as a resize object of window obj."),
      EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_DEL, "Delete subobj as a resize object of window obj."),
+     EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TYPE_GET, "Get the type of the window."),
      EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TITLE_SET, "Set the title of the window."),
      EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TITLE_GET, "Get the title of the window."),
      EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_NAME_SET, "Set the icon name of the window."),
index 664b29b..b5eb567 100644 (file)
@@ -9,6 +9,7 @@
  */
 typedef enum
 {
+   ELM_WIN_UNKNOWN, /**< Unknown window type. */
    ELM_WIN_BASIC, /**< A normal window. Indicates a normal, top-level
                      window. Almost every window will be created with this
                      type. */
index e7f0dcd..8ccc901 100644 (file)
@@ -14,6 +14,7 @@ enum
      ELM_OBJ_WIN_SUB_ID_WIN_CONSTRUCTOR,
      ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_ADD,
      ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_DEL,
+     ELM_OBJ_WIN_SUB_ID_TYPE_GET,
      ELM_OBJ_WIN_SUB_ID_TITLE_SET,
      ELM_OBJ_WIN_SUB_ID_TITLE_GET,
      ELM_OBJ_WIN_SUB_ID_ICON_NAME_SET,
@@ -148,6 +149,18 @@ enum
 #define elm_obj_win_resize_object_del(subobj) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_DEL), EO_TYPECHECK(Evas_Object *, subobj)
 
 /**
+ * @def elm_obj_win_type_get
+ * @since 1.9
+ *
+ * Get the type of the window
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_type_get
+ */
+#define elm_obj_win_type_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TYPE_GET), EO_TYPECHECK(Elm_Win_Type *, ret)
+
+/**
  * @def elm_obj_win_title_set
  * @since 1.8
  *
index eab92d0..2a31c01 100644 (file)
 EAPI Evas_Object          *elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type);
 
 /**
+ * Get the type of a window.
+ *
+ * @param obj The window object for which it gets the type.
+ *
+ * @return The type of a window object. If the object is not window object, return ELM_WIN_UNKNOWN.
+ *
+ * @ingroup Win
+ */
+EAPI Elm_Win_Type          elm_win_type_get(const Evas_Object *obj);
+
+/**
  * Adds a window object with standard setup
  *
  * @param name The name of the window