widget: Make theme_apply a protected function (EO)
authorJean-Philippe Andre <jp.andre@samsung.com>
Thu, 24 Aug 2017 05:33:36 +0000 (14:33 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 29 Aug 2017 01:40:53 +0000 (10:40 +0900)
This is a strange function but absolutely necessary to implement a
widget. Even non-layout widgets may override this.

Ref T5363

src/lib/elementary/elm_widget.c
src/lib/elementary/elm_widget.eo

index 6639bab..61e83f7 100644 (file)
@@ -1209,9 +1209,7 @@ elm_widget_theme(Evas_Object *obj)
    EINA_LIST_FOREACH(sd->cursors, l, cur)
      elm_cursor_theme(cur);
 
-   Efl_Ui_Theme_Apply ret2 = EFL_UI_THEME_APPLY_FAILED;
-   ret2 = elm_obj_widget_theme_apply(obj);
-   ret &= ret2;
+   ret &= elm_obj_widget_theme_apply(obj);
 
    return ret;
 }
index 4992dc3..2034a6b 100644 (file)
@@ -398,9 +398,19 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
          }
          return: bool; [[Indicates if the operation succeeded.]]
       }
-      theme_apply {
-         [['Virtual' function on the widget being re-themed.]]
-         return: Efl.Ui.Theme.Apply; [[Theme apply]]
+      theme_apply @protected {
+         [[Virtual function called when the widget needs to re-apply its theme.
+
+           This may be called when the object is first created, or whenever
+           the widget is modified in any way that may require a reload of the
+           theme. This may include but is not limited to scale, theme, or
+           mirrored mode changes.
+
+           Note: even widgets not based on layouts may override this method
+           to handle widget updates (scale, mirrored mode, etc...).
+         ]]
+         return: Efl.Ui.Theme.Apply; [[Indicates success, and if the current
+                                       theme or default theme was used.]]
       }
       activate {
          [['Virtual' function to activate widget.]]