Page MenuHomePhabricator

Fix namespace clashes for Efl.Text.Cursor
ClosedPublic

Authored by segfaultxavi on Apr 7 2020, 4:11 AM.

Details

Summary

Three renames are applied here:
Efl.Text.Cursor -> Efl.Text_Cursor.Object (class)
Efl.Text.Cursor_Type -> Efl.Text_Cursor.Type (enum)
Efl.Text.Cursor_Move_Type -> Efl.Text_Cursor.Move_Type (enum)

Nothing changes for the enums on the C side. For the class... Well,
the method names are a bit more verbose now.

These renames are required to avoid clashing with the Efl.Text interface.
This did not cause trouble to C# because interfaces are prefixed with "I",
but it did cause trouble to Eolian when the EO files were installed and
somebody tried to use them.
Ref T8648

Test Plan

Everything builds and passes tests.

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.
segfaultxavi created this revision.Apr 7 2020, 4:11 AM
segfaultxavi requested review of this revision.Apr 7 2020, 4:11 AM

Thank you for the update.

I was hoping for changing (Efl.Text) interface, which is the main reason to complicate things and loose the nice text namespace. (maybe it is too late now :( )

We cannot change Efl.Text, its stable since 2 releases.

ali.alzyod added a comment.EditedApr 7 2020, 8:21 AM

A class called Object, maybe it is a little this is a little ambiguous, what do you think?
Maybe just call the class Cursor

You mean Efl.Text_Cursor.Cursor?

In other places, when we had a class named like a namespace we called the class Object, and when we had an interface named like a namespace we called the interface Entity.
This just follows that convention.

ali.alzyod added a comment.EditedApr 7 2020, 1:34 PM

You mean Efl.Text_Cursor.Cursor?

In other places, when we had a class named like a namespace we called the class Object, and when we had an interface named like a namespace we called the interface Entity.
This just follows that convention.

Would not this be a bit confusing for some language (for example C#), where Object class founded in the System namespace and in Text_Curosr namespace?
I think using new namespace like Efl.TextUtil and put everything there will keep things organized (Efl.TextUtil replace Efl.Text namespace)

We have right now 6 EO classes named Object, including Efl.Object, and so far binding generators have managed to avoid any clash with system classes.
We would need to rename those classes too if we decided that we do not like that name, but I don't think it's required.

I don't like Util classes. They usually end up being a collection of unrelated functionality, which makes hard to find things.
We already have 3 of them and I am against them too :)

bu5hm4n accepted this revision.Apr 14 2020, 3:26 AM
This revision is now accepted and ready to land.Apr 14 2020, 3:26 AM
Closed by commit rEFLf526ad8c26ae: Fix namespace clashes for Efl.Text.Cursor (authored by segfaultxavi, committed by Marcel Hollerbach <mail@marcel-hollerbach.de>). · Explain WhyApr 14 2020, 3:29 AM
This revision was automatically updated to reflect the committed changes.