Page MenuHomePhabricator

Name conflict between class and property
Closed, ResolvedPublic

Description

There are name conflict cases between class and property. For example,

  • Efl.Ui.Text Class name and Text property of Efl.Text interface. (D7394#129052)
  • Efl.Canvas.Text Class name and Text property of Efl.Text interface.
  • Efl.Input.Hold Class name and its Hold property.
  • Efl.Input.Key Class name and its Key property.

In eolian_mono, Efl.IText.Text is listed in blacklist because of Compiler Error CS0542(https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0542). there are only getter, setter methods(GetText, SetText).

The other UI Frameworks text widget naming will help this discussion.

EFL(elm)EFL(Efl.Ui)XamarinWPFUWPAndroid
for presenting textLabelTextLabelTextBlockTextBlockTextView
for editing single line textEntryText, TextEditableEntryTextBoxTextBoxEditText
for editing multi line textEntryText, TextEditableEditorTextBoxTextBoxEditText

Android:
TextView - https://developer.android.com/reference/android/widget/TextView
EditText - https://developer.android.com/reference/android/widget/EditText

WPF :
TextBlock - https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.textblock?view=netframework-4.8
TextBox - https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.textbox?view=netframework-4.8

UWP : https://docs.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/text-controls
Xamarin : https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/text/

I'd like to suggest some widget names.

  • TextView - It may make conflict with MVVM namespace.
  • TextBlock - There is evas_object_textblock. but it is legacy evas_object(not eo). so, it won't be problem.
  • EditableText - In this case, Text and TextEditable should be merged.
YOhoho created this task.Jul 31 2019, 12:18 AM
YOhoho triaged this task as TODO priority.
YOhoho added a parent task: T7849: efl.ui.text.
YOhoho updated the task description. (Show Details)Jul 31 2019, 12:27 AM

Thanks for a very detailed report!

These are the last three remaining name conflicts, which are blacklisted by eolian_mono. When we fix them, we can finally remove that blacklist.

  • Efl.Input.Key: We should reopen T7964.
  • Efl.Input.Hold: We should reopen T7965.
  • Efl.Ui.Text and Efl.Canvas.Text: Yeah, we need to rename them. TextLabel and TextEntry look fine to me, but maybe there was a reason to move away from these names when we moved from Legacy to Unified (@cedric? @tasn?). We have to avoid View.

I agree that TextEditable is just a Text widget with editable = true in the constructor, but this is a very common case, so I would not remove it.

For Efl.Canvas.Text, I think it should be TextView (since it is most basic text element), TextLabel is more advanced element to show one line text.

Efl.Ui.Text can be "Textbox" or "Textblock" but again it may be conflicted with legacy canvas textblock

Question ?
Efl.Ui.Text and Efl.Canvas.Text are interfaces or objects ? if they are interfaces why donot we use "I" infront to detect that they are interfaces like Efl.UI.IText

Names containing the word View should be reserved for MVVM widgets. Otherwise it's going to be very confusing.
Other than that, I have no strong opinion. There cannot be name conflicts between Legacy and Unified APIs since they are in different namespaces.

The EFL C API does not use I to indicate interfaces. It was deemed too verbose. The C# bindings add the I prefix, though, because that's the common practice in that language.

If you open their eo files you can see that both Efl.Ui.Text and Efl.Canvas.Text are classes.

For Efl.Canvas.Text, I think it should be TextView (since it is most basic text element), TextLabel is more advanced element to show one line text.

Efl.Ui.Text can be "Textbox" or "Textblock" but again it may be conflicted with legacy canvas textblock

Question ?
Efl.Ui.Text and Efl.Canvas.Text are interfaces or objects ? if they are interfaces why donot we use "I" infront to detect that they are interfaces like Efl.UI.IText

The I prefix is a C#-specific thing for all interfaces. It is added by eolian_mono to generated code.

AFAIK at eolian/C level we have no such prefix for interfaces.

ali.alzyod added a comment.EditedJul 31 2019, 8:32 AM

Sorry I did not use EFL in C#.

Other Issue :
For most systems TextEdit or TextBox/block are inherited from TextView (or have same functionality)

But what is the relation between EFL_UI_TEXT and EFL_CANVAS_TEXT ? I think normal user should not use EFL_CANVAS_TEXT because it is supposed to be low level canvas, and the widgets founded in EFL_UI not CANVAS

Other Issue :
For most systems TextEdit or TextBox/block are inherited from TextView (or have same functionality)

What is the issue?

But what is the relation between EFL_UI_TEXT and EFL_CANVAS_TEXT ? I think normal user should not use EFL_CANVAS_TEXT because it is supposed to be low level canvas, and the widgets founded in EFL_UI not CANVAS

Agreed. Widgets are in the Efl.Ui namespace, low level drawing APIs are in the Efl.Canvas namespace.

ali.alzyod added a comment.EditedJul 31 2019, 10:29 AM

@segfaultxavi the issue I am talking about, TextView(or label) and TextEdit should be widgets
I think all ui components in this task for other platforms are (@YOhoho please correct me if i am wrong) are widgets.

And Efl_Canvas_Text is not widget, it is low level canvas.

So compare to other platforms TextView(lable) and TextEdit should come from Efl_UI and one is base to the other.
But As I see it, Efl_UI_Text is huge class contains everything, if you want specific text widget then user enable/disable properties to custom user needs

Android:
view.View -> widget.TextView
view.View -> widget.TextView -> widget.EditText

Xamarin:
Element -> NavigableElement -> VisualElement -> View -> Label
Element -> NavigableElement -> VisualElement -> View -> InputView -> Entry
Element -> NavigableElement -> VisualElement -> View -> InputView -> Editor

WPF, UWP:
UIElement -> FrameworkElement -> TextBlock
UIElement -> FrameworkElement -> Control -> TextBox

EFL
Efl.Canvas.Object -> Efl.Canvas.Text
Efl.Canvas.Object -> Efl.Canvas.Group -> Efl.Ui.Widget -> Efl.Ui.Layout_Base -> Efl.Ui.Text (Note: Efl.Ui.Text has Efl.Canvas.Text(composition))

It seems that only Android EditText is inherited from TextView.
In UWP case, TextBlock is not Control but it used for read-only text.

ali.alzyod added a comment.EditedAug 1 2019, 1:40 AM

I think WPF arrange things for user usage simplicity :)

When using WPF you will find TextBlock and TextBox in same control name space system.windows.controls. (Textblock or Textbox)
https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls?view=netframework-4.8

So maybe there are two types of hierarchy, one for usage(visibility) and one for development

@tasn @cedric @zmike @bu5hm4n @segfaultxavi

Do you have other candidate names for Text classes ?
I also like the idea of WPF, but I hope to hear your ideas.

Env class has an env property. It is multi-valued, so it is not generating a problem for C# yet. But it may in the future.

tasn added a comment.Aug 19 2019, 1:23 AM

@woohyun, I'm going to reshuffle things in the text space so I wouldn't worry about making a decision/change yet. I'll take a look at the WPF naming scheme when changing though.

@ali.alzyod @segfaultxavi @bu5hm4n @zmike

I should have remembered this while taking care of text interfaces.
(I'm sorry for missing perfectly).

But, we still can change the name of class, so I want to hear the opinion again.

I still like the idea of WPF -
But if you have better names (or another idea to solve this issue), please share to us.

How about rename

Efl.Ui.Text into Efl.Ui.TextEdit ?

In future we can create new class called Efl.Ui.TextBase which will act as base for text classes.

For example

efl.ui.textbase                           (Most lightweight text element, user can use it when building apps uses alot of basic text components (like custom list user want to create) )
efl.ui.lable: efl.ui.textbase        (Label widget, to represent text to user for viewing)
efl.ui.textfeild: efl.ui.textbase  (one line edit, much light weigh than efl.ui.textedit)
woohyun added a comment.EditedNov 28 2019, 12:56 AM

How about the changes below ?

  1. Efl.Canvas.Text -> Efl.Canvas.Textblock
  1. Efl.Ui.Text -> Efl.Ui.TextEdit

How about the changes below ?

  1. Efl.Canvas.Text -> Efl.Canvas.Textblock
  2. Efl.Ui.Text -> Efl.Ui.TextEdit

+1

However, Efl.Ui.TextEdit can also be used for non-editable texts (labels). I would bring back Efl.Ui.Label, which is just an Efl.Ui.TextEdit with the editable flag set to false by default.

I must admit that i like TextField more than TextEdit (TextEdit seems like a invented word, that does not correctly reflect the reallity).
And as far as label is not inheriting from TextEdit, then i am also fine with that.

@segfaultxavi @ali.alzyod @bu5hm4n @zmike and other developers here :)

Thanks for the opinions ~ then, how about the below suggestion ?

  1. Efl.Canvas.Text -> Efl.Canvas.Textblock (I think there is no objection)
  2. Efl.Ui.Text -> "Efl.Ui.TextField" or "Efl.Ui.TextBox (comes from WPF)"

I am ok with both TextField and TextBox ~ so, I want to get your opinion one more time :)

I like TextField.

@bu5hm4n what's wrong with Label inheriting from TextField? It's just a matter of initializing editable to false in the constructor.

I like TextField.

@bu5hm4n what's wrong with Label inheriting from TextField? It's just a matter of initializing editable to false in the constructor.

If the only difference between the label and the TextField is the initialization, then it is IMO not worth it a new type. A new type only makes sense if there is something that you can do with label that you cannot do with TextField, (Label > TextField, because Label inherits from TextField).
As an example, the parameter Efl.Ui.Label would not be any different from the type Efl.Ui.TextField, anyone could have just changed the editable flag to true, and then you can even handedit the label.

@segfaultxavi @ali.alzyod @bu5hm4n @zmike and other developers here :)

Thanks for the opinions ~ then, how about the below suggestion ?

  1. Efl.Canvas.Text -> Efl.Canvas.Textblock (I think there is no objection)
  2. Efl.Ui.Text -> "Efl.Ui.TextField" or "Efl.Ui.TextBox (comes from WPF)"

    I am ok with both TextField and TextBox ~ so, I want to get your opinion one more time :)

Sounds good to me :)

Sure, if the only difference between Label and TextField is the initialization then it's not worth having a new type.
Ideally, I would like to have a non-interactive text widget (Label) and then TextField would inherit from it and add all the interactive code. But honestly, I am now completely lost regarding the state of this idea. Is this planned? Was this an option at some point? @ali.alzyod can you clarify?

My main concern is that, for the user, these two widgets serve completely different purposes and it will be weird to have them merged. Typically, text entry widgets have a box around them, whereas text labels do not, for example.
Also, we will be the ONLY toolkit to do this, according to the table at the top of this task.

ali.alzyod added a comment.EditedNov 29 2019, 7:54 AM

First:
Regard @woohyun suggestion, I think currently you, me and @bu5hm4n like the idea.
I just like to use TextEdit or TextBox instead of TextField


Second:
I will try to explain what I am planing in the future.

First Lets explain what are these new widgets :
1- TextField: this is different than a label, TextField normally means single line entry, it is used in many frameworks like QT,UIKit and many javascript frameworks,
2- Label used to view text, the user should not interact with it, just view it (no selection or editing)

Why do we need these widgets while we can represent them all with current Efl.Ui.Text?
Our Efl.Ui.Text is a huge widget with many many features, so using it as a label is a waste of memory and processing power. label should be lightweight widget, if the user uses a huge number of labels in his application it is not a big deal, but using a huge number of efl.ui,text is a problem (waist of memory and power).

So what we need is to create new lightweight text class from scratch using Canvas.Text object.

What are these widgets:
1- Efl.Ui.TextBase: this is very lightweight text object (basically wrapper around Canvas.Text), They are very basic and do not really allocate and process more than canvas.text. (for example this component can be used in custom list or table user what to create, this can act as a basic field, and this class is perfect as base class for future widgets)
2- Efl.Ui.Label: this class inherits from Efl.Ui.TextBase, this object will have more functionality for viewing text in label, such as having scrollbar, auto slide text, bounders,... and many more viewing options that are not available in Efl.Ui.TextBase.

3- TextField: this class inherits from Efl.Ui.Base, and will expect the user to insert data to it, in a single line,
What is the difference between the TextField and TextEdit ?

a-  text field is much simple when user set its position and size (for example height is not set by user but instead it well be calculated using font hight).
b- text field is single line by default, much lightweight than efl.ui.text.

4- TextEdit, this is our current efl.ui.text, it is rich of feature widget, it is heavy in comparison to other text widgets, it can be used for any need that other text widgets can not provide the user with.

woohyun added a comment.EditedNov 29 2019, 11:22 PM

@ali.alzyod

Could you check the below hierarchy is the thing that you are considering ?
(for better understanding of other developers)

  1. Efl.Ui.Widget <- Efl.Ui.Layout_Base <- Efl.Ui.Text (will be changed to Efl.Ui.TextEdit or Efl.Ui.Texbox)
    • Rich Text Editor which includes various functionalities
  1. Efl.Ui.Widget <- Efl.Ui.Layout_Base <- Efl.Ui.TextBase
    • The wrapper for Efl.Canvas.Text
  1. Efl.Ui.TextBase <- Efl.Ui.Label
    • Current elm_label's functionality will be included such as auto sliding and so on
  1. Efl.Ui.TextBase <- Efl.Ui.FieldEdit
    • Single line text editor

I'm also wondering whether Efl.Ui.TextBase will inherits from Efl.Ui.Layout_Base or Efl.Ui.Widget directly.

@woohyun To be honest I do not know exactly from where Efl.Ui.TextBase should be extended.
but by looking at other classes, I think the proper class to be parent of Efl.Ui.TextBase is Efl.Ui.Widget, because Efl.Ui.Widget is a single visual component (same as Efl.Ui.Image), it should be lightweight as possible.

@ali.alzyod
Okay. The important thing is that you have a plan to add more classes such as Efl.Ui.TextBase, Efl.Ui.Label, and Efl.Ui.TextField.

I don't think that the name "TextField" can be used for both "Current Efl.Ui.TextEdit" and "New Single Line Text Editor".
So, How about this ~ ?

  1. Let's go with below changes.
    • Efl.Canvas.Text -> Efl.Canvas.Textblock
    • Efl.Ui.Text -> Efl.Ui.TextField
  1. Let's try to find out the better name for single line editor when we create new class hierarchy based on Efl.Ui.TextBase
ali.alzyod added a comment.EditedDec 3 2019, 3:49 AM

Efl.Canvas.Text -> Efl.Canvas.Textblock I am fine with this
Efl.Ui.Text -> Efl.Ui.TextField I prefer using name other than textfiled text field gives impression it is single line.

I am fine with :
Efl.Ui.Text -> Efl.Ui.TextBox or Efl.Ui.TextEdit or Efl.Ui.TextArea

Notes: these are examples for textfield and they are used for single line edit
https://developer.apple.com/documentation/uikit/uitextfield
https://docs.oracle.com/javase/7/docs/api/java/awt/TextField.html

@zmike @segfaultxavi @bu5hm4n

Sorry for asking this again, but I hope you to check the name once again.
As @ali.alzyod told, "TextField" seems to be used in "single line editor" case normally.

So, please check other candidates (Efl.Ui.TextBox or Efl.Ui.TextEdit or Efl.Ui.TextArea) together.

For me, below changes look best for now.

  • Efl.Canvas.Text -> Efl.Canvas.Textblock
  • Efl.Ui.Text -> Efl.Ui.TextBox

How do you think about this change ?

ali.alzyod added a comment.EditedDec 4 2019, 11:25 PM

@woohyun @zmike @bu5hm4n @segfaultxavi
If there are no further concerns I will soon update :

Efl.Ui.Text into Efl.Ui.TextBox
Efl.Canvas,Text into Efl.Canvas.TextBlock

By the way should we name them TextBlock or Textblock , TextBox or Textbox ?

segfaultxavi added a comment.EditedDec 5 2019, 12:56 AM

Efl.Ui.Textbox and Efl.Canvas.Textblock both look fine to me.

We don't use CamelCase in EFL and the names are already pretty long so I prefer the way I spelled it above.

By the way, how does your plan relate to @tasn's ? I admit I didn't thoroughly read his RFC.

Rename Efl.Canvas.Text into Efl.Canvas.Textblock D10808

@segfaultxavi

By the way, how does your plan relate to @tasn's ? I admit I didn't thoroughly read his RFC.

@tasn plan does not include future widget design, and also it was effected a lot where a composite class in EFL is not working anymore.

Everything seems fine now. Anything left for more discussion ?

segfaultxavi closed this task as Resolved.Dec 13 2019, 4:39 AM
segfaultxavi claimed this task.

Yeah, all name clashes have been resolved now ?