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 \
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);
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
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.]]
}
}
}
}
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.
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]]
}
}
}
It's only used if @.hostname_verify is $true.
]]
values {
- hostname: string @nullable; [[Hostname for this socket]]
+ hostname: string; [[Hostname for this socket]]
}
}
}
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]]
$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.]]
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.]]
]]
}
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 {
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.]]
}
}
}
*/
set {} get {}
values {
- fmt: string @nullable; [[The clock format.]]
+ fmt: string; [[The clock format.]]
}
}
@property pause {
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]]
}
}
[[Set a page transition effect]]
}
values {
- transition: Efl.Page.Transition @nullable; [[transition effect]]
+ transition: Efl.Page.Transition; [[transition effect]]
}
}
@property indicator {
[[Set a page indicator]]
}
values {
- indicator: Efl.Page.Indicator @nullable; [[indicator class]]
+ indicator: Efl.Page.Indicator; [[indicator class]]
}
}
@property current_page {
]]
}
values {
- valuep: ptr(int) @nullable; [[Pointer to the integer to modify]]
+ valuep: ptr(int); [[Pointer to the integer to modify]]
}
}
@property selected_object {
set {
}
values {
- pan: Efl.Ui.Pan @nullable; [[Pan object]]
+ pan: Efl.Ui.Pan; [[Pan object]]
}
}
}
}
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]]
[[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 {
[[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).]]
}
}
get {
}
values {
- parent: Efl.Ui.Widget @nullable; [[Widget parent object]]
+ parent: Efl.Ui.Widget; [[Widget parent 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 {
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.]]
}
}
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.]]
}
}
get {
}
values {
- name: string @nullable; [[Window name]]
+ name: string; [[Window name]]
}
}
@property win_type @beta {
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 {
[[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 {
[[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 {
[[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]]
}
}
//TIZEN_ONLY(20190219): fix page snap behavior.
[[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 {
[[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 {
[[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 {
[[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 {
[[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 {
[[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]]
}
}
//TIZEN_ONLY(20190219): fix page snap behavior.
set {
}
values {
- pan: Efl.Canvas.Object @nullable; [[Pan object]]
+ pan: Efl.Canvas.Object; [[Pan object]]
}
}
@property page_change_cb {
[[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 {
[[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 {
[[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 {
[[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 {
[[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 {
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 {
[[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 {
set {
}
values {
- content: Efl.Canvas.Object @nullable; [[Content object]]
+ content: Efl.Canvas.Object; [[Content object]]
}
}
@property edge_left_cb {
[[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 {
[[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 {
[[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 {
[[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 {
[[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 {
[[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 {
get {
}
values {
- parent: Efl.Object @nullable; [[The new parent.]]
+ parent: Efl.Object; [[The new parent.]]
}
}
@property name {
get {
}
values {
- name: string @nullable; [[The name.]]
+ name: string; [[The name.]]
}
}
@property comment {
get {
}
values {
- comment: string @nullable; [[The comment.]]
+ comment: string; [[The comment.]]
}
}
debug_name_override {
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.
*
* @param[in] param_desc parameter handle
}
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)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(param, EINA_FALSE);
};
/* 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), \
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;
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);
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;
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 */
};
class Function_Parameter(Object):
def __repr__(self):
return "<eolian.Function_Parameter '{0.name}', type={0.type}," \
- " optional={0.is_optional}, nullable={0.is_nullable}>".format(self)
+ " optional={0.is_optional}>".format(self)
@cached_property
def direction(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))
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
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)
+++ /dev/null
-class Null {
- methods {
- foo {
- params {
- x: ptr(char);
- y: ptr(char) @nullable;
- z: ptr(char) @optional;
- w: ptr(char) @optional @nullable;
- }
- }
- }
-}
}
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;
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);