From 5ea0195661e88395ee3e7384db7acc3f03d52dc1 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Tue, 21 May 2019 16:01:07 +0200 Subject: [PATCH] eolian: remove @nullable keyword This was an experiment that never properly took off and was never used by any generator. Its use was highly variable, so it could not be relied upon. We will still want to reverse the current behavior eventually (no null by default), but that will be done with eo file versioning in the future. @feature --- src/Makefile_Eolian.am | 1 - src/bindings/luajit/eolian.lua | 5 -- src/lib/ecore_con/efl_net_control_manager.eo | 10 ++-- src/lib/ecore_con/efl_net_dialer.eo | 2 +- src/lib/ecore_con/efl_net_socket_ssl.eo | 2 +- src/lib/ecore_con/efl_net_ssl_context.eo | 2 +- src/lib/efl/interfaces/efl_canvas_scene.eo | 2 +- src/lib/efl/interfaces/efl_gfx_buffer.eo | 4 +- src/lib/efl/interfaces/efl_ui_format.eo | 4 +- src/lib/elementary/efl_ui_clock.eo | 2 +- .../efl_ui_internal_text_scroller.eo | 4 +- src/lib/elementary/efl_ui_pager.eo | 4 +- src/lib/elementary/efl_ui_radio.eo | 2 +- src/lib/elementary/efl_ui_scroll_manager.eo | 2 +- src/lib/elementary/efl_ui_text.eo | 2 +- src/lib/elementary/efl_ui_widget.eo | 10 ++-- src/lib/elementary/efl_ui_win.eo | 8 +-- .../elementary/elm_interface_scrollable.eo | 48 ++++++++--------- src/lib/eo/efl_object.eo | 6 +-- src/lib/eolian/Eolian.h | 10 ---- .../eolian/database_function_parameter_api.c | 7 --- src/lib/eolian/eo_lexer.h | 5 +- src/lib/eolian/eo_parser.c | 11 +--- src/lib/eolian/eolian_database.h | 1 - src/scripts/pyolian/eolian.py | 6 +-- src/scripts/pyolian/eolian_lib.py | 4 -- src/scripts/pyolian/test_eolian.py | 1 - src/tests/eolian/data/null.eo | 12 ----- src/tests/eolian/eolian_parsing.c | 51 ------------------- 29 files changed, 63 insertions(+), 165 deletions(-) delete mode 100644 src/tests/eolian/data/null.eo diff --git a/src/Makefile_Eolian.am b/src/Makefile_Eolian.am index 876a2f01ac..0336b7f5c2 100644 --- a/src/Makefile_Eolian.am +++ b/src/Makefile_Eolian.am @@ -92,7 +92,6 @@ tests/eolian/data/nmsp1_class1.eo \ tests/eolian/data/nmsp1_nmsp11_class2.eo \ tests/eolian/data/nmsp2_class1.eo \ tests/eolian/data/no_nmsp.eo \ -tests/eolian/data/null.eo \ tests/eolian/data/object_impl.eo \ tests/eolian/data/object_impl_add.eo \ tests/eolian/data/override.eo \ diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua index 20118af15f..34da82c27b 100644 --- a/src/bindings/luajit/eolian.lua +++ b/src/bindings/luajit/eolian.lua @@ -370,7 +370,6 @@ ffi.cdef [[ const Eolian_Expression *eolian_parameter_default_value_get(const Eolian_Function_Parameter *param); const Eolian_Documentation *eolian_parameter_documentation_get(const Eolian_Function_Parameter *param); Eina_Bool eolian_parameter_is_nonull(const Eolian_Function_Parameter *param_desc); - Eina_Bool eolian_parameter_is_nullable(const Eolian_Function_Parameter *param_desc); Eina_Bool eolian_parameter_is_optional(const Eolian_Function_Parameter *param_desc); const Eolian_Type *eolian_function_return_type_get(const Eolian_Function *function_id, Eolian_Function_Type ftype); const Eolian_Expression *eolian_function_return_default_value_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype); @@ -1268,10 +1267,6 @@ ffi.metatype("Eolian_Function_Parameter", { return eolian.eolian_parameter_is_nonull(self) ~= 0 end, - is_nullable = function(self) - return eolian.eolian_parameter_is_nullable(self) ~= 0 - end, - is_optional = function(self) return eolian.eolian_parameter_is_optional(self) ~= 0 end diff --git a/src/lib/ecore_con/efl_net_control_manager.eo b/src/lib/ecore_con/efl_net_control_manager.eo index cfb729b9db..fb2fabf29c 100644 --- a/src/lib/ecore_con/efl_net_control_manager.eo +++ b/src/lib/ecore_con/efl_net_control_manager.eo @@ -193,11 +193,11 @@ class @beta Efl.Net.Control.Manager extends Efl.Loop_Consumer { agent_reply { [[If event "agent_request_input" was emitted, this will reply with the requested data]] params { - name: string @nullable; [[If @Efl.Net.Control.Agent_Request_Input_Field.name was present, this should contain the network name or the 'ssid' parameter should be used.]] - @cref ssid: Eina.Slice @nullable; [[If @Efl.Net.Control.Agent_Request_Input_Field.ssid was present, this should contain the network SSID or the 'name' parameter should be used.]] - username: string @nullable; [[If @Efl.Net.Control.Agent_Request_Input_Field.username was present, this should contain the identity or username]] - passphrase: string @nullable; [[If @Efl.Net.Control.Agent_Request_Input_Field.passphrase was present, this should contain the password or passphrase, more details on how it should be interpreted was given in Efl.Net.Control.Agent_Request_Input.passphrase_type.]] - wps: string @nullable; [[If @Efl.Net.Control.Agent_Request_Input_Field.wps was present, this should contain the WPS PIN or an empty string "" to use the WPS push button instead.]] + name: string; [[If @Efl.Net.Control.Agent_Request_Input_Field.name was present, this should contain the network name or the 'ssid' parameter should be used.]] + @cref ssid: Eina.Slice; [[If @Efl.Net.Control.Agent_Request_Input_Field.ssid was present, this should contain the network SSID or the 'name' parameter should be used.]] + username: string; [[If @Efl.Net.Control.Agent_Request_Input_Field.username was present, this should contain the identity or username]] + passphrase: string; [[If @Efl.Net.Control.Agent_Request_Input_Field.passphrase was present, this should contain the password or passphrase, more details on how it should be interpreted was given in Efl.Net.Control.Agent_Request_Input.passphrase_type.]] + wps: string; [[If @Efl.Net.Control.Agent_Request_Input_Field.wps was present, this should contain the WPS PIN or an empty string "" to use the WPS push button instead.]] } } } diff --git a/src/lib/ecore_con/efl_net_dialer.eo b/src/lib/ecore_con/efl_net_dialer.eo index 02770dca46..fce38973f7 100644 --- a/src/lib/ecore_con/efl_net_dialer.eo +++ b/src/lib/ecore_con/efl_net_dialer.eo @@ -109,7 +109,7 @@ interface @beta Efl.Net.Dialer extends Efl.Net.Socket { } events { - /* FIXME: Might be NULL, but @nullable does not work on event types */ + /* tag nullable once supported by eolian */ dialer,resolved: string; [[Notifies @.address_dial was resolved to @Efl.Net.Socket.address_remote. diff --git a/src/lib/ecore_con/efl_net_socket_ssl.eo b/src/lib/ecore_con/efl_net_socket_ssl.eo index 9fb0031473..31fcb309f5 100644 --- a/src/lib/ecore_con/efl_net_socket_ssl.eo +++ b/src/lib/ecore_con/efl_net_socket_ssl.eo @@ -75,7 +75,7 @@ class @beta Efl.Net.Socket_Ssl extends Efl.Loop_Consumer implements Efl.Net.Sock It's only used if @.hostname_verify is $true. ]] values { - hostname_override: string @nullable; [[Hostname for this socket]] + hostname_override: string; [[Hostname for this socket]] } } } diff --git a/src/lib/ecore_con/efl_net_ssl_context.eo b/src/lib/ecore_con/efl_net_ssl_context.eo index 2557a03552..26fd68f1de 100644 --- a/src/lib/ecore_con/efl_net_ssl_context.eo +++ b/src/lib/ecore_con/efl_net_ssl_context.eo @@ -122,7 +122,7 @@ class @beta Efl.Net.Ssl.Context extends Efl.Object { It's only used if @.hostname_verify is $true. ]] values { - hostname: string @nullable; [[Hostname for this socket]] + hostname: string; [[Hostname for this socket]] } } } diff --git a/src/lib/efl/interfaces/efl_canvas_scene.eo b/src/lib/efl/interfaces/efl_canvas_scene.eo index fd1a8180d9..44539d3581 100644 --- a/src/lib/efl/interfaces/efl_canvas_scene.eo +++ b/src/lib/efl/interfaces/efl_canvas_scene.eo @@ -235,7 +235,7 @@ interface Efl.Canvas.Scene object,focus,in: Efl.Input.Focus; [[Called when object got focus]] object,focus,out: Efl.Input.Focus; [[Called when object lost focus]] render,pre: void; [[Called when pre render happens]] - /* FIXME: event_info can be NULL, but @nullable tag does not work on events yet */ + /* tag nullable once supported by eolian */ render,post @beta: Efl.Gfx.Event.Render_Post; [[Called when post render happens]] device,changed @beta : Efl.Input.Device; [[Called when input device changed]] device,added @beta: Efl.Input.Device; [[Called when input device was added]] diff --git a/src/lib/efl/interfaces/efl_gfx_buffer.eo b/src/lib/efl/interfaces/efl_gfx_buffer.eo index 074dd7843a..38da6c8266 100644 --- a/src/lib/efl/interfaces/efl_gfx_buffer.eo +++ b/src/lib/efl/interfaces/efl_gfx_buffer.eo @@ -174,7 +174,7 @@ interface @beta Efl.Gfx.Buffer $slice should not be the return value of @.buffer_managed_get. ]] params { - @cref slice: Eina.Slice @nullable; [[If $null, allocates an empty buffer]] + @cref slice: Eina.Slice; [[If $null, allocates an empty buffer]] @in size: Eina.Size2D; [[The size in pixels.]] @in stride: int @optional; [[If 0, automatically guessed from the $width.]] @in cspace: Efl.Gfx.Colorspace @optional; [[argb8888 by default.]] @@ -199,7 +199,7 @@ interface @beta Efl.Gfx.Buffer internally. ]] params { - @cref slice: Eina.Slice @nullable; [[If $null, detaches the previous buffer.]] + @cref slice: Eina.Slice; [[If $null, detaches the previous buffer.]] @in size: Eina.Size2D; [[The size in pixels.]] @in stride: int @optional; [[If 0, automatically guessed from the $width.]] @in cspace: Efl.Gfx.Colorspace @optional; [[argb8888 by default.]] diff --git a/src/lib/efl/interfaces/efl_ui_format.eo b/src/lib/efl/interfaces/efl_ui_format.eo index 8f59d858af..c7b6aba841 100644 --- a/src/lib/efl/interfaces/efl_ui_format.eo +++ b/src/lib/efl/interfaces/efl_ui_format.eo @@ -18,7 +18,7 @@ mixin @beta Efl.Ui.Format ]] } values { - func: Efl.Ui.Format_Func_Cb @nullable; [[The format function callback]] + func: Efl.Ui.Format_Func_Cb; [[The format function callback]] } } @property format_string { @@ -35,7 +35,7 @@ mixin @beta Efl.Ui.Format as in $"%.0f %%". ]] values { - units: string @nullable; [[The format string for $obj's units label.]] + units: string; [[The format string for $obj's units label.]] } } } diff --git a/src/lib/elementary/efl_ui_clock.eo b/src/lib/elementary/efl_ui_clock.eo index e2c7fdec6e..abc7b5e48f 100644 --- a/src/lib/elementary/efl_ui_clock.eo +++ b/src/lib/elementary/efl_ui_clock.eo @@ -95,7 +95,7 @@ class @beta Efl.Ui.Clock extends Efl.Ui.Layout_Base */ set {} get {} values { - fmt: string @nullable; [[The clock format.]] + fmt: string; [[The clock format.]] } } @property pause { diff --git a/src/lib/elementary/efl_ui_internal_text_scroller.eo b/src/lib/elementary/efl_ui_internal_text_scroller.eo index 4e20e9bea7..b18c008d76 100644 --- a/src/lib/elementary/efl_ui_internal_text_scroller.eo +++ b/src/lib/elementary/efl_ui_internal_text_scroller.eo @@ -38,8 +38,8 @@ class @beta Efl.Ui.Internal_Text_Scroller extends Efl.Ui.Scroller This should be called upon constructing the object. ]] params { - text_obj: Efl.Canvas.Text @nullable; [[The text object to query]] - text_table: Efl.Ui.Table @nullable; [[The table container of + text_obj: Efl.Canvas.Text; [[The text object to query]] + text_table: Efl.Ui.Table; [[The table container of the $text_obj]] } } diff --git a/src/lib/elementary/efl_ui_pager.eo b/src/lib/elementary/efl_ui_pager.eo index 7879132d26..7389fd8e08 100644 --- a/src/lib/elementary/efl_ui_pager.eo +++ b/src/lib/elementary/efl_ui_pager.eo @@ -27,7 +27,7 @@ class @beta Efl.Ui.Pager extends Efl.Ui.Layout_Base implements Efl.Pack_Linear [[Set a page transition effect]] } values { - transition: Efl.Page.Transition @nullable; [[transition effect]] + transition: Efl.Page.Transition; [[transition effect]] } } @property indicator { @@ -40,7 +40,7 @@ class @beta Efl.Ui.Pager extends Efl.Ui.Layout_Base implements Efl.Pack_Linear [[Set a page indicator]] } values { - indicator: Efl.Page.Indicator @nullable; [[indicator class]] + indicator: Efl.Page.Indicator; [[indicator class]] } } @property current_page { diff --git a/src/lib/elementary/efl_ui_radio.eo b/src/lib/elementary/efl_ui_radio.eo index 5fd6136543..8dabfc7cfc 100644 --- a/src/lib/elementary/efl_ui_radio.eo +++ b/src/lib/elementary/efl_ui_radio.eo @@ -33,7 +33,7 @@ class @beta Efl.Ui.Radio extends Efl.Ui.Check implements Efl.Access.Widget.Actio ]] } values { - valuep: ptr(int) @nullable; [[Pointer to the integer to modify]] + valuep: ptr(int); [[Pointer to the integer to modify]] } } @property selected_object { diff --git a/src/lib/elementary/efl_ui_scroll_manager.eo b/src/lib/elementary/efl_ui_scroll_manager.eo index e948fe6bc9..3733e81369 100644 --- a/src/lib/elementary/efl_ui_scroll_manager.eo +++ b/src/lib/elementary/efl_ui_scroll_manager.eo @@ -17,7 +17,7 @@ class @beta Efl.Ui.Scroll.Manager extends Efl.Object implements set { } values { - pan: Efl.Ui.Pan @nullable; [[Pan object]] + pan: Efl.Ui.Pan; [[Pan object]] } } } diff --git a/src/lib/elementary/efl_ui_text.eo b/src/lib/elementary/efl_ui_text.eo index 626280afc2..4ebb3faec8 100644 --- a/src/lib/elementary/efl_ui_text.eo +++ b/src/lib/elementary/efl_ui_text.eo @@ -360,7 +360,7 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Ui.Clickable, } events { changed: void; [[Called when entry changes]] - /* FIXME: Sometimes it can be NULL but @nullable does not work on events */ + /* can be NULL, tag nullable once Eolian supports it */ changed,user: Efl.Ui.Text_Change_Info; [[The text object has changed due to user interaction]] validate: Elm.Validate_Content; [[Called when validating]] diff --git a/src/lib/elementary/efl_ui_widget.eo b/src/lib/elementary/efl_ui_widget.eo index ece49ef4f6..1c2f85abf9 100644 --- a/src/lib/elementary/efl_ui_widget.eo +++ b/src/lib/elementary/efl_ui_widget.eo @@ -53,8 +53,8 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, [[Returns the current cursor name.]] } values { - cursor: string @nullable; [[The cursor name, defined either - by the display system or the theme.]] + cursor: string; [[The cursor name, defined either + by the display system or the theme.]] } } @property cursor_style @beta { @@ -104,7 +104,7 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, [[Sets the new resize object for this widget.]] } values { - sobj: Efl.Canvas.Object @nullable; + sobj: Efl.Canvas.Object; [[A canvas object (often a @Efl.Canvas.Layout object).]] } } @@ -216,7 +216,7 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, get { } values { - parent: Efl.Ui.Widget @nullable; [[Widget parent object]] + parent: Efl.Ui.Widget; [[Widget parent object]] } } @@ -231,7 +231,7 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, out loud, instead $txt will be read out. ]] values { - txt: string @nullable; [[Accessibility text description.]] + txt: string; [[Accessibility text description.]] } } on_access_activate @protected @beta { diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo index 33a4be6510..1a3e3a4db3 100644 --- a/src/lib/elementary/efl_ui_win.eo +++ b/src/lib/elementary/efl_ui_win.eo @@ -303,7 +303,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W type @Efl.Canvas.Image or @Efl.Ui.Image are allowed. ]] values { - icon: Efl.Canvas.Object @nullable; + icon: Efl.Canvas.Object; [[The image object to use for an icon.]] } } @@ -314,7 +314,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W the object to use for the window icon. ]] values { - icon: const(Efl.Canvas.Object) @nullable; + icon: const(Efl.Canvas.Object); [[The Evas image object to use for an icon.]] } } @@ -444,7 +444,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W get { } values { - name: string @nullable; [[Window name]] + name: string; [[Window name]] } } @property win_type @beta { @@ -797,7 +797,7 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W get { } values { - style: string @nullable; [[The name of the focus highlight style.]] + style: string; [[The name of the focus highlight style.]] } } @property focus_highlight_animate { diff --git a/src/lib/elementary/elm_interface_scrollable.eo b/src/lib/elementary/elm_interface_scrollable.eo index f8c2a2dbfd..77f2422864 100644 --- a/src/lib/elementary/elm_interface_scrollable.eo +++ b/src/lib/elementary/elm_interface_scrollable.eo @@ -287,7 +287,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the content has been moved up.]] } values { - scroll_up_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + scroll_up_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property hbar_drag_cb { @@ -295,7 +295,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the horizontal scrollbar is dragged.]] } values { - hbar_drag_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + hbar_drag_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property drag_start_cb { @@ -303,7 +303,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when dragging of the contents has started.]] } values { - drag_start_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + drag_start_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property freeze { @@ -319,7 +319,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[When the viewport is resized, the callback is called.]] } values { - viewport_resize_cb: Elm_Interface_Scrollable_Resize_Cb @nullable; [[The callback]] + viewport_resize_cb: Elm_Interface_Scrollable_Resize_Cb; [[The callback]] } } @property scroll_left_cb { @@ -327,7 +327,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the content has been moved to the left]] } values { - scroll_left_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + scroll_left_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property vbar_press_cb { @@ -335,7 +335,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the vertical scrollbar is pressed.]] } values { - vbar_press_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + vbar_press_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property hbar_press_cb { @@ -343,7 +343,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the horizontal scrollbar is pressed.]] } values { - hbar_press_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + hbar_press_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property hbar_unpress_cb { @@ -351,7 +351,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the horizontal scrollbar is unpressed.]] } values { - hbar_unpress_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + hbar_unpress_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property drag_stop_cb { @@ -359,7 +359,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when dragging of the contents has stopped.]] } values { - drag_stop_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + drag_stop_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property extern_pan { @@ -367,7 +367,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol set { } values { - pan: Efl.Canvas.Object @nullable; [[Pan object]] + pan: Efl.Canvas.Object; [[Pan object]] } } @property page_change_cb { @@ -375,7 +375,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the visible page changes.]] } values { - page_change_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + page_change_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property hold { @@ -391,7 +391,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the scrolling animation has started.]] } values { - animate_start_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + animate_start_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property scroll_down_cb { @@ -399,7 +399,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the content has been moved down.]] } values { - scroll_down_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + scroll_down_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property page_relative { @@ -416,7 +416,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the content has been moved.]] } values { - scroll_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + scroll_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property animate_stop_cb { @@ -424,7 +424,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the scrolling animation has stopped.]] } values { - animate_stop_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + animate_stop_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property content_min_limit_cb { @@ -432,7 +432,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol set { } values { - min_limit_cb: Elm_Interface_Scrollable_Min_Limit_Cb @nullable; [[The callback]] + min_limit_cb: Elm_Interface_Scrollable_Min_Limit_Cb; [[The callback]] } } @property scroll_right_cb { @@ -440,7 +440,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the content has been moved to the right.]] } values { - scroll_right_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + scroll_right_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property scrollable_content { @@ -448,7 +448,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol set { } values { - content: Efl.Canvas.Object @nullable; [[Content object]] + content: Efl.Canvas.Object; [[Content object]] } } @property edge_left_cb { @@ -456,7 +456,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the left edge of the content has been reached.]] } values { - edge_left_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + edge_left_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property vbar_drag_cb { @@ -464,7 +464,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the horizontal scrollbar is dragged.]] } values { - vbar_drag_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + vbar_drag_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property vbar_unpress_cb { @@ -472,7 +472,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the horizontal scrollbar is unpressed.]] } values { - vbar_unpress_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + vbar_unpress_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property edge_bottom_cb { @@ -480,7 +480,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the bottom edge of the content has been reached.]] } values { - edge_bottom_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + edge_bottom_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property edge_right_cb { @@ -488,7 +488,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the right edge of the content has been reached.]] } values { - edge_right_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + edge_right_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property edge_top_cb { @@ -496,7 +496,7 @@ mixin @beta Elm.Interface_Scrollable requires Efl.Ui.Widget extends Efl.Ui.Scrol [[Set the callback to run when the top edge of the content has been reached.]] } values { - edge_top_cb: Elm_Interface_Scrollable_Cb @nullable; [[The callback]] + edge_top_cb: Elm_Interface_Scrollable_Cb; [[The callback]] } } @property objects { diff --git a/src/lib/eo/efl_object.eo b/src/lib/eo/efl_object.eo index a63343ac9a..84a5558677 100644 --- a/src/lib/eo/efl_object.eo +++ b/src/lib/eo/efl_object.eo @@ -91,7 +91,7 @@ abstract Efl.Object get { } values { - parent: Efl.Object @nullable; [[The new parent.]] + parent: Efl.Object; [[The new parent.]] } } @property name { @@ -108,7 +108,7 @@ abstract Efl.Object get { } values { - name: string @nullable; [[The name.]] + name: string; [[The name.]] } } @property comment { @@ -123,7 +123,7 @@ abstract Efl.Object get { } values { - comment: string @nullable; [[The comment.]] + comment: string; [[The comment.]] } } debug_name_override { diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h index 3715ed1eaf..2f5346eb7b 100644 --- a/src/lib/eolian/Eolian.h +++ b/src/lib/eolian/Eolian.h @@ -1791,16 +1791,6 @@ EAPI const Eolian_Documentation *eolian_parameter_documentation_get(const Eolian */ EAPI Eina_Bool eolian_parameter_is_nonull(const Eolian_Function_Parameter *param_desc); -/* - * @brief Indicates if a parameter is nullable. - * - * @param[in] param_desc parameter handle - * @return EINA_TRUE if nullable, EINA_FALSE otherwise - * - * @ingroup Eolian - */ -EAPI Eina_Bool eolian_parameter_is_nullable(const Eolian_Function_Parameter *param_desc); - /* * @brief Indicates if a parameter is optional. * diff --git a/src/lib/eolian/database_function_parameter_api.c b/src/lib/eolian/database_function_parameter_api.c index 87f1ed34c1..265c98ee1c 100644 --- a/src/lib/eolian/database_function_parameter_api.c +++ b/src/lib/eolian/database_function_parameter_api.c @@ -40,13 +40,6 @@ eolian_parameter_is_nonull(const Eolian_Function_Parameter *param) return param->nonull; } -EAPI Eina_Bool -eolian_parameter_is_nullable(const Eolian_Function_Parameter *param) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(param, EINA_FALSE); - return param->nullable; -} - EAPI Eina_Bool eolian_parameter_is_optional(const Eolian_Function_Parameter *param) { diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h index 4fec039de2..cc8fc9ce8b 100644 --- a/src/lib/eolian/eo_lexer.h +++ b/src/lib/eolian/eo_lexer.h @@ -21,7 +21,10 @@ enum Tokens }; /* all keywords in eolian, they can still be used as names (they're TOK_VALUE) - * they just fill in the "kw" field of the token */ + * they just fill in the "kw" field of the token + * + * reserved for the future: @nullable + */ #define KEYWORDS KW(class), KW(const), KW(enum), KW(return), KW(struct), \ \ KW(abstract), KW(c_prefix), KW(composite), KW(constructor), KW(constructors), \ diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index 80d89e558b..3a75555fce 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -907,7 +907,7 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout, Eina_Bool is_vals) { Eina_Bool has_nonull = EINA_FALSE, has_optional = EINA_FALSE, - has_nullable = EINA_FALSE, has_owned = EINA_FALSE; + has_owned = EINA_FALSE; Eina_Bool cref = (ls->t.kw == KW_at_cref); Eolian_Function_Parameter *par = calloc(1, sizeof(Eolian_Function_Parameter)); par->param_dir = EOLIAN_IN_PARAM; @@ -956,8 +956,6 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout, for (;;) switch (ls->t.kw) { case KW_at_nonull: - if (has_nullable) - eo_lexer_syntax_error(ls, "both nullable and nonull specified"); CASE_LOCK(ls, nonull, "nonull qualifier") par->nonull = EINA_TRUE; eo_lexer_get(ls); @@ -967,13 +965,6 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout, par->optional = EINA_TRUE; eo_lexer_get(ls); break; - case KW_at_nullable: - if (has_nonull) - eo_lexer_syntax_error(ls, "both nullable and nonull specified"); - CASE_LOCK(ls, nullable, "nullable qualifier"); - par->nullable = EINA_TRUE; - eo_lexer_get(ls); - break; case KW_at_owned: CASE_LOCK(ls, owned, "owned qualifier"); par->type->owned = EINA_TRUE; diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h index f2dceba007..f51f4269c9 100644 --- a/src/lib/eolian/eolian_database.h +++ b/src/lib/eolian/eolian_database.h @@ -252,7 +252,6 @@ struct _Eolian_Function_Parameter Eolian_Documentation *doc; Eolian_Parameter_Dir param_dir; Eina_Bool nonull :1; /* True if this argument cannot be NULL - deprecated */ - Eina_Bool nullable :1; /* True if this argument is nullable */ Eina_Bool optional :1; /* True if this argument is optional */ }; diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py index 4dce2e6d4b..bd92075565 100644 --- a/src/scripts/pyolian/eolian.py +++ b/src/scripts/pyolian/eolian.py @@ -963,7 +963,7 @@ class Function(Object): class Function_Parameter(Object): def __repr__(self): return "".format(self) + " optional={0.is_optional}>".format(self) @cached_property def direction(self): @@ -978,10 +978,6 @@ class Function_Parameter(Object): def is_nonull(self): return bool(lib.eolian_parameter_is_nonull(self)) - @cached_property - def is_nullable(self): - return bool(lib.eolian_parameter_is_nullable(self)) - @cached_property def is_optional(self): return bool(lib.eolian_parameter_is_optional(self)) diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py index 622486ebdf..4fe2dc54fb 100644 --- a/src/scripts/pyolian/eolian_lib.py +++ b/src/scripts/pyolian/eolian_lib.py @@ -403,10 +403,6 @@ lib.eolian_parameter_documentation_get.restype = c_void_p lib.eolian_parameter_is_nonull.argtypes = (c_void_p,) lib.eolian_parameter_is_nonull.restype = c_bool -# EAPI Eina_Bool eolian_parameter_is_nullable(const Eolian_Function_Parameter *param_desc); -lib.eolian_parameter_is_nullable.argtypes = (c_void_p,) -lib.eolian_parameter_is_nullable.restype = c_bool - # EAPI Eina_Bool eolian_parameter_is_optional(const Eolian_Function_Parameter *param_desc); lib.eolian_parameter_is_optional.argtypes = (c_void_p,) lib.eolian_parameter_is_optional.restype = c_bool diff --git a/src/scripts/pyolian/test_eolian.py b/src/scripts/pyolian/test_eolian.py index 3695330cc6..2a59349386 100755 --- a/src/scripts/pyolian/test_eolian.py +++ b/src/scripts/pyolian/test_eolian.py @@ -381,7 +381,6 @@ class TestEolianFunction(unittest.TestCase): self.assertEqual(p.name, 'add') self.assertIsNone(p.default_value) self.assertFalse(p.is_nonull) # TODO is correct ?? 'add' can be null? - self.assertFalse(p.is_nullable) self.assertFalse(p.is_optional) self.assertEqual(p.type.name, 'double') self.assertIsInstance(p.documentation, eolian.Documentation) diff --git a/src/tests/eolian/data/null.eo b/src/tests/eolian/data/null.eo deleted file mode 100644 index ad872e0ace..0000000000 --- a/src/tests/eolian/data/null.eo +++ /dev/null @@ -1,12 +0,0 @@ -class Null { - methods { - foo { - params { - x: ptr(char); - y: ptr(char) @nullable; - z: ptr(char) @optional; - w: ptr(char) @optional @nullable; - } - } - } -} diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c index 8711fdf319..2fbb1b52b0 100644 --- a/src/tests/eolian/eolian_parsing.c +++ b/src/tests/eolian/eolian_parsing.c @@ -1010,56 +1010,6 @@ EFL_START_TEST(eolian_free_func) } EFL_END_TEST -EFL_START_TEST(eolian_null) -{ - const Eolian_Class *class; - const Eolian_Function *func; - const Eolian_Function_Parameter *param; - const Eolian_Unit *unit; - Eina_Iterator *iter; - - Eolian_State *eos = eolian_state_new(); - - /* Parsing */ - fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data")); - fail_if(!(unit = eolian_state_file_parse(eos, "null.eo"))); - - fail_if(!(class = eolian_unit_class_by_name_get(unit, "Null"))); - fail_if(!(func = eolian_class_function_by_name_get(class, "foo", EOLIAN_METHOD))); - - fail_if(!(iter = eolian_function_parameters_get(func))); - - /* no qualifiers */ - fail_if(!(eina_iterator_next(iter, (void**)¶m))); - fail_if(strcmp(eolian_parameter_name_get(param), "x")); - fail_if(eolian_parameter_is_nullable(param)); - fail_if(eolian_parameter_is_optional(param)); - - /* nullable */ - fail_if(!(eina_iterator_next(iter, (void**)¶m))); - fail_if(strcmp(eolian_parameter_name_get(param), "y")); - fail_if(!eolian_parameter_is_nullable(param)); - fail_if(eolian_parameter_is_optional(param)); - - /* optional */ - fail_if(!(eina_iterator_next(iter, (void**)¶m))); - fail_if(strcmp(eolian_parameter_name_get(param), "z")); - fail_if(eolian_parameter_is_nullable(param)); - fail_if(!eolian_parameter_is_optional(param)); - - /* both */ - fail_if(!(eina_iterator_next(iter, (void**)¶m))); - fail_if(strcmp(eolian_parameter_name_get(param), "w")); - fail_if(!eolian_parameter_is_nullable(param)); - fail_if(!eolian_parameter_is_optional(param)); - - fail_if(eina_iterator_next(iter, (void**)¶m)); - eina_iterator_free(iter); - - eolian_state_free(eos); -} -EFL_END_TEST - EFL_START_TEST(eolian_import) { const Eolian_Class *class; @@ -1654,7 +1604,6 @@ void eolian_parsing_test(TCase *tc) tcase_add_test(tc, eolian_enum); tcase_add_test(tc, eolian_class_funcs); tcase_add_test(tc, eolian_free_func); - tcase_add_test(tc, eolian_null); tcase_add_test(tc, eolian_import); tcase_add_test(tc, eolian_docs); tcase_add_test(tc, eolian_function_types);