Merge strict eolian type checking branch.

In this branch I turned on strict eolian type checking and silenced all
of the errors that came to be because of it (fixed some).

I did it so new code will not introduce new errors. We've had more
errors introduced recently, and I believe it's because of ignorance. No
more excuses, compilation will now fail if you fail to handle types
correctly.

We need to fix my workarounds. Many of the .eo files that I worked
around on need to be removed anyway, and a lot of the rest need a lot of
changes, so there was no point wasting my time into fixing it properly.
This commit is contained in:
Tom Hacohen 2016-04-19 17:16:20 +01:00
commit daed567e3c
44 changed files with 198 additions and 73 deletions

View File

@ -1,3 +1,8 @@
import eina_types;
type Elm_App_Client_Open_View_Cb: __undefined_type;
type Elm_App_Client_Pending: __undefined_type;
class Elm.App_Client (Eo.Base)
{
legacy_prefix: null;
@ -34,7 +39,7 @@ class Elm.App_Client (Eo.Base)
view_open {
[[Open an application view.]]
params {
@in args: Eina_Value * @optional; [[an array of.]]
@in args: Eina.Value * @optional; [[an array of.]]
@in view_open_cb: Elm_App_Client_Open_View_Cb @optional; [[callback to be called when view open]]
@in data: const(void)* @optional; [[callback user data]]
}

View File

@ -1,3 +1,7 @@
import elm_general;
type Elm_App_Client_View_Cb: __undefined_type;
class Elm.App_Client_View (Eo.Base)
{
legacy_prefix: null;
@ -49,7 +53,7 @@ class Elm.App_Client_View (Eo.Base)
[[Get DBus path of view]]
}
values {
ret: Eina_Stringshare *; [[DBus path of view]]
ret: Eina.Stringshare *; [[DBus path of view]]
}
}
@property package {

View File

@ -1,3 +1,8 @@
import eina_types;
import elm_general;
type Elm_App_Server_Create_View_Cb: __undefined_type;
class Elm.App_Server (Eo.Base)
{
legacy_prefix: null;
@ -9,7 +14,7 @@ class Elm.App_Server (Eo.Base)
get {
}
values {
icon: Eina_Stringshare *; [[title of icon]]
icon: Eina.Stringshare *; [[title of icon]]
}
}
@property views {
@ -31,7 +36,7 @@ class Elm.App_Server (Eo.Base)
get {
}
values {
ret: Eina_Stringshare *;
ret: Eina.Stringshare *;
}
}
@property pixels {
@ -83,7 +88,7 @@ class Elm.App_Server (Eo.Base)
}
title_get {
[[Get title of application]]
return: Eina_Stringshare *; [[title of application]]
return: Eina.Stringshare *; [[title of application]]
}
save {
[[Save the state of all views]]

View File

@ -1,3 +1,5 @@
import elm_general;
class Elm.App_Server_View (Eo.Base)
{
legacy_prefix: null;

View File

@ -1,3 +1,7 @@
import evas_box;
type Ecore_Cb: __undefined_type;
class Elm.Box (Elm.Widget)
{
eo_prefix: elm_obj_box;

View File

@ -1,3 +1,7 @@
import efl_types;
type Elm_Calendar_Format_Cb: __undefined_type;
enum Elm.Calendar.Mark.Repeat.Type
{
[[

View File

@ -10,7 +10,7 @@ class Elm.Check (Elm.Nstate, Elm.Interface_Atspi_Widget_Action)
[[Get the state of the check object.]]
}
values {
value: Eina_Bool;
value: bool;
}
}
}

View File

@ -1,3 +1,5 @@
import efl_types;
enum Elm.Datetime.Field_Type
{
[[Identifies a Datetime field, The widget supports 6 fields : Year, month,

View File

@ -1,4 +1,8 @@
import elm_general;
import elm_icon;
type Elm_Entry_Item_Provider_Cb: __undefined_type;
type Elm_Entry_Filter_Cb: __undefined_type;
enum Elm.Text_Format
{

View File

@ -6,6 +6,20 @@ struct Elm.Event.Policy_Changed
old_value: int; [[new value the policy got]]
}
/* FIXME: These shouldn't be here, we don't do functions in eolian!!! */
type Elm_Gen_Item_Text_Get_Cb: __undefined_type;
type Elm_Gen_Item_Content_Get_Cb: __undefined_type;
type Elm_Gen_Item_State_Get_Cb: __undefined_type;
type Elm_Gen_Item_Del_Cb: __undefined_type;
type Elm_Gen_Item_Filter_Get_Cb: __undefined_type;
type Elm_Gen_Item_Reusable_Content_Get_Cb: __undefined_type;
type Elm_Tooltip_Item_Content_Cb: __undefined_type;
type Elm_Object_Item_Signal_Cb: __undefined_type;
type Elm_Event_Cb: __undefined_type;
type Evas_Smart_Cb: __undefined_type;
type Eina_Compare_Cb: __undefined_type;
/* FIXME: This shouldn't be here, we don't do functions in eolian!!! */
struct Elm.Gen.Item.Class.Functions
{
text_get: Elm_Gen_Item_Text_Get_Cb; [[ Text fetching class function for

View File

@ -1,4 +1,5 @@
import elm_general;
import ecore_types;
enum Elm.Gengrid.Reorder_Type
{

View File

@ -1,5 +1,6 @@
import elm_general;
import elm_list;
import elm_genlist_item;
class Elm.Genlist (Elm.Layout, Elm.Interface_Scrollable, Evas.Clickable_Interface,
Elm.Interface_Atspi_Widget_Action, Elm.Interface_Atspi_Selection,

View File

@ -1,3 +1,5 @@
type Elm_Gesture_Event_Cb: __undefined_type;
enum Elm.Gesture.Type
{
[[

View File

@ -1,3 +1,7 @@
type Evas_GL: __undefined_type;
type Evas_GL_API: __undefined_type;
type Evas_GL_Context_Version: __undefined_type;
enum Elm.GLView.Mode
{
[[

View File

@ -1,3 +1,5 @@
import elm_icon;
class Elm.Hoversel_Item(Elm.Widget_Item)
{
eo_prefix: elm_obj_hoversel_item;

View File

@ -17,7 +17,7 @@ struct Elm.Image.Error
@since 1.8
]]
status: int;
open_error: Eina.Bool;
open_error: bool;
}
class Elm.Image (Elm.Widget, Evas.Clickable_Interface, Evas.Draggable_Interface,

View File

@ -1,3 +1,6 @@
/* FIXME: This definitely shouldn't be here. */
type Eo_Event_Cb: __undefined_type;
enum Elm.Atspi.Type
{
[[Type of accessibility object]]

View File

@ -1,3 +1,5 @@
import eina_types;
enum Elm.Atspi_Text.Granularity
{
char,
@ -32,9 +34,9 @@ struct Elm.Atspi_Text.Range
struct Elm.Atspi_Text.Change_Info
{
content: const(char)*;
inserted: Eina.Bool;
pos: size_t;
len: size_t;
inserted: bool;
pos: size;
len: size;
}
interface Elm.Interface_Atspi_Text ()
@ -50,7 +52,7 @@ interface Elm.Interface_Atspi_Text ()
offset: int; [[Position in text.]]
}
values {
character: Eina_Unicode; [[Character at offset. 0 when out-of bounds offset has been given. Codepoints between DC80 and DCFF indicates that string includes invalid UTF8 chars.]]
character: Eina.Unicode; [[Character at offset. 0 when out-of bounds offset has been given. Codepoints between DC80 and DCFF indicates that string includes invalid UTF8 chars.]]
}
}
@property string @protected {
@ -131,7 +133,7 @@ interface Elm.Interface_Atspi_Text ()
screen_coords: bool;
}
values {
rect: Eina_Rectangle;
rect: Eina.Rectangle;
}
}
@property character_count @protected {
@ -158,7 +160,7 @@ interface Elm.Interface_Atspi_Text ()
}
keys {
screen_coords: bool;
rect: Eina_Rectangle;
rect: Eina.Rectangle;
xclip: Elm.Atspi_Text.Clip_Type;
yclip: Elm.Atspi_Text.Clip_Type;
}
@ -176,7 +178,7 @@ interface Elm.Interface_Atspi_Text ()
end_offset: int;
}
values {
rect: Eina_Rectangle;
rect: Eina.Rectangle;
}
}
@property selections_count @protected {

View File

@ -1,3 +1,5 @@
type Elm_Atspi_Action: __undefined_type;
mixin Elm.Interface_Atspi_Widget_Action (Elm.Interface_Atspi_Action)
{
legacy_prefix: null;

View File

@ -1,3 +1,7 @@
import evas_types;
type Elm_Fileselector_Filter_Func: __undefined_type;
enum Elm.Fileselector.Mode
{
[[Defines how a file selector widget is to layout its contents

View File

@ -1,3 +1,47 @@
import elm_general;
type Elm_Interface_Scrollable_Cb: __undefined_type;
type Elm_Interface_Scrollable_Resize_Cb: __undefined_type;
type Elm_Interface_Scrollable_Min_Limit_Cb: __undefined_type;
/* FIXME: Rename the namespace of the types. */
enum Elm.Scroller.Policy
{
[[Type that controls when scrollbars should appear.
See also @Elm.Interface_Scrollable.policy.set.
]]
auto = 0, [[Show scrollbars as needed]]
on, [[Always show scrollbars]]
off, [[Never show scrollbars]]
last
}
enum Elm.Scroller.Single_Direction
{
[[Type that controls how the content is scrolled.
See also @Elm.Interface_Scrollable.single_direction.set.
]]
none = 0, [[Scroll every direction]]
soft, [[Scroll single direction if the direction is certain]]
hard, [[Scroll only single direction]]
last
}
enum Elm.Scroller.Movement_Block
{
[[Type that blocks the scroll movement in one or more direction.
@since 1.8
]]
legacy: elm_scroller_movement;
no_block = 1 << 0, [[Do not block movements]]
block_vertical = 1 << 1, [[Block vertical movements]]
block_horizontal = 1 << 2 [[Block horizontal movements]]
}
mixin Elm.Interface_Scrollable(Evas.Scrollable_Interface, Evas.Object_Smart)
{
legacy_prefix: null;

View File

@ -56,6 +56,9 @@ typedef void (*Elm_Interface_Scrollable_Resize_Cb)(Evas_Object *obj, Evas_C
typedef struct _Elm_Scrollable_Smart_Interface_Data
Elm_Scrollable_Smart_Interface_Data;
#include "elm_interface_scrollable.eo.h"
struct _Elm_Scrollable_Smart_Interface_Data
{
Evas_Coord x, y, w, h;
@ -232,8 +235,6 @@ struct _Elm_Scrollable_Smart_Interface_Data
return __VA_ARGS__; \
}
#include "elm_interface_scrollable.eo.h"
/**
* @}
*/

View File

@ -1,3 +1,5 @@
import edje_types;
struct Elm.Layout_Part_Alias_Description
{
[[
@ -254,7 +256,7 @@ class Elm.Layout (Elm.Container, Efl.File)
params {
@in emission: const(char)*; [[The signal's name string.]]
@in source: const(char)*; [[The signal's source string.]]
@in func: Edje_Signal_Cb; [[The callback function to be executed
@in func: Edje.Signal_Cb; [[The callback function to be executed
when the signal is emitted.]]
@in data: void * @optional; [[A pointer to data to pass in to the
callback function.]]
@ -365,7 +367,7 @@ class Elm.Layout (Elm.Container, Efl.File)
params {
@in emission: const(char)*; [[The signal's name string.]]
@in source: const(char)*; [[The signal's source string.]]
@in func: Edje_Signal_Cb; [[The callback function being executed
@in func: Edje.Signal_Cb; [[The callback function being executed
when the signal was emitted.]]
}
}

View File

@ -1,3 +1,10 @@
/* FIXME: Handle properly. */
type Elm_Map_Route: __undefined_type;
type Elm_Map_Route_Cb: __undefined_type;
type Elm_Map_Overlay: __undefined_type;
type Elm_Map_Name: __undefined_type;
type Elm_Map_Name_Cb: __undefined_type;
type Elm_Map_Name_List_Cb: __undefined_type;
enum Elm.Map.Zoom_Mode
{

View File

@ -1,3 +1,6 @@
type Elm_Multibuttonentry_Item_Filter_Cb: __undefined_type;
type Elm_Multibuttonentry_Format_Cb: __undefined_type;
class Elm.Multibuttonentry (Elm.Layout)
{
eo_prefix: elm_obj_multibuttonentry;

View File

@ -1,3 +1,5 @@
type Elm_Naviframe_Item_Pop_Cb: __undefined_type;
class Elm.Naviframe_Item(Elm.Widget_Item)
{
eo_prefix: elm_obj_naviframe_item;

View File

@ -1,3 +1,5 @@
import evas_types;
enum Elm.Photocam.Zoom_Mode
{
[[Types of zoom available.]]
@ -163,7 +165,7 @@ class Elm.Photocam (Elm.Widget, Elm.Interface_Scrollable,
]]
}
values {
orient: Evas.Image.Orient; [[The photocam image orientation
orient: Evas.Image_Orient; [[The photocam image orientation
\@ref Evas_Image_Orient. Default is
#EVAS_IMAGE_ORIENT_NONE.
]]

View File

@ -1,3 +1,8 @@
import eina_types;
type Elm_Prefs_Data: __undefined_type;
type Elm_Prefs_Reset_Mode: __undefined_type;
class Elm.Prefs (Elm.Widget, Efl.File)
{
eo_prefix: elm_obj_prefs;
@ -85,7 +90,7 @@ class Elm.Prefs (Elm.Widget, Efl.File)
return: bool; [[$true, on success, $false otherwise]]
params {
@in name: const(char)*; [[The name of the item (as declared in the prefs collection)]]
@in value: const(Eina_Value)*; [[The value to set on the item. It should be typed as the item expects, preferably, or a conversion will take place]]
@in value: const(Eina.Value)*; [[The value to set on the item. It should be typed as the item expects, preferably, or a conversion will take place]]
}
}
item_value_get @const {
@ -98,7 +103,7 @@ class Elm.Prefs (Elm.Widget, Efl.File)
params {
@in name: const(char)*; [[The name of the item (as declared in the prefs collection) to get value from]]
@out value: Eina_Value; [[Where to store the value of the item. It will be overwritten and setup with the type the item is bound to]]
@out value: Eina.Value; [[Where to store the value of the item. It will be overwritten and setup with the type the item is bound to]]
}
}
item_object_get {

View File

@ -1,39 +1,3 @@
enum Elm.Scroller.Policy
{
[[Type that controls when scrollbars should appear.
See also @Elm.Interface_Scrollable.policy.set.
]]
auto = 0, [[Show scrollbars as needed]]
on, [[Always show scrollbars]]
off, [[Never show scrollbars]]
last
}
enum Elm.Scroller.Single_Direction
{
[[Type that controls how the content is scrolled.
See also @Elm.Interface_Scrollable.single_direction.set.
]]
none = 0, [[Scroll every direction]]
soft, [[Scroll single direction if the direction is certain]]
hard, [[Scroll only single direction]]
last
}
enum Elm.Scroller.Movement_Block
{
[[Type that blocks the scroll movement in one or more direction.
@since 1.8
]]
legacy: elm_scroller_movement;
no_block = 1 << 0, [[Do not block movements]]
block_vertical = 1 << 1, [[Block vertical movements]]
block_horizontal = 1 << 2 [[Block horizontal movements]]
}
class Elm.Scroller (Elm.Layout, Elm.Interface_Scrollable,
Elm.Interface_Atspi_Widget_Action,
Evas.Scrollable_Interface)

View File

@ -1,3 +1,4 @@
#include "elm_interface_scrollable.eo.legacy.h"
#include "elm_scroller.eo.legacy.h"
/**
* @brief Add a new scroller to the parent

View File

@ -1,3 +1,6 @@
type slider_func_type: __undefined_type;
type slider_freefunc_type: __undefined_type;
class Elm.Slider (Elm.Layout, Efl.Ui.Progress,
Efl.Orientation,
Elm.Interface_Atspi_Value,
@ -147,7 +150,7 @@ class Elm.Slider (Elm.Layout, Efl.Ui.Progress,
[[Get whether the range is enabled.]]
}
values {
enable: Eina_Bool;
enable: bool;
}
}
@property range {

View File

@ -1,3 +1,5 @@
type Elm_Slideshow_Item_Class: __undefined_type;
class Elm.Slideshow (Elm.Layout, Elm.Interface_Atspi_Widget_Action)
{
eo_prefix: elm_obj_slideshow;

View File

@ -1,3 +1,5 @@
type Elm_Sys_Notify_Send_Cb: __undefined_type;
enum Elm.Sys_Notify.Urgency
{
[[Urgency levels of a notification

View File

@ -68,7 +68,7 @@ class Elm.Systray (Eo.Base)
[[Get the object path of the D-Bus Menu currently in use.]]
}
values {
menu: const(Eo)* @nullable;
menu: const(Eo.Base)* @nullable;
}
}
@property att_icon_name {

View File

@ -1,4 +1,5 @@
import elm_general;
import elm_icon;
enum Elm.Toolbar.Shrink_Mode
{

View File

@ -195,7 +195,7 @@ class Elm.Toolbar_Item(Elm.Widget_Item)
]]
params {
@in img: const (void) *; [[The binary data that will be used as an image.]]
@in size: size_t; [[The size of binary data $img.]]
@in size: size; [[The size of binary data $img.]]
@in format: const (char) *; [[Optional format of $img to pass to the image loader.]]
@in key: const (char) *; [[Optional key of $img to pass to the image loader (eg. if $img is an edje file).]]
}

View File

@ -1,3 +1,5 @@
import elm_genlist_item;
class Elm.View_List (Eo.Base)
{
legacy_prefix: null;

View File

@ -1,3 +1,10 @@
type Elm_Web_Console_Message: __undefined_type;
type Elm_Web_Window_Open: __undefined_type;
type Elm_Web_Dialog_File_Selector: __undefined_type;
type Elm_Web_Dialog_Confirm: __undefined_type;
type Elm_Web_Dialog_Prompt: __undefined_type;
type Elm_Web_Dialog_Alert: __undefined_type;
enum Elm.Web.Zoom_Mode
{
[[Types of zoom available.]]

View File

@ -1,5 +1,10 @@
import edje_types;
import elm_general;
/* FIXME: This shouldn't be here. */
type list_data_get_func_type: __undefined_type;
type region_hook_func_type: __undefined_type;
enum Elm.Activate
{
[[ Used in 'Virtual' function @Elm.Widget.activate. ]]

View File

@ -1,3 +1,5 @@
import elm_general;
class Elm.Widget_Item(Eo.Base, Elm.Interface_Atspi_Accessible,
Elm.Interface_Atspi_Component)
{

View File

@ -1,3 +1,11 @@
/* FIXME: Shouldn't be here. */
type Ecore_Evas: __undefined_type;
type Ecore_X_Window: __undefined_type;
type Ecore_Wl2_Window: __undefined_type;
type Ecore_Cocoa_Window: __undefined_type;
type Ecore_Win32_Window: __undefined_type;
type Ecore_Window: __undefined_type;
enum Elm.Win.Type
{
[[Defines the types of window that can be created

View File

@ -23,3 +23,7 @@ struct @extern Eina.Matrix3 {
}
struct @extern Eina.Inarray;
type @extern Eina.Unicode: uint32;
struct @extern Eina.Value;

View File

@ -207,7 +207,7 @@ abstract Eo.Base ()
]]
params {
@in key: const(char)*; [[the key associated with the object ref]]
@in objdata: Eo *; [[the object to set]]
@in objdata: Eo.Base *; [[the object to set]]
}
}
key_obj_get @const {
@ -215,7 +215,7 @@ abstract Eo.Base ()
params {
@in key: const(char)*; [[the key associated with the object ref]]
}
return: Eo *; [[the object reference for the key]]
return: Eo.Base *; [[the object reference for the key]]
}
key_obj_del {
[[Del generic objecrt reference from object.]]

View File

@ -174,18 +174,11 @@ _ef_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED,
static Eina_Bool
_type_error(const Validator *vs, const Eolian_Type *tp, const char *msg)
{
Eina_Bool weak = !getenv("EOLIAN_VALIDATE_STRICT");
if (vs->silent_types)
return weak;
if (!weak)
{
fprintf(stderr, "eolian:%s:%d:%d: %s\n", tp->base.file, tp->base.line,
tp->base.column, msg);
return EINA_FALSE;
}
eina_log_print(_eolian_log_dom, EINA_LOG_LEVEL_WARN, tp->base.file, "",
tp->base.line, "%s at column %d", msg, tp->base.column);
return EINA_TRUE;
return EINA_FALSE;
fprintf(stderr, "eolian:%s:%d:%d: %s\n", tp->base.file, tp->base.line,
tp->base.column, msg);
return EINA_FALSE;
}
static Eina_Bool