aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/efl_ui_box.eo
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-04-12 16:20:54 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-04-20 10:47:40 +0900
commit24eccb6d62dc8de443bbd3db8f0d61248a170cf2 (patch)
tree770f9de1c3eaa04cca263809b935e8f55f1c1aca /src/lib/elementary/efl_ui_box.eo
parentElm_test: Add basic test case for the new box api (diff)
downloadefl-24eccb6d62dc8de443bbd3db8f0d61248a170cf2.tar.gz
Efl.Ui.Box: Implement way to override layout function
So, since we don't have function pointers, all the solutions to reimplementing the layout function are quite convoluted: 1. use events 2. reimplement layout func 3. use an extra object 4. use a generic class (non instanciated) Promises don't apply here (layout will run multiple times). Problems: 1. Multiple event callbacks will be called, resulting in potential performance impact, extra events, etc... Also, there is no way to define standard implementations that would be provided by the framework. 2. Reimplementation of a function requires extra EO work (create an EO class, etc...), doesn't allow on-the-fly change of the layout method. 3. Probably the best solution is to have an object implementing the layout. But this means creating an extra object along with the container. 4. To avoid the extra object, use a class, and reimplement a @class function. This unfortunately requires extra EO work. Solution 4. has been selected, but it's not very nice...
Diffstat (limited to 'src/lib/elementary/efl_ui_box.eo')
-rw-r--r--src/lib/elementary/efl_ui_box.eo6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/elementary/efl_ui_box.eo b/src/lib/elementary/efl_ui_box.eo
index 4cc7e8ed7b..4a97db2e98 100644
--- a/src/lib/elementary/efl_ui_box.eo
+++ b/src/lib/elementary/efl_ui_box.eo
@@ -1,4 +1,4 @@
-class Efl.Ui.Box (Elm.Widget, Efl.Pack_Linear)
+class Efl.Ui.Box (Elm.Widget, Efl.Pack_Engine, Efl.Pack_Linear)
{
legacy_prefix: null;
implements {
@@ -25,6 +25,8 @@ class Efl.Ui.Box (Elm.Widget, Efl.Pack_Linear)
Efl.Pack.padding.set;
Efl.Pack.layout_update;
Efl.Pack.layout_request;
+ Efl.Pack.layout_engine.get;
+ Efl.Pack.layout_engine.set;
Efl.Pack_Linear.pack_begin;
Efl.Pack_Linear.pack_end;
Efl.Pack_Linear.pack_before;
@@ -35,5 +37,7 @@ class Efl.Ui.Box (Elm.Widget, Efl.Pack_Linear)
//Efl.Pack_Linear.child_index.set;
Efl.Pack_Linear.direction.set;
Efl.Pack_Linear.direction.get;
+
+ Efl.Pack_Engine.layout_do;
}
}