elm_win: move shaped & title property from eo to legacy
authorJi-Youn Park <jy0703.park@samsung.com>
Wed, 1 Jun 2016 12:25:47 +0000 (20:55 +0830)
committerJi-Youn Park <jy0703.park@samsung.com>
Wed, 1 Jun 2016 12:29:20 +0000 (20:59 +0830)
1. remain borderless property.
2. shaped property was removed because wayland not support this.
3. remain noblank property.
4. remain role, name properties.
5. remove title property because it can be supported using name property

src/lib/elementary/elm_win.c
src/lib/elementary/elm_win.eo
src/lib/elementary/elm_win_legacy.h

index 084b2f7..8c22ecf 100644 (file)
@@ -4272,24 +4272,6 @@ _elm_win_efl_container_content_iterate(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
 }
 
 EOLIAN static void
-_elm_win_title_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *title)
-{
-   if (!title) return;
-   eina_stringshare_replace(&(sd->title), title);
-   if (sd->ee)
-     TRAP(sd, title_set, sd->title);
-   if (sd->frame_obj)
-     edje_object_part_text_escaped_set
-       (sd->frame_obj, "elm.text.title", sd->title);
-}
-
-EOLIAN static const char*
-_elm_win_title_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
-{
-   return sd->title;
-}
-
-EOLIAN static void
 _elm_win_role_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, const char *role)
 {
    if (!role) return;
@@ -4427,21 +4409,6 @@ _elm_win_borderless_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
 }
 
 EOLIAN static void
-_elm_win_shaped_set(Eo *obj EINA_UNUSED, Elm_Win_Data *sd, Eina_Bool shaped)
-{
-   TRAP(sd, shaped_set, shaped);
-#ifdef HAVE_ELEMENTARY_X
-   _elm_win_xwin_update(sd);
-#endif
-}
-
-EOLIAN static Eina_Bool
-_elm_win_shaped_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd)
-{
-   return ecore_evas_shaped_get(sd->ee);
-}
-
-EOLIAN static void
 _elm_win_alpha_set(Eo *obj, Elm_Win_Data *sd, Eina_Bool enabled)
 {
    sd->application_alpha = enabled;
@@ -6320,4 +6287,49 @@ elm_win_modal_get(const Evas_Object *obj)
    return sd->modal;
 }
 
+EAPI void
+elm_win_shaped_set(Evas_Object *obj, Eina_Bool shaped)
+{
+   ELM_WIN_CHECK(obj);
+   ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+
+   TRAP(sd, shaped_set, shaped);
+#ifdef HAVE_ELEMENTARY_X
+   _elm_win_xwin_update(sd);
+#endif
+}
+
+EAPI Eina_Bool
+elm_win_shaped_get(const Evas_Object *obj)
+{
+   ELM_WIN_CHECK(obj) EINA_FALSE;
+   ELM_WIN_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
+
+   return ecore_evas_shaped_get(sd->ee);
+}
+
+EAPI void
+elm_win_title_set(Evas_Object *obj, const char *title)
+{
+   ELM_WIN_CHECK(obj);
+   ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+
+   if (!title) return;
+   eina_stringshare_replace(&(sd->title), title);
+   if (sd->ee)
+     TRAP(sd, title_set, sd->title);
+   if (sd->frame_obj)
+     edje_object_part_text_escaped_set
+       (sd->frame_obj, "elm.text.title", sd->title);
+}
+
+EAPI const char*
+elm_win_title_get(const Evas_Object *obj)
+{
+   ELM_WIN_CHECK(obj) NULL;
+   ELM_WIN_DATA_GET_OR_RETURN(obj, sd, NULL);
+
+   return sd->title;
+}
+
 #include "elm_win.eo.c"
index 9ba7339..7b8c042 100644 (file)
@@ -503,6 +503,46 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
             modal: Elm.Win.Modal_Mode; [[The mode of a window, one of #Elm_Win_Modal_Mode.]]
          }
       }
+      @property noblank {
+         set {
+            [[Set the noblank property of a window.
+
+              The "noblank" property is a way to request the display on
+              which the windowis shown does not blank, screensave or
+              otherwise hide or obscure the window. It is intended for
+              uses such as media playback on a television where a user
+              may not want to be interrupted by an idle screen. The
+              noblank property may have no effect if the window is
+              iconified/minimized or hidden.
+
+              @since 1.11
+            ]]
+         }
+         get {
+            [[Get the noblank property of a window.
+
+              @since 1.11
+            ]]
+         }
+         values {
+            noblank: bool; [[If true, the window is set to noblank.]]
+         }
+      }
+      @property borderless {
+         set {
+            [[Set the borderless state of a window.
+
+              This function requests the Window Manager to not draw any
+              decoration around the window.
+            ]]
+         }
+         get {
+            [[Get the borderless state of a window.]]
+         }
+         values {
+            borderless: bool; [[If true, the window is borderless.]]
+         }
+      }
       @property role {
          set {
             [[Set the role of the window.]]
@@ -519,6 +559,29 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
             role: string; [[The role to set.]]
          }
       }
+      @property name {
+         [[The window name.
+
+           The meaning of name depends on the underlying windowing system.
+
+           The window name is a constructing property that need to be set at
+           creation within \@ref eo_add.
+
+           Note: Once set, it can NOT be modified afterward.
+         ]]
+         /* FIXME-doc
+         Example:
+         @code
+         win = eo_add(ELM_WIN_CLASS, NULL, elm_obj_win_name_set(ELM_WIN_BASIC));
+         @endcode
+         */
+         set {
+            [[Can only be used at creation time, within \@ref eo_add.]]
+         }
+         values {
+            name: string @nullable;
+         }
+      }
       @property size_step {
          set {
             [[Set the window stepping used with sizing calculation.
@@ -540,21 +603,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
             h: int; [[The stepping height (0 disables).]]
          }
       }
-      @property borderless {
-         set {
-            [[Set the borderless state of a window.
-
-              This function requests the Window Manager to not draw any
-              decoration around the window.
-            ]]
-         }
-         get {
-            [[Get the borderless state of a window.]]
-         }
-         values {
-            borderless: bool; [[If true, the window is borderless.]]
-         }
-      }
       @property available_profiles {
          set {
             [[Set the array of available profiles to a window.
@@ -578,22 +626,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
             return: bool;
          }
       }
-      @property title {
-         set {
-            [[Set the title of the window.]]
-         }
-         get {
-            [[Get the title of the window.
-
-              The returned string is an internal one and should not be
-              freed or modified. It will also be invalid if a new title
-              is set or if the window is destroyed.
-            ]]
-         }
-         values {
-            title: string; [[The title.]]
-         }
-      }
       @property alpha {
          set {
             [[Set the alpha channel state of a window.
@@ -602,9 +634,7 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
               enabled possibly making parts of the window completely or
               partially transparent. This is also subject to the underlying
               system supporting it, like for example, running under a
-              compositing manager. If no compositing is available, enabling
-              this option will instead fallback to using shaped windows,
-              with @.shaped.set.
+              compositing manager.
 
               Note: Alpha window can be enabled automatically by window
               theme style's property. If "alpha" data.item is "1" or
@@ -671,26 +701,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
             profile: string; [[The string value of a window profile.]]
          }
       }
-      @property shaped {
-         set {
-            [[Set the shaped state of a window.
-
-              Shaped windows, when supported, will render the parts of the
-              window that has no content, transparent.
-
-              If $shaped is false, then it is strongly advised to have some
-              background object or cover the entire window in any other way,
-              or the parts of the canvas that have no data will show
-              framebuffer artifacts.
-            ]]
-         }
-         get {
-            [[Get the shaped state of a window.]]
-         }
-         values {
-            shaped: bool; [[If $true, the window is shaped.]]
-         }
-      }
       @property size_base {
          set {
             [[Set the base window size used with stepping calculation
@@ -745,29 +755,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
             return: Evas.Object; [[The inlined image object or $null if none exists.]]
          }
       }
-      @property name {
-         [[The window name.
-
-           The meaning of name depends on the underlying windowing system.
-
-           The window name is a constructing property that need to be set at
-           creation within \@ref eo_add.
-
-           Note: Once set, it can NOT be modified afterward.
-         ]]
-         /* FIXME-doc
-         Example:
-         @code
-         win = eo_add(ELM_WIN_CLASS, NULL, elm_obj_win_name_set(ELM_WIN_BASIC));
-         @endcode
-         */
-         set {
-            [[Can only be used at creation time, within \@ref eo_add.]]
-         }
-         values {
-            name: string @nullable;
-         }
-      }
       @property type { /* FIXME: before finalize */
          [[The type of the window.
 
@@ -794,31 +781,6 @@ class Elm.Win (Elm.Widget, Elm.Interface.Atspi.Window,
             type: Elm.Win.Type(Elm.Win.Type.unknown);
          }
       }
-      @property noblank {
-         set {
-            [[Set the noblank property of a window.
-
-              The "noblank" property is a way to request the display on
-              which the windowis shown does not blank, screensave or
-              otherwise hide or obscure the window. It is intended for
-              uses such as media playback on a television where a user
-              may not want to be interrupted by an idle screen. The
-              noblank property may have no effect if the window is
-              iconified/minimized or hidden.
-
-              @since 1.11
-            ]]
-         }
-         get {
-            [[Get the noblank property of a window.
-
-              @since 1.11
-            ]]
-         }
-         values {
-            noblank: bool; [[If true, the window is set to noblank.]]
-         }
-      }
       @property fake_canvas @protected {
            set {
                 [[Internal. Used to completent the fake window type.]]
index d713cfe..1a2a538 100644 (file)
@@ -806,3 +806,49 @@ EAPI void elm_win_modal_set(Evas_Object *obj, Eina_Bool modal);
  */
 EAPI Eina_Bool elm_win_modal_get(const Evas_Object *obj);
 
+/**
+ * @brief Set the shaped state of a window.
+ *
+ * Shaped windows, when supported, will render the parts of the window that has
+ * no content, transparent.
+ *
+ * If @c shaped is false, then it is strongly advised to have some background
+ * object or cover the entire window in any other way, or the parts of the
+ * canvas that have no data will show framebuffer artifacts.
+ *
+ * @param[in] shaped If @c true, the window is shaped.
+ *
+ * @ingroup Elm_Win
+ */
+EAPI void elm_win_shaped_set(Evas_Object *obj, Eina_Bool shaped);
+
+/**
+ * @brief Get the shaped state of a window.
+ *
+ * @return If @c true, the window is shaped.
+ *
+ * @ingroup Elm_Win
+ */
+EAPI Eina_Bool elm_win_shaped_get(const Evas_Object *obj);
+
+/**
+ * @brief Set the title of the window.
+ *
+ * @param[in] title The title.
+ *
+ * @ingroup Elm_Win
+ */
+EAPI void elm_win_title_set(Evas_Object *obj, const char *title);
+
+/**
+ * @brief Get the title of the window.
+ *
+ * The returned string is an internal one and should not be freed or modified.
+ * It will also be invalid if a new title is set or if the window is destroyed.
+ *
+ * @return The title.
+ *
+ * @ingroup Elm_Win
+ */
+EAPI const char *elm_win_title_get(const Evas_Object *obj);
+