Page MenuHomePhabricator

eolian_mono: setters returning complex values should not be mapped to properties
Closed, ResolvedPublic

Description

Some eolian properties have setters that return a value (an arguable decision, but legal as of now).
This should prevent a C# property from being created, since the return value would then be lost.
To be clear, only the Set and Get C# method should be generated.


As discussed in Z150, we will skip these setters only for really complex types like Futures, etc.

segfaultxavi triaged this task as Normal priority.
felipealmeida added a subscriber: lauromoura.

The property could still be generated, but only with get;

lauromoura edited subscribers, added: felipealmeida, woohyun, YOhoho and 3 others; removed: lauromoura.

In the discussion in Z150, it was raised the issue that property accessors are desired/required for better integration with XAML-style property binding.

One alternative to removing setters returning values would be wrapping the return value (usually an indicator of success/failure) in a check raising an exception if it failed. This could work for booleans and Eina_Errors but may be overkill if the failure is a "soft" one and could be ignored. I'm not sure on how the exceptions would play with XAML-bindings too.

That said, here is a list of setters with returning values, longside their documentation.

classpropertytypestable?return doc
Efl.Access.Actionaction_descriptionEina_BoolFalse$true if description was set, $false otherwise
Efl.Access.ComponentextentsEina_BoolFalse$true if geometry was set, $false otherwise
Efl.Access.Componentscreen_positionEina_BoolFalse$true if position was set, $false otherwise
Efl.Access.Editable.Texttext_contentEina_BoolFalse$true if setting the value succeeded, $false otherwise
Efl.Access.Textaccess_selectionEina_BoolFalse$true if selection was set, $false otherwise
Efl.Access.Textcaret_offsetEina_BoolFalse$true if caret was successfully moved, $false otherwise.
Efl.Access.Valuevalue_and_textEina_BoolFalse$true if setting widgets value has succeeded, otherwise $false .
Efl.Canvas.Objectpointer_modeEina_BoolFalse$true if pointer behaviour was set, $false otherwise
Efl.Canvas.Objectpointer_mode_by_deviceEina_BoolFalse$true if pointer mode was set, $false otherwise
Efl.Input.PointervalueEina_BoolFalse$false if the value could not be set.
Efl.Ui.WidgetcursorEina_BoolFalse$true if successful.
Efl.Ui.Widgetcursor_styleEina_BoolFalse$true if successful.
Efl.Ui.Widgetcursor_theme_search_enabledEina_BoolFalse$true if successful.
Ecore.AudioformatEina_BoolTrue$true if the format was supported, $false otherwise
Ecore.AudiosourceEina_BoolTrue$true if the source was set correctly (i.e. the file was opened), $false otherwise
Efl.Canvas.ProxysourceEina_BoolTrueReturns $true in case of success.
Efl.Canvas.Surfacenative_bufferEina_BoolTrue$true on success, $false otherwise
Efl.Canvas.Surface_X11pixmapEina_BoolTrue$true on success, $false otherwise
Efl.Canvas.VideoengineEina_BoolTrue$true if the specified module was successfully initialized for this object, $false otherwise.
Efl.ConfigconfigEina_BoolTrue$false in case of error: value type was invalid, the config can't be changed, config does not exist...
Efl.ContentcontentEina_BoolTrue$true if $content was successfully swallowed.
Efl.Core.Command_Linecommand_arrayEina_BoolTrueOn success $true, $false otherwise
Efl.Core.Command_Linecommand_stringEina_BoolTrueOn success $true, $false otherwise
Efl.Gfx.Color_Classcolor_classEina_BoolTrue$true if setting the color succeeded, $false otherwise
Efl.Gfx.Color_Classcolor_class_codeEina_BoolTrue$true if setting the color succeeded, $false otherwise
Efl.Gfx.Frame_ControllerframeEina_BoolTrueReturns $true if the frame index is valid.
Efl.Gfx.Size_Classsize_classEina_BoolTrue$true, on success or $false, on error
Efl.Gfx.Text_Classtext_classEina_BoolTrue$true, on success or $false, on error
Efl.Io.Bufferposition_readEina_BoolTrue$true if setting the position succeeded, $false otherwise
Efl.Io.Bufferposition_writeEina_BoolTrue$true if setting the position succeeded, $false otherwise
Efl.Io.Closerclose_on_execEina_BoolTrue$true if could set, $false if not supported or failed.
Efl.Io.PositionerpositionEina_BoolTrue$true if could reposition, $false if errors.
Efl.Io.SizersizeEina_BoolTrue$true if could resize, $false if errors.
Efl.Net.Dialer_Sslkeep_aliveEina_BoolTrue$true on success
Efl.Net.Dialer_Sslno_delayEina_BoolTrue$true on success
Efl.Net.Server_Fdclose_on_execEina_BoolTrue$true on success, $false otherwise
Efl.Net.Server_Fdreuse_addressEina_BoolTrue$true on success, $false otherwise
Efl.Net.Server_Fdreuse_portEina_BoolTrue$true on success, $false otherwise
Efl.Net.Server_Udpdont_routeEina_BoolTrue$true on success
Efl.Net.Socket_TcpcorkEina_BoolTrue$true on success
Efl.Net.Socket_Tcpkeep_aliveEina_BoolTrue$true on success
Efl.Net.Socket_Tcpno_delayEina_BoolTrue$true on success
Efl.Net.Socket_UdpcorkEina_BoolTrue$true on success, $false otherwise
Efl.Net.Socket_Udpdont_routeEina_BoolTrue$true on success
Efl.Net.Socket_Udpreuse_addressEina_BoolTrue$true on success
Efl.Net.Socket_Udpreuse_portEina_BoolTrue$true on success
Efl.PlayerpausedEina_BoolTrueIf $true, the property change has succeeded.
Efl.PlayerplayingEina_BoolTrueIf $true, the property change has succeeded.
Efl.Text_AnnotateannotationEina_BoolTrue$true on success, $false otherwise.
Efl.Ui.Animation_ViewspeedEina_BoolTrue$true when it's successful. $false otherwise.
Efl.Ui.CalendardateEina_BoolTrue$true on success.
Efl.Ui.Calendardate_maxEina_BoolTrue$true on success.
Efl.Ui.Calendardate_minEina_BoolTrue$true on success.
Efl.Ui.Dragdrag_pageEina_BoolTrue$true on success, $false otherwise
Efl.Ui.Dragdrag_sizeEina_BoolTrue$true on success, $false otherwise
Efl.Ui.Dragdrag_stepEina_BoolTrue$true on success, $false otherwise
Efl.Ui.Dragdrag_valueEina_BoolTrue$true on success, $false otherwise
Efl.Ui.Focus.ManagerrootEina_BoolTrue$true on success, $false if it had already been set.
Efl.Ui.ImageiconEina_BoolTrue$true on success, $false on error
Efl.Ui.Widget_Scrollable_Contentscrollable_contentEina_BoolTrue$true on success.
Efl.Ui.Winfocus_highlight_styleEina_BoolTrue$true on success, $false otherwise.
Efl.FilefileEina_ErrorTrue0 on success, error code otherwise
Efl.FilemmapEina_ErrorTrue0 on success, error code otherwise
Efl.Gfx.Imagestretch_regionEina_ErrorTrueReturn an error code if the provided values are incorrect.
Efl.Net.Server_Udpmulticast_loopbackEina_ErrorTrue0 on success, error code otherwise
Efl.Net.Server_Udpmulticast_time_to_liveEina_ErrorTrue0 on success, error code otherwise
Efl.Net.Socket_UdpbindEina_ErrorTrue$0 on success, error code otherwise
Efl.Net.Socket_Udpmulticast_loopbackEina_ErrorTrue$0 on success, error code otherwise
Efl.Net.Socket_Udpmulticast_time_to_liveEina_ErrorTrue$0 on success, error code otherwise
Efl.Ui.Layout_BasethemeEina_ErrorTrueWhether the theme was successfully applied or not, see the Efl.Ui.Theme.Apply_Error subset of @Eina.Error for more information.
Efl.Ui.WidgetstyleEina_ErrorTrueWhether the style was successfully applied or not, see the Efl.Ui.Theme.Apply_Error subset of @Eina.Error for more information.
Efl.Io.ManagerxattrEina_Future *TrueFuture for asynchronous set operation
Efl.ModelpropertyEina_Future *TrueReturn an error in case the property could not be set, or the value that was set otherwise.
lauromoura renamed this task from eolian_mono: setters returning values should not be mapped to properties to eolian_mono: setters returning complex values should not be mapped to properties.Oct 17 2019, 5:21 AM
lauromoura updated the task description. (Show Details)
felipealmeida added a subscriber: lauromoura.
felipealmeida closed this task as Invalid.Mar 23 2020, 10:30 AM
felipealmeida changed the task status from Invalid to Resolved.