Page MenuHomePhabricator

csharp: Make GetPart public.
ClosedPublic

Authored by lauromoura on Nov 4 2019, 9:38 AM.

Details

Summary

efl_part_get is protected in C due to the presence of efl_part,
which does automatic refcount management in single method calls.

The C# binding has no limitation on this as it already handles the
lifetime for all objects.

Fixes T8462

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
lauromoura created this revision.Nov 4 2019, 9:38 AM
lauromoura requested review of this revision.Nov 4 2019, 9:38 AM

Since you already have some test cases, can you test this, @SanghyeonLee?
I see nothing very wrong with adding this exception for efl_part_get.

SanghyeonLee added a comment.EditedNov 5 2019, 10:49 PM

I'm not tested every cases,
but it seems works as what we expected.

tested code is below.

Efl.Ui.Layout layout = new Efl.Ui.Layout(parent);
layout.SetFile("/home/sh10233lee/Share/layout_example.edj");
layout.SetKey("example_layout");
layout.Load();
Efl.Ui.LayoutPartText text = (Efl.Ui.LayoutPartText)layout.GetPart("text");
Efl.Ui.LayoutPartContent content = (Efl.Ui.LayoutPartContent)layout.GetPart("content");

text.SetText("Layout Examples");

Efl.Ui.Image image = new Efl.Ui.Image(parent);
image.SetFile("/home/sh10233lee/Pictures/tizen_logo.png");
image.SetColor(255, 255, 255, 255);
image.Load();

content.SetContent(image);

return layout;

Looks good to me.
if we could auto generate the swallow and text/textblock part as property of layout after loaded it would be best, but it doesn't seems possible to me..

SanghyeonLee accepted this revision.Nov 6 2019, 11:07 PM
This revision is now accepted and ready to land.Nov 6 2019, 11:07 PM
This revision was automatically updated to reflect the committed changes.